[PATCH] D81538: [clangd] Disable new errs()-tie behavior, it's racy.

Sam McCall via Phabricator via cfe-commits cfe-commits at lists.llvm.org
Wed Jun 10 07:37:59 PDT 2020


This revision was automatically updated to reflect the committed changes.
Closed by commit rG4e3a44d42eac: [clangd] Disable new errs()-tie behavior, it's racy. (authored by sammccall).

Repository:
  rG LLVM Github Monorepo

CHANGES SINCE LAST ACTION
  https://reviews.llvm.org/D81538/new/

https://reviews.llvm.org/D81538

Files:
  clang-tools-extra/clangd/tool/ClangdMain.cpp


Index: clang-tools-extra/clangd/tool/ClangdMain.cpp
===================================================================
--- clang-tools-extra/clangd/tool/ClangdMain.cpp
+++ clang-tools-extra/clangd/tool/ClangdMain.cpp
@@ -585,6 +585,8 @@
   // Use buffered stream to stderr (we still flush each log message). Unbuffered
   // stream can cause significant (non-deterministic) latency for the logger.
   llvm::errs().SetBuffered();
+  // Don't flush stdout when logging, this would be both slow and racy!
+  llvm::errs().tie(nullptr);
   StreamLogger Logger(llvm::errs(), LogLevel);
   LoggingSession LoggingSession(Logger);
   // Write some initial logs before we start doing any real work.


-------------- next part --------------
A non-text attachment was scrubbed...
Name: D81538.269846.patch
Type: text/x-patch
Size: 690 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/cfe-commits/attachments/20200610/00159ea4/attachment.bin>


More information about the cfe-commits mailing list