This is an archive of the discontinued LLVM Phabricator instance.

[clangd] Triggering indexing on each translation unit with an error
Changes PlannedPublic

Authored by kadircet on Jul 15 2019, 5:43 AM.

Details

Reviewers
None
Summary

Background indexing triggers indexing only on the first TU that
includes a stale dependency.

This patch extends this behavior to also trigger indexing on TUs with errors.

Event Timeline

kadircet created this revision.Jul 15 2019, 5:43 AM
Herald added a project: Restricted Project. · View Herald TranscriptJul 15 2019, 5:43 AM
kadircet planned changes to this revision.Aug 20 2019, 3:32 AM

this requires keeping an inverted dependency graph, which can be quite expensive memory-wise.
In a project like chromium there are ~40k translation units, and it is safe to assume there are ~1k core headers just coming from std library,
that are most likely included by all of the translation units directly or transatively. This results in ~320MB of memory usage even if we just
store a pointer.

It is quite likely that there would be a lot more "base" headers like that, which could easily drive up the memory usage.

We might need some tradeoffs to limit that usage.