Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

llvm: add mlir #65223

Closed
wants to merge 3 commits into from
Closed
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
16 changes: 13 additions & 3 deletions Formula/llvm.rb
Original file line number Diff line number Diff line change
Expand Up @@ -79,6 +79,7 @@ def install
lldb
openmp
polly
mlir
]
runtimes = %w[
compiler-rt
Expand Down Expand Up @@ -139,9 +140,9 @@ def install
llvmpath = buildpath/"llvm"
mkdir llvmpath/"build" do
system "cmake", "-G", "Unix Makefiles", "..", *(std_cmake_args + args)
system "make"
system "make", "install"
system "make", "install-xcode-toolchain" if MacOS::Xcode.installed?
system "cmake", "--build", "."
system "cmake", "--build", ".", "--target", "install"
system "cmake", "--build", ".", "--target", "install-xcode-toolchain" if MacOS::Xcode.installed?
end

# Install LLVM Python bindings
Expand Down Expand Up @@ -209,6 +210,15 @@ def caveats
}
EOS

# Testing mlir
(testpath/"test.mlir").write <<~EOS
func @bad_branch() {
br ^missing // expected-error {{reference to an undefined block}}
}
EOS

system "#{bin}/mlir-opt", "--verify-diagnostics", "test.mlir"

# Testing default toolchain and SDK location.
system "#{bin}/clang++", "-v",
"-std=c++11", "test.cpp", "-o", "test++"
Expand Down