[cfe-commits] r77263 - in /cfe/trunk/utils: ccc-analyzer scan-build
Ted Kremenek
kremenek at apple.com
Mon Jul 27 15:10:34 PDT 2009
Author: kremenek
Date: Mon Jul 27 17:10:34 2009
New Revision: 77263
URL: http://llvm.org/viewvc/llvm-project?rev=77263&view=rev
Log:
Add scan-build support for 'plist-html', a hybrid mode that supports the
creation of both HTML and plist files. Plist files are currently not generated
using the same layout algorithm as just specifying '-plist', so this is mainly
intended to help support automated runs of the 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=77263&r1=77262&r2=77263&view=diff
==============================================================================
--- cfe/trunk/utils/ccc-analyzer (original)
+++ cfe/trunk/utils/ccc-analyzer Mon Jul 27 17:10:34 2009
@@ -584,7 +584,7 @@
if (defined $OutputFormat) {
push @AnalyzeArgs, "-analyzer-output=" . $OutputFormat;
- if ($OutputFormat eq "plist") {
+ if ($OutputFormat =~ /plist/) {
# Change "Output" to be a file.
my ($h, $f) = tempfile("report-XXXXXX", SUFFIX => ".plist",
DIR => $HtmlDir);
Modified: cfe/trunk/utils/scan-build
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/utils/scan-build?rev=77263&r1=77262&r2=77263&view=diff
==============================================================================
--- cfe/trunk/utils/scan-build (original)
+++ cfe/trunk/utils/scan-build Mon Jul 27 17:10:34 2009
@@ -1167,7 +1167,12 @@
$OutputFormat = "plist";
next;
}
-
+ if ($arg eq "-plist-html") {
+ shift @ARGV;
+ $OutputFormat = "plist-html";
+ next;
+ }
+
DieDiag("unrecognized option '$arg'\n") if ($arg =~ /^-/);
last;
@@ -1253,25 +1258,27 @@
# Run the build.
my $ExitStatus = RunBuildCommand(\@ARGV, $IgnoreErrors, $Cmd);
-if (defined $OutputFormat and $OutputFormat eq "plist") {
- Diag "Analysis run complete.\n";
- Diag "Analysis results (plist files) deposited in '$HtmlDir'\n";
-}
-else {
- # Postprocess the HTML directory.
- my $NumBugs = Postprocess($HtmlDir, $BaseDir);
-
- if ($ViewResults and -r "$HtmlDir/index.html") {
- Diag "Analysis run complete.\n";
- Diag "Viewing analysis results in '$HtmlDir' using scan-view.\n";
- my $ScanView = Cwd::realpath("$RealBin/scan-view");
- if (! -x $ScanView) { $ScanView = "scan-view"; }
- exec $ScanView, "$HtmlDir";
+if (defined $OutputFormat) {
+ if ($OutputFormat =~ /html/) {
+ # Postprocess the HTML directory.
+ my $NumBugs = Postprocess($HtmlDir, $BaseDir);
+
+ if ($ViewResults and -r "$HtmlDir/index.html") {
+ Diag "Analysis run complete.\n";
+ Diag "Viewing analysis results in '$HtmlDir' using scan-view.\n";
+ my $ScanView = Cwd::realpath("$RealBin/scan-view");
+ if (! -x $ScanView) { $ScanView = "scan-view"; }
+ exec $ScanView, "$HtmlDir";
+ }
+
+ if ($ExitStatusFoundBugs) {
+ exit 1 if ($NumBugs > 0);
+ exit 0;
+ }
}
-
- if ($ExitStatusFoundBugs) {
- exit 1 if ($NumBugs > 0);
- exit 0;
+ elsif ($OutputFormat =~ /plist/) {
+ Diag "Analysis run complete.\n";
+ Diag "Analysis results (plist files) deposited in '$HtmlDir'\n";
}
}
More information about the cfe-commits
mailing list