diff options
author | Juergen Ributzka <juergen@apple.com> | 2014-01-23 19:23:28 +0000 |
---|---|---|
committer | Juergen Ributzka <juergen@apple.com> | 2014-01-23 19:23:28 +0000 |
commit | 5fe955cb757410c9eee7d2455cf147cc59dbf3c9 (patch) | |
tree | 49f289e9a246a5e7a5cb1cdff0956a391a8cde1a /llvm/lib/ExecutionEngine/ExecutionEngineBindings.cpp | |
parent | 5d31f6945b21fb462cdcbc08b7c0656281a23835 (diff) | |
download | llvm-5fe955cb757410c9eee7d2455cf147cc59dbf3c9.zip llvm-5fe955cb757410c9eee7d2455cf147cc59dbf3c9.tar.gz llvm-5fe955cb757410c9eee7d2455cf147cc59dbf3c9.tar.bz2 |
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
llvm-svn: 199926
Diffstat (limited to 'llvm/lib/ExecutionEngine/ExecutionEngineBindings.cpp')
-rw-r--r-- | llvm/lib/ExecutionEngine/ExecutionEngineBindings.cpp | 10 |
1 files changed, 10 insertions, 0 deletions
diff --git a/llvm/lib/ExecutionEngine/ExecutionEngineBindings.cpp b/llvm/lib/ExecutionEngine/ExecutionEngineBindings.cpp index 2d34eea..af0a372 100644 --- a/llvm/lib/ExecutionEngine/ExecutionEngineBindings.cpp +++ b/llvm/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); |