diff options
author | Chris Lattner <sabre@nondot.org> | 2003-12-08 08:22:01 +0000 |
---|---|---|
committer | Chris Lattner <sabre@nondot.org> | 2003-12-08 08:22:01 +0000 |
commit | 18cb4c3c747ac2439ca9fb1218edd8993df69d7a (patch) | |
tree | 32d4c379dc9954e4beed52f08371d2bdd2a96bf7 | |
parent | c19aadee66b744311afe6e420847e80822a765f2 (diff) |
add two new virtual functions:
The first returns a function pointer or a stub if it's not already generated
The second exposes what was previously JIT specific state to general clients
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@10319 91177308-0d34-0410-b5e6-96231b3b80d8
-rw-r--r-- | include/llvm/ExecutionEngine/ExecutionEngine.h | 17 |
1 files changed, 17 insertions, 0 deletions
diff --git a/include/llvm/ExecutionEngine/ExecutionEngine.h b/include/llvm/ExecutionEngine/ExecutionEngine.h index 5dd74b7cde..f6f725a78a 100644 --- a/include/llvm/ExecutionEngine/ExecutionEngine.h +++ b/include/llvm/ExecutionEngine/ExecutionEngine.h @@ -86,9 +86,26 @@ public: // virtual void *getPointerToFunction(Function *F) = 0; + // getPointerToFunctionOrStub - If the specified function has been code-gen'd, + // return a pointer to the function. If not, compile it, or use a stub to + // implement lazy compilation if available. + // + virtual void *getPointerToFunctionOrStub(Function *F) { + // Default implementation, just codegen the function. + return getPointerToFunction(F); + } + void StoreValueToMemory(GenericValue Val, GenericValue *Ptr, const Type *Ty); void InitializeMemory(const Constant *Init, void *Addr); + /// recompileAndRelinkFunction - This method is used to force a function + /// which has already been compiled, to be compiled again, possibly + /// after it has been modified. Then the entry to the old copy is overwritten + /// with a branch to the new copy. If there was no old copy, this acts + /// just like VM::getPointerToFunction(). + /// + virtual void *recompileAndRelinkFunction(Function *F) = 0; + protected: void emitGlobals(); GenericValue getConstantValue(const Constant *C); |