aboutsummaryrefslogtreecommitdiff
path: root/tools/scan-build/ccc-analyzer
diff options
context:
space:
mode:
authorAnna Zaks <ganna@apple.com>2011-09-09 18:43:53 +0000
committerAnna Zaks <ganna@apple.com>2011-09-09 18:43:53 +0000
commit9134294114c15b938f2ff954995d9f00f63dd9d8 (patch)
treea285341567c55c823ff86836cbae8351442bfa66 /tools/scan-build/ccc-analyzer
parent6311d2bb3db1ec1064f45a14983ae5806adc676a (diff)
[analyzer] When running scan-build with -plist on ./configure, delete the plist files.
(scan-build does not set the $HtmlDir when running against configure. Previously, this implied that the plist files would appear in the current directory, with this patch they will get deleted.) git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@139382 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'tools/scan-build/ccc-analyzer')
-rwxr-xr-xtools/scan-build/ccc-analyzer10
1 files changed, 8 insertions, 2 deletions
diff --git a/tools/scan-build/ccc-analyzer b/tools/scan-build/ccc-analyzer
index 7793a8db49..c39e417951 100755
--- a/tools/scan-build/ccc-analyzer
+++ b/tools/scan-build/ccc-analyzer
@@ -55,7 +55,10 @@ my $ResultFile;
# Remove any stale files at exit.
END {
- if (defined $CleanupFile && -z $CleanupFile) {
+ if (defined $ResultFile && -z $ResultFile) {
+ `rm -f $ResultFile`;
+ }
+ if (defined $CleanupFile) {
`rm -f $CleanupFile`;
}
}
@@ -631,7 +634,10 @@ if ($Action eq 'compile' or $Action eq 'link') {
my ($h, $f) = tempfile("report-XXXXXX", SUFFIX => ".plist",
DIR => $HtmlDir);
$ResultFile = $f;
- $CleanupFile = $f;
+ # If the HtmlDir is not set, we sould clean up the plist files.
+ if (!defined $HtmlDir || -z $HtmlDir) {
+ $CleanupFile = $f;
+ }
}
}