summaryrefslogtreecommitdiffstats
path: root/llvm/lib/ExecutionEngine/JIT/JIT.cpp
diff options
context:
space:
mode:
authorChris Lattner <sabre@nondot.org>2003-05-14 13:53:40 +0000
committerChris Lattner <sabre@nondot.org>2003-05-14 13:53:40 +0000
commit2537ca318a65e29e085ed1f8e4f88387b21fdbad (patch)
treea25c6d467ec9ddee96c69c60f0d8fe6718facfe5 /llvm/lib/ExecutionEngine/JIT/JIT.cpp
parentc67e34032753a4fe9e943ab56fd88fd507928055 (diff)
downloadbcm5719-llvm-2537ca318a65e29e085ed1f8e4f88387b21fdbad.tar.gz
bcm5719-llvm-2537ca318a65e29e085ed1f8e4f88387b21fdbad.zip
Add support for atexit handlers to the JIT, fixing 2003-05-14-AtExit.c
llvm-svn: 6193
Diffstat (limited to 'llvm/lib/ExecutionEngine/JIT/JIT.cpp')
-rw-r--r--llvm/lib/ExecutionEngine/JIT/JIT.cpp6
1 files changed, 5 insertions, 1 deletions
diff --git a/llvm/lib/ExecutionEngine/JIT/JIT.cpp b/llvm/lib/ExecutionEngine/JIT/JIT.cpp
index 39f305e1270..05aa934a85c 100644
--- a/llvm/lib/ExecutionEngine/JIT/JIT.cpp
+++ b/llvm/lib/ExecutionEngine/JIT/JIT.cpp
@@ -50,5 +50,9 @@ int VM::run(const std::string &FnName, const std::vector<std::string> &Args) {
char **Argv = (char**)CreateArgv(Args);
// Call the main function...
- return PF(Args.size(), Argv);
+ int Result = PF(Args.size(), Argv);
+
+ // Run any atexit handlers now!
+ runAtExitHandlers();
+ return Result;
}
OpenPOWER on IntegriCloud