r239970 - [analyzer] Close file handle before output to file from	external command.
    Anton Yartsev 
    anton.yartsev at gmail.com
       
    Wed Jun 17 16:12:33 PDT 2015
    
    
  
Author: ayartsev
Date: Wed Jun 17 18:12:33 2015
New Revision: 239970
URL: http://llvm.org/viewvc/llvm-project?rev=239970&view=rev
Log:
[analyzer] Close file handle before output to file from external command.
An old code caused problems under Windows - additional temporary file was created for clang preprocessor output while the right output file remained empty.
Modified:
    cfe/trunk/tools/scan-build/ccc-analyzer
Modified: cfe/trunk/tools/scan-build/ccc-analyzer
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/tools/scan-build/ccc-analyzer?rev=239970&r1=239969&r2=239970&view=diff
==============================================================================
--- cfe/trunk/tools/scan-build/ccc-analyzer (original)
+++ cfe/trunk/tools/scan-build/ccc-analyzer Wed Jun 17 18:12:33 2015
@@ -135,8 +135,8 @@ sub ProcessClangFailure {
   my ($PPH, $PPFile) = tempfile( $prefix . "_XXXXXX",
                                  SUFFIX => GetPPExt($Lang),
                                  DIR => $Dir);
-  system $Clang, @$Args, "-E", "-o", $PPFile;
   close ($PPH);
+  system $Clang, @$Args, "-E", "-o", $PPFile;
 
   # Create the info file.
   open (OUT, ">", "$PPFile.info.txt") or die "Cannot open $PPFile.info.txt\n";
    
    
More information about the cfe-commits
mailing list