[PATCH] D109884: [clangd] Dont work on diags if we are not going to emit
Sam McCall via Phabricator via cfe-commits
cfe-commits at lists.llvm.org
Thu Sep 16 07:24:47 PDT 2021
sammccall added a comment.
Great!
================
Comment at: clang-tools-extra/clangd/ParsedAST.cpp:295
llvm::MemoryBuffer::getMemBufferCopy(Inputs.Contents, Filename), VFS,
- ASTDiags);
+ PreserveDiags ? static_cast<DiagnosticConsumer &>(ASTDiags)
+ : static_cast<DiagnosticConsumer &>(DropDiags));
----------------
These explicit upcasts seem ugly enough that I might extract a pointer var to avoid them...
================
Comment at: clang-tools-extra/clangd/ParsedAST.cpp:338
llvm::Optional<tidy::ClangTidyContext> CTContext;
- {
+ // No need to initalize a clang-tidy context if we are not going to surface
+ // diagnostics.
----------------
s/initialize a clang-tidy context/run clang-tidy/
================
Comment at: clang-tools-extra/clangd/unittests/ParsedASTTests.cpp:464
-
- TU.AdditionalFiles["a.h"] = "";
- TU.AdditionalFiles["b.h"] = "";
----------------
Why are these tests deleted?
Repository:
rG LLVM Github Monorepo
CHANGES SINCE LAST ACTION
https://reviews.llvm.org/D109884/new/
https://reviews.llvm.org/D109884
More information about the cfe-commits
mailing list