@@ -505,18 +505,18 @@ int main(int argc, char **argv) {
505
505
" for the executable <input file> by using debug symbols information\n "
506
506
" contained in its symbol table.\n " ,
507
507
false );
508
- return 0 ;
508
+ return EXIT_SUCCESS ;
509
509
}
510
510
511
511
if (Args.hasArg (OPT_version)) {
512
512
cl::PrintVersionMessage ();
513
- return 0 ;
513
+ return EXIT_SUCCESS ;
514
514
}
515
515
516
516
auto OptionsOrErr = getOptions (Args);
517
517
if (!OptionsOrErr) {
518
518
WithColor::error () << toString (OptionsOrErr.takeError ());
519
- return 1 ;
519
+ return EXIT_FAILURE ;
520
520
}
521
521
522
522
auto &Options = *OptionsOrErr;
@@ -530,7 +530,7 @@ int main(int argc, char **argv) {
530
530
Reproducer::createReproducer (Options.ReproMode , Options.ReproducerPath );
531
531
if (!Repro) {
532
532
WithColor::error () << toString (Repro.takeError ());
533
- return 1 ;
533
+ return EXIT_FAILURE ;
534
534
}
535
535
536
536
Options.LinkOpts .VFS = (*Repro)->getVFS ();
@@ -539,7 +539,7 @@ int main(int argc, char **argv) {
539
539
if (Arch != " *" && Arch != " all" &&
540
540
!object::MachOObjectFile::isValidArch (Arch)) {
541
541
WithColor::error () << " unsupported cpu architecture: '" << Arch << " '\n " ;
542
- return 1 ;
542
+ return EXIT_FAILURE ;
543
543
}
544
544
545
545
SymbolMapLoader SymMapLoader (Options.SymbolMap );
@@ -549,7 +549,7 @@ int main(int argc, char **argv) {
549
549
if (Options.DumpStab ) {
550
550
if (!dumpStab (Options.LinkOpts .VFS , InputFile, Options.Archs ,
551
551
Options.LinkOpts .PrependPath ))
552
- return 1 ;
552
+ return EXIT_FAILURE ;
553
553
continue ;
554
554
}
555
555
@@ -561,7 +561,7 @@ int main(int argc, char **argv) {
561
561
if (auto EC = DebugMapPtrsOrErr.getError ()) {
562
562
WithColor::error () << " cannot parse the debug map for '" << InputFile
563
563
<< " ': " << EC.message () << ' \n ' ;
564
- return 1 ;
564
+ return EXIT_FAILURE ;
565
565
}
566
566
567
567
// Remember the number of debug maps that are being processed to decide how
@@ -579,7 +579,7 @@ int main(int argc, char **argv) {
579
579
// Ensure that the debug map is not empty (anymore).
580
580
if (DebugMapPtrsOrErr->empty ()) {
581
581
WithColor::error () << " no architecture to link\n " ;
582
- return 1 ;
582
+ return EXIT_FAILURE ;
583
583
}
584
584
585
585
// Shared a single binary holder for all the link steps.
@@ -590,7 +590,7 @@ int main(int argc, char **argv) {
590
590
getOutputFileName (InputFile, Options);
591
591
if (!OutputLocationOrErr) {
592
592
WithColor::error () << toString (OutputLocationOrErr.takeError ());
593
- return 1 ;
593
+ return EXIT_FAILURE ;
594
594
}
595
595
Options.LinkOpts .ResourceDir = OutputLocationOrErr->getResourceDir ();
596
596
@@ -642,7 +642,7 @@ int main(int argc, char **argv) {
642
642
auto E = TempFiles.back ().createTempFile ();
643
643
if (E) {
644
644
WithColor::error () << toString (std::move (E));
645
- return 1 ;
645
+ return EXIT_FAILURE ;
646
646
}
647
647
648
648
auto &TempFile = *(TempFiles.back ().File );
@@ -655,7 +655,7 @@ int main(int argc, char **argv) {
655
655
Options.LinkOpts .NoOutput ? " -" : OutputFile, EC, sys::fs::OF_None);
656
656
if (EC) {
657
657
WithColor::error () << OutputFile << " : " << EC.message ();
658
- return 1 ;
658
+ return EXIT_FAILURE ;
659
659
}
660
660
}
661
661
@@ -681,15 +681,15 @@ int main(int argc, char **argv) {
681
681
Threads.wait ();
682
682
683
683
if (!AllOK)
684
- return 1 ;
684
+ return EXIT_FAILURE ;
685
685
686
686
if (NeedsTempFiles) {
687
687
if (!MachOUtils::generateUniversalBinary (TempFiles,
688
688
OutputLocationOrErr->DWARFFile ,
689
689
Options.LinkOpts , SDKPath))
690
- return 1 ;
690
+ return EXIT_FAILURE ;
691
691
}
692
692
}
693
693
694
- return 0 ;
694
+ return EXIT_SUCCESS ;
695
695
}
0 commit comments