aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorTed Kremenek <kremenek@apple.com>2011-04-12 21:47:00 +0000
committerTed Kremenek <kremenek@apple.com>2011-04-12 21:47:00 +0000
commit09fbf297da918760ce33302a3f709a77f43af265 (patch)
tree296137439f5be009ebcce0978974c8ab875b3cdd
parentea8b01eb843b9de5b3d05941baba7287709803b3 (diff)
Provide options to explicitly enable/disable checkers in scan-build.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@129393 91177308-0d34-0410-b5e6-96231b3b80d8
-rwxr-xr-xtools/scan-build/ccc-analyzer6
-rwxr-xr-xtools/scan-build/scan-build20
2 files changed, 22 insertions, 4 deletions
diff --git a/tools/scan-build/ccc-analyzer b/tools/scan-build/ccc-analyzer
index 6f6d3cf1a7..0649a97def 100755
--- a/tools/scan-build/ccc-analyzer
+++ b/tools/scan-build/ccc-analyzer
@@ -619,9 +619,9 @@ if ($Action eq 'compile' or $Action eq 'link') {
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;
diff --git a/tools/scan-build/scan-build b/tools/scan-build/scan-build
index 8068d5c171..86c1744558 100755
--- a/tools/scan-build/scan-build
+++ b/tools/scan-build/scan-build
@@ -1001,8 +1001,16 @@ ADVANCED OPTIONS:
-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 @@ while (@ARGV) {
$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 =~ /^-/);