mirror of
https://github.com/c64scene-ar/llvm-6502.git
synced 2025-07-28 19:25:00 +00:00
simplify creation of the interpreter, make ExecutionEngine ctor protected,
delete one ExecutionEngine ctor, minor cleanup. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@44646 91177308-0d34-0410-b5e6-96231b3b80d8
This commit is contained in:
@@ -12,8 +12,8 @@
|
||||
//
|
||||
//===----------------------------------------------------------------------===//
|
||||
|
||||
#ifndef EXECUTION_ENGINE_H
|
||||
#define EXECUTION_ENGINE_H
|
||||
#ifndef LLVM_EXECUTION_ENGINE_H
|
||||
#define LLVM_EXECUTION_ENGINE_H
|
||||
|
||||
#include <vector>
|
||||
#include <map>
|
||||
@@ -34,6 +34,7 @@ class ModuleProvider;
|
||||
class TargetData;
|
||||
class Type;
|
||||
class MutexGuard;
|
||||
class JITMemoryManager;
|
||||
|
||||
class ExecutionEngineState {
|
||||
private:
|
||||
@@ -90,18 +91,36 @@ public:
|
||||
/// any of those classes.
|
||||
sys::Mutex lock; // Used to make this class and subclasses thread-safe
|
||||
|
||||
ExecutionEngine(ModuleProvider *P);
|
||||
ExecutionEngine(Module *M);
|
||||
//===----------------------------------------------------------------------===//
|
||||
// ExecutionEngine Startup
|
||||
//===----------------------------------------------------------------------===//
|
||||
|
||||
virtual ~ExecutionEngine();
|
||||
|
||||
const TargetData *getTargetData() const { return TD; }
|
||||
|
||||
/// create - This is the factory method for creating an execution engine which
|
||||
/// is appropriate for the current machine. This takes ownership of the
|
||||
/// module provider.
|
||||
static ExecutionEngine *create(ModuleProvider *MP,
|
||||
bool ForceInterpreter = false,
|
||||
std::string *ErrorStr = 0);
|
||||
|
||||
/// create - This is the factory method for creating an execution engine which
|
||||
/// is appropriate for the current machine. This takes ownership of the
|
||||
/// module.
|
||||
static ExecutionEngine *create(Module *M);
|
||||
|
||||
|
||||
/// addModuleProvider - Add a ModuleProvider to the list of modules that we
|
||||
/// can JIT from. Note that this takes ownership of the ModuleProvider: when
|
||||
/// the ExecutionEngine is destroyed, it destroys the MP as well.
|
||||
void addModuleProvider(ModuleProvider *P) {
|
||||
Modules.push_back(P);
|
||||
}
|
||||
|
||||
//===----------------------------------------------------------------------===//
|
||||
|
||||
const TargetData *getTargetData() const { return TD; }
|
||||
|
||||
|
||||
/// removeModuleProvider - Remove a ModuleProvider from the list of modules.
|
||||
/// Release module from ModuleProvider.
|
||||
@@ -112,18 +131,6 @@ public:
|
||||
/// general code.
|
||||
Function *FindFunctionNamed(const char *FnName);
|
||||
|
||||
/// create - This is the factory method for creating an execution engine which
|
||||
/// is appropriate for the current machine. This takes ownership of the
|
||||
/// module provider.
|
||||
static ExecutionEngine *create(ModuleProvider *MP,
|
||||
bool ForceInterpreter = false,
|
||||
std::string *ErrorStr = 0);
|
||||
|
||||
/// create - This is the factory method for creating an execution engine which
|
||||
/// is appropriate for the current machine. This takes ownership of the
|
||||
/// module.
|
||||
static ExecutionEngine *create(Module *M);
|
||||
|
||||
/// runFunction - Execute the specified function with the specified arguments,
|
||||
/// and return the result.
|
||||
///
|
||||
@@ -233,6 +240,8 @@ public:
|
||||
}
|
||||
|
||||
protected:
|
||||
ExecutionEngine(ModuleProvider *P);
|
||||
|
||||
void emitGlobals();
|
||||
|
||||
// EmitGlobalVariable - This method emits the specified global variable to the
|
||||
|
Reference in New Issue
Block a user