aboutsummaryrefslogtreecommitdiff
path: root/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
commit8022fd46d45005de63306a7513aece20a1be16ed (patch)
treecab726771b33b144146ab35623ad873bdd64ab28 /lib/Driver/Driver.cpp
parent85c491064b33e8d407166256a9e639bc1fcad4ef (diff)
Driver: Update ArgList::{hasArg,getLastArg} to optionally claim the
arguments if they exist. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@67014 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'lib/Driver/Driver.cpp')
-rw-r--r--lib/Driver/Driver.cpp12
1 files changed, 5 insertions, 7 deletions
diff --git a/lib/Driver/Driver.cpp b/lib/Driver/Driver.cpp
index cbd03a331b..2aa50180bd 100644
--- a/lib/Driver/Driver.cpp
+++ b/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))