[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 04:56:30 PDT 2018


ioeric created this revision.
ioeric added a reviewer: sammccall.
Herald added subscribers: cfe-commits, kadircet, arphaman, jkorous, MaskRay, ilya-biryukov.

Unbuffered stream can cause significant (non-deterministic) latency for the logger.


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. 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.162832.patch
Type: text/x-patch
Size: 565 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/cfe-commits/attachments/20180828/a9e88051/attachment.bin>


More information about the cfe-commits mailing list