aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--include/clang/Driver/ArgList.h3
-rw-r--r--include/clang/Driver/Options.def1
-rw-r--r--lib/Driver/Driver.cpp5
3 files changed, 7 insertions, 2 deletions
diff --git a/include/clang/Driver/ArgList.h b/include/clang/Driver/ArgList.h
index cff82c185e..84e0329a37 100644
--- a/include/clang/Driver/ArgList.h
+++ b/include/clang/Driver/ArgList.h
@@ -74,6 +74,9 @@ namespace driver {
bool hasArg(options::ID Id, bool Claim=true) const {
return getLastArg(Id, Claim) != 0;
}
+ bool hasArg(options::ID Id0, options::ID Id1, bool Claim=true) const {
+ return getLastArg(Id0, Id1, Claim) != 0;
+ }
/// getLastArg - Return the last argument matching \arg Id, or null.
///
diff --git a/include/clang/Driver/Options.def b/include/clang/Driver/Options.def
index 5f029628e7..5d35602e5b 100644
--- a/include/clang/Driver/Options.def
+++ b/include/clang/Driver/Options.def
@@ -127,6 +127,7 @@ OPTION("-###", _HASH_HASH_HASH, Flag, INVALID, INVALID, "d", 0,
OPTION("--CLASSPATH=", _CLASSPATH_EQ, Joined, INVALID, fclasspath_EQ, "", 0, 0, 0)
OPTION("--CLASSPATH", _CLASSPATH, Separate, INVALID, fclasspath_EQ, "J", 0, 0, 0)
OPTION("--all-warnings", _all_warnings, Flag, INVALID, Wall, "", 0, 0, 0)
+OPTION("--analyze-auto", _analyze_auto, Flag, INVALID, INVALID, "d", 0, 0, 0)
OPTION("--analyze", _analyze, Flag, INVALID, INVALID, "d", 0,
"Run the static analyzer", 0)
OPTION("--ansi", _ansi, Flag, INVALID, ansi, "", 0, 0, 0)
diff --git a/lib/Driver/Driver.cpp b/lib/Driver/Driver.cpp
index 8df64ea618..f50db66c69 100644
--- a/lib/Driver/Driver.cpp
+++ b/lib/Driver/Driver.cpp
@@ -661,7 +661,8 @@ void Driver::BuildActions(const ArgList &Args, ActionList &Actions) const {
// -{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__analyze,
+ options::OPT__analyze_auto)) ||
(FinalPhaseArg = Args.getLastArg(options::OPT_S))) {
FinalPhase = phases::Compile;
@@ -762,7 +763,7 @@ Action *Driver::ConstructPhaseAction(const ArgList &Args, phases::ID Phase,
case phases::Compile: {
if (Args.hasArg(options::OPT_fsyntax_only)) {
return new CompileJobAction(Input, types::TY_Nothing);
- } else if (Args.hasArg(options::OPT__analyze)) {
+ } else if (Args.hasArg(options::OPT__analyze, options::OPT__analyze_auto)) {
return new AnalyzeJobAction(Input, types::TY_Plist);
} else if (Args.hasArg(options::OPT_emit_llvm) ||
Args.hasArg(options::OPT_flto) ||