[PATCH] D84697: [clangd] Use elog instead of llvm::errs, log instead of llvm::outs

Sam McCall via Phabricator via cfe-commits cfe-commits at lists.llvm.org
Tue Jul 28 07:56:37 PDT 2020


sammccall accepted this revision.
sammccall added inline comments.
This revision is now accepted and ready to land.


================
Comment at: clang-tools-extra/clangd/index/remote/server/Server.cpp:202
 
+  // Use buffered stream to stderr.
+  llvm::errs().SetBuffered();
----------------
explain why or just delete this comment


================
Comment at: clang-tools-extra/clangd/index/remote/server/Server.cpp:202
 
+  // Use buffered stream to stderr.
+  llvm::errs().SetBuffered();
----------------
sammccall wrote:
> explain why or just delete this comment
nit: move this down after flag validation?


================
Comment at: clang-tools-extra/clangd/index/remote/server/Server.cpp:204
+  llvm::errs().SetBuffered();
+  // Don't flush stdout when logging for performance.
+  llvm::errs().tie(nullptr);
----------------
I'm not sure performance matters here (if you don't actually write to stdout much, it should be free). Rather, this is for correctness: it's not threadsafe.


Repository:
  rG LLVM Github Monorepo

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

https://reviews.llvm.org/D84697



More information about the cfe-commits mailing list