llvm.org GIT mirror llvm / f74edf2
this is an overcomplex way to call exit :) git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@32978 91177308-0d34-0410-b5e6-96231b3b80d8 Chris Lattner 12 years ago
1 changed file(s) with 1 addition(s) and 12 deletion(s). Raw diff Collapse all Expand all
117117 // Run static destructors.
118118 EE->runStaticConstructorsDestructors(true);
119119
120 // If the program didn't explicitly call exit, call exit now, for the
121 // program. This ensures that any atexit handlers get called correctly.
122 Function *Exit = MP->getModule()->getOrInsertFunction("exit", Type::VoidTy,
123 Type::Int32Ty,
124 (Type *)0);
125
126 std::vector Args;
127 GenericValue ResultGV;
128 ResultGV.Int32Val = Result;
129 Args.push_back(ResultGV);
130 EE->runFunction(Exit, Args);
131
120 exit(Result);
132121 std::cerr << "ERROR: exit(" << Result << ") returned!\n";
133122 abort();
134123 } catch (const std::string& msg) {