[cfe-commits] r58248 - in /cfe/trunk/utils: ccc-analyzer scan-build

Zhongxing Xu xuzhongxing at gmail.com
Mon Oct 27 07:26:33 PDT 2008


Author: zhongxingxu
Date: Mon Oct 27 09:26:32 2008
New Revision: 58248

URL: http://llvm.org/viewvc/llvm-project?rev=58248&view=rev
Log:
Add store option to scan-build and ccc-analyzer.

Modified:
    cfe/trunk/utils/ccc-analyzer
    cfe/trunk/utils/scan-build

Modified: cfe/trunk/utils/ccc-analyzer
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/utils/ccc-analyzer?rev=58248&r1=58247&r2=58248&view=diff

==============================================================================
--- cfe/trunk/utils/ccc-analyzer (original)
+++ cfe/trunk/utils/ccc-analyzer Mon Oct 27 09:26:32 2008
@@ -241,6 +241,9 @@
 my $Analyses = $ENV{'CCC_ANALYZER_ANALYSIS'};
 if (!defined($Analyses)) { $Analyses = '-checker-cfref'; }
 
+# Get the store model.
+my $StoreModel = $ENV{'CCC_ANALYZER_STORE_MODEL'};
+
 # Determine the level of verbosity.
 my $Verbose = 0;
 if (defined $ENV{CCC_ANALYZER_VERBOSE}) { $Verbose = 1; }
@@ -416,9 +419,13 @@
       push @AnalyzeArgs,$FileLang;
     }
 
+    if (defined $StoreModel) {
+      push @AnalyzeArgs, $StoreModel;
+    }
+
     push @AnalyzeArgs, at CompileOpts;
     push @AnalyzeArgs,$file;
-    
+
     my @Archs = keys %ArchsSeen;
     if (scalar @Archs) {
       foreach my $arch (@Archs) {

Modified: cfe/trunk/utils/scan-build
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/utils/scan-build?rev=58248&r1=58247&r2=58248&view=diff

==============================================================================
--- cfe/trunk/utils/scan-build (original)
+++ cfe/trunk/utils/scan-build Mon Oct 27 09:26:32 2008
@@ -808,6 +808,11 @@
 
  -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
@@ -918,6 +923,7 @@
 my $ViewResults  = 0;  # View results when the build terminates.
 my $ExitStatusFoundBugs = 0; # Exit status reflects whether bugs were found
 my @AnalysesToRun;
+my $StoreModel;
 
 if (!@ARGV) {
   DisplayHelp();
@@ -1030,6 +1036,12 @@
     $ExitStatusFoundBugs = 1;
     next;
   }
+
+  if ($arg eq "-store") {
+    shift @ARGV;
+    $StoreModel = '-analyzer-store-' . shift @ARGV;
+    next;
+  }
   
   DieDiag("unrecognized option '$arg'\n") if ($arg =~ /^-/);
   
@@ -1094,6 +1106,10 @@
 
 $ENV{'CCC_ANALYZER_ANALYSIS'} = join ' ', at AnalysesToRun;
 
+if ($StoreModel) {
+  $ENV{'CCC_ANALYZER_STORE_MODEL'} = $StoreModel;
+}
+
 # Run the build.
 my $ExitStatus = RunBuildCommand(\@ARGV, $IgnoreErrors, $Cmd);
 





More information about the cfe-commits mailing list