[cfe-commits] r129393 - in /cfe/trunk/tools/scan-build: ccc-analyzer scan-build

Ted Kremenek kremenek at apple.com
Tue Apr 12 14:47:00 PDT 2011


Author: kremenek
Date: Tue Apr 12 16:47:00 2011
New Revision: 129393

URL: http://llvm.org/viewvc/llvm-project?rev=129393&view=rev
Log:
Provide options to explicitly enable/disable checkers in scan-build.

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

Modified: cfe/trunk/tools/scan-build/ccc-analyzer
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/tools/scan-build/ccc-analyzer?rev=129393&r1=129392&r2=129393&view=diff
==============================================================================
--- cfe/trunk/tools/scan-build/ccc-analyzer (original)
+++ cfe/trunk/tools/scan-build/ccc-analyzer Tue Apr 12 16:47:00 2011
@@ -619,9 +619,9 @@
       push @AnalyzeArgs, "-analyzer-constraints=$ConstraintsModel";
     }
     
-#    if (defined $Analyses) {
-#      push @AnalyzeArgs, split '\s+', $Analyses;
-#    }
+    if (defined $Analyses) {
+      push @AnalyzeArgs, split '\s+', $Analyses;
+    }
 
     if (defined $OutputFormat) {
       push @AnalyzeArgs, "-analyzer-output=" . $OutputFormat;

Modified: cfe/trunk/tools/scan-build/scan-build
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/tools/scan-build/scan-build?rev=129393&r1=129392&r2=129393&view=diff
==============================================================================
--- cfe/trunk/tools/scan-build/scan-build (original)
+++ cfe/trunk/tools/scan-build/scan-build Tue Apr 12 16:47:00 2011
@@ -1001,8 +1001,16 @@
  -stats - Generates visitation statistics for the project being analyzed.
 
  -maxloop N - specifiy the number of times a block can be visited before giving
-              up. Default is 3. Increase for more comprehensive coverage at a
+              up. Default is 4. Increase for more comprehensive coverage at a
               cost of speed.
+
+CONTROLLING CHECKERS:
+
+ A default group of checkers are always run unless explicitly disabled.
+ Checkers may be enabled/disabled using the following options:
+
+ -enable-checker [checker name]
+ -disable-checker [checker name]
 ENDTEXT
 
 # Query clang for list of checkers that are enabled.
@@ -1305,6 +1313,16 @@
     $MaxLoop = shift @ARGV;
     next;
   }
+  if ($arg eq "-enable-checker") {
+    shift @ARGV;
+    push @AnalysesToRun, "-analyzer-checker", shift @ARGV;
+    next;
+  }
+  if ($arg eq "-disable-checker") {
+    shift @ARGV;
+    push @AnalysesToRun, "-analyzer-disable-checker", shift @ARGV;
+    next;
+  }
 
   DieDiag("unrecognized option '$arg'\n") if ($arg =~ /^-/);
   





More information about the cfe-commits mailing list