]> granicus.if.org Git - clang/commitdiff
[analyzer] scan-build: Don't forget to close our temp file for Clang's output.
authorJordan Rose <jordan_rose@apple.com>
Wed, 28 Nov 2012 19:12:44 +0000 (19:12 +0000)
committerJordan Rose <jordan_rose@apple.com>
Wed, 28 Nov 2012 19:12:44 +0000 (19:12 +0000)
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

index 8bd9ec2724ae198479cc8efa6b7a22c21a71536e..f94f804a29e32ef3d1addd0de310b45e34427dc2 100755 (executable)
@@ -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;
         }
       }
     }