[PATCH] D51349: [clangd] Use buffered llvm::errs() in the clangd binary.

Eric Liu via Phabricator via cfe-commits cfe-commits at lists.llvm.org
Tue Aug 28 06:16:54 PDT 2018


This revision was automatically updated to reflect the committed changes.
ioeric marked an inline comment as done.
Closed by commit rCTE340822: [clangd] Use buffered llvm::errs() in the clangd binary. (authored by ioeric, committed by ).

Changed prior to commit:
  https://reviews.llvm.org/D51349?vs=162832&id=162839#toc

Repository:
  rCTE Clang Tools Extra

https://reviews.llvm.org/D51349

Files:
  clangd/tool/ClangdMain.cpp


Index: clangd/tool/ClangdMain.cpp
===================================================================
--- clangd/tool/ClangdMain.cpp
+++ clangd/tool/ClangdMain.cpp
@@ -259,6 +259,9 @@
   if (Tracer)
     TracingSession.emplace(*Tracer);
 
+  // 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();
   JSONOutput Out(llvm::outs(), llvm::errs(), LogLevel,
                  InputMirrorStream ? InputMirrorStream.getPointer() : nullptr,
                  PrettyPrint);


-------------- next part --------------
A non-text attachment was scrubbed...
Name: D51349.162839.patch
Type: text/x-patch
Size: 599 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/cfe-commits/attachments/20180828/b7443cfd/attachment.bin>


More information about the cfe-commits mailing list