aboutsummaryrefslogtreecommitdiffstats
path: root/src/ortho/llvm4-nodebug/llvm-cbindings.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'src/ortho/llvm4-nodebug/llvm-cbindings.cpp')
-rw-r--r--src/ortho/llvm4-nodebug/llvm-cbindings.cpp21
1 files changed, 21 insertions, 0 deletions
diff --git a/src/ortho/llvm4-nodebug/llvm-cbindings.cpp b/src/ortho/llvm4-nodebug/llvm-cbindings.cpp
index 4a61ad552..e0ae23198 100644
--- a/src/ortho/llvm4-nodebug/llvm-cbindings.cpp
+++ b/src/ortho/llvm4-nodebug/llvm-cbindings.cpp
@@ -18,6 +18,9 @@
#include "llvm-c/Target.h"
#include "llvm/IR/Type.h"
#include "llvm/IR/LLVMContext.h"
+#include "llvm/Config/llvm-config.h"
+#include "llvm-c/TargetMachine.h"
+#include "llvm-c/Core.h"
using namespace llvm;
@@ -35,4 +38,22 @@ LLVMInitializeNativeAsmPrinter_noinline (void)
LLVMInitializeNativeAsmPrinter();
}
+char *
+LLVMGetDefaultNormalizedTargetTriple(void)
+{
+ char *triple;
+ triple = LLVMGetDefaultTargetTriple();
+
+#if LLVM_VERSION_MAJOR >= 7
+ {
+ char *res;
+ res = LLVMNormalizeTargetTriple(triple);
+ LLVMDisposeMessage(triple);
+ return res;
+ }
+#else
+ return triple;
+#endif
+}
+
}