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
diff --git a/lib/ExecutionEngine/JIT/JIT.h b/lib/ExecutionEngine/JIT/JIT.h
index 17c4ddd..a720c96 100644
--- a/lib/ExecutionEngine/JIT/JIT.h
+++ b/lib/ExecutionEngine/JIT/JIT.h
@@ -27,6 +27,7 @@
   // handler to lazily patch up references...
   //
   std::map<void*, Function*> FunctionRefs;
+
 public:
   VM(Module *M, TargetMachine *tm);
   ~VM();
@@ -54,6 +55,12 @@
   // which causes lazy compilation of the target function.
   // 
   static void CompilationCallback();
+
+  /// runAtExitHandlers - Before exiting the program, at_exit functions must be
+  /// called.  This method calls them.
+  ///
+  static void runAtExitHandlers();
+
 private:
   static MachineCodeEmitter *createEmitter(VM &V);
   void setupPassManager();