1
0
mirror of https://github.com/RPCS3/llvm-mirror.git synced 2024-11-24 03:33:20 +01:00

Enabling incremental bytecode loading in the JIT:

* ExecutionEngine can be constructed from a ModuleProvider
* Alphabetized order of forward-declared classes

llvm-svn: 9123
This commit is contained in:
Misha Brukman 2003-10-14 21:35:52 +00:00
parent 6e81243ff7
commit 2ab03faac1

View File

@ -8,23 +8,25 @@
#ifndef EXECUTION_ENGINE_H #ifndef EXECUTION_ENGINE_H
#define EXECUTION_ENGINE_H #define EXECUTION_ENGINE_H
#include "llvm/ModuleProvider.h"
#include <vector> #include <vector>
#include <string> #include <string>
#include <map> #include <map>
#include <cassert> #include <cassert>
class Constant; class Constant;
class Type;
class GlobalValue;
class Function; class Function;
union GenericValue;
class GlobalValue;
class Module; class Module;
class TargetData; class TargetData;
union GenericValue; class Type;
class ExecutionEngine { class ExecutionEngine {
Module &CurMod; Module &CurMod;
const TargetData *TD; const TargetData *TD;
protected: protected:
ModuleProvider *MP;
// GlobalAddress - A mapping between LLVM global values and their actualized // GlobalAddress - A mapping between LLVM global values and their actualized
// version... // version...
std::map<const GlobalValue*, void *> GlobalAddress; std::map<const GlobalValue*, void *> GlobalAddress;
@ -32,9 +34,13 @@ protected:
void setTargetData(const TargetData &td) { void setTargetData(const TargetData &td) {
TD = &td; TD = &td;
} }
public: public:
ExecutionEngine(Module *M) : CurMod(*M) { ExecutionEngine(ModuleProvider *P) : CurMod(*(P->getModule())), MP(P) {
assert(M && "Module is null?"); assert(P && "ModuleProvider is null?");
}
ExecutionEngine(Module *M) : CurMod(*M), MP(0) {
assert(M && "Module is null?");
} }
virtual ~ExecutionEngine(); virtual ~ExecutionEngine();
@ -47,8 +53,8 @@ public:
virtual GenericValue run(Function *F, virtual GenericValue run(Function *F,
const std::vector<GenericValue> &ArgValues) = 0; const std::vector<GenericValue> &ArgValues) = 0;
static ExecutionEngine *create (Module *M, bool ForceInterpreter, static ExecutionEngine *create(ModuleProvider *MP, bool ForceInterpreter,
bool TraceMode); bool TraceMode);
void addGlobalMapping(const Function *F, void *Addr) { void addGlobalMapping(const Function *F, void *Addr) {
void *&CurVal = GlobalAddress[(const GlobalValue*)F]; void *&CurVal = GlobalAddress[(const GlobalValue*)F];