summaryrefslogtreecommitdiffstats
path: root/llvm/lib/ExecutionEngine/JIT
diff options
context:
space:
mode:
authorChris Lattner <sabre@nondot.org>2007-10-22 02:50:12 +0000
committerChris Lattner <sabre@nondot.org>2007-10-22 02:50:12 +0000
commitfd6f3257b86b46e76b5a965d70ec1df43a960d18 (patch)
treebbcc379d49ece947f7c012a59cc50349615a5f70 /llvm/lib/ExecutionEngine/JIT
parentbf5e958ba09b139e74e242747eb2fc0fe1b539ed (diff)
downloadbcm5719-llvm-fd6f3257b86b46e76b5a965d70ec1df43a960d18.tar.gz
bcm5719-llvm-fd6f3257b86b46e76b5a965d70ec1df43a960d18.zip
add a mechanism for the JIT to invoke a function to lazily create functions as they are referenced.
llvm-svn: 43210
Diffstat (limited to 'llvm/lib/ExecutionEngine/JIT')
-rw-r--r--llvm/lib/ExecutionEngine/JIT/Intercept.cpp5
1 files changed, 5 insertions, 0 deletions
diff --git a/llvm/lib/ExecutionEngine/JIT/Intercept.cpp b/llvm/lib/ExecutionEngine/JIT/Intercept.cpp
index 61035c25359..318d6067d6c 100644
--- a/llvm/lib/ExecutionEngine/JIT/Intercept.cpp
+++ b/llvm/lib/ExecutionEngine/JIT/Intercept.cpp
@@ -101,6 +101,11 @@ void *JIT::getPointerToNamedFunction(const std::string &Name) {
Ptr = sys::DynamicLibrary::SearchForAddressOfSymbol(NameStr+1);
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;
cerr << "ERROR: Program used external function '" << Name
<< "' which could not be resolved!\n";
OpenPOWER on IntegriCloud