[PATCH] clang-cl: Flush stdout after writing the /showIncludes output

Ehsan Akhgari ehsan.akhgari at gmail.com
Thu Jul 17 06:06:00 PDT 2014


Hi rnk,

Before this patch, you could get lines in the output such as:
Note: including file:   ../../dist/include/js/Tc:/path/to/foo.cpp(1,1) :  error(clang): static_assert failed...

This patch ensures that the stdout output from showIncludes won't be garbled
in the terminal like this, and it also helps applications that use the output
to generate dependency information if they happen to capture both stdout and
stderr.

http://reviews.llvm.org/D4559

Files:
  lib/Frontend/HeaderIncludeGen.cpp

Index: lib/Frontend/HeaderIncludeGen.cpp
===================================================================
--- lib/Frontend/HeaderIncludeGen.cpp
+++ lib/Frontend/HeaderIncludeGen.cpp
@@ -131,5 +131,6 @@
     Msg += '\n';
 
     OutputFile->write(Msg.data(), Msg.size());
+    OutputFile->flush();
   }
 }
-------------- next part --------------
A non-text attachment was scrubbed...
Name: D4559.11576.patch
Type: text/x-patch
Size: 307 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/cfe-commits/attachments/20140717/7035d294/attachment.bin>


More information about the cfe-commits mailing list