From 2cbdd7d21e3902e568ce2a51a7459ab5a4fc236c Mon Sep 17 00:00:00 2001 From: Jordan Rose Date: Wed, 28 Nov 2012 19:12:44 +0000 Subject: [PATCH] [analyzer] scan-build: Don't forget to close our temp file for Clang's output. Also, minor whitespace/indentation fixes. Patch by Peeter Joot! git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@168805 91177308-0d34-0410-b5e6-96231b3b80d8 --- tools/scan-build/ccc-analyzer | 15 ++++++++------- 1 file changed, 8 insertions(+), 7 deletions(-) diff --git a/tools/scan-build/ccc-analyzer b/tools/scan-build/ccc-analyzer index 8bd9ec2724..f94f804a29 100755 --- a/tools/scan-build/ccc-analyzer +++ b/tools/scan-build/ccc-analyzer @@ -31,11 +31,11 @@ my $DefaultCCompiler; my $DefaultCXXCompiler; if (`uname -a` =~ m/Darwin/) { - $DefaultCCompiler = 'clang'; - $DefaultCXXCompiler = 'clang++'; + $DefaultCCompiler = 'clang'; + $DefaultCXXCompiler = 'clang++'; } else { - $DefaultCCompiler = 'gcc'; - $DefaultCXXCompiler = 'g++'; + $DefaultCCompiler = 'gcc'; + $DefaultCXXCompiler = 'g++'; } if ($FindBin::Script =~ /c\+\+-analyzer/) { @@ -252,6 +252,7 @@ sub Analyze { print $ofh $_; print STDERR $_; } + close $ofh; waitpid($pid,0); close(FROM_CHILD); @@ -269,7 +270,7 @@ sub Analyze { $HtmlDir, $ParserRejects, $ofile); } else { ProcessClangFailure($Clang, $Lang, $file, \@CmdArgsSansAnalyses, - $HtmlDir, $OtherError, $ofile); + $HtmlDir, $OtherError, $ofile); } } else { @@ -618,7 +619,7 @@ if ($Action eq 'compile' or $Action eq 'link') { my @Archs = keys %ArchsSeen; # Skip the file if we don't support the architectures specified. exit 0 if ($HadArch && scalar(@Archs) == 0); - + foreach my $file (@Files) { # Determine the language for the file. my $FileLang = $Lang; @@ -672,7 +673,7 @@ if ($Action eq 'compile' or $Action eq 'link') { $ResultFile = $f; # If the HtmlDir is not set, we sould clean up the plist files. if (!defined $HtmlDir || -z $HtmlDir) { - $CleanupFile = $f; + $CleanupFile = $f; } } } -- 2.50.1