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 | 5c50760d3294419f42a78d0518395b584336c045 (patch) | |
| tree | 1ab0a8fc513ee27f87b8f0a4c992a933df0a4677 /include/llvm/ExecutionEngine/ExecutionEngine.h | |
| parent | ca6b6a4738a9843531272d455ac6c4e7a6716d3c (diff) | |
| download | external_llvm-5c50760d3294419f42a78d0518395b584336c045.zip external_llvm-5c50760d3294419f42a78d0518395b584336c045.tar.gz external_llvm-5c50760d3294419f42a78d0518395b584336c045.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 'include/llvm/ExecutionEngine/ExecutionEngine.h')
| -rw-r--r-- | include/llvm/ExecutionEngine/ExecutionEngine.h | 15 |
1 files changed, 14 insertions, 1 deletions
diff --git a/include/llvm/ExecutionEngine/ExecutionEngine.h b/include/llvm/ExecutionEngine/ExecutionEngine.h index da034a7..3ec2641 100644 --- a/include/llvm/ExecutionEngine/ExecutionEngine.h +++ b/include/llvm/ExecutionEngine/ExecutionEngine.h @@ -64,6 +64,7 @@ class ExecutionEngine { const TargetData *TD; ExecutionEngineState state; bool LazyCompilationDisabled; + protected: /// Modules - This is a list of ModuleProvider's that we are JIT'ing from. We /// use a smallvector to optimize for the case where there is only one module. @@ -78,7 +79,11 @@ protected: // at startup time if they are linked in. typedef ExecutionEngine *(*EECtorFn)(ModuleProvider*, std::string*); static EECtorFn JITCtor, InterpCtor; - + + /// LazyFunctionCreator - If an unknown function is needed, this function + /// pointer is invoked to create it. If this returns null, the JIT will abort. + void* (*LazyFunctionCreator)(const std::string &); + public: /// lock - This lock is protects the ExecutionEngine, JIT, JITResolver and /// JITEmitter classes. It must be held while changing the internal state of @@ -218,6 +223,14 @@ public: bool isLazyCompilationDisabled() const { return LazyCompilationDisabled; } + + + /// InstallLazyFunctionCreator - If an unknown function is needed, the + /// specified function pointer is invoked to create it. If it returns null, + /// the JIT will abort. + void InstallLazyFunctionCreator(void* (*P)(const std::string &)) { + LazyFunctionCreator = P; + } protected: void emitGlobals(); |
