aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJordan Rose <jordan_rose@apple.com>2012-11-28 19:12:44 +0000
committerJordan Rose <jordan_rose@apple.com>2012-11-28 19:12:44 +0000
commit2cbdd7d21e3902e568ce2a51a7459ab5a4fc236c (patch)
treeaab3a1520bd23cab90884cdcb7a2e6d27f6f6a73
parent501be138462d9d6fe1b55ea92c3a14a2d7501c5f (diff)
[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
-rwxr-xr-xtools/scan-build/ccc-analyzer15
1 files 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;
}
}
}