diff options
author | Chris Lattner <sabre@nondot.org> | 2003-12-20 02:45:16 +0000 |
---|---|---|
committer | Chris Lattner <sabre@nondot.org> | 2003-12-20 02:45:16 +0000 |
commit | 3ddc05bdde6ed65f93340ea467d362e80c0ceb9c (patch) | |
tree | e8dd9688ead7c816533d3b0d924fb91c6a00cb5e /include/llvm/ExecutionEngine/ExecutionEngine.h | |
parent | 2828970819ee6b056df8e676aa5e7950f1e1ff7e (diff) |
Simple refactorings to prepare for lazy global emission
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@10546 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'include/llvm/ExecutionEngine/ExecutionEngine.h')
-rw-r--r-- | include/llvm/ExecutionEngine/ExecutionEngine.h | 13 |
1 files changed, 10 insertions, 3 deletions
diff --git a/include/llvm/ExecutionEngine/ExecutionEngine.h b/include/llvm/ExecutionEngine/ExecutionEngine.h index f049197e52..573e5f1d9a 100644 --- a/include/llvm/ExecutionEngine/ExecutionEngine.h +++ b/include/llvm/ExecutionEngine/ExecutionEngine.h @@ -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 @@ 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); }; |