diff options
author | Anna Zaks <ganna@apple.com> | 2011-09-09 18:43:53 +0000 |
---|---|---|
committer | Anna Zaks <ganna@apple.com> | 2011-09-09 18:43:53 +0000 |
commit | 45ce1bf09123503a7d26b27ea8f9b024c91f88fc (patch) | |
tree | c5e59d97634c14edd6f2c6452e026645439949d2 /clang/tools | |
parent | a05627ebaf0bf5fbc1d666b677305212743699b1 (diff) | |
download | bcm5719-llvm-45ce1bf09123503a7d26b27ea8f9b024c91f88fc.tar.gz bcm5719-llvm-45ce1bf09123503a7d26b27ea8f9b024c91f88fc.zip |
[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.)
llvm-svn: 139382
Diffstat (limited to 'clang/tools')
-rwxr-xr-x | clang/tools/scan-build/ccc-analyzer | 10 |
1 files changed, 8 insertions, 2 deletions
diff --git a/clang/tools/scan-build/ccc-analyzer b/clang/tools/scan-build/ccc-analyzer index 7793a8db49b..c39e4179514 100755 --- a/clang/tools/scan-build/ccc-analyzer +++ b/clang/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; + } } } |