Index: Common/ErrorHandler.cpp =================================================================== --- Common/ErrorHandler.cpp +++ Common/ErrorHandler.cpp @@ -25,7 +25,7 @@ using namespace lld; // The functions defined in this file can be called from multiple threads, -// but outs() or errs() are not thread-safe. We protect them using a mutex. +// but errs() is not thread-safe. We protect them using a mutex. static std::mutex Mu; // Prints "\n" or does nothing, depending on Msg contents of @@ -54,7 +54,6 @@ // build allows us to get the output of -time-passes. llvm_shutdown(); - outs().flush(); errs().flush(); _exit(Val); } @@ -73,15 +72,13 @@ void ErrorHandler::log(const Twine &Msg) { if (Verbose) { std::lock_guard Lock(Mu); - outs() << LogName << ": " << Msg << "\n"; - outs().flush(); + *ErrorOS << LogName << ": " << Msg << "\n"; } } void ErrorHandler::message(const Twine &Msg) { std::lock_guard Lock(Mu); - outs() << Msg << "\n"; - outs().flush(); + *ErrorOS << Msg << "\n"; } void ErrorHandler::warn(const Twine &Msg) {