]> granicus.if.org Git - clang/commitdiff
Static Analyzer driver/options (partial) cleanup:
authorTed Kremenek <kremenek@apple.com>
Tue, 17 Feb 2009 04:27:41 +0000 (04:27 +0000)
committerTed Kremenek <kremenek@apple.com>
Tue, 17 Feb 2009 04:27:41 +0000 (04:27 +0000)
- 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

48 files changed:
Driver/ASTConsumers.h
Driver/Analyses.def
Driver/AnalysisConsumer.cpp
Driver/AnalysisConsumer.h [deleted file]
Driver/clang.cpp
test/Analysis/CFDateGC.m
test/Analysis/CFNumber.c
test/Analysis/CFRetainRelease_NSAssertionHandler.m
test/Analysis/CGColorSpace.c
test/Analysis/CheckNSError.m
test/Analysis/NSPanel.m
test/Analysis/NSString.m
test/Analysis/NSWindow.m
test/Analysis/NoReturn.m
test/Analysis/ObjCProperties.m
test/Analysis/array-struct.c
test/Analysis/cfref_PR2519.c
test/Analysis/cfref_rdar6080742.c
test/Analysis/complex.c
test/Analysis/exercise-ps.c
test/Analysis/fields.c
test/Analysis/func.c
test/Analysis/misc-ps-basic-store.m
test/Analysis/misc-ps-region-store.m
test/Analysis/misc-ps.m
test/Analysis/no-exit-cfg.c
test/Analysis/null-deref-ps.c
test/Analysis/outofbound.c
test/Analysis/rdar-6442306-1.m
test/Analysis/rdar-6539791.c
test/Analysis/rdar-6541136-region.c
test/Analysis/rdar-6541136.c
test/Analysis/rdar-6582778-basic-store.c
test/Analysis/refcnt_naming.m
test/Analysis/region-only-test.c
test/Analysis/retain-release-basic-store.m
test/Analysis/retain-release-gc-only.m
test/Analysis/retain-release-region-store.m
test/Analysis/retain-release.m
test/Analysis/stack-addr-ps.c
test/Analysis/uninit-msg-expr.m
test/Analysis/uninit-ps-rdar6145427.m
test/Analysis/uninit-vals-ps-region.c
test/Analysis/uninit-vals-ps.c
test/Analysis/uninit-vals.m
tools/ccc/ccclib/Tools.py
utils/ccc-analyzer
utils/scan-build

index 2032a2d598c4b6f429f5cd5d57b506f64326166c..34c9fb246ec820a5df65bfee26e8642bc823e17a 100644 (file)
@@ -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
index 3beaa73bcb7322bb0af9ae78782cfc95244ec64d..333055f929db1ffb17eb196a7a89e84dd21d0fa4 100644 (file)
@@ -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
 
index 5c1e3d87bf21550da910de9de5bba9433b2493ce..66fe299e371270bf0ec3475599ac2ff3401d7c7e 100644 (file)
@@ -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 (file)
index eb349be..0000000
+++ /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
index deea08c3353ab6cb41666b4b1a7efb34135efc89..1fdfde4318e27786b61cc28e9a00260996ebd1e6 100644 (file)
@@ -221,53 +221,6 @@ MathErrno("fmath-errno",
           llvm::cl::desc("Require math functions to respect 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
 //===----------------------------------------------------------------------===//
@@ -779,18 +731,6 @@ static void InitializeDiagnostics(Diagnostic &Diags) {
   Diags.setDiagnosticMapping(diag::err_pp_file_not_found, diag::MAP_FATAL);
 }
 
-//===----------------------------------------------------------------------===//
-// 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);
   }
 }
 
index 8b702d920365b13a72ebcb312f40aaf7ada6969c..10c72331ab6c1cfe649e87a0ed4c815cd88fc9d4 100644 (file)
@@ -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
index e0d3c3ad03dfc397755e7b12397e06eca1d3423f..cfef84983b81a73e64f5f1797759549fe1c23a05 100644 (file)
@@ -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;
index 13a2236518fd2b7bf89771699fa664d19f4278bf..a4c16bda9a695858726e35ca71dc6ac3ca2b6753 100644 (file)
@@ -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;
index b229bd2e2464537c2caacfb75577c2753e451d92..807c6b83f2878021fab6dece1faaee5a67580b38 100644 (file)
@@ -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);
index b3eacda20d2de5d43426597177ec1d35019c5d9a..ac6ab673c39ee657bf3e1d24cbe2cbee74fc7387 100644 (file)
@@ -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;
index 7e2d0a807f1e3295fecb574da94bc811adec1088..2ceabc0c1d30c77cfc4dc7f791af4a06cc244569 100644 (file)
@@ -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
 
