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 | 4a5bb95729a5335bfdddd401454003ac05ba4316 (patch) | |
tree | 607258b2be0e52186b222f3d3f17b0002b47b3e8 /llvm/lib/ExecutionEngine/Interpreter/Interpreter.h | |
parent | 2537ca318a65e29e085ed1f8e4f88387b21fdbad (diff) | |
download | bcm5719-llvm-4a5bb95729a5335bfdddd401454003ac05ba4316.tar.gz bcm5719-llvm-4a5bb95729a5335bfdddd401454003ac05ba4316.zip |
Add support for atexit function, remove support for __main function
llvm-svn: 6194
Diffstat (limited to 'llvm/lib/ExecutionEngine/Interpreter/Interpreter.h')
-rw-r--r-- | llvm/lib/ExecutionEngine/Interpreter/Interpreter.h | 9 |
1 files changed, 9 insertions, 0 deletions
diff --git a/llvm/lib/ExecutionEngine/Interpreter/Interpreter.h b/llvm/lib/ExecutionEngine/Interpreter/Interpreter.h index 6481cb7d42e..50765810abf 100644 --- a/llvm/lib/ExecutionEngine/Interpreter/Interpreter.h +++ b/llvm/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(); |