mirror of
https://github.com/RPCS3/llvm-mirror.git
synced 2024-11-23 11:13:28 +01:00
this is an overcomplex way to call exit :)
llvm-svn: 32978
This commit is contained in:
parent
1ba48e5dc6
commit
af9e5ba7fa
@ -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) {
|
||||
|
Loading…
Reference in New Issue
Block a user