@@ -170,6 +170,12 @@ static Expected<std::vector<std::string>> getInputs(opt::InputArgList &Args,
170
170
171
171
// Verify that the given combination of options makes sense.
172
172
static Error verifyOptions (const DsymutilOptions &Options) {
173
+ if (Options.LinkOpts .Verbose && Options.LinkOpts .Quiet ) {
174
+ return make_error<StringError>(
175
+ " --quiet and --verbose cannot be specified together" ,
176
+ errc::invalid_argument);
177
+ }
178
+
173
179
if (Options.InputFiles .empty ()) {
174
180
return make_error<StringError>(" no input files specified" ,
175
181
errc::invalid_argument);
@@ -312,6 +318,7 @@ static Expected<DsymutilOptions> getOptions(opt::InputArgList &Args) {
312
318
Options.LinkOpts .NoTimestamp = Args.hasArg (OPT_no_swiftmodule_timestamp);
313
319
Options.LinkOpts .Update = Args.hasArg (OPT_update);
314
320
Options.LinkOpts .Verbose = Args.hasArg (OPT_verbose);
321
+ Options.LinkOpts .Quiet = Args.hasArg (OPT_quiet);
315
322
Options.LinkOpts .Statistics = Args.hasArg (OPT_statistics);
316
323
Options.LinkOpts .Fat64 = Args.hasArg (OPT_fat64);
317
324
Options.LinkOpts .KeepFunctionForStatic =
@@ -490,16 +497,20 @@ static bool verifyOutput(StringRef OutputFile, StringRef Arch,
490
497
DsymutilOptions Options, std::mutex &Mutex) {
491
498
492
499
if (OutputFile == " -" ) {
493
- std::lock_guard<std::mutex> Guard (Mutex);
494
- WithColor::warning () << " verification skipped for " << Arch
495
- << " because writing to stdout.\n " ;
500
+ if (!Options.LinkOpts .Quiet ) {
501
+ std::lock_guard<std::mutex> Guard (Mutex);
502
+ WithColor::warning () << " verification skipped for " << Arch
503
+ << " because writing to stdout.\n " ;
504
+ }
496
505
return true ;
497
506
}
498
507
499
508
if (Options.LinkOpts .NoOutput ) {
500
- std::lock_guard<std::mutex> Guard (Mutex);
501
- WithColor::warning () << " verification skipped for " << Arch
502
- << " because --no-output was passed.\n " ;
509
+ if (!Options.LinkOpts .Quiet ) {
510
+ std::lock_guard<std::mutex> Guard (Mutex);
511
+ WithColor::warning () << " verification skipped for " << Arch
512
+ << " because --no-output was passed.\n " ;
513
+ }
503
514
return true ;
504
515
}
505
516
@@ -514,10 +525,12 @@ static bool verifyOutput(StringRef OutputFile, StringRef Arch,
514
525
if (auto *Obj = dyn_cast<MachOObjectFile>(&Binary)) {
515
526
std::unique_ptr<DWARFContext> DICtx = DWARFContext::create (*Obj);
516
527
if (DICtx->getMaxVersion () > 5 ) {
517
- std::lock_guard<std::mutex> Guard (Mutex);
518
- WithColor::warning ()
519
- << " verification skipped for " << Arch
520
- << " because DWARF standard greater than v5 is not supported yet.\n " ;
528
+ if (!Options.LinkOpts .Quiet ) {
529
+ std::lock_guard<std::mutex> Guard (Mutex);
530
+ WithColor::warning () << " verification skipped for " << Arch
531
+ << " because DWARF standard greater than v5 is "
532
+ " not supported yet.\n " ;
533
+ }
521
534
return true ;
522
535
}
523
536
@@ -766,11 +779,13 @@ int main(int argc, char **argv) {
766
779
Options.LinkOpts .Translator = SymMapLoader.Load (InputFile, *Map);
767
780
768
781
if (Map->begin () == Map->end ()) {
769
- std::lock_guard<std::mutex> Guard (ErrorHandlerMutex);
770
- WithColor::warning ()
771
- << " no debug symbols in executable (-arch "
772
- << MachOUtils::getArchName (Map->getTriple ().getArchName ())
773
- << " )\n " ;
782
+ if (!Options.LinkOpts .Quiet ) {
783
+ std::lock_guard<std::mutex> Guard (ErrorHandlerMutex);
784
+ WithColor::warning ()
785
+ << " no debug symbols in executable (-arch "
786
+ << MachOUtils::getArchName (Map->getTriple ().getArchName ())
787
+ << " )\n " ;
788
+ }
774
789
}
775
790
776
791
// Using a std::shared_ptr rather than std::unique_ptr because move-only
0 commit comments