diff options
-rw-r--r-- | src/ortho/llvm6/llvm-cbindings.cpp | 9 |
1 files changed, 7 insertions, 2 deletions
diff --git a/src/ortho/llvm6/llvm-cbindings.cpp b/src/ortho/llvm6/llvm-cbindings.cpp index a6f78df62..c39c64847 100644 --- a/src/ortho/llvm6/llvm-cbindings.cpp +++ b/src/ortho/llvm6/llvm-cbindings.cpp @@ -26,10 +26,15 @@ #include "llvm-c/Analysis.h" #include "llvm-c/Transforms/Scalar.h" -#if LLVM_VERSION_MAJOR >= 4 +#if LLVM_VERSION_MAJOR >= 7 +// Not present in llvm-6, present in llvm-7 #include "llvm-c/Transforms/Utils.h" #endif +#if LLVM_VERSION_MAJOR >= 6 +#define USE_DEBUG +#endif + #ifdef USE_DEBUG #include "llvm/IR/IRBuilder.h" #include "llvm/IR/DIBuilder.h" @@ -151,8 +156,8 @@ generateCommon() LLVMPassManagerRef PassManager; PassManager = LLVMCreateFunctionPassManagerForModule (TheModule); - LLVMAddPromoteMemoryToRegisterPass (PassManager); LLVMAddCFGSimplificationPass (PassManager); + LLVMAddPromoteMemoryToRegisterPass (PassManager); for (LLVMValueRef Func = LLVMGetFirstFunction (TheModule); Func != nullptr; |