[PATCH] D101066: [clangd] Dont index deeply nested symbols

Sam McCall via Phabricator via cfe-commits cfe-commits at lists.llvm.org
Fri Apr 23 03:28:43 PDT 2021


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


================
Comment at: clang-tools-extra/clangd/index/IndexAction.cpp:142
     this->Opts.ShouldTraverseDecl = [this](const Decl *D) {
+      // Many operations performed during indexing is linear in terms of depth
+      // of the decl (USR generation, name lookups, figuring out role of a
----------------
I'd consider pulling the logic out into `isDeeplyNested(unsigned MaxDepth=10)` in AST.h, to keep this readable & policy-oriented and as we may well want to apply this in other places where we use SymbolCollector (or other traversals)


Repository:
  rG LLVM Github Monorepo

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

https://reviews.llvm.org/D101066



More information about the cfe-commits mailing list