From 1ac5e84e9179fd9c02b5f8d6c46eaab58baa6e4b Mon Sep 17 00:00:00 2001 From: Alex Crichton Date: Wed, 26 Feb 2014 14:06:27 -0800 Subject: 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. --- src/rustllvm/rustllvm.h | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) (limited to 'src/rustllvm/rustllvm.h') 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__ -- cgit 1.4.1-3-g733a5