[Support] Add stream tie function and use it for errs()
authorJames Henderson <james.henderson@sony.com>
Mon, 8 Jun 2020 11:58:04 +0000 (12:58 +0100)
committerJames Henderson <james.henderson@sony.com>
Tue, 9 Jun 2020 11:51:02 +0000 (12:51 +0100)
commit1ce831912c797df1cb6d313d8e576a3f86175b6d
tree3f10f03ccee13e3cede3516791d3e8e5b8ca7ce6
parent4515d35f5c9e2bdcdbcb9fe9028d4a84871958c5
[Support] Add stream tie function and use it for errs()

errs() is now tied to outs() so that if something prints to errs(),
outs() will be flushed before the printing occurs. This avoids
interleaving output between the two and is consistent with standard cout
and cerr behaviour.

Reviewed by: labath, JDevlieghere, MaskRay

Differential Revision: https://reviews.llvm.org/D81156
llvm/include/llvm/Support/raw_ostream.h
llvm/lib/Support/raw_ostream.cpp
llvm/unittests/Support/raw_ostream_test.cpp