summaryrefslogtreecommitdiff
path: root/lib/ExecutionEngine/ExecutionEngineBindings.cpp
diff options
context:
space:
mode:
authorJuergen Ributzka <juergen@apple.com>2014-01-23 19:23:28 +0000
committerJuergen Ributzka <juergen@apple.com>2014-01-23 19:23:28 +0000
commit9ce88db75231063445de4800684a52b90a8a0ecc (patch)
tree8d6fd2030da8e8f4e96a061cfa95a4900b450216 /lib/ExecutionEngine/ExecutionEngineBindings.cpp
parenta8aa6c3940852434edb967c47312a5d21c777ce9 (diff)
downloadllvm-9ce88db75231063445de4800684a52b90a8a0ecc.tar.gz
llvm-9ce88db75231063445de4800684a52b90a8a0ecc.tar.bz2
llvm-9ce88db75231063445de4800684a52b90a8a0ecc.tar.xz
Add target analysis passes to the codegen pipeline for MCJIT.
This patch adds the target analysis passes (usually TargetTransformInfo) to the codgen pipeline. We also expose now the AddAnalysisPasses method through the C API, because the optimizer passes would also benefit from better target-specific cost models. Reviewed by Andrew Kaylor git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@199926 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'lib/ExecutionEngine/ExecutionEngineBindings.cpp')
-rw-r--r--lib/ExecutionEngine/ExecutionEngineBindings.cpp10
1 files changed, 10 insertions, 0 deletions
diff --git a/lib/ExecutionEngine/ExecutionEngineBindings.cpp b/lib/ExecutionEngine/ExecutionEngineBindings.cpp
index 2d34eeabf2..af0a372db8 100644
--- a/lib/ExecutionEngine/ExecutionEngineBindings.cpp
+++ b/lib/ExecutionEngine/ExecutionEngineBindings.cpp
@@ -43,6 +43,11 @@ inline LLVMTargetLibraryInfoRef wrap(const TargetLibraryInfo *P) {
return reinterpret_cast<LLVMTargetLibraryInfoRef>(X);
}
+inline LLVMTargetMachineRef wrap(const TargetMachine *P) {
+ return
+ reinterpret_cast<LLVMTargetMachineRef>(const_cast<TargetMachine*>(P));
+}
+
/*===-- Operations on generic values --------------------------------------===*/
LLVMGenericValueRef LLVMCreateGenericValueOfInt(LLVMTypeRef Ty,
@@ -323,6 +328,11 @@ LLVMTargetDataRef LLVMGetExecutionEngineTargetData(LLVMExecutionEngineRef EE) {
return wrap(unwrap(EE)->getDataLayout());
}
+LLVMTargetMachineRef
+LLVMGetExecutionEngineTargetMachine(LLVMExecutionEngineRef EE) {
+ return wrap(unwrap(EE)->getTargetMachine());
+}
+
void LLVMAddGlobalMapping(LLVMExecutionEngineRef EE, LLVMValueRef Global,
void* Addr) {
unwrap(EE)->addGlobalMapping(unwrap<GlobalValue>(Global), Addr);