[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.

llvm-svn: 239970
This commit is contained in:
Anton Yartsev
2015-06-17 23:12:33 +00:00
parent 75ea855fd7
commit 321b176a08

View File

@@ -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";