about summary refs log tree commit diff
path: root/src/rustllvm/rustllvm.h
diff options
context:
space:
mode:
authorAlex Crichton <alex@alexcrichton.com>2014-02-26 14:06:27 -0800
committerAlex Crichton <alex@alexcrichton.com>2014-02-26 15:01:15 -0800
commit1ac5e84e9179fd9c02b5f8d6c46eaab58baa6e4b (patch)
treee2e247e9291994e3b8edf99732e278ec1e54bd2b /src/rustllvm/rustllvm.h
parent86177dbbcf65be72c8d2a4c8bc2f5dc84f5ae65c (diff)
downloadrust-1ac5e84e9179fd9c02b5f8d6c46eaab58baa6e4b.tar.gz
rust-1ac5e84e9179fd9c02b5f8d6c46eaab58baa6e4b.zip
rustc: Get rustc compiling with LLVM 3.{3,4} again
The travis builds have been breaking recently because LLVM 3.5 upstream is
changing. This looks like it's likely to continue, so it would be more useful
for us if we could lock ourselves to a system LLVM version that is not changing.

This commit has the support to bring our C++ glue to LLVM back in line with what
was possible back in LLVM 3.{3,4}. I don't think we're going to be able to
reasonably protect against regressions in the future, but this kind of code is a
good sign that we can continue to use the system LLVM for simple-ish things.
Codegen for ARM won't work and it won't have some of the perf improvements we
have, but using the system LLVM should work well enough for development.
Diffstat (limited to 'src/rustllvm/rustllvm.h')
-rw-r--r--src/rustllvm/rustllvm.h7
1 files changed, 6 insertions, 1 deletions
diff --git a/src/rustllvm/rustllvm.h b/src/rustllvm/rustllvm.h
index e45a910fc8c..f046587052a 100644
--- a/src/rustllvm/rustllvm.h
+++ b/src/rustllvm/rustllvm.h
@@ -16,7 +16,6 @@
 #include "llvm/PassManager.h"
 #include "llvm/IR/InlineAsm.h"
 #include "llvm/IR/LLVMContext.h"
-#include "llvm/IR/IRPrintingPasses.h"
 #include "llvm/Analysis/Passes.h"
 #include "llvm/Analysis/Lint.h"
 #include "llvm/ADT/ArrayRef.h"
@@ -52,6 +51,12 @@
 #include "llvm-c/ExecutionEngine.h"
 #include "llvm-c/Object.h"
 
+#if LLVM_VERSION_MINOR >= 5
+#include "llvm/IR/IRPrintingPasses.h"
+#else
+#include "llvm/Assembly/PrintModulePass.h"
+#endif
+
 // Used by RustMCJITMemoryManager::getPointerToNamedFunction()
 // to get around glibc issues. See the function for more information.
 #ifdef __linux__