diff options
author | Chris Lattner <sabre@nondot.org> | 2007-10-22 02:50:12 +0000 |
---|---|---|
committer | Chris Lattner <sabre@nondot.org> | 2007-10-22 02:50:12 +0000 |
commit | d958a5a9feea7239a73c2068f43f237db550f46e (patch) | |
tree | 1ab0a8fc513ee27f87b8f0a4c992a933df0a4677 /lib/ExecutionEngine/JIT/Intercept.cpp | |
parent | ec2fcafbea1fef61c611e04e5063766d910be7ef (diff) | |
download | external_llvm-d958a5a9feea7239a73c2068f43f237db550f46e.zip external_llvm-d958a5a9feea7239a73c2068f43f237db550f46e.tar.gz external_llvm-d958a5a9feea7239a73c2068f43f237db550f46e.tar.bz2 |
add a mechanism for the JIT to invoke a function to lazily create functions as they are referenced.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@43210 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'lib/ExecutionEngine/JIT/Intercept.cpp')
-rw-r--r-- | lib/ExecutionEngine/JIT/Intercept.cpp | 5 |
1 files changed, 5 insertions, 0 deletions
diff --git a/lib/ExecutionEngine/JIT/Intercept.cpp b/lib/ExecutionEngine/JIT/Intercept.cpp index 61035c2..318d606 100644 --- a/lib/ExecutionEngine/JIT/Intercept.cpp +++ b/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"; |