diff options
author | Hans Wennborg <hans@hanshq.net> | 2013-09-17 00:03:41 +0000 |
---|---|---|
committer | Hans Wennborg <hans@hanshq.net> | 2013-09-17 00:03:41 +0000 |
commit | a8ef14f3f49c98e2874df8af0e612d80971131ab (patch) | |
tree | 5ee28636274aea00ff0087e8d58608ee29ebfbf5 /clang/lib/Driver/Driver.cpp | |
parent | fab61e95f3b74a35ff45eb8d29e487dea273b399 (diff) | |
download | bcm5719-llvm-a8ef14f3f49c98e2874df8af0e612d80971131ab.tar.gz bcm5719-llvm-a8ef14f3f49c98e2874df8af0e612d80971131ab.zip |
clang-cl: ignore compile-only options in link-only invocations.
Previously we would warn about unused arguments such as /MD when linking.
Clang already has logic to ignore compile-only options, e.g. for -D and -U.
This patch extends that to include clang-cl's compile-only options too.
Also, some clang-cl options should always be ignored. Doing this earlier
means they get ignored both for compilation and link-only invocations.
llvm-svn: 190825
Diffstat (limited to 'clang/lib/Driver/Driver.cpp')
-rw-r--r-- | clang/lib/Driver/Driver.cpp | 7 |
1 files changed, 6 insertions, 1 deletions
diff --git a/clang/lib/Driver/Driver.cpp b/clang/lib/Driver/Driver.cpp index b1d5e619637..7ad09accd8c 100644 --- a/clang/lib/Driver/Driver.cpp +++ b/clang/lib/Driver/Driver.cpp @@ -1268,8 +1268,13 @@ void Driver::BuildActions(const ToolChain &TC, DerivedArgList &Args, // If we are linking, claim any options which are obviously only used for // compilation. - if (FinalPhase == phases::Link && PL.size() == 1) + if (FinalPhase == phases::Link && PL.size() == 1) { Args.ClaimAllArgs(options::OPT_CompileOnly_Group); + Args.ClaimAllArgs(options::OPT_cl_compile_Group); + } + + // Claim ignored clang-cl options. + Args.ClaimAllArgs(options::OPT_cl_ignored_Group); } Action *Driver::ConstructPhaseAction(const ArgList &Args, phases::ID Phase, |