From c7a67b78773f64f12bc332882cb4220ea61ff778 Mon Sep 17 00:00:00 2001 From: Daniel Dunbar Date: Tue, 22 Dec 2009 23:19:32 +0000 Subject: Driver: When linking, don't warn about unused arguments which are obviously only used during compilation. - There is no easy way to define this group properly, unfortunately, and maybe this is a losing strategy. For now this is unambiguous more friendly, though. llvm-svn: 91940 --- clang/lib/Driver/Driver.cpp | 5 +++++ 1 file changed, 5 insertions(+) (limited to 'clang/lib') diff --git a/clang/lib/Driver/Driver.cpp b/clang/lib/Driver/Driver.cpp index dbe7bd9b682..c7eaad338c8 100644 --- a/clang/lib/Driver/Driver.cpp +++ b/clang/lib/Driver/Driver.cpp @@ -711,6 +711,11 @@ void Driver::BuildActions(const ArgList &Args, ActionList &Actions) const { // Add a link action if necessary. if (!LinkerInputs.empty()) Actions.push_back(new LinkJobAction(LinkerInputs, types::TY_Image)); + + // If we are linking, claim any options which are obviously only used for + // compilation. + if (FinalPhase == phases::Link) + Args.ClaimAllArgs(options::OPT_CompileOnly_Group); } Action *Driver::ConstructPhaseAction(const ArgList &Args, phases::ID Phase, -- cgit v1.2.3