[clangd] Treat __GCC_HAVE_DWARF2_CFI_ASM the same as isWrittenInBuiltinFile macros
authorFangrui Song <i@maskray.me>
Wed, 10 Mar 2021 07:11:54 +0000 (23:11 -0800)
committerFangrui Song <i@maskray.me>
Wed, 10 Mar 2021 07:11:54 +0000 (23:11 -0800)
clang-tools-extra/clangd/index/SymbolCollector.cpp

index b1363c1..e330c9f 100644 (file)
@@ -432,7 +432,8 @@ bool SymbolCollector::handleMacroOccurrence(const IdentifierInfo *Name,
   const auto &SM = PP->getSourceManager();
   auto DefLoc = MI->getDefinitionLoc();
   // Also avoid storing predefined macros like __DBL_MIN__.
-  if (SM.isWrittenInBuiltinFile(DefLoc))
+  if (SM.isWrittenInBuiltinFile(DefLoc) ||
+      Name->getName() == "__GCC_HAVE_DWARF2_CFI_ASM")
     return true;
 
   auto ID = getSymbolID(Name->getName(), MI, SM);