diff options
author | Chris Lattner <sabre@nondot.org> | 2003-05-14 14:21:30 +0000 |
---|---|---|
committer | Chris Lattner <sabre@nondot.org> | 2003-05-14 14:21:30 +0000 |
commit | 44edb6bdd2edc48eb31ed160a09006b610cead67 (patch) | |
tree | 15e78604c92945363480b2b80937f38a9f934816 /lib/ExecutionEngine/Interpreter/Interpreter.h | |
parent | 22080f9f168b0129d0ed3a2a29a145e17723c3ba (diff) |
Add support for atexit function, remove support for __main function
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@6194 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'lib/ExecutionEngine/Interpreter/Interpreter.h')
-rw-r--r-- | lib/ExecutionEngine/Interpreter/Interpreter.h | 9 |
1 files changed, 9 insertions, 0 deletions
diff --git a/lib/ExecutionEngine/Interpreter/Interpreter.h b/lib/ExecutionEngine/Interpreter/Interpreter.h index 6481cb7d42..50765810ab 100644 --- a/lib/ExecutionEngine/Interpreter/Interpreter.h +++ b/lib/ExecutionEngine/Interpreter/Interpreter.h @@ -84,6 +84,8 @@ class Interpreter : public ExecutionEngine, public InstVisitor<Interpreter> { // 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); } @@ -164,6 +166,10 @@ public: // 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, @@ -207,6 +213,9 @@ private: // Helper functions 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(); |