aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMisha Brukman <brukman+llvm@gmail.com>2003-10-14 21:35:52 +0000
committerMisha Brukman <brukman+llvm@gmail.com>2003-10-14 21:35:52 +0000
commitb6c54ed8f50a351989993a5ef88507abc6d63e2d (patch)
treee011a4c35b50b197f8b66bbb57c0bb7e867b7807
parentdeb1740615b29d646cbc92640bfeb93b11934397 (diff)
Enabling incremental bytecode loading in the JIT:
* ExecutionEngine can be constructed from a ModuleProvider * Alphabetized order of forward-declared classes git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@9123 91177308-0d34-0410-b5e6-96231b3b80d8
-rw-r--r--include/llvm/ExecutionEngine/ExecutionEngine.h20
1 files changed, 13 insertions, 7 deletions
diff --git a/include/llvm/ExecutionEngine/ExecutionEngine.h b/include/llvm/ExecutionEngine/ExecutionEngine.h
index 98d9daedac..03fc6d6a94 100644
--- a/include/llvm/ExecutionEngine/ExecutionEngine.h
+++ b/include/llvm/ExecutionEngine/ExecutionEngine.h
@@ -8,23 +8,25 @@
#ifndef EXECUTION_ENGINE_H
#define EXECUTION_ENGINE_H
+#include "llvm/ModuleProvider.h"
#include <vector>
#include <string>
#include <map>
#include <cassert>
class Constant;
-class Type;
-class GlobalValue;
class Function;
+union GenericValue;
+class GlobalValue;
class Module;
class TargetData;
-union GenericValue;
+class Type;
class ExecutionEngine {
Module &CurMod;
const TargetData *TD;
protected:
+ ModuleProvider *MP;
// GlobalAddress - A mapping between LLVM global values and their actualized
// version...
std::map<const GlobalValue*, void *> GlobalAddress;
@@ -32,9 +34,13 @@ protected:
void setTargetData(const TargetData &td) {
TD = &td;
}
+
public:
- ExecutionEngine(Module *M) : CurMod(*M) {
- assert(M && "Module is null?");
+ ExecutionEngine(ModuleProvider *P) : CurMod(*(P->getModule())), MP(P) {
+ assert(P && "ModuleProvider is null?");
+ }
+ ExecutionEngine(Module *M) : CurMod(*M), MP(0) {
+ assert(M && "Module is null?");
}
virtual ~ExecutionEngine();
@@ -47,8 +53,8 @@ public:
virtual GenericValue run(Function *F,
const std::vector<GenericValue> &ArgValues) = 0;
- static ExecutionEngine *create (Module *M, bool ForceInterpreter,
- bool TraceMode);
+ static ExecutionEngine *create(ModuleProvider *MP, bool ForceInterpreter,
+ bool TraceMode);
void addGlobalMapping(const Function *F, void *Addr) {
void *&CurVal = GlobalAddress[(const GlobalValue*)F];