From a3cfbe33dacca77b89ee3733ef9c5c2a44a70ca8 Mon Sep 17 00:00:00 2001 From: Daniel Dunbar Date: Tue, 7 Apr 2009 19:04:18 +0000 Subject: Driver: Add 'q' flag for options which shouldn't be reported as unused. - warning about '-dynamic' argument unused during compilation seems incorrect llvm-svn: 68535 --- clang/lib/Driver/Driver.cpp | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) (limited to 'clang/lib/Driver/Driver.cpp') diff --git a/clang/lib/Driver/Driver.cpp b/clang/lib/Driver/Driver.cpp index 68ff8bc8b0c..f9a82ff78d4 100644 --- a/clang/lib/Driver/Driver.cpp +++ b/clang/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(); -- cgit v1.2.3