diff options
Diffstat (limited to 'utils')
-rwxr-xr-x | utils/ccc-analyzer | 17 | ||||
-rwxr-xr-x | utils/scan-build | 28 |
2 files changed, 35 insertions, 10 deletions
diff --git a/utils/ccc-analyzer b/utils/ccc-analyzer index 2a9a99367d..d9d4f1cbc8 100755 --- a/utils/ccc-analyzer +++ b/utils/ccc-analyzer @@ -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; diff --git a/utils/scan-build b/utils/scan-build index 39b9ede939..bc690d5768 100755 --- a/utils/scan-build +++ b/utils/scan-build @@ -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; } |