Driver: Add 'q' flag for options which shouldn't be reported as unused.
- <rdar://problem/6756295> warning about '-dynamic' argument unused
during compilation seems incorrect
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@68535 91177308-0d34-0410-b5e6-96231b3b80d8
diff --git a/lib/Driver/Driver.cpp b/lib/Driver/Driver.cpp
index 68ff8bc..f9a82ff 100644
--- a/lib/Driver/Driver.cpp
+++ b/lib/Driver/Driver.cpp
@@ -802,7 +802,8 @@
// 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 @@
// 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();