Skip to content
Snippets Groups Projects
Commit 823c2c36 authored by Ehsan Akhgari's avatar Ehsan Akhgari
Browse files

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

Summary:
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.

Test Plan:
Tested locally, it's hard to write an automated test for this as
the behavior depends on the buffering of the ostreams.

Reviewers: nico

Subscribers: cfe-commits

Differential Revision: http://reviews.llvm.org/D4559

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@213297 91177308-0d34-0410-b5e6-96231b3b80d8
parent f35aa781
No related branches found
No related tags found
No related merge requests found
...@@ -131,5 +131,6 @@ void HeaderIncludesCallback::FileChanged(SourceLocation Loc, ...@@ -131,5 +131,6 @@ void HeaderIncludesCallback::FileChanged(SourceLocation Loc,
Msg += '\n'; Msg += '\n';
OutputFile->write(Msg.data(), Msg.size()); OutputFile->write(Msg.data(), Msg.size());
OutputFile->flush();
} }
} }
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment