[llvm] Add thread-local overrides for `llvm::errs()` and `llvm::outs()`. (PR #90374)

Alexandre Ganea via llvm-commits llvm-commits at lists.llvm.org
Tue May 14 09:54:44 PDT 2024


================
@@ -906,11 +912,14 @@ raw_fd_ostream &llvm::outs() {
 }
 
 raw_fd_ostream &llvm::errs() {
-  // Set standard error to be unbuffered and tied to outs() by default.
+  if (auto *TLSErrs = OutsOverride; TLSErrs != nullptr)
----------------
aganea wrote:

There's a copy-paste error here, should be `ErrsOverride`. Suprised that the test below hasn't catched that, maybe add another test that writes to different buffers?

https://github.com/llvm/llvm-project/pull/90374


More information about the llvm-commits mailing list