index 9788971f62d04f392bd637bd25884e46e6639d1c..5a515a345cb5d37ab4f8e4fdaf9418edd3f0cdc5 100644 (file)
@@ -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
index 33d77528f922212793e14fcc210e1e5bfee4b997..ef8bff5c8d4a184d9875ce2ee65a1d3192a622de 100644 (file)
@@ -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.
index 2d3bd7c81e0703319816adbad0d1364e56c7f0d4..1ab60bd380ac5da907575fcff94994bd1f1cefb3 100644 (file)
@@ -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>
 
index 7ce434fbfa13170addbf3a8dd09106ef64cb19e3..c2c3b66dd7d3a4f1208f07e7a1b29a601aebde26 100644 (file)
@@ -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
index a8de8245cd0ab03ce119e6ea9cd8c84bc1ac6d62..0d25ef721d3f5d156932dcb9de8b0edec1dac836 100644 (file)
@@ -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;
index cfe5a1d60d2bb09f1ff4b91440de26e8c92c68cc..0e25c12a7525c8b9e8ee8371a731af0e78852081 100644 (file)
@@ -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;
index b1038bcfafd6ea62cded8840b6cf0bdce5e1cfc5..0912a7a1031f1ebf4a4fc199aecb84427bd5a80b 100644 (file)
@@ -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).
index fd3d429a1ab84c46317dc7c94dcd4c5155995be6..f2ade5aa1cf15d294522df8915b9fe760f536341 100644 (file)
@@ -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>
 
index 217135ec06e2787dc88ff4d564431ead5dec04bb..1b001ec3cbe218bcd7775b803605a89f3e923e4c 100644 (file)
@@ -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).
index 60353d93adf023dfb5286afcbdf7dd4c78bebcd9..aa7acf26d1166b0c63cafeb86a2e37f82331a055 100644 (file)
@@ -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();
index 49f2731256911237533e43bdf7270eb9ce98cb5f..94ca2694fea5275b29985d299568a4f8c9841afe 100644 (file)
@@ -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);
index 8d7ac87b268da0adcc74ad9b7a598f27a83b9271..00183e7b8dc96250fe873ca76b84a02c2ac6e206 100644 (file)
@@ -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.
index 940d277b924749f3568bc810c4b0fc56778ffa95..a7409ec5dc6f4232184ac7cf808a00cb86fc035d 100644 (file)
@@ -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.
index 0ddce3aa73043b5d25159953b3d96ce2714bb1ba..e38b94e613f491b575e26e7cfb651bc02b7a04cb 100644 (file)
@@ -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>
index 362fd88edaf14b7c63ba7c4adaf2466ea6834d5d..6752008d67b9fbc95571445aa1daa4cb7e4e2d4f 100644 (file)
@@ -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
index 68937bec9f09d8ca461569e386bde4648dfbca8c..b320e8dd191fb1ee786181633e5f33949eb664c8 100644 (file)
@@ -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>
index e496425eb91afeb78d9515a3ee164d7bbb0a88bf..4ab2326fcd8907a612ff97d817642dcad9cedf35 100644 (file)
@@ -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";
index b3235d9c40d3bb8872f9c7421f5415986f2049e1..e53b09411c68a602468e1bd46f6bc6110299eec9 100644 (file)
@@ -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 {
index 75485b0b547cdcd041622c234b9aae79c885a6b5..5fe2d293c1cc84f1aba69acf5f97dc93745a2fae 100644 (file)
@@ -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;
index 4fd2214daa5aea77186e5dee052695873a3bb03e..270fa33fbc668fce14f435437bda2cba64644631 100644 (file)
@@ -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;
index 524f154adc015b5ed3943519bfb656c9de61e37a..f90837c7dc259f612d7a7a315f854c37a936ec22 100644 (file)
@@ -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;
index c0a599335bc8eaa6d4f4110454a7caf6632705bc..0e1c9055b0600ccb16c99397b21f1be1e3e529d0 100644 (file)
@@ -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;
index 0fa95ebc8bd4b36ce6127f3d1d087b64b56ab038..ee89d245f5d6edd1161b998e2e12149d4f56d816 100644 (file)
@@ -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;
index 0eabb7b8889626b3dac653f913608be78550313c..701da72f82ea31aed247b3981f86922ade38e01b 100644 (file)
@@ -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.
 
index 2fec3383ccec401e784e7ebe255779447577391a..651135a72f9a4990cef7c87dcffb77eb0227c8cc 100644 (file)
@@ -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
index 7e8164a2cc59b79515db454148ed8f76ba491486..32a9c877ac100d06310456192735fb6b03a51685 100644 (file)
@@ -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.
index 91b69cffcac3f6599488c2b8b05cbf9411ecef0e..ca040743b149eb546fbc414c74bc561db51448e9 100644 (file)
@@ -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
index 9a5a8559474c3a133ab6041e1718b1728de06cc5..cff7b9be6033c2c03af46342e00beaa7bcd0a0a1 100644 (file)
@@ -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
 
 
 //===----------------------------------------------------------------------===//
index f9de9c0d72541494d79ae4489f5bb5562e847559..b1214efd31ac09f505608a5a6a5f71684c0b4f0e 100644 (file)
@@ -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>
index 024e59e865172cd3dc65b4a7d0373b4796329383..aad1a721f14de14139e19009aa730fdd4972fd54 100644 (file)
@@ -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
index 3850846e8fb298476cdf65ad3c988b5219fa9f84..126a5940235e0355fd2a8889e641542e617364bb 100644 (file)
@@ -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;
index 73c23590e3ac7cbf60235e2ba02a769562691f0b..7e3d711bae812363aa290d8b74b80cbd43391de8 100644 (file)
@@ -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;
index 96963e4fff46107883de5975f7dd988a06a03c3c..c6cf351ca2da0bf0b8cd86dda9764df6b5d4b048 100644 (file)
@@ -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);  
index f89ffeacdfe41cc6b61e6e7509f57e65439b86e5..85efe5700b28b96eec2b290e2e5827637814a9aa 100644 (file)
@@ -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;
 
