This is an archive of the discontinued LLVM Phabricator instance.

[clangd] Dont index deeply nested symbols
ClosedPublic

Authored by kadircet on Apr 22 2021, 7:11 AM.

Details

Summary

This is fix for some timeouts and OOM problems faced while indexing an
auto-generated file with thousands of nested lambdas.

Diff Detail

Event Timeline

kadircet created this revision.Apr 22 2021, 7:11 AM
kadircet requested review of this revision.Apr 22 2021, 7:11 AM
Herald added a project: Restricted Project. · View Herald TranscriptApr 22 2021, 7:11 AM
kadircet updated this revision to Diff 339960.Apr 23 2021, 3:05 AM
  • Revert unrelated changes in tests
sammccall accepted this revision.Apr 23 2021, 3:28 AM
sammccall added inline comments.
clang-tools-extra/clangd/index/IndexAction.cpp
143

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)

This revision is now accepted and ready to land.Apr 23 2021, 3:28 AM
kadircet updated this revision to Diff 340091.Apr 23 2021, 9:55 AM
  • Move depth check into a helper and add tests for it.
This revision was landed with ongoing or failed builds.Apr 27 2021, 3:35 AM
This revision was automatically updated to reflect the committed changes.