[llvm-commits] CVS: llvm/include/llvm/ExecutionEngine/ExecutionEngine.h

Chris Lattner lattner at cs.uiuc.edu
Mon Dec 8 02:23:01 PST 2003


Changes in directory llvm/include/llvm/ExecutionEngine:

ExecutionEngine.h updated: 1.18 -> 1.19

---
Log message:

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


---
Diffs of the changes:  (+17 -0)

Index: llvm/include/llvm/ExecutionEngine/ExecutionEngine.h
diff -u llvm/include/llvm/ExecutionEngine/ExecutionEngine.h:1.18 llvm/include/llvm/ExecutionEngine/ExecutionEngine.h:1.19
--- llvm/include/llvm/ExecutionEngine/ExecutionEngine.h:1.18	Tue Nov 11 16:41:31 2003
+++ llvm/include/llvm/ExecutionEngine/ExecutionEngine.h	Mon Dec  8 02:22:01 2003
@@ -86,8 +86,25 @@
   //
   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();





More information about the llvm-commits mailing list