aboutsummaryrefslogtreecommitdiff
path: root/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
commit22080f9f168b0129d0ed3a2a29a145e17723c3ba (patch)
tree1ee2ae5caa38865739d1561bc07cf7758c9bf071 /lib/ExecutionEngine/JIT/JIT.cpp
parent1b72216a711cddf5fc53cf0a4f5407b41b8303c9 (diff)
Add support for atexit handlers to the JIT, fixing 2003-05-14-AtExit.c
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@6193 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'lib/ExecutionEngine/JIT/JIT.cpp')
-rw-r--r--lib/ExecutionEngine/JIT/JIT.cpp6
1 files changed, 5 insertions, 1 deletions
diff --git a/lib/ExecutionEngine/JIT/JIT.cpp b/lib/ExecutionEngine/JIT/JIT.cpp
index 39f305e127..05aa934a85 100644
--- a/lib/ExecutionEngine/JIT/JIT.cpp
+++ b/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;
}