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
This commit is contained in:
Chris Lattner
2007-10-22 02:50:12 +00:00
parent ec2fcafbea
commit d958a5a9fe
3 changed files with 21 additions and 3 deletions

View File

@@ -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";