[PATCH] D115301: [clangd] Don't index __reserved_names in headers.

Sam McCall via Phabricator via cfe-commits cfe-commits at lists.llvm.org
Wed Jan 5 07:33:50 PST 2022


sammccall marked an inline comment as done.
sammccall added inline comments.


================
Comment at: clang-tools-extra/clangd/SourceCode.h:334
+/// Returns true if Name is reserved, like _Foo or __Vector_base.
+inline bool isReservedName(llvm::StringRef Name) {
+  // This doesn't catch all cases, but the most common.
----------------
kadircet wrote:
> nit: maybe move definition out-of-line.
This "just a few instructions", I'd rather let the compiler make that call...


================
Comment at: clang-tools-extra/clangd/unittests/QualityTests.cpp:60
-  EXPECT_FALSE(Quality.ImplementationDetail);
-  EXPECT_TRUE(Quality.ReservedName);
-  EXPECT_EQ(Quality.References, SymbolQualitySignals().References);
----------------
kadircet wrote:
> can we still have a test that indexes main file symbols and ensures `ReservedName` is set correctly?
Whoops, of course.


Repository:
  rG LLVM Github Monorepo

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

https://reviews.llvm.org/D115301



More information about the cfe-commits mailing list