diff options
Diffstat (limited to 'lib/Driver')
-rw-r--r-- | lib/Driver/Driver.cpp | 6 | ||||
-rw-r--r-- | lib/Driver/OptTable.cpp | 1 | ||||
-rw-r--r-- | lib/Driver/Option.cpp | 2 |
3 files changed, 7 insertions, 2 deletions
diff --git a/lib/Driver/Driver.cpp b/lib/Driver/Driver.cpp index 68ff8bc8b0..f9a82ff78d 100644 --- a/lib/Driver/Driver.cpp +++ b/lib/Driver/Driver.cpp @@ -802,7 +802,8 @@ void Driver::BuildJobs(Compilation &C) const { // If the user passed -Qunused-arguments or there were errors, don't // warn about any unused arguments. - if (Diags.getNumErrors() || C.getArgs().hasArg(options::OPT_Qunused_arguments)) + if (Diags.getNumErrors() || + C.getArgs().hasArg(options::OPT_Qunused_arguments)) return; // Claim -### here. @@ -816,6 +817,9 @@ void Driver::BuildJobs(Compilation &C) const { // Diagnostic, so that extra values, position, and so on could be // printed. if (!A->isClaimed()) { + if (A->getOption().hasNoArgumentUnused()) + continue; + // Suppress the warning automatically if this is just a flag, // and it is an instance of an argument we already claimed. const Option &Opt = A->getOption(); diff --git a/lib/Driver/OptTable.cpp b/lib/Driver/OptTable.cpp index cbbeea1974..7ea6a8b0d9 100644 --- a/lib/Driver/OptTable.cpp +++ b/lib/Driver/OptTable.cpp @@ -204,6 +204,7 @@ Option *OptTable::constructOption(options::ID id) const { case 'd': Opt->setDriverOption(true); break; case 'i': Opt->setNoOptAsInput(true); break; case 'l': Opt->setLinkerInput(true); break; + case 'q': Opt->setNoArgumentUnused(true); break; case 'u': Opt->setUnsupported(true); break; } } diff --git a/lib/Driver/Option.cpp b/lib/Driver/Option.cpp index 624854815d..cad2bbf2b7 100644 --- a/lib/Driver/Option.cpp +++ b/lib/Driver/Option.cpp @@ -21,7 +21,7 @@ Option::Option(OptionClass _Kind, options::ID _ID, const char *_Name, : Kind(_Kind), ID(_ID), Name(_Name), Group(_Group), Alias(_Alias), Unsupported(false), LinkerInput(false), NoOptAsInput(false), ForceSeparateRender(false), ForceJoinedRender(false), - DriverOption(false) + DriverOption(false), NoArgumentUnused(false) { // Multi-level aliases are not supported, and alias options cannot |