aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorTed Kremenek <kremenek@apple.com>2009-02-17 04:27:41 +0000
committerTed Kremenek <kremenek@apple.com>2009-02-17 04:27:41 +0000
commitbe1fe1eb12a1cb91c8e3a9fcc2db4dfe989def6c (patch)
tree8622aef537c73c734dd3ecb08c70f5b8ac1a9ed4
parent9add31798f621f843233dbff8bba103fca64447b (diff)
Static Analyzer driver/options (partial) cleanup:
- Move all analyzer options logic to AnalysisConsumer.cpp. - Unified specification of stores/constraints/output to be: -analyzer-output=... -analyzer-store=... -analyzer-constraints=... instead of -analyzer-range-constraints, -analyzer-store-basic, etc. - Updated drivers (ccc-analyzer, scan-builds, new ccc) to obey this new interface - Updated test cases to conform to new driver options git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@64737 91177308-0d34-0410-b5e6-96231b3b80d8
-rw-r--r--Driver/ASTConsumers.h7
-rw-r--r--Driver/Analyses.def16
-rw-r--r--Driver/AnalysisConsumer.cpp228
-rw-r--r--Driver/AnalysisConsumer.h51
-rw-r--r--Driver/clang.cpp69
-rw-r--r--test/Analysis/CFDateGC.m3
-rw-r--r--test/Analysis/CFNumber.c5
-rw-r--r--test/Analysis/CFRetainRelease_NSAssertionHandler.m3
-rw-r--r--test/Analysis/CGColorSpace.c5
-rw-r--r--test/Analysis/CheckNSError.m7
-rw-r--r--test/Analysis/NSPanel.m5
-rw-r--r--test/Analysis/NSString.m5
-rw-r--r--test/Analysis/NSWindow.m5
-rw-r--r--test/Analysis/NoReturn.m7
-rw-r--r--test/Analysis/ObjCProperties.m4
-rw-r--r--test/Analysis/array-struct.c6
-rw-r--r--test/Analysis/cfref_PR2519.c4
-rw-r--r--test/Analysis/cfref_rdar6080742.c4
-rw-r--r--test/Analysis/complex.c4
-rw-r--r--test/Analysis/exercise-ps.c4
-rw-r--r--test/Analysis/fields.c4
-rw-r--r--test/Analysis/func.c4
-rw-r--r--test/Analysis/misc-ps-basic-store.m2
-rw-r--r--test/Analysis/misc-ps-region-store.m2
-rw-r--r--test/Analysis/misc-ps.m4
-rw-r--r--test/Analysis/no-exit-cfg.c4
-rw-r--r--test/Analysis/null-deref-ps.c6
-rw-r--r--test/Analysis/outofbound.c2
-rw-r--r--test/Analysis/rdar-6442306-1.m4
-rw-r--r--test/Analysis/rdar-6539791.c4
-rw-r--r--test/Analysis/rdar-6541136-region.c2
-rw-r--r--test/Analysis/rdar-6541136.c2
-rw-r--r--test/Analysis/rdar-6582778-basic-store.c2
-rw-r--r--test/Analysis/refcnt_naming.m4
-rw-r--r--test/Analysis/region-only-test.c2
-rw-r--r--test/Analysis/retain-release-basic-store.m2
-rw-r--r--test/Analysis/retain-release-gc-only.m2
-rw-r--r--test/Analysis/retain-release-region-store.m2
-rw-r--r--test/Analysis/retain-release.m2
-rw-r--r--test/Analysis/stack-addr-ps.c4
-rw-r--r--test/Analysis/uninit-msg-expr.m4
-rw-r--r--test/Analysis/uninit-ps-rdar6145427.m4
-rw-r--r--test/Analysis/uninit-vals-ps-region.c2
-rw-r--r--test/Analysis/uninit-vals-ps.c2
-rw-r--r--test/Analysis/uninit-vals.m4
-rw-r--r--tools/ccc/ccclib/Tools.py2
-rwxr-xr-xutils/ccc-analyzer17
-rwxr-xr-xutils/scan-build28
48 files changed, 288 insertions, 277 deletions
diff --git a/Driver/ASTConsumers.h b/Driver/ASTConsumers.h
index 2032a2d598..34c9fb246e 100644
--- a/Driver/ASTConsumers.h
+++ b/Driver/ASTConsumers.h
@@ -75,8 +75,11 @@ ASTConsumer *CreateBlockRewriter(const std::string& InFile,
ASTConsumer *CreateInheritanceViewer(const std::string& clsname);
-} // end clang namespace
+ASTConsumer* CreateAnalysisConsumer(Diagnostic &diags, Preprocessor* pp,
+ PreprocessorFactory* ppf,
+ const LangOptions& lopts,
+ const std::string& output);
-#include "AnalysisConsumer.h"
+} // end clang namespace
#endif
diff --git a/Driver/Analyses.def b/Driver/Analyses.def
index 3beaa73bcb..333055f929 100644
--- a/Driver/Analyses.def
+++ b/Driver/Analyses.def
@@ -49,11 +49,18 @@ ANALYSIS(CheckerCFRef, "checker-cfref",
#ifndef ANALYSIS_STORE
-#define ANALYSIS_STORE(NAME, CMDFLAG, DESC)
+#define ANALYSIS_STORE(NAME, CMDFLAG, DESC, CREATFN)
#endif
-ANALYSIS_STORE(BasicStore, "basic", "Use basic analyzer store")
-ANALYSIS_STORE(RegionStore, "region", "Use region-based analyzer store")
+ANALYSIS_STORE(BasicStore, "basic", "Use basic analyzer store", CreateBasicStoreManager)
+ANALYSIS_STORE(RegionStore, "region", "Use region-based analyzer store", CreateRegionStoreManager)
+
+#ifndef ANALYSIS_CONSTRAINTS
+#define ANALYSIS_CONSTRAINTS(NAME, CMDFLAG, DESC, CREATFN)
+#endif
+
+ANALYSIS_CONSTRAINTS(BasicConstraints, "basic", "Use basic constraint tracking", CreateBasicConstraintManager)
+ANALYSIS_CONSTRAINTS(RangeContraints, "range", "Use constraint tracking of concrete value ranges", CreateRangeConstraintManager)
#ifndef ANALYSIS_DIAGNOSTICS
#define ANALYSIS_DIAGNOSTICS(NAME, CMDFLAG, DESC, CREATEFN, AUTOCREATE)
@@ -64,6 +71,7 @@ ANALYSIS_DIAGNOSTICS(PLIST, "plist", "Output analysis results using Plists", Cre
#undef ANALYSIS
#undef ANALYSIS_STORE
+#undef ANALYSIS_CONSTRAINTS
#undef ANALYSIS_DIAGNOSTICS
-
+#undef ANALYSIS_STORE
diff --git a/Driver/AnalysisConsumer.cpp b/Driver/AnalysisConsumer.cpp
index 5c1e3d87bf..66fe299e37 100644
--- a/Driver/AnalysisConsumer.cpp
+++ b/Driver/AnalysisConsumer.cpp
@@ -42,18 +42,124 @@ using namespace clang;
static ExplodedNodeImpl::Auditor* CreateUbiViz();
-// Analyzer options.
+//===----------------------------------------------------------------------===//
+// Analyzer Options: available analyses.
+//===----------------------------------------------------------------------===//
+
+/// Analysis - Set of available source code analyses.
+enum Analyses {
+#define ANALYSIS(NAME, CMDFLAG, DESC, SCOPE) NAME,
+#include "Analyses.def"
+NumAnalyses
+};
+
+static llvm::cl::list<Analyses>
+AnalysisList(llvm::cl::desc("Source Code Analysis - Checks and Analyses"),
+llvm::cl::values(
+#define ANALYSIS(NAME, CMDFLAG, DESC, SCOPE)\
+clEnumValN(NAME, CMDFLAG, DESC),
+#include "Analyses.def"
+clEnumValEnd));
+
+//===----------------------------------------------------------------------===//
+// Analyzer Options: store model.
+//===----------------------------------------------------------------------===//
+
+/// AnalysisStores - Set of available analysis store models.
+enum AnalysisStores {
+#define ANALYSIS_STORE(NAME, CMDFLAG, DESC, CREATFN) NAME##Model,
+#include "Analyses.def"
+NumStores
+};
+
+static llvm::cl::opt<AnalysisStores>
+AnalysisStoreOpt("analyzer-store",
+ llvm::cl::desc("Source Code Analysis - Abstract Memory Store Models"),
+ llvm::cl::init(BasicStoreModel),
+ llvm::cl::values(
+#define ANALYSIS_STORE(NAME, CMDFLAG, DESC, CREATFN)\
+clEnumValN(NAME##Model, CMDFLAG, DESC),
+#include "Analyses.def"
+clEnumValEnd));
+
+//===----------------------------------------------------------------------===//
+// Analyzer Options: constraint engines.
+//===----------------------------------------------------------------------===//
+
+/// AnalysisConstraints - Set of available constraint models.
+enum AnalysisConstraints {
+#define ANALYSIS_CONSTRAINTS(NAME, CMDFLAG, DESC, CREATFN) NAME##Model,
+#include "Analyses.def"
+NumConstraints
+};
+
+static llvm::cl::opt<AnalysisConstraints>
+AnalysisConstraintsOpt("analyzer-constraints",
+ llvm::cl::desc("Source Code Analysis - Symbolic Constraint Engines"),
+ llvm::cl::init(BasicConstraintsModel),
+ llvm::cl::values(
+#define ANALYSIS_CONSTRAINTS(NAME, CMDFLAG, DESC, CREATFN)\
+clEnumValN(NAME##Model, CMDFLAG, DESC),
+#include "Analyses.def"
+clEnumValEnd));
+
+//===----------------------------------------------------------------------===//
+// Analyzer Options: diagnostic clients.
+//===----------------------------------------------------------------------===//
+
+/// AnalysisDiagClients - Set of available diagnostic clients for rendering
+/// analysis results.
+enum AnalysisDiagClients {
+#define ANALYSIS_DIAGNOSTICS(NAME, CMDFLAG, DESC, CREATFN, AUTOCREAT) PD_##NAME,
+#include "Analyses.def"
+NUM_ANALYSIS_DIAG_CLIENTS
+};
+
+static llvm::cl::opt<AnalysisDiagClients>
+AnalysisDiagOpt("analyzer-output",
+ llvm::cl::desc("Source Code Analysis - Output Options"),
+ llvm::cl::init(PD_HTML),
+ llvm::cl::values(
+#define ANALYSIS_DIAGNOSTICS(NAME, CMDFLAG, DESC, CREATFN, AUTOCREATE)\
+clEnumValN(PD_##NAME, CMDFLAG, DESC),
+#include "Analyses.def"
+clEnumValEnd));
+
+//===----------------------------------------------------------------------===//
+// Misc. fun options.
+//===----------------------------------------------------------------------===//
+
+static llvm::cl::opt<bool>
+VisualizeEGDot("analyzer-viz-egraph-graphviz",
+ llvm::cl::desc("Display exploded graph using GraphViz"));
+
+static llvm::cl::opt<bool>
+VisualizeEGUbi("analyzer-viz-egraph-ubigraph",
+ llvm::cl::desc("Display exploded graph using Ubigraph"));
+
+static llvm::cl::opt<bool>
+AnalyzeAll("analyzer-opt-analyze-headers",
+ llvm::cl::desc("Force the static analyzer to analyze "
+ "functions defined in header files"));
+
+static llvm::cl::opt<bool>
+AnalyzerDisplayProgress("analyzer-display-progress",
+ llvm::cl::desc("Emit verbose output about the analyzer's progress."));
+
static llvm::cl::opt<bool>
PurgeDead("analyzer-purge-dead",
llvm::cl::init(true),
llvm::cl::desc("Remove dead symbols, bindings, and constraints before"
" processing a statement."));
+
+static llvm::cl::opt<std::string>
+AnalyzeSpecificFunction("analyze-function",
+ llvm::cl::desc("Run analysis on specific function"));
+
static llvm::cl::opt<bool>
-UseRanges("analyzer-range-constraints",
- llvm::cl::init(false),
- llvm::cl::desc("Use the range constraint manager instead of the basic"
- " constraint manager"));
-
+TrimGraph("trim-egraph",
+ llvm::cl::desc("Only show error-related paths in the analysis graph"));
+
//===----------------------------------------------------------------------===//
// Basic type definitions.
//===----------------------------------------------------------------------===//
@@ -77,37 +183,21 @@ namespace {
Actions TranslationUnitActions;
public:
- const bool VisGraphviz;
- const bool VisUbigraph;
- const bool TrimGraph;
const LangOptions& LOpts;
Diagnostic &Diags;
ASTContext* Ctx;
Preprocessor* PP;
PreprocessorFactory* PPF;
- const std::string HTMLDir;
- const std::string FName;
+ const std::string OutDir;
llvm::OwningPtr<PathDiagnosticClient> PD;
- bool AnalyzeAll;
- AnalysisStores SM;
- AnalysisDiagClients DC;
- const bool DisplayProgress;
AnalysisConsumer(Diagnostic &diags, Preprocessor* pp,
PreprocessorFactory* ppf,
const LangOptions& lopts,
- const std::string& fname,
- const std::string& htmldir,
- AnalysisStores sm, AnalysisDiagClients dc,
- bool visgraphviz, bool visubi, bool trim, bool analyzeAll,
- bool displayProgress)
- : VisGraphviz(visgraphviz), VisUbigraph(visubi), TrimGraph(trim),
- LOpts(lopts), Diags(diags),
+ const std::string& outdir)
+ : LOpts(lopts), Diags(diags),
Ctx(0), PP(pp), PPF(ppf),
- HTMLDir(htmldir),
- FName(fname),
- AnalyzeAll(analyzeAll), SM(sm), DC(dc),
- DisplayProgress(displayProgress) {}
+ OutDir(outdir) {}
void addCodeAction(CodeAction action) {
FunctionActions.push_back(action);
@@ -215,11 +305,11 @@ namespace {
}
virtual PathDiagnosticClient* getPathDiagnosticClient() {
- if (C.PD.get() == 0 && !C.HTMLDir.empty()) {
- switch (C.DC) {
+ if (C.PD.get() == 0 && !C.OutDir.empty()) {
+ switch (AnalysisDiagOpt) {
default:
#define ANALYSIS_DIAGNOSTICS(NAME, CMDFLAG, DESC, CREATEFN, AUTOCREATE)\
-case PD_##NAME: C.PD.reset(CREATEFN(C.HTMLDir, C.PP, C.PPF)); break;
+case PD_##NAME: C.PD.reset(CREATEFN(C.OutDir, C.PP, C.PPF)); break;
#include "Analyses.def"
}
}
@@ -239,22 +329,16 @@ case PD_##NAME: C.PD.reset(CREATEFN(C.HTMLDir, C.PP, C.PPF)); break;
return liveness.get();
}
- bool shouldVisualizeGraphviz() const {
- return C.VisGraphviz;
- }
+ bool shouldVisualizeGraphviz() const { return VisualizeEGDot; }
+
+ bool shouldVisualizeUbigraph() const { return VisualizeEGUbi; }
- bool shouldVisualizeUbigraph() const {
- return C.VisUbigraph;
- }
-
bool shouldVisualize() const {
- return C.VisGraphviz || C.VisUbigraph;
- }
-
- bool shouldTrimGraph() const {
- return C.TrimGraph;
+ return VisualizeEGDot || VisualizeEGUbi;
}
-
+
+ bool shouldTrimGraph() const { return TrimGraph; }
+
void DisplayFunction() {
if (DisplayedFunction)
@@ -282,25 +366,31 @@ case PD_##NAME: C.PD.reset(CREATEFN(C.HTMLDir, C.PP, C.PPF)); break;
CreateStoreMgr = ManagerRegistry::StoreMgrCreator;
}
else {
- switch (C.SM) {
+ switch (AnalysisStoreOpt) {
default:
assert(0 && "Unknown store manager.");
-#define ANALYSIS_STORE(NAME, CMDFLAG, DESC) \
- case NAME##Model: CreateStoreMgr = Create##NAME##Manager; break;
+#define ANALYSIS_STORE(NAME, CMDFLAG, DESC, CREATEFN) \
+ case NAME##Model: CreateStoreMgr = CREATEFN; break;
#include "Analyses.def"
}
}
if (ManagerRegistry::ConstraintMgrCreator != 0)
CreateConstraintMgr = ManagerRegistry::ConstraintMgrCreator;
- else if (UseRanges)
- CreateConstraintMgr = CreateRangeConstraintManager;
- else
- CreateConstraintMgr = CreateBasicConstraintManager;
+ else {
+ switch (AnalysisConstraintsOpt) {
+ default:
+ assert(0 && "Unknown store manager.");
+#define ANALYSIS_CONSTRAINTS(NAME, CMDFLAG, DESC, CREATEFN) \
+ case NAME##Model: CreateConstraintMgr = CREATEFN; break;
+#include "Analyses.def"
+ }
+ }
+
// Some DiagnosticClients should be created all the time instead of
// lazily. Create those now.
- switch (C.DC) {
+ switch (AnalysisDiagOpt) {
default: break;
#define ANALYSIS_DIAGNOSTICS(NAME, CMDFLAG, DESC, CREATEFN, AUTOCREATE)\
case PD_##NAME: if (AUTOCREATE) getPathDiagnosticClient(); break;
@@ -329,7 +419,8 @@ void AnalysisConsumer::HandleTopLevelDecl(Decl *D) {
case Decl::Function: {
FunctionDecl* FD = cast<FunctionDecl>(D);
- if (FName.size() > 0 && FName != FD->getIdentifier()->getName())
+ if (AnalyzeSpecificFunction.size() > 0 &&
+ AnalyzeSpecificFunction != FD->getIdentifier()->getName())
break;
Stmt* Body = FD->getBody();
@@ -340,7 +431,8 @@ void AnalysisConsumer::HandleTopLevelDecl(Decl *D) {
case Decl::ObjCMethod: {
ObjCMethodDecl* MD = cast<ObjCMethodDecl>(D);
- if (FName.size() > 0 && FName != MD->getSelector().getAsString())
+ if (AnalyzeSpecificFunction.size() > 0 &&
+ AnalyzeSpecificFunction != MD->getSelector().getAsString())
return;
Stmt* Body = MD->getBody();
@@ -356,7 +448,7 @@ void AnalysisConsumer::HandleTopLevelDecl(Decl *D) {
void AnalysisConsumer::HandleTranslationUnit(TranslationUnit& TU) {
if(!TranslationUnitActions.empty()) {
- AnalysisManager mgr(*this, &TU, DisplayProgress);
+ AnalysisManager mgr(*this, &TU, AnalyzerDisplayProgress);
for (Actions::iterator I = TranslationUnitActions.begin(),
E = TranslationUnitActions.end(); I != E; ++I)
(*I)(mgr);
@@ -386,7 +478,7 @@ void AnalysisConsumer::HandleCode(Decl* D, Stmt* Body, Actions& actions) {
// Create an AnalysisManager that will manage the state for analyzing
// this method/function.
- AnalysisManager mgr(*this, D, Body, DisplayProgress);
+ AnalysisManager mgr(*this, D, Body, AnalyzerDisplayProgress);
// Dispatch on the actions.
for (Actions::iterator I = actions.begin(), E = actions.end(); I != E; ++I)
@@ -538,26 +630,16 @@ static void ActionWarnObjCMethSigs(AnalysisManager& mgr) {
// AnalysisConsumer creation.
//===----------------------------------------------------------------------===//
-ASTConsumer* clang::CreateAnalysisConsumer(Analyses* Beg, Analyses* End,
- AnalysisStores SM,
- AnalysisDiagClients DC,
- Diagnostic &diags, Preprocessor* pp,
+ASTConsumer* clang::CreateAnalysisConsumer(Diagnostic &diags, Preprocessor* pp,
PreprocessorFactory* ppf,
const LangOptions& lopts,
- const std::string& fname,
- const std::string& htmldir,
- bool VisGraphviz, bool VisUbi,
- bool trim,
- bool analyzeAll,
- bool displayProgress) {
-
- llvm::OwningPtr<AnalysisConsumer>
- C(new AnalysisConsumer(diags, pp, ppf, lopts, fname, htmldir, SM, DC,
- VisGraphviz, VisUbi, trim, analyzeAll,
- displayProgress));
-
- for ( ; Beg != End ; ++Beg)
- switch (*Beg) {
+ const std::string& OutDir) {
+
+ llvm::OwningPtr<AnalysisConsumer> C(new AnalysisConsumer(diags, pp, ppf,
+ lopts, OutDir));
+
+ for (unsigned i = 0; i < AnalysisList.size(); ++i)
+ switch (AnalysisList[i]) {
#define ANALYSIS(NAME, CMD, DESC, SCOPE)\
case NAME:\
C->add ## SCOPE ## Action(&Action ## NAME);\
@@ -565,7 +647,7 @@ ASTConsumer* clang::CreateAnalysisConsumer(Analyses* Beg, Analyses* End,
#include "Analyses.def"
default: break;
}
-
+
return C.take();
}
diff --git a/Driver/AnalysisConsumer.h b/Driver/AnalysisConsumer.h
deleted file mode 100644
index eb349be240..0000000000
--- a/Driver/AnalysisConsumer.h
+++ /dev/null
@@ -1,51 +0,0 @@
-//===--- AnalysisConsumer.cpp - ASTConsumer for running Analyses ----------===//
-//
-// The LLVM Compiler Infrastructure
-//
-// This file is distributed under the University of Illinois Open Source
-// License. See LICENSE.TXT for details.
-//
-//===----------------------------------------------------------------------===//
-//
-// "Meta" ASTConsumer for running different source analyses.
-//
-//===----------------------------------------------------------------------===//
-
-#ifndef DRIVER_ANALYSISCONSUMER_H
-#define DRIVER_ANALYSISCONSUMER_H
-
-namespace clang {
-
-enum Analyses {
-#define ANALYSIS(NAME, CMDFLAG, DESC, SCOPE) NAME,
-#include "Analyses.def"
-NumAnalyses
-};
-
-enum AnalysisStores {
-#define ANALYSIS_STORE(NAME, CMDFLAG, DESC) NAME##Model,
-#include "Analyses.def"
-NumStores
-};
-
-enum AnalysisDiagClients {
-#define ANALYSIS_DIAGNOSTICS(NAME, CMDFLAG, DESC, CREATFN, AUTOCREAT) PD_##NAME,
-#include "Analyses.def"
-NUM_ANALYSIS_DIAG_CLIENTS
-};
-
-ASTConsumer* CreateAnalysisConsumer(Analyses* Beg, Analyses* End,
- AnalysisStores SM, AnalysisDiagClients DC,
- Diagnostic &diags, Preprocessor* pp,
- PreprocessorFactory* ppf,
- const LangOptions& lopts,
- const std::string& fname,
- const std::string& htmldir,
- bool VisualizeGraphViz,
- bool VisualizeUbi,
- bool VizTrimGraph,
- bool AnalyzeAll,
- bool DisplayProgress);
-} // end clang namespace
-
-#endif
diff --git a/Driver/clang.cpp b/Driver/clang.cpp
index deea08c335..1fdfde4318 100644
--- a/Driver/clang.cpp
+++ b/Driver/clang.cpp
@@ -222,53 +222,6 @@ MathErrno("fmath-errno",
llvm::cl::init(true), llvm::cl::AllowInverse);
//===----------------------------------------------------------------------===//
-// Analyzer Options.
-//===----------------------------------------------------------------------===//
-
-static llvm::cl::opt<bool>
-VisualizeEGDot("analyzer-viz-egraph-graphviz",
- llvm::cl::desc("Display exploded graph using GraphViz"));
-
-static llvm::cl::opt<bool>
-VisualizeEGUbi("analyzer-viz-egraph-ubigraph",
- llvm::cl::desc("Display exploded graph using Ubigraph"));
-
-static llvm::cl::opt<bool>
-AnalyzeAll("analyzer-opt-analyze-headers",
- llvm::cl::desc("Force the static analyzer to analyze "
- "functions defined in header files"));
-
-static llvm::cl::opt<bool>
-AnalyzerDisplayProgress("analyzer-display-progress",
- llvm::cl::desc("Emit verbose output about the analyzer's progress."));
-
-static llvm::cl::list<Analyses>
-AnalysisList(llvm::cl::desc("SCA Checks/Analyses:"),
-llvm::cl::values(
-#define ANALYSIS(NAME, CMDFLAG, DESC, SCOPE)\
-clEnumValN(NAME, CMDFLAG, DESC),
-#include "Analyses.def"
-clEnumValEnd));
-
-static llvm::cl::opt<AnalysisStores>
-AnalysisStoreOpt(llvm::cl::desc("SCA Low-Level Options (Store):"),
- llvm::cl::init(BasicStoreModel),
- llvm::cl::values(
-#define ANALYSIS_STORE(NAME, CMDFLAG, DESC)\
-clEnumValN(NAME##Model, "analyzer-store-" CMDFLAG, DESC),
-#include "Analyses.def"
-clEnumValEnd));
-
-static llvm::cl::opt<AnalysisDiagClients>
-AnalysisDiagOpt(llvm::cl::desc("SCA Output Options:"),
- llvm::cl::init(PD_HTML),
- llvm::cl::values(
-#define ANALYSIS_DIAGNOSTICS(NAME, CMDFLAG, DESC, CREATFN, AUTOCREATE)\
-clEnumValN(PD_##NAME, "analyzer-output-" CMDFLAG, DESC),
-#include "Analyses.def"
-clEnumValEnd));
-
-//===----------------------------------------------------------------------===//
// Language Options
//===----------------------------------------------------------------------===//
@@ -683,7 +636,6 @@ void InitializeGCMode(LangOptions &Options) {
Options.setGCMode(LangOptions::HybridGC);
}
-
//===----------------------------------------------------------------------===//
// Our DiagnosticClient implementation
//===----------------------------------------------------------------------===//
@@ -780,18 +732,6 @@ static void InitializeDiagnostics(Diagnostic &Diags) {
}
//===----------------------------------------------------------------------===//
-// Analysis-specific options.
-//===----------------------------------------------------------------------===//
-
-static llvm::cl::opt<std::string>
-AnalyzeSpecificFunction("analyze-function",
- llvm::cl::desc("Run analysis on specific function"));
-
-static llvm::cl::opt<bool>
-TrimGraph("trim-egraph",
- llvm::cl::desc("Only show error-related paths in the analysis graph"));
-
-//===----------------------------------------------------------------------===//
// Target Triple Processing.
//===----------------------------------------------------------------------===//
@@ -1349,14 +1289,7 @@ static ASTConsumer* CreateASTConsumer(const std::string& InFile,
return CreateBlockRewriter(InFile, OutputFile, Diag, LangOpts);
case RunAnalysis:
- return CreateAnalysisConsumer(&AnalysisList[0],
- &AnalysisList[0]+AnalysisList.size(),
- AnalysisStoreOpt, AnalysisDiagOpt,
- Diag, PP, PPF, LangOpts,
- AnalyzeSpecificFunction,
- OutputFile, VisualizeEGDot, VisualizeEGUbi,
- TrimGraph, AnalyzeAll,
- AnalyzerDisplayProgress);
+ return CreateAnalysisConsumer(Diag, PP, PPF, LangOpts, OutputFile);
}
}
diff --git a/test/Analysis/CFDateGC.m b/test/Analysis/CFDateGC.m
index 8b702d9203..10c72331ab 100644
--- a/test/Analysis/CFDateGC.m
+++ b/test/Analysis/CFDateGC.m
@@ -1,6 +1,7 @@
// RUN: clang -analyze -checker-cfref -verify -fobjc-gc %s &&
+// RUN: clang -analyze -checker-cfref -verify -fobjc-gc -analyzer-constraints=range %s &&
// RUN: clang -analyze -checker-cfref -verify -fobjc-gc -disable-free %s &&
-// RUN: clang -analyze -checker-cfref -analyzer-store-region -verify -fobjc-gc %s
+// RUN: clang -analyze -checker-cfref -analyzer-store=region -verify -fobjc-gc %s
//===----------------------------------------------------------------------===//
// The following code is reduced using delta-debugging from
diff --git a/test/Analysis/CFNumber.c b/test/Analysis/CFNumber.c
index e0d3c3ad03..cfef84983b 100644
--- a/test/Analysis/CFNumber.c
+++ b/test/Analysis/CFNumber.c
@@ -1,5 +1,6 @@
-// RUN: clang -analyze -checker-cfref -analyzer-store-basic -verify -triple x86_64-apple-darwin9 %s &&
-// RUN: clang -analyze -checker-cfref -analyzer-store-region -verify -triple x86_64-apple-darwin9 %s
+// RUN: clang -analyze -checker-cfref -analyzer-store=basic -verify -triple x86_64-apple-darwin9 %s &&
+// RUN: clang -analyze -checker-cfref -analyzer-store=basic -verify -triple x86_64-apple-darwin9 -analyzer-constraints=range %s &&
+// RUN: clang -analyze -checker-cfref -analyzer-store=region -verify -triple x86_64-apple-darwin9 %s
typedef signed long CFIndex;
typedef const struct __CFAllocator * CFAllocatorRef;
diff --git a/test/Analysis/CFRetainRelease_NSAssertionHandler.m b/test/Analysis/CFRetainRelease_NSAssertionHandler.m
index 13a2236518..a4c16bda9a 100644
--- a/test/Analysis/CFRetainRelease_NSAssertionHandler.m
+++ b/test/Analysis/CFRetainRelease_NSAssertionHandler.m
@@ -1,4 +1,5 @@
-// RUN: clang -analyze -checker-cfref -verify %s
+// RUN: clang -analyze -checker-cfref -verify %s &&
+// RUN: clang -analyze -checker-cfref -verify %s -analyzer-constraints=range
typedef struct objc_selector *SEL;
typedef signed char BOOL;
diff --git a/test/Analysis/CGColorSpace.c b/test/Analysis/CGColorSpace.c
index b229bd2e24..807c6b83f2 100644
--- a/test/Analysis/CGColorSpace.c
+++ b/test/Analysis/CGColorSpace.c
@@ -1,5 +1,6 @@
-// RUN: clang -analyze -checker-cfref -analyzer-store-basic -verify %s &&
-// RUN: clang -