[clang-tools-extra] r340822 - [clangd] Use buffered llvm::errs() in the clangd binary.

Eric Liu via cfe-commits cfe-commits at lists.llvm.org
Tue Aug 28 06:15:50 PDT 2018


Author: ioeric
Date: Tue Aug 28 06:15:50 2018
New Revision: 340822

URL: http://llvm.org/viewvc/llvm-project?rev=340822&view=rev
Log:
[clangd] Use buffered llvm::errs() in the clangd binary.

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

Reviewers: sammccall

Subscribers: ilya-biryukov, MaskRay, jkorous, arphaman, kadircet, cfe-commits

Differential Revision: https://reviews.llvm.org/D51349

Modified:
    clang-tools-extra/trunk/clangd/tool/ClangdMain.cpp

Modified: clang-tools-extra/trunk/clangd/tool/ClangdMain.cpp
URL: http://llvm.org/viewvc/llvm-project/clang-tools-extra/trunk/clangd/tool/ClangdMain.cpp?rev=340822&r1=340821&r2=340822&view=diff
==============================================================================
--- clang-tools-extra/trunk/clangd/tool/ClangdMain.cpp (original)
+++ clang-tools-extra/trunk/clangd/tool/ClangdMain.cpp Tue Aug 28 06:15:50 2018
@@ -259,6 +259,9 @@ int main(int argc, char *argv[]) {
   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);




More information about the cfe-commits mailing list