Simple refactorings to prepare for lazy global emission
authorChris Lattner <sabre@nondot.org>
Sat, 20 Dec 2003 02:45:16 +0000 (02:45 +0000)
committerChris Lattner <sabre@nondot.org>
Sat, 20 Dec 2003 02:45:16 +0000 (02:45 +0000)
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@10546 91177308-0d34-0410-b5e6-96231b3b80d8

include/llvm/ExecutionEngine/ExecutionEngine.h

index f049197e52ae1231755cba58a659737235f16d1c..573e5f1d9ab5d55e76790ad7f45c76123740baf3 100644 (file)
 
 namespace llvm {
 
+union GenericValue;
 class Constant;
 class Function;
-union GenericValue;
+class GlobalVariable;
 class GlobalValue;
 class Module;
 class ModuleProvider;
@@ -60,8 +61,8 @@ public:
 
   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 @@ public:
 
 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);
 };