mirror of
https://github.com/c64scene-ar/llvm-6502.git
synced 2025-06-20 10:24:12 +00:00
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
This commit is contained in:
@ -118,18 +118,7 @@ int main(int argc, char **argv, char * const *envp) {
|
|||||||
// Run static destructors.
|
// Run static destructors.
|
||||||
EE->runStaticConstructorsDestructors(true);
|
EE->runStaticConstructorsDestructors(true);
|
||||||
|
|
||||||
// If the program didn't explicitly call exit, call exit now, for the
|
exit(Result);
|
||||||
// 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);
|
|
||||||
|
|
||||||
std::cerr << "ERROR: exit(" << Result << ") returned!\n";
|
std::cerr << "ERROR: exit(" << Result << ") returned!\n";
|
||||||
abort();
|
abort();
|
||||||
} catch (const std::string& msg) {
|
} catch (const std::string& msg) {
|
||||||
|
Reference in New Issue
Block a user