[cfe-commits] r64737 - in /cfe/trunk: Driver/ test/Analysis/ tools/ccc/ccclib/ utils/
Ted Kremenek
kremenek at apple.com
Mon Feb 16 20:27:45 PST 2009
Author: kremenek
Date: Mon Feb 16 22:27:41 2009
New Revision: 64737
URL: http://llvm.org/viewvc/llvm-project?rev=64737&view=rev
Log:
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
Removed:
cfe/trunk/Driver/AnalysisConsumer.h
Modified:
cfe/trunk/Driver/ASTConsumers.h
cfe/trunk/Driver/Analyses.def
cfe/trunk/Driver/AnalysisConsumer.cpp
cfe/trunk/Driver/clang.cpp
cfe/trunk/test/Analysis/CFDateGC.m
cfe/trunk/test/Analysis/CFNumber.c
cfe/trunk/test/Analysis/CFRetainRelease_NSAssertionHandler.m
cfe/trunk/test/Analysis/CGColorSpace.c
cfe/trunk/test/Analysis/CheckNSError.m
cfe/trunk/test/Analysis/NSPanel.m
cfe/trunk/test/Analysis/NSString.m
cfe/trunk/test/Analysis/NSWindow.m
cfe/trunk/test/Analysis/NoReturn.m
cfe/trunk/test/Analysis/ObjCProperties.m
cfe/trunk/test/Analysis/array-struct.c
cfe/trunk/test/Analysis/cfref_PR2519.c
cfe/trunk/test/Analysis/cfref_rdar6080742.c
cfe/trunk/test/Analysis/complex.c
cfe/trunk/test/Analysis/exercise-ps.c
cfe/trunk/test/Analysis/fields.c
cfe/trunk/test/Analysis/func.c
cfe/trunk/test/Analysis/misc-ps-basic-store.m
cfe/trunk/test/Analysis/misc-ps-region-store.m
cfe/trunk/test/Analysis/misc-ps.m
cfe/trunk/test/Analysis/no-exit-cfg.c
cfe/trunk/test/Analysis/null-deref-ps.c
cfe/trunk/test/Analysis/outofbound.c
cfe/trunk/test/Analysis/rdar-6442306-1.m
cfe/trunk/test/Analysis/rdar-6539791.c
cfe/trunk/test/Analysis/rdar-6541136-region.c
cfe/trunk/test/Analysis/rdar-6541136.c
cfe/trunk/test/Analysis/rdar-6582778-basic-store.c
cfe/trunk/test/Analysis/refcnt_naming.m
cfe/trunk/test/Analysis/region-only-test.c
cfe/trunk/test/Analysis/retain-release-basic-store.m
cfe/trunk/test/Analysis/retain-release-gc-only.m
cfe/trunk/test/Analysis/retain-release-region-store.m
cfe/trunk/test/Analysis/retain-release.m
cfe/trunk/test/Analysis/stack-addr-ps.c
cfe/trunk/test/Analysis/uninit-msg-expr.m
cfe/trunk/test/Analysis/uninit-ps-rdar6145427.m
cfe/trunk/test/Analysis/uninit-vals-ps-region.c
cfe/trunk/test/Analysis/uninit-vals-ps.c
cfe/trunk/test/Analysis/uninit-vals.m
cfe/trunk/tools/ccc/ccclib/Tools.py
cfe/trunk/utils/ccc-analyzer
cfe/trunk/utils/scan-build
Modified: cfe/trunk/Driver/ASTConsumers.h
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/Driver/ASTConsumers.h?rev=64737&r1=64736&r2=64737&view=diff
==============================================================================
--- cfe/trunk/Driver/ASTConsumers.h (original)
+++ cfe/trunk/Driver/ASTConsumers.h Mon Feb 16 22:27:41 2009
@@ -75,8 +75,11 @@
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
Modified: cfe/trunk/Driver/Analyses.def
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/Driver/Analyses.def?rev=64737&r1=64736&r2=64737&view=diff
==============================================================================
--- cfe/trunk/Driver/Analyses.def (original)
+++ cfe/trunk/Driver/Analyses.def Mon Feb 16 22:27:41 2009
@@ -49,11 +49,18 @@
#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 @@
#undef ANALYSIS
#undef ANALYSIS_STORE
+#undef ANALYSIS_CONSTRAINTS
#undef ANALYSIS_DIAGNOSTICS
-
+#undef ANALYSIS_STORE
Modified: cfe/trunk/Driver/AnalysisConsumer.cpp
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/Driver/AnalysisConsumer.cpp?rev=64737&r1=64736&r2=64737&view=diff
==============================================================================
--- cfe/trunk/Driver/AnalysisConsumer.cpp (original)
+++ cfe/trunk/Driver/AnalysisConsumer.cpp Mon Feb 16 22:27:41 2009
@@ -42,18 +42,124 @@
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 @@
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 @@
}
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 @@
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;
+ return VisualizeEGDot || VisualizeEGUbi;
}
-
- bool shouldTrimGraph() const {
- return C.TrimGraph;
- }
-
+
+ bool shouldTrimGraph() const { return TrimGraph; }
+
void DisplayFunction() {
if (DisplayedFunction)
@@ -282,25 +366,31 @@
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 @@
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 @@
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::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 @@
// 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 @@
// 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 @@
#include "Analyses.def"
default: break;
}
-
+
return C.take();
}
Removed: cfe/trunk/Driver/AnalysisConsumer.h
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/Driver/AnalysisConsumer.h?rev=64736&view=auto
==============================================================================
--- cfe/trunk/Driver/AnalysisConsumer.h (original)
+++ cfe/trunk/Driver/AnalysisConsumer.h (removed)
@@ -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
Modified: cfe/trunk/Driver/clang.cpp
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/Driver/clang.cpp?rev=64737&r1=64736&r2=64737&view=diff
==============================================================================
--- cfe/trunk/Driver/clang.cpp (original)
+++ cfe/trunk/Driver/clang.cpp Mon Feb 16 22:27:41 2009
@@ -222,53 +222,6 @@
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 @@
Options.setGCMode(LangOptions::HybridGC);
}
-
//===----------------------------------------------------------------------===//
// Our DiagnosticClient implementation
//===----------------------------------------------------------------------===//
@@ -780,18 +732,6 @@
}
//===----------------------------------------------------------------------===//
-// 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 @@
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);
}
}
Modified: cfe/trunk/test/Analysis/CFDateGC.m
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/test/Analysis/CFDateGC.m?rev=64737&r1=64736&r2=64737&view=diff
==============================================================================
--- cfe/trunk/test/Analysis/CFDateGC.m (original)
+++ cfe/trunk/test/Analysis/CFDateGC.m Mon Feb 16 22:27:41 2009
@@ -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
Modified: cfe/trunk/test/Analysis/CFNumber.c
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/test/Analysis/CFNumber.c?rev=64737&r1=64736&r2=64737&view=diff
==============================================================================
--- cfe/trunk/test/Analysis/CFNumber.c (original)
+++ cfe/trunk/test/Analysis/CFNumber.c Mon Feb 16 22:27:41 2009
@@ -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;
Modified: cfe/trunk/test/Analysis/CFRetainRelease_NSAssertionHandler.m
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/test/Analysis/CFRetainRelease_NSAssertionHandler.m?rev=64737&r1=64736&r2=64737&view=diff
==============================================================================
--- cfe/trunk/test/Analysis/CFRetainRelease_NSAssertionHandler.m (original)
+++ cfe/trunk/test/Analysis/CFRetainRelease_NSAssertionHandler.m Mon Feb 16 22:27:41 2009
@@ -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;
Modified: cfe/trunk/test/Analysis/CGColorSpace.c
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/test/Analysis/CGColorSpace.c?rev=64737&r1=64736&r2=64737&view=diff
==============================================================================
--- cfe/trunk/test/Analysis/CGColorSpace.c (original)
+++ cfe/trunk/test/Analysis/CGColorSpace.c Mon Feb 16 22:27:41 2009
@@ -1,5 +1,6 @@
-// RUN: clang -analyze -checker-cfref -analyzer-store-basic -verify %s &&
-// RUN: clang -analyze -checker-cfref -analyzer-store-region -verify %s
+// RUN: clang -analyze -checker-cfref -analyzer-store=basic -verify %s &&
+// RUN: clang -analyze -checker-cfref -analyzer-store=region -verify %s &&
+// RUN: clang -analyze -checker-cfref -analyzer-store=region -analyzer-constraints=range -verify %s
typedef struct CGColorSpace *CGColorSpaceRef;
extern CGColorSpaceRef CGColorSpaceCreateDeviceRGB(void);
Modified: cfe/trunk/test/Analysis/CheckNSError.m
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/test/Analysis/CheckNSError.m?rev=64737&r1=64736&r2=64737&view=diff
==============================================================================
--- cfe/trunk/test/Analysis/CheckNSError.m (original)
+++ cfe/trunk/test/Analysis/CheckNSError.m Mon Feb 16 22:27:41 2009
@@ -1,5 +1,8 @@
-// RUN: clang -analyze -checker-cfref -analyzer-store-basic -verify %s &&
-// RUN: clang -analyze -checker-cfref -analyzer-store-region -verify %s
+// RUN: clang -analyze -checker-cfref -analyzer-store=basic -verify %s &&
+// RUN: clang -analyze -checker-cfref -analyzer-store=region -verify %s &&
+// RUN: clang -analyze -checker-cfref -analyzer-store=basic -analyzer-constraints=range -verify %s &&
+// RUN: clang -analyze -checker-cfref -analyzer-store=region -analyzer-constraints=range -verify %s
+
typedef signed char BOOL;
typedef int NSInteger;
Modified: cfe/trunk/test/Analysis/NSPanel.m
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/test/Analysis/NSPanel.m?rev=64737&r1=64736&r2=64737&view=diff
==============================================================================
--- cfe/trunk/test/Analysis/NSPanel.m (original)
+++ cfe/trunk/test/Analysis/NSPanel.m Mon Feb 16 22:27:41 2009
@@ -1,5 +1,6 @@
-// RUN: clang -analyze -checker-cfref -analyzer-store-basic -verify %s &&
-// RUN: clang -analyze -checker-cfref -analyzer-store-region -verify %s
+// RUN: clang -analyze -checker-cfref -analyzer-store=basic -verify %s &&
+// RUN: clang -analyze -checker-cfref -analyzer-store=basic -analyzer-constraints=range -verify %s &&
+// RUN: clang -analyze -checker-cfref -analyzer-store=region -verify %s
// BEGIN delta-debugging reduced header stuff
Modified: cfe/trunk/test/Analysis/NSString.m
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/test/Analysis/NSString.m?rev=64737&r1=64736&r2=64737&view=diff
==============================================================================
--- cfe/trunk/test/Analysis/NSString.m (original)
+++ cfe/trunk/test/Analysis/NSString.m Mon Feb 16 22:27:41 2009
@@ -1,5 +1,6 @@
-// RUN: clang -analyze -checker-cfref -analyzer-store-basic -verify %s &&
-// RUN: clang -analyze -checker-cfref -analyzer-store-region -verify %s
+// RUN: clang -analyze -checker-cfref -analyzer-store=basic -verify %s &&
+// RUN: clang -analyze -checker-cfref -analyzer-store=basic -analyzer-constraints=range -verify %s &&
+// RUN: clang -analyze -checker-cfref -analyzer-store=region -verify %s
//===----------------------------------------------------------------------===//
// The following code is reduced using delta-debugging from
Modified: cfe/trunk/test/Analysis/NSWindow.m
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/test/Analysis/NSWindow.m?rev=64737&r1=64736&r2=64737&view=diff
==============================================================================
--- cfe/trunk/test/Analysis/NSWindow.m (original)
+++ cfe/trunk/test/Analysis/NSWindow.m Mon Feb 16 22:27:41 2009
@@ -1,5 +1,6 @@
-// RUN: clang -analyze -checker-cfref -warn-dead-stores -analyzer-store-basic -verify %s &&
-// RUN: clang -analyze -checker-cfref -warn-dead-stores -analyzer-store-region -verify %s
+// RUN: clang -analyze -checker-cfref -warn-dead-stores -analyzer-store=basic -verify %s &&
+// RUN: clang -analyze -checker-cfref -warn-dead-stores -analyzer-store=basic -analyzer-constraints=range -verify %s &&
+// RUN: clang -analyze -checker-cfref -warn-dead-stores -analyzer-store=region -verify %s
// These declarations were reduced using Delta-Debugging from Foundation.h
// on Mac OS X. The test cases are below.
Modified: cfe/trunk/test/Analysis/NoReturn.m
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/test/Analysis/NoReturn.m?rev=64737&r1=64736&r2=64737&view=diff
==============================================================================
--- cfe/trunk/test/Analysis/NoReturn.m (original)
+++ cfe/trunk/test/Analysis/NoReturn.m Mon Feb 16 22:27:41 2009
@@ -1,6 +1,7 @@
-// RUN: clang -analyze -checker-simple -analyzer-store-basic -verify %s &&
-// RUN: clang -analyze -checker-cfref -analyzer-store-basic -verify %s &&
-// RUN: clang -analyze -checker-cfref -analyzer-store-region -verify %s
+// RUN: clang -analyze -checker-simple -analyzer-store=basic -verify %s &&
+// RUN: clang -analyze -checker-cfref -analyzer-store=basic -verify %s &&
+// RUN: clang -analyze -checker-cfref -analyzer-store=basic -analyzer-constraints=range -verify %s &&
+// RUN: clang -analyze -checker-cfref -analyzer-store=region -verify %s
#include <stdarg.h>
Modified: cfe/trunk/test/Analysis/ObjCProperties.m
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/test/Analysis/ObjCProperties.m?rev=64737&r1=64736&r2=64737&view=diff
==============================================================================
--- cfe/trunk/test/Analysis/ObjCProperties.m (original)
+++ cfe/trunk/test/Analysis/ObjCProperties.m Mon Feb 16 22:27:41 2009
@@ -1,6 +1,6 @@
// RUN: clang -analyze -checker-simple %s -verify &&
-// RUN: clang -analyze -checker-cfref -analyzer-store-basic %s -verify &&
-// RUN: clang -analyze -checker-cfref -analyzer-store-region %s -verify
+// RUN: clang -analyze -checker-cfref -analyzer-store=basic %s -verify &&
+// RUN: clang -analyze -checker-cfref -analyzer-store=region %s -verify
// The point of this test cases is to exercise properties in the static
// analyzer
Modified: cfe/trunk/test/Analysis/array-struct.c
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/test/Analysis/array-struct.c?rev=64737&r1=64736&r2=64737&view=diff
==============================================================================
--- cfe/trunk/test/Analysis/array-struct.c (original)
+++ cfe/trunk/test/Analysis/array-struct.c Mon Feb 16 22:27:41 2009
@@ -1,6 +1,6 @@
-// RUN: clang -analyze -checker-simple -analyzer-store-basic -verify %s &&
-// RUN: clang -analyze -checker-cfref -analyzer-store-basic -verify %s &&
-// RUN: clang -analyze -checker-cfref -analyzer-store-region -verify %s
+// RUN: clang -analyze -checker-simple -analyzer-store=basic -verify %s &&
+// RUN: clang -analyze -checker-cfref -analyzer-store=basic -verify %s &&
+// RUN: clang -analyze -checker-cfref -analyzer-store=region -verify %s
struct s {
int data;
Modified: cfe/trunk/test/Analysis/cfref_PR2519.c
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/test/Analysis/cfref_PR2519.c?rev=64737&r1=64736&r2=64737&view=diff
==============================================================================
--- cfe/trunk/test/Analysis/cfref_PR2519.c (original)
+++ cfe/trunk/test/Analysis/cfref_PR2519.c Mon Feb 16 22:27:41 2009
@@ -1,5 +1,5 @@
-// RUN: clang -analyze -checker-cfref --analyzer-store-basic -verify %s &&
-// RUN: clang -analyze -checker-cfref --analyzer-store-region -verify %s
+// RUN: clang -analyze -checker-cfref --analyzer-store=basic -verify %s &&
+// RUN: clang -analyze -checker-cfref --analyzer-store=region -verify %s
typedef unsigned char Boolean;
typedef signed long CFIndex;
Modified: cfe/trunk/test/Analysis/cfref_rdar6080742.c
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/test/Analysis/cfref_rdar6080742.c?rev=64737&r1=64736&r2=64737&view=diff
==============================================================================
--- cfe/trunk/test/Analysis/cfref_rdar6080742.c (original)
+++ cfe/trunk/test/Analysis/cfref_rdar6080742.c Mon Feb 16 22:27:41 2009
@@ -1,5 +1,5 @@
-// RUN: clang -analyze -checker-cfref -analyzer-store-basic -verify %s &&
-// RUN: clang -analyze -checker-cfref -analyzer-store-region -verify %s
+// RUN: clang -analyze -checker-cfref -analyzer-store=basic -verify %s &&
+// RUN: clang -analyze -checker-cfref -analyzer-store=region -verify %s
// This test case was reported in <rdar:problem/6080742>.
// It tests path-sensitivity with respect to '!(cfstring != 0)' (negation of inequality).
Modified: cfe/trunk/test/Analysis/complex.c
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/test/Analysis/complex.c?rev=64737&r1=64736&r2=64737&view=diff
==============================================================================
--- cfe/trunk/test/Analysis/complex.c (original)
+++ cfe/trunk/test/Analysis/complex.c Mon Feb 16 22:27:41 2009
@@ -1,6 +1,6 @@
// RUN: clang -analyze -checker-simple -verify %s &&
-// RUN: clang -analyze -checker-cfref -analyzer-store-basic -verify %s &&
-// RUN: clang -analyze -checker-cfref -analyzer-store-region -verify %s
+// RUN: clang -analyze -checker-cfref -analyzer-store=basic -verify %s &&
+// RUN: clang -analyze -checker-cfref -analyzer-store=region -verify %s
#include <stdint.h>
Modified: cfe/trunk/test/Analysis/exercise-ps.c
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/test/Analysis/exercise-ps.c?rev=64737&r1=64736&r2=64737&view=diff
==============================================================================
--- cfe/trunk/test/Analysis/exercise-ps.c (original)
+++ cfe/trunk/test/Analysis/exercise-ps.c Mon Feb 16 22:27:41 2009
@@ -1,6 +1,6 @@
// RUN: clang -analyze -checker-simple -verify %s &&
-// RUN: clang -analyze -checker-cfref -analyzer-store-basic -verify %s &&
-// RUN: clang -analyze -checker-cfref -analyzer-store-region -verify %s
+// RUN: clang -analyze -checker-cfref -analyzer-store=basic -verify %s &&
+// RUN: clang -analyze -checker-cfref -analyzer-store=region -verify %s
//
// Just exercise the analyzer on code that has at one point caused issues
// (i.e., no assertions or crashes).
Modified: cfe/trunk/test/Analysis/fields.c
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/test/Analysis/fields.c?rev=64737&r1=64736&r2=64737&view=diff
==============================================================================
--- cfe/trunk/test/Analysis/fields.c (original)
+++ cfe/trunk/test/Analysis/fields.c Mon Feb 16 22:27:41 2009
@@ -1,5 +1,5 @@
-// RUN: clang -analyze -checker-cfref %s --analyzer-store-basic -verify &&
-// RUN: clang -analyze -checker-cfref %s --analyzer-store-region -verify &&
+// RUN: clang -analyze -checker-cfref %s --analyzer-store=basic -verify &&
+// RUN: clang -analyze -checker-cfref %s --analyzer-store=region -verify &&
// RUN: clang -analyze -checker-simple %s -verify
unsigned foo();
Modified: cfe/trunk/test/Analysis/func.c
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/test/Analysis/func.c?rev=64737&r1=64736&r2=64737&view=diff
==============================================================================
--- cfe/trunk/test/Analysis/func.c (original)
+++ cfe/trunk/test/Analysis/func.c Mon Feb 16 22:27:41 2009
@@ -1,6 +1,6 @@
// RUN: clang -analyze -checker-simple -verify %s &&
-// RUN: clang -analyze -checker-cfref -analyzer-store-basic -verify %s &&
-// RUN: clang -analyze -checker-cfref -analyzer-store-region -verify %s
+// RUN: clang -analyze -checker-cfref -analyzer-store=basic -verify %s &&
+// RUN: clang -analyze -checker-cfref -analyzer-store=region -verify %s
void f(void) {
void (*p)(void);
Modified: cfe/trunk/test/Analysis/misc-ps-basic-store.m
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/test/Analysis/misc-ps-basic-store.m?rev=64737&r1=64736&r2=64737&view=diff
==============================================================================
--- cfe/trunk/test/Analysis/misc-ps-basic-store.m (original)
+++ cfe/trunk/test/Analysis/misc-ps-basic-store.m Mon Feb 16 22:27:41 2009
@@ -1,4 +1,4 @@
-// RUN: clang -analyze -checker-cfref --analyzer-store-basic --verify -fblocks %s
+// RUN: clang -analyze -checker-cfref --analyzer-store=basic --verify -fblocks %s
//---------------------------------------------------------------------------
// Test case 'checkaccess_union' differs for region store and basic store.
Modified: cfe/trunk/test/Analysis/misc-ps-region-store.m
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/test/Analysis/misc-ps-region-store.m?rev=64737&r1=64736&r2=64737&view=diff
==============================================================================
--- cfe/trunk/test/Analysis/misc-ps-region-store.m (original)
+++ cfe/trunk/test/Analysis/misc-ps-region-store.m Mon Feb 16 22:27:41 2009
@@ -1,4 +1,4 @@
-// RUN: clang -analyze -checker-cfref --analyzer-store-region --verify -fblocks %s
+// RUN: clang -analyze -checker-cfref --analyzer-store=region --verify -fblocks %s
//---------------------------------------------------------------------------
// Test case 'checkaccess_union' differs for region store and basic store.
Modified: cfe/trunk/test/Analysis/misc-ps.m
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/test/Analysis/misc-ps.m?rev=64737&r1=64736&r2=64737&view=diff
==============================================================================
--- cfe/trunk/test/Analysis/misc-ps.m (original)
+++ cfe/trunk/test/Analysis/misc-ps.m Mon Feb 16 22:27:41 2009
@@ -1,5 +1,5 @@
-// RUN: clang -analyze -checker-cfref --analyzer-store-basic --verify -fblocks %s &&
-// RUN: clang -analyze -checker-cfref --analyzer-store-region --verify -fblocks %s
+// RUN: clang -analyze -checker-cfref --analyzer-store=basic --verify -fblocks %s &&
+// RUN: clang -analyze -checker-cfref --analyzer-store=region --verify -fblocks %s
// Reduced test case from crash in <rdar://problem/6253157>
Modified: cfe/trunk/test/Analysis/no-exit-cfg.c
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/test/Analysis/no-exit-cfg.c?rev=64737&r1=64736&r2=64737&view=diff
==============================================================================
--- cfe/trunk/test/Analysis/no-exit-cfg.c (original)
+++ cfe/trunk/test/Analysis/no-exit-cfg.c Mon Feb 16 22:27:41 2009
@@ -1,5 +1,5 @@
-// RUN: clang -analyze -checker-cfref -analyzer-store-basic -verify %s &&
-// RUN: clang -analyze -checker-cfref -analyzer-store-region -verify %s
+// RUN: clang -analyze -checker-cfref -analyzer-store=basic -verify %s &&
+// RUN: clang -analyze -checker-cfref -analyzer-store=region -verify %s
// This is a test case for the issue reported in PR 2819:
// http://llvm.org/bugs/show_bug.cgi?id=2819
Modified: cfe/trunk/test/Analysis/null-deref-ps.c
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/test/Analysis/null-deref-ps.c?rev=64737&r1=64736&r2=64737&view=diff
==============================================================================
--- cfe/trunk/test/Analysis/null-deref-ps.c (original)
+++ cfe/trunk/test/Analysis/null-deref-ps.c Mon Feb 16 22:27:41 2009
@@ -1,7 +1,7 @@
// RUN: clang -analyze -std=gnu99 -checker-simple -verify %s &&
-// RUN: clang -analyze -std=gnu99 -checker-simple -verify %s -analyzer-range-constraints &&
-// RUN: clang -analyze -std=gnu99 -checker-simple -analyzer-store-region -analyzer-purge-dead=false -verify %s &&
-// RUN: clang -analyze -std=gnu99 -checker-cfref -analyzer-store-region -verify %s
+// RUN: clang -analyze -std=gnu99 -checker-simple -verify %s -analyzer-constraints=range &&
+// RUN: clang -analyze -std=gnu99 -checker-simple -analyzer-store=region -analyzer-purge-dead=false -verify %s &&
+// RUN: clang -analyze -std=gnu99 -checker-cfref -analyzer-store=region -verify %s
#include<stdint.h>
#include <assert.h>
Modified: cfe/trunk/test/Analysis/outofbound.c
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/test/Analysis/outofbound.c?rev=64737&r1=64736&r2=64737&view=diff
==============================================================================
--- cfe/trunk/test/Analysis/outofbound.c (original)
+++ cfe/trunk/test/Analysis/outofbound.c Mon Feb 16 22:27:41 2009
@@ -1,4 +1,4 @@
-// RUN: clang -analyze -checker-simple -analyzer-store-region -verify %s
+// RUN: clang -analyze -checker-simple -analyzer-store=region -verify %s
char f1() {
char* s = "abcd";
Modified: cfe/trunk/test/Analysis/rdar-6442306-1.m
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/test/Analysis/rdar-6442306-1.m?rev=64737&r1=64736&r2=64737&view=diff
==============================================================================
--- cfe/trunk/test/Analysis/rdar-6442306-1.m (original)
+++ cfe/trunk/test/Analysis/rdar-6442306-1.m Mon Feb 16 22:27:41 2009
@@ -1,5 +1,5 @@
-// RUN: clang -analyze -checker-cfref %s --analyzer-store-basic -verify &&
-// RUN: clang -analyze -checker-cfref %s --analyzer-store-region -verify
+// RUN: clang -analyze -checker-cfref %s --analyzer-store=basic -verify &&
+// RUN: clang -analyze -checker-cfref %s --analyzer-store=region -verify
typedef int bar_return_t;
typedef struct {
Modified: cfe/trunk/test/Analysis/rdar-6539791.c
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/test/Analysis/rdar-6539791.c?rev=64737&r1=64736&r2=64737&view=diff
==============================================================================
--- cfe/trunk/test/Analysis/rdar-6539791.c (original)
+++ cfe/trunk/test/Analysis/rdar-6539791.c Mon Feb 16 22:27:41 2009
@@ -1,5 +1,5 @@
-// RUN: clang -analyze -checker-cfref -analyzer-store-basic -verify %s &&
-// RUN: clang -analyze -checker-cfref -analyzer-store-region -verify %s
+// RUN: clang -analyze -checker-cfref -analyzer-store=basic -verify %s &&
+// RUN: clang -analyze -checker-cfref -analyzer-store=region -verify %s
typedef const struct __CFAllocator * CFAllocatorRef;
typedef struct __CFDictionary * CFMutableDictionaryRef;
Modified: cfe/trunk/test/Analysis/rdar-6541136-region.c
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/test/Analysis/rdar-6541136-region.c?rev=64737&r1=64736&r2=64737&view=diff
==============================================================================
--- cfe/trunk/test/Analysis/rdar-6541136-region.c (original)
+++ cfe/trunk/test/Analysis/rdar-6541136-region.c Mon Feb 16 22:27:41 2009
@@ -1,4 +1,4 @@
-// RUN: clang -verify -analyze -checker-cfref -analyzer-store-region %s
+// RUN: clang -verify -analyze -checker-cfref -analyzer-store=region %s
struct tea_cheese { unsigned magic; };
typedef struct tea_cheese kernel_tea_cheese_t;
Modified: cfe/trunk/test/Analysis/rdar-6541136.c
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/test/Analysis/rdar-6541136.c?rev=64737&r1=64736&r2=64737&view=diff
==============================================================================
--- cfe/trunk/test/Analysis/rdar-6541136.c (original)
+++ cfe/trunk/test/Analysis/rdar-6541136.c Mon Feb 16 22:27:41 2009
@@ -1,4 +1,4 @@
-// RUN: clang -verify -analyze -checker-cfref -analyzer-store-basic %s
+// RUN: clang -verify -analyze -checker-cfref -analyzer-store=basic %s
struct tea_cheese { unsigned magic; };
typedef struct tea_cheese kernel_tea_cheese_t;
Modified: cfe/trunk/test/Analysis/rdar-6582778-basic-store.c
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/test/Analysis/rdar-6582778-basic-store.c?rev=64737&r1=64736&r2=64737&view=diff
==============================================================================
--- cfe/trunk/test/Analysis/rdar-6582778-basic-store.c (original)
+++ cfe/trunk/test/Analysis/rdar-6582778-basic-store.c Mon Feb 16 22:27:41 2009
@@ -1,4 +1,4 @@
-// RUN: clang -analyze -checker-cfref -analyzer-store-basic -verify %s
+// RUN: clang -analyze -checker-cfref -analyzer-store=basic -verify %s
typedef const void * CFTypeRef;
typedef double CFTimeInterval;
Modified: cfe/trunk/test/Analysis/refcnt_naming.m
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/test/Analysis/refcnt_naming.m?rev=64737&r1=64736&r2=64737&view=diff
==============================================================================
--- cfe/trunk/test/Analysis/refcnt_naming.m (original)
+++ cfe/trunk/test/Analysis/refcnt_naming.m Mon Feb 16 22:27:41 2009
@@ -1,5 +1,5 @@
-// RUN: clang -analyze -checker-cfref -analyzer-store-basic -verify %s &&
-// RUN: clang -analyze -checker-cfref -analyzer-store-region -verify %s
+// RUN: clang -analyze -checker-cfref -analyzer-store=basic -verify %s &&
+// RUN: clang -analyze -checker-cfref -analyzer-store=region -verify %s
typedef const struct __CFString * CFStringRef;
typedef const struct __CFAllocator * CFAllocatorRef;
Modified: cfe/trunk/test/Analysis/region-only-test.c
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/test/Analysis/region-only-test.c?rev=64737&r1=64736&r2=64737&view=diff
==============================================================================
--- cfe/trunk/test/Analysis/region-only-test.c (original)
+++ cfe/trunk/test/Analysis/region-only-test.c Mon Feb 16 22:27:41 2009
@@ -1,4 +1,4 @@
-// RUN: clang -analyze -checker-simple -analyzer-store-region -verify %s
+// RUN: clang -analyze -checker-simple -analyzer-store=region -verify %s
// Region store must be enabled for tests in this file.
Modified: cfe/trunk/test/Analysis/retain-release-basic-store.m
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/test/Analysis/retain-release-basic-store.m?rev=64737&r1=64736&r2=64737&view=diff
==============================================================================
--- cfe/trunk/test/Analysis/retain-release-basic-store.m (original)
+++ cfe/trunk/test/Analysis/retain-release-basic-store.m Mon Feb 16 22:27:41 2009
@@ -1,4 +1,4 @@
-// RUN: clang -analyze -checker-cfref -analyzer-store-basic -verify %s
+// RUN: clang -analyze -checker-cfref -analyzer-store=basic -verify %s
//===----------------------------------------------------------------------===//
// The following code is reduced using delta-debugging from
Modified: cfe/trunk/test/Analysis/retain-release-gc-only.m
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/test/Analysis/retain-release-gc-only.m?rev=64737&r1=64736&r2=64737&view=diff
==============================================================================
--- cfe/trunk/test/Analysis/retain-release-gc-only.m (original)
+++ cfe/trunk/test/Analysis/retain-release-gc-only.m Mon Feb 16 22:27:41 2009
@@ -1,5 +1,5 @@
// RUN: clang -analyze -checker-cfref -verify -fobjc-gc-only %s &&
-// RUN: clang -analyze -checker-cfref -analyzer-store-region -fobjc-gc-only -verify %s
+// RUN: clang -analyze -checker-cfref -analyzer-store=region -fobjc-gc-only -verify %s
//===----------------------------------------------------------------------===//
// Header stuff.
Modified: cfe/trunk/test/Analysis/retain-release-region-store.m
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/test/Analysis/retain-release-region-store.m?rev=64737&r1=64736&r2=64737&view=diff
==============================================================================
--- cfe/trunk/test/Analysis/retain-release-region-store.m (original)
+++ cfe/trunk/test/Analysis/retain-release-region-store.m Mon Feb 16 22:27:41 2009
@@ -1,4 +1,4 @@
-// RUN: clang -analyze -checker-cfref -analyzer-store-region -verify %s
+// RUN: clang -analyze -checker-cfref -analyzer-store=region -verify %s
//===----------------------------------------------------------------------===//
// The following code is reduced using delta-debugging from
Modified: cfe/trunk/test/Analysis/retain-release.m
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/test/Analysis/retain-release.m?rev=64737&r1=64736&r2=64737&view=diff
==============================================================================
--- cfe/trunk/test/Analysis/retain-release.m (original)
+++ cfe/trunk/test/Analysis/retain-release.m Mon Feb 16 22:27:41 2009
@@ -1,5 +1,5 @@
// RUN: clang -analyze -checker-cfref -verify %s &&
-// RUN: clang -analyze -checker-cfref -analyzer-store-region -verify %s
+// RUN: clang -analyze -checker-cfref -analyzer-store=region -verify %s
//===----------------------------------------------------------------------===//
Modified: cfe/trunk/test/Analysis/stack-addr-ps.c
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/test/Analysis/stack-addr-ps.c?rev=64737&r1=64736&r2=64737&view=diff
==============================================================================
--- cfe/trunk/test/Analysis/stack-addr-ps.c (original)
+++ cfe/trunk/test/Analysis/stack-addr-ps.c Mon Feb 16 22:27:41 2009
@@ -1,6 +1,6 @@
// RUN: clang -analyze -checker-simple -verify %s &&
-// RUN: clang -analyze -checker-cfref -analyzer-store-basic -verify %s &&
-// RUN: clang -analyze -checker-cfref -analyzer-store-region -verify %s
+// RUN: clang -analyze -checker-cfref -analyzer-store=basic -verify %s &&
+// RUN: clang -analyze -checker-cfref -analyzer-store=region -verify %s
#include <stdlib.h>
#include <alloca.h>
Modified: cfe/trunk/test/Analysis/uninit-msg-expr.m
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/test/Analysis/uninit-msg-expr.m?rev=64737&r1=64736&r2=64737&view=diff
==============================================================================
--- cfe/trunk/test/Analysis/uninit-msg-expr.m (original)
+++ cfe/trunk/test/Analysis/uninit-msg-expr.m Mon Feb 16 22:27:41 2009
@@ -1,6 +1,6 @@
// RUN: clang -analyze -checker-simple -verify %s &&
-// RUN: clang -analyze -checker-cfref -analyzer-store-basic -verify %s &&
-// RUN: clang -analyze -checker-cfref -analyzer-store-region -verify %s
+// RUN: clang -analyze -checker-cfref -analyzer-store=basic -verify %s &&
+// RUN: clang -analyze -checker-cfref -analyzer-store=region -verify %s
//===----------------------------------------------------------------------===//
// The following code is reduced using delta-debugging from
Modified: cfe/trunk/test/Analysis/uninit-ps-rdar6145427.m
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/test/Analysis/uninit-ps-rdar6145427.m?rev=64737&r1=64736&r2=64737&view=diff
==============================================================================
--- cfe/trunk/test/Analysis/uninit-ps-rdar6145427.m (original)
+++ cfe/trunk/test/Analysis/uninit-ps-rdar6145427.m Mon Feb 16 22:27:41 2009
@@ -1,5 +1,5 @@
-// RUN: clang -analyze -verify -analyzer-store-basic -checker-cfref %s &&
-// RUN: clang -analyze -verify -analyzer-store-region -checker-cfref %s
+// RUN: clang -analyze -verify -analyzer-store=basic -checker-cfref %s &&
+// RUN: clang -analyze -verify -analyzer-store=region -checker-cfref %s
// Delta-Debugging reduced preamble.
typedef signed char BOOL;
Modified: cfe/trunk/test/Analysis/uninit-vals-ps-region.c
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/test/Analysis/uninit-vals-ps-region.c?rev=64737&r1=64736&r2=64737&view=diff
==============================================================================
--- cfe/trunk/test/Analysis/uninit-vals-ps-region.c (original)
+++ cfe/trunk/test/Analysis/uninit-vals-ps-region.c Mon Feb 16 22:27:41 2009
@@ -1,4 +1,4 @@
-// RUN: clang -analyze -checker-simple -analyzer-store-region -verify %s
+// RUN: clang -analyze -checker-simple -analyzer-store=region -verify %s
struct s {
int data;
Modified: cfe/trunk/test/Analysis/uninit-vals-ps.c
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/test/Analysis/uninit-vals-ps.c?rev=64737&r1=64736&r2=64737&view=diff
==============================================================================
--- cfe/trunk/test/Analysis/uninit-vals-ps.c (original)
+++ cfe/trunk/test/Analysis/uninit-vals-ps.c Mon Feb 16 22:27:41 2009
@@ -1,5 +1,5 @@
// RUN: clang -analyze -checker-cfref -verify %s &&
-// RUN: clang -analyze -checker-cfref -analyzer-store-region -verify %s
+// RUN: clang -analyze -checker-cfref -analyzer-store=region -verify %s
struct FPRec {
void (*my_func)(int * x);
Modified: cfe/trunk/test/Analysis/uninit-vals.m
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/test/Analysis/uninit-vals.m?rev=64737&r1=64736&r2=64737&view=diff
==============================================================================
--- cfe/trunk/test/Analysis/uninit-vals.m (original)
+++ cfe/trunk/test/Analysis/uninit-vals.m Mon Feb 16 22:27:41 2009
@@ -1,5 +1,5 @@
-// RUN: clang -analyze -checker-cfref -analyzer-store-basic -verify %s &&
-// RUN: clang -analyze -checker-cfref -analyzer-store-region -verify %s
+// RUN: clang -analyze -checker-cfref -analyzer-store=basic -verify %s &&
+// RUN: clang -analyze -checker-cfref -analyzer-store=region -verify %s
typedef unsigned int NSUInteger;
Modified: cfe/trunk/tools/ccc/ccclib/Tools.py
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/tools/ccc/ccclib/Tools.py?rev=64737&r1=64736&r2=64737&view=diff
==============================================================================
--- cfe/trunk/tools/ccc/ccclib/Tools.py (original)
+++ cfe/trunk/tools/ccc/ccclib/Tools.py Mon Feb 16 22:27:41 2009
@@ -221,7 +221,7 @@
'-warn-objc-missing-dealloc',
'-warn-objc-unused-ivars'])
- cmd_args.append('-analyzer-output-plist')
+ cmd_args.append('-analyzer-output=plist')
# Add -Xanalyzer arguments when running as analyzer.
for arg in arglist.getArgs(arglist.parser.XanalyzerOption):
Modified: cfe/trunk/utils/ccc-analyzer
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/utils/ccc-analyzer?rev=64737&r1=64736&r2=64737&view=diff
==============================================================================
--- cfe/trunk/utils/ccc-analyzer (original)
+++ cfe/trunk/utils/ccc-analyzer Mon Feb 16 22:27:41 2009
@@ -267,9 +267,15 @@
# Get the store model.
my $StoreModel = $ENV{'CCC_ANALYZER_STORE_MODEL'};
+if (!defined $StoreModel) { $StoreModel = "basic"; }
+
+# Get the constraints engine.
+my $ConstraintsModel = $ENV{'CCC_ANALYZER_CONSTRAINTS_MODEL'};
+if (!defined $ConstraintsModel) { $ConstraintsModel = "basic"; }
# Get the output format.
my $OutputFormat = $ENV{'CCC_ANALYZER_OUTPUT_FORMAT'};
+if (!defined OutputFormat) { $OutputFormat = "html"; }
# Determine the level of verbosity.
my $Verbose = 0;
@@ -447,11 +453,15 @@
}
if (defined $StoreModel) {
- push @AnalyzeArgs, $StoreModel;
+ push @AnalyzeArgs, "-analyzer-store=$StoreModel";
}
-
+
+ if (defined $ConstraintsModel) {
+ push @AnalyzeArgs, "-analyzer-constraints=$ConstraintsModel";
+ }
+
if (defined $OutputFormat) {
- push @AnalyzeArgs, "-analyzer-output-" . $OutputFormat;
+ push @AnalyzeArgs, "-analyzer-output=" . $OutputFormat;
if ($OutputFormat eq "plist") {
# Change "Output" to be a file.
my ($h, $f) = tempfile("report-XXXXXX", SUFFIX => ".plist",
@@ -459,7 +469,6 @@
$ResultFile = $f;
$CleanupFile = $f;
}
-
}
push @AnalyzeArgs, at CompileOpts;
Modified: cfe/trunk/utils/scan-build
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/utils/scan-build?rev=64737&r1=64736&r2=64737&view=diff
==============================================================================
--- cfe/trunk/utils/scan-build (original)
+++ cfe/trunk/utils/scan-build Mon Feb 16 22:27:41 2009
@@ -850,11 +850,6 @@
-analyze-headers - Also analyze functions in #included files.
- -store [model] - Specify the store model used by the analyzer. By default,
- the 'basic' store model is used. 'region' specifies a field-
- sensitive store model. Be warned that the 'region' model
- is still in very early testing phase and may often crash.
-
-o - Target directory for HTML report files. Subdirectories
will be created as needed to represent separate "runs" of
the analyzer. If this option is not specified, a directory
@@ -893,6 +888,16 @@
-V - View analysis results in a web browser when the build
--view completes.
+ADVANCED OPTIONS:
+
+ -constraints [model] - Specify the contraint model used by the analyzer.
+ By default the 'basic' model is used. 'range' adds
+ experimental range tracking for program values.
+
+ -store [model] - Specify the store model used by the analyzer. By default,
+ the 'basic' store model is used. 'region' specifies a field-
+ sensitive store model. Be warned that the 'region' model
+ is still in very early testing phase and may often crash.
AVAILABLE ANALYSES (multiple analyses may be specified):
@@ -966,6 +971,7 @@
my $ExitStatusFoundBugs = 0; # Exit status reflects whether bugs were found
my @AnalysesToRun;
my $StoreModel;
+my $ConstraintsModel;
my $OutputFormat;
if (!@ARGV) {
@@ -1082,7 +1088,13 @@
if ($arg eq "-store") {
shift @ARGV;
- $StoreModel = '-analyzer-store-' . shift @ARGV;
+ $StoreModel = shift @ARGV;
+ next;
+ }
+
+ if ($arg eq "-constraints") {
+ shift @ARGV;
+ $ConstraintsModel = shift @ARGV;
next;
}
@@ -1159,6 +1171,10 @@
$ENV{'CCC_ANALYZER_STORE_MODEL'} = $StoreModel;
}
+if (defined $ConstraintsModel) {
+ $ENV{'CCC_ANALYZER_CONSTRAINTS_MODEL'} = $ConstraintsModel;
+}
+
if (defined $OutputFormat) {
$ENV{'CCC_ANALYZER_OUTPUT_FORMAT'} = $OutputFormat;
}
More information about the cfe-commits
mailing list