summaryrefslogtreecommitdiffstats
path: root/clang/lib/Driver/Driver.cpp
diff options
context:
space:
mode:
authorDaniel Dunbar <daniel@zuster.org>2009-03-15 00:48:16 +0000
committerDaniel Dunbar <daniel@zuster.org>2009-03-15 00:48:16 +0000
commitae0e55eb7f21e654d6f4af9810354432b0c978da (patch)
tree0a3b586e134e8999fad58588b80e331322cbdd5b /clang/lib/Driver/Driver.cpp
parent36a3e925218c46820ffcc94e60a83262f5283473 (diff)
downloadbcm5719-llvm-ae0e55eb7f21e654d6f4af9810354432b0c978da.tar.gz
bcm5719-llvm-ae0e55eb7f21e654d6f4af9810354432b0c978da.zip
Driver: Update ArgList::{hasArg,getLastArg} to optionally claim the
arguments if they exist. llvm-svn: 67014
Diffstat (limited to 'clang/lib/Driver/Driver.cpp')
-rw-r--r--clang/lib/Driver/Driver.cpp12
1 files changed, 5 insertions, 7 deletions
diff --git a/clang/lib/Driver/Driver.cpp b/clang/lib/Driver/Driver.cpp
index cbd03a331bc..2aa50180bd2 100644
--- a/clang/lib/Driver/Driver.cpp
+++ b/clang/lib/Driver/Driver.cpp
@@ -378,7 +378,7 @@ void Driver::BuildActions(ArgList &Args, ActionList &Actions) const {
//
// Otherwise emit an error but still use a valid type to
// avoid spurious errors (e.g., no inputs).
- if (!Args.hasArg(options::OPT_E))
+ if (!Args.hasArg(options::OPT_E, false))
Diag(clang::diag::err_drv_unknown_stdin_type);
Ty = types::TY_C;
} else {
@@ -454,9 +454,10 @@ void Driver::BuildActions(ArgList &Args, ActionList &Actions) const {
(FinalPhaseArg = Args.getLastArg(options::OPT_MM))) {
FinalPhase = phases::Preprocess;
- // -{-analyze,fsyntax-only,S} only run up to the compiler.
- } else if ((FinalPhaseArg = Args.getLastArg(options::OPT__analyze)) ||
- (FinalPhaseArg = Args.getLastArg(options::OPT_fsyntax_only)) ||
+ // -{fsyntax-only,-analyze,emit-llvm,S} only run up to the compiler.
+ } else if ((FinalPhaseArg = Args.getLastArg(options::OPT_fsyntax_only)) ||
+ (FinalPhaseArg = Args.getLastArg(options::OPT__analyze)) ||
+ (FinalPhaseArg = Args.getLastArg(options::OPT_emit_llvm)) ||
(FinalPhaseArg = Args.getLastArg(options::OPT_S))) {
FinalPhase = phases::Compile;
@@ -468,9 +469,6 @@ void Driver::BuildActions(ArgList &Args, ActionList &Actions) const {
} else
FinalPhase = phases::Link;
- if (FinalPhaseArg)
- FinalPhaseArg->claim();
-
// Reject -Z* at the top level, these options should never have been
// exposed by gcc.
if (Arg *A = Args.getLastArg(options::OPT_Z))
OpenPOWER on IntegriCloud