Skip to content

Commit 7bf7b80

Browse files
committed
[dsymutil] Use EXIT_SUCCESS and EXIT_FAILURE (NFC)
1 parent aab488a commit 7bf7b80

File tree

1 file changed

+14
-14
lines changed

1 file changed

+14
-14
lines changed

llvm/tools/dsymutil/dsymutil.cpp

Lines changed: 14 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -505,18 +505,18 @@ int main(int argc, char **argv) {
505505
"for the executable <input file> by using debug symbols information\n"
506506
"contained in its symbol table.\n",
507507
false);
508-
return 0;
508+
return EXIT_SUCCESS;
509509
}
510510

511511
if (Args.hasArg(OPT_version)) {
512512
cl::PrintVersionMessage();
513-
return 0;
513+
return EXIT_SUCCESS;
514514
}
515515

516516
auto OptionsOrErr = getOptions(Args);
517517
if (!OptionsOrErr) {
518518
WithColor::error() << toString(OptionsOrErr.takeError());
519-
return 1;
519+
return EXIT_FAILURE;
520520
}
521521

522522
auto &Options = *OptionsOrErr;
@@ -530,7 +530,7 @@ int main(int argc, char **argv) {
530530
Reproducer::createReproducer(Options.ReproMode, Options.ReproducerPath);
531531
if (!Repro) {
532532
WithColor::error() << toString(Repro.takeError());
533-
return 1;
533+
return EXIT_FAILURE;
534534
}
535535

536536
Options.LinkOpts.VFS = (*Repro)->getVFS();
@@ -539,7 +539,7 @@ int main(int argc, char **argv) {
539539
if (Arch != "*" && Arch != "all" &&
540540
!object::MachOObjectFile::isValidArch(Arch)) {
541541
WithColor::error() << "unsupported cpu architecture: '" << Arch << "'\n";
542-
return 1;
542+
return EXIT_FAILURE;
543543
}
544544

545545
SymbolMapLoader SymMapLoader(Options.SymbolMap);
@@ -549,7 +549,7 @@ int main(int argc, char **argv) {
549549
if (Options.DumpStab) {
550550
if (!dumpStab(Options.LinkOpts.VFS, InputFile, Options.Archs,
551551
Options.LinkOpts.PrependPath))
552-
return 1;
552+
return EXIT_FAILURE;
553553
continue;
554554
}
555555

@@ -561,7 +561,7 @@ int main(int argc, char **argv) {
561561
if (auto EC = DebugMapPtrsOrErr.getError()) {
562562
WithColor::error() << "cannot parse the debug map for '" << InputFile
563563
<< "': " << EC.message() << '\n';
564-
return 1;
564+
return EXIT_FAILURE;
565565
}
566566

567567
// Remember the number of debug maps that are being processed to decide how
@@ -579,7 +579,7 @@ int main(int argc, char **argv) {
579579
// Ensure that the debug map is not empty (anymore).
580580
if (DebugMapPtrsOrErr->empty()) {
581581
WithColor::error() << "no architecture to link\n";
582-
return 1;
582+
return EXIT_FAILURE;
583583
}
584584

585585
// Shared a single binary holder for all the link steps.
@@ -590,7 +590,7 @@ int main(int argc, char **argv) {
590590
getOutputFileName(InputFile, Options);
591591
if (!OutputLocationOrErr) {
592592
WithColor::error() << toString(OutputLocationOrErr.takeError());
593-
return 1;
593+
return EXIT_FAILURE;
594594
}
595595
Options.LinkOpts.ResourceDir = OutputLocationOrErr->getResourceDir();
596596

@@ -642,7 +642,7 @@ int main(int argc, char **argv) {
642642
auto E = TempFiles.back().createTempFile();
643643
if (E) {
644644
WithColor::error() << toString(std::move(E));
645-
return 1;
645+
return EXIT_FAILURE;
646646
}
647647

648648
auto &TempFile = *(TempFiles.back().File);
@@ -655,7 +655,7 @@ int main(int argc, char **argv) {
655655
Options.LinkOpts.NoOutput ? "-" : OutputFile, EC, sys::fs::OF_None);
656656
if (EC) {
657657
WithColor::error() << OutputFile << ": " << EC.message();
658-
return 1;
658+
return EXIT_FAILURE;
659659
}
660660
}
661661

@@ -681,15 +681,15 @@ int main(int argc, char **argv) {
681681
Threads.wait();
682682

683683
if (!AllOK)
684-
return 1;
684+
return EXIT_FAILURE;
685685

686686
if (NeedsTempFiles) {
687687
if (!MachOUtils::generateUniversalBinary(TempFiles,
688688
OutputLocationOrErr->DWARFFile,
689689
Options.LinkOpts, SDKPath))
690-
return 1;
690+
return EXIT_FAILURE;
691691
}
692692
}
693693

694-
return 0;
694+
return EXIT_SUCCESS;
695695
}

0 commit comments

Comments
 (0)