aboutsummaryrefslogtreecommitdiff
path: root/lib/Driver/Tools.cpp
diff options
context:
space:
mode:
authorDaniel Dunbar <daniel@zuster.org>2009-04-07 19:18:24 +0000
committerDaniel Dunbar <daniel@zuster.org>2009-04-07 19:18:24 +0000
commit5c1aaafbd6dd25a99ca1960e1c3c98aeefe9d728 (patch)
tree0999b9a22c6e1a339fdf2248e18843a3e2335656 /lib/Driver/Tools.cpp
parent1e23f5f963dd6a3cee43ace77578161798e41e2d (diff)
Driver: Explicitly warn that -pg isn't supported (even though we
aren't failing the compilation). git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@68540 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'lib/Driver/Tools.cpp')
-rw-r--r--lib/Driver/Tools.cpp18
1 files changed, 15 insertions, 3 deletions
diff --git a/lib/Driver/Tools.cpp b/lib/Driver/Tools.cpp
index 62a63cb882..e26bb9e85a 100644
--- a/lib/Driver/Tools.cpp
+++ b/lib/Driver/Tools.cpp
@@ -37,6 +37,7 @@ void Clang::ConstructJob(Compilation &C, const JobAction &JA,
const InputInfoList &Inputs,
const ArgList &Args,
const char *LinkingOutput) const {
+ const Driver &D = getToolChain().getHost().getDriver();
ArgStringList CmdArgs;
assert(Inputs.size() == 1 && "Unable to handle multiple inputs.");
@@ -277,11 +278,9 @@ void Clang::ConstructJob(Compilation &C, const JobAction &JA,
Arg *Unsupported;
if ((Unsupported = Args.getLastArg(options::OPT_MG)) ||
- (Unsupported = Args.getLastArg(options::OPT_MQ))) {
- const Driver &D = getToolChain().getHost().getDriver();
+ (Unsupported = Args.getLastArg(options::OPT_MQ)))
D.Diag(clang::diag::err_drv_unsupported_opt)
<< Unsupported->getOption().getName();
- }
}
Args.AddAllArgs(CmdArgs, options::OPT_v);
@@ -415,6 +414,19 @@ void Clang::ConstructJob(Compilation &C, const JobAction &JA,
Args.MakeArgString(getToolChain().GetProgramPath(C, "clang-cc").c_str());
Dest.addCommand(new Command(Exec, CmdArgs));
+ // Explicitly warn that these options are unsupported, even though
+ // we are allowing compilation to continue.
+ // FIXME: Use iterator.
+ for (ArgList::const_iterator
+ it = Args.begin(), ie = Args.end(); it != ie; ++it) {
+ const Arg *A = *it;
+ if (A->getOption().matches(options::OPT_pg)) {
+ A->claim();
+ D.Diag(clang::diag::warn_drv_clang_unsupported)
+ << A->getAsString(Args);
+ }
+ }
+
// Claim some arguments which clang supports automatically.
// -fpch-preprocess is used with gcc to add a special marker in the