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

Chris Lattner lattner at cs.uiuc.edu
Fri Dec 19 20:46:02 PST 2003


Changes in directory llvm/include/llvm/ExecutionEngine:

ExecutionEngine.h updated: 1.20 -> 1.21

---
Log message:

Simple refactorings to prepare for lazy global emission


---
Diffs of the changes:  (+10 -3)

Index: llvm/include/llvm/ExecutionEngine/ExecutionEngine.h
diff -u llvm/include/llvm/ExecutionEngine/ExecutionEngine.h:1.20 llvm/include/llvm/ExecutionEngine/ExecutionEngine.h:1.21
--- llvm/include/llvm/ExecutionEngine/ExecutionEngine.h:1.20	Fri Dec 12 00:31:42 2003
+++ llvm/include/llvm/ExecutionEngine/ExecutionEngine.h	Fri Dec 19 20:45:16 2003
@@ -21,9 +21,10 @@
 
 namespace llvm {
 
+union GenericValue;
 class Constant;
 class Function;
-union GenericValue;
+class GlobalVariable;
 class GlobalValue;
 class Module;
 class ModuleProvider;
@@ -60,8 +61,8 @@
 
   static ExecutionEngine *create(ModuleProvider *MP, bool ForceInterpreter);
 
-  void addGlobalMapping(const Function *F, void *Addr) {
-    void *&CurVal = GlobalAddress[(const GlobalValue*)F];
+  void addGlobalMapping(const GlobalValue *GV, void *Addr) {
+    void *&CurVal = GlobalAddress[GV];
     assert(CurVal == 0 && "GlobalMapping already established!");
     CurVal = Addr;
   }
@@ -107,6 +108,12 @@
 
 protected:
   void emitGlobals();
+
+  // EmitGlobalVariable - This method emits the specified global variable to the
+  // address specified in GlobalAddresses, or allocates new memory if it's not
+  // already in the map.
+  void EmitGlobalVariable(GlobalVariable *GV);
+
   GenericValue getConstantValue(const Constant *C);
   GenericValue LoadValueFromMemory(GenericValue *Ptr, const Type *Ty);
 };





More information about the llvm-commits mailing list