diff options
author | Danil Malyshev <dmalyshev@accesssoftek.com> | 2012-03-28 21:46:36 +0000 |
---|---|---|
committer | Danil Malyshev <dmalyshev@accesssoftek.com> | 2012-03-28 21:46:36 +0000 |
commit | 30b9e322e159df8eaabb5b194cec6e11ba99c261 (patch) | |
tree | 36664ec6b85c6050e280736f2c6ff2e976957aac /lib/ExecutionEngine/MCJIT/MCJIT.cpp | |
parent | 8f3fabe0febb7335c4349d3d6081deca95419d48 (diff) | |
download | external_llvm-30b9e322e159df8eaabb5b194cec6e11ba99c261.zip external_llvm-30b9e322e159df8eaabb5b194cec6e11ba99c261.tar.gz external_llvm-30b9e322e159df8eaabb5b194cec6e11ba99c261.tar.bz2 |
Move getPointerToNamedFunction() from JIT/MCJIT to JITMemoryManager.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@153607 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'lib/ExecutionEngine/MCJIT/MCJIT.cpp')
-rw-r--r-- | lib/ExecutionEngine/MCJIT/MCJIT.cpp | 20 |
1 files changed, 20 insertions, 0 deletions
diff --git a/lib/ExecutionEngine/MCJIT/MCJIT.cpp b/lib/ExecutionEngine/MCJIT/MCJIT.cpp index 5f93a8d..80110e8 100644 --- a/lib/ExecutionEngine/MCJIT/MCJIT.cpp +++ b/lib/ExecutionEngine/MCJIT/MCJIT.cpp @@ -215,3 +215,23 @@ GenericValue MCJIT::runFunction(Function *F, llvm_unreachable("Full-featured argument passing not supported yet!"); } + +void *MCJIT::getPointerToNamedFunction(const std::string &Name, + bool AbortOnFailure){ + if (!isSymbolSearchingDisabled() && MemMgr) { + void *ptr = MemMgr->getPointerToNamedFunction(Name, false); + if (ptr) + return ptr; + } + + /// If a LazyFunctionCreator is installed, use it to get/create the function. + if (LazyFunctionCreator) + if (void *RP = LazyFunctionCreator(Name)) + return RP; + + if (AbortOnFailure) { + report_fatal_error("Program used external function '"+Name+ + "' which could not be resolved!"); + } + return 0; +} |