index 5da2de28f9191cbf1b93ba266c8b8fc7ee5431cb..dc1678ecbd841565b1d399a9f5e4cc6f51e0c33a 100644 (file)
@@ -221,7 +221,7 @@ class Clang_CompileTool(Tool):
                              '-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):
index 2a9a99367d90ea8720779471f56b6cfc63b7d7a7..d9d4f1cbc808a2015c2441beb5f4320f8e43c075 100755 (executable)
@@ -267,9 +267,15 @@ if (!defined($Analyses)) { $Analyses = '-checker-cfref'; }
 
 # 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 ($Action eq 'compile' or $Action eq 'link') {
     }
 
     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 @@ if ($Action eq 'compile' or $Action eq 'link') {
         $ResultFile = $f;
         $CleanupFile = $f;
       }
-      
     }
 
     push @AnalyzeArgs,@CompileOpts;
index 39b9ede93916e7c3379ebb17f48b2ee201d358f8..bc690d5768b34a26f018810024bc5b421913fa58 100755 (executable)
@@ -850,11 +850,6 @@ OPTIONS:
 
  -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 @@ OPTIONS:
  -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 $ViewResults  = 0;  # View results when the build terminates.
 my $ExitStatusFoundBugs = 0; # Exit status reflects whether bugs were found
 my @AnalysesToRun;
 my $StoreModel;
+my $ConstraintsModel;
 my $OutputFormat;
 
 if (!@ARGV) {
@@ -1082,7 +1088,13 @@ while (@ARGV) {
 
   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 @@ if (defined $StoreModel) {
   $ENV{'CCC_ANALYZER_STORE_MODEL'} = $StoreModel;
 }
 
+if (defined $ConstraintsModel) {
+  $ENV{'CCC_ANALYZER_CONSTRAINTS_MODEL'} = $ConstraintsModel;
+}
+
 if (defined $OutputFormat) {
   $ENV{'CCC_ANALYZER_OUTPUT_FORMAT'} = $OutputFormat;
 }