mirror of
https://github.com/RPCS3/llvm-mirror.git
synced 2025-02-26 07:16:39 +00:00
ExecutionEngine::create no longer takes a TraceMode argument.
CurFrame, TraceMode, and the CachedWriter are history. The ExecutionAnnotations (SlotNumber, InstNumber, and FunctionInfo) are history. ExecutionContext now keeps Values for each stack frame in a std::map. printValue() and print() are history. executeInstruction() is now part of run(). llvm-svn: 9493
This commit is contained in:
parent
8abf6d4df3
commit
1de42e556d
@ -15,15 +15,12 @@
|
|||||||
#define LLI_INTERPRETER_H
|
#define LLI_INTERPRETER_H
|
||||||
|
|
||||||
#include "llvm/BasicBlock.h"
|
#include "llvm/BasicBlock.h"
|
||||||
#include "llvm/Assembly/CachedWriter.h"
|
|
||||||
#include "llvm/ExecutionEngine/ExecutionEngine.h"
|
#include "llvm/ExecutionEngine/ExecutionEngine.h"
|
||||||
#include "llvm/ExecutionEngine/GenericValue.h"
|
#include "llvm/ExecutionEngine/GenericValue.h"
|
||||||
#include "llvm/Support/InstVisitor.h"
|
#include "llvm/Support/InstVisitor.h"
|
||||||
#include "llvm/Target/TargetData.h"
|
#include "llvm/Target/TargetData.h"
|
||||||
#include "Support/DataTypes.h"
|
#include "Support/DataTypes.h"
|
||||||
|
|
||||||
extern CachedWriter CW; // Object to accelerate printing of LLVM
|
|
||||||
|
|
||||||
struct FunctionInfo; // Defined in ExecutionAnnotations.h
|
struct FunctionInfo; // Defined in ExecutionAnnotations.h
|
||||||
|
|
||||||
// AllocaHolder - Object to track all of the blocks of memory allocated by
|
// AllocaHolder - Object to track all of the blocks of memory allocated by
|
||||||
@ -65,10 +62,8 @@ struct ExecutionContext {
|
|||||||
Function *CurFunction;// The currently executing function
|
Function *CurFunction;// The currently executing function
|
||||||
BasicBlock *CurBB; // The currently executing BB
|
BasicBlock *CurBB; // The currently executing BB
|
||||||
BasicBlock::iterator CurInst; // The next instruction to execute
|
BasicBlock::iterator CurInst; // The next instruction to execute
|
||||||
FunctionInfo *FuncInfo; // The FuncInfo annotation for the function
|
std::map<Value *, GenericValue> Values; // LLVM values used in this invocation
|
||||||
std::vector<ValuePlaneTy> Values;// ValuePlanes for each type
|
|
||||||
std::vector<GenericValue> VarArgs; // Values passed through an ellipsis
|
std::vector<GenericValue> VarArgs; // Values passed through an ellipsis
|
||||||
|
|
||||||
CallInst *Caller; // Holds the call that called subframes.
|
CallInst *Caller; // Holds the call that called subframes.
|
||||||
// NULL if main func or debugger invoked fn
|
// NULL if main func or debugger invoked fn
|
||||||
AllocaHolderHandle Allocas; // Track memory allocated by alloca
|
AllocaHolderHandle Allocas; // Track memory allocated by alloca
|
||||||
@ -78,8 +73,6 @@ struct ExecutionContext {
|
|||||||
//
|
//
|
||||||
class Interpreter : public ExecutionEngine, public InstVisitor<Interpreter> {
|
class Interpreter : public ExecutionEngine, public InstVisitor<Interpreter> {
|
||||||
int ExitCode; // The exit code to be returned by the lli util
|
int ExitCode; // The exit code to be returned by the lli util
|
||||||
bool Trace; // Tracing enabled?
|
|
||||||
int CurFrame; // The current stack frame being inspected
|
|
||||||
TargetData TD;
|
TargetData TD;
|
||||||
|
|
||||||
// The runtime stack of executing code. The top of the stack is the current
|
// The runtime stack of executing code. The top of the stack is the current
|
||||||
@ -90,11 +83,9 @@ class Interpreter : public ExecutionEngine, public InstVisitor<Interpreter> {
|
|||||||
// registered with the atexit() library function.
|
// registered with the atexit() library function.
|
||||||
std::vector<Function*> AtExitHandlers;
|
std::vector<Function*> AtExitHandlers;
|
||||||
|
|
||||||
std::map<Function*, FunctionInfo*> FunctionInfoMap;
|
|
||||||
public:
|
public:
|
||||||
Interpreter(Module *M, bool isLittleEndian, bool isLongPointer,
|
Interpreter(Module *M, bool isLittleEndian, bool isLongPointer);
|
||||||
bool TraceMode);
|
inline ~Interpreter() { }
|
||||||
inline ~Interpreter() { CW.setModule(0); }
|
|
||||||
|
|
||||||
/// runAtExitHandlers - Run any functions registered by the
|
/// runAtExitHandlers - Run any functions registered by the
|
||||||
/// program's calls to atexit(3), which we intercept and store in
|
/// program's calls to atexit(3), which we intercept and store in
|
||||||
@ -104,21 +95,16 @@ public:
|
|||||||
|
|
||||||
/// create - Create an interpreter ExecutionEngine. This can never fail.
|
/// create - Create an interpreter ExecutionEngine. This can never fail.
|
||||||
///
|
///
|
||||||
static ExecutionEngine *create(Module *M, bool TraceMode);
|
static ExecutionEngine *create(Module *M);
|
||||||
|
|
||||||
/// run - Start execution with the specified function and arguments.
|
/// run - Start execution with the specified function and arguments.
|
||||||
///
|
///
|
||||||
virtual GenericValue run(Function *F,
|
virtual GenericValue run(Function *F,
|
||||||
const std::vector<GenericValue> &ArgValues);
|
const std::vector<GenericValue> &ArgValues);
|
||||||
|
|
||||||
// Methods used for debug printouts:
|
|
||||||
static void print(const Type *Ty, GenericValue V);
|
|
||||||
static void printValue(const Type *Ty, GenericValue V);
|
|
||||||
|
|
||||||
// Methods used to execute code:
|
// Methods used to execute code:
|
||||||
// Place a call on the stack
|
// Place a call on the stack
|
||||||
void callFunction(Function *F, const std::vector<GenericValue> &ArgVals);
|
void callFunction(Function *F, const std::vector<GenericValue> &ArgVals);
|
||||||
void executeInstruction(); // Execute one instruction
|
|
||||||
void run(); // Execute instructions until nothing left to do
|
void run(); // Execute instructions until nothing left to do
|
||||||
|
|
||||||
// Opcode Implementations
|
// Opcode Implementations
|
||||||
|
Loading…
x
Reference in New Issue
Block a user