From 45ce1bf09123503a7d26b27ea8f9b024c91f88fc Mon Sep 17 00:00:00 2001 From: Anna Zaks Date: Fri, 9 Sep 2011 18:43:53 +0000 Subject: [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 --- clang/tools/scan-build/ccc-analyzer | 10 ++++++++-- 1 file changed, 8 insertions(+), 2 deletions(-) (limited to 'clang/tools') 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; + } } } -- cgit v1.2.3