From 2537ca318a65e29e085ed1f8e4f88387b21fdbad Mon Sep 17 00:00:00 2001 From: Chris Lattner Date: Wed, 14 May 2003 13:53:40 +0000 Subject: Add support for atexit handlers to the JIT, fixing 2003-05-14-AtExit.c llvm-svn: 6193 --- llvm/lib/ExecutionEngine/JIT/JIT.cpp | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) (limited to 'llvm/lib/ExecutionEngine/JIT/JIT.cpp') 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 &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; } -- cgit v1.2.3