This is an archive of the discontinued LLVM Phabricator instance.

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

Authored by ehsan on Jul 17 2014, 6:05 AM.

Details

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.

Diff Detail

Event Timeline

ehsan updated this revision to Diff 11576.Jul 17 2014, 6:05 AM
ehsan retitled this revision from to clang-cl: Flush stdout after writing the /showIncludes output.
ehsan updated this object.
ehsan edited the test plan for this revision. (Show Details)
ehsan added a reviewer: rnk.
ehsan added a subscriber: Unknown Object (MLST).

Note that I didn't make this flush conditional on MSStyle since I think it's good practice to flush here even for non-clang-cl mode where we output to stderr, but I'd be happy to change that if you think that is not appropriate.

thakis accepted this revision.Jul 17 2014, 8:56 AM
thakis added a reviewer: thakis.
thakis added a subscriber: thakis.

lgtm

(I can't think of a great way to test this.)

This revision is now accepted and ready to land.Jul 17 2014, 8:56 AM
ehsan closed this revision.Jul 17 2014, 12:16 PM
ehsan updated this revision to Diff 11605.

Closed by commit rL213297 (authored by @ehsan).