OSDN Git Service

this is an overcomplex way to call exit :)
authorChris Lattner <sabre@nondot.org>
Sun, 7 Jan 2007 06:43:08 +0000 (06:43 +0000)
committerChris Lattner <sabre@nondot.org>
Sun, 7 Jan 2007 06:43:08 +0000 (06:43 +0000)
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@32978 91177308-0d34-0410-b5e6-96231b3b80d8

tools/lli/lli.cpp

index 5b139bf..998e761 100644 (file)
@@ -118,18 +118,7 @@ int main(int argc, char **argv, char * const *envp) {
     // Run static destructors.
     EE->runStaticConstructorsDestructors(true);
     
-    // If the program didn't explicitly call exit, call exit now, for the
-    // program. This ensures that any atexit handlers get called correctly.
-    Function *Exit = MP->getModule()->getOrInsertFunction("exit", Type::VoidTy,
-                                                          Type::Int32Ty,
-                                                          (Type *)0);
-
-    std::vector<GenericValue> Args;
-    GenericValue ResultGV;
-    ResultGV.Int32Val = Result;
-    Args.push_back(ResultGV);
-    EE->runFunction(Exit, Args);
-
+    exit(Result);
     std::cerr << "ERROR: exit(" << Result << ") returned!\n";
     abort();
   } catch (const std::string& msg) {