// function record.
std::vector<ExecutionContext> ECStack;
+ // AtExitHandlers - List of functions to call when the program exits.
+ std::vector<Function*> AtExitHandlers;
public:
Interpreter(Module *M, unsigned Config, bool DebugMode, bool TraceMode);
inline ~Interpreter() { CW.setModule(0); }
//
inline bool isStopped() const { return !ECStack.empty(); }
+ void addAtExitHandler(Function *F) {
+ AtExitHandlers.push_back(F);
+ }
+
//FIXME: private:
public:
GenericValue executeGEPOperation(Value *Ptr, User::op_iterator I,
Value *ChooseOneOption(const std::string &Name,
const std::vector<Value*> &Opts);
+ // PerformExitStuff - Print out counters and profiling information if
+ // applicable...
+ void PerformExitStuff();
void initializeExecutionEngine();
void initializeExternalFunctions();