aboutsummaryrefslogtreecommitdiffstats
path: root/src/ortho/llvm6
diff options
context:
space:
mode:
authorTristan Gingold <tgingold@free.fr>2020-06-19 05:33:06 +0200
committerTristan Gingold <tgingold@free.fr>2020-06-19 05:33:06 +0200
commit167285ec30c5e51bf9bd501e56581c05d09eaebe (patch)
treef23c014a7b9e9722f094dda4ead14bee30ba3879 /src/ortho/llvm6
parent67bdbb81a09da1ccd3ab60bba5f7091477a46071 (diff)
downloadghdl-167285ec30c5e51bf9bd501e56581c05d09eaebe.tar.gz
ghdl-167285ec30c5e51bf9bd501e56581c05d09eaebe.tar.bz2
ghdl-167285ec30c5e51bf9bd501e56581c05d09eaebe.zip
llvm6: adjust code to support llvm 6 and llvm 7.
Diffstat (limited to 'src/ortho/llvm6')
-rw-r--r--src/ortho/llvm6/llvm-cbindings.cpp9
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;