[PATCH] D77732: [clangd] Shard preamble symbols in dynamic index

2020-04-15 Thread Kadir Cetinkaya via Phabricator via cfe-commits
This revision was automatically updated to reflect the committed changes. Closed by commit rGdffa9dfbda56: [clangd] Shard preamble symbols in dynamic index (authored by kadircet). Repository: rG LLVM Github Monorepo CHANGES SINCE LAST ACTION https://reviews.llvm.org/D77732/new/ https://revi

[PATCH] D77732: [clangd] Shard preamble symbols in dynamic index

2020-04-14 Thread Kadir Cetinkaya via Phabricator via cfe-commits
kadircet updated this revision to Diff 257607. kadircet added a comment. - Add tests for sharding logic and preamble overwrite Repository: rG LLVM Github Monorepo CHANGES SINCE LAST ACTION https://reviews.llvm.org/D77732/new/ https://reviews.llvm.org/D77732 Files: clang-tools-extra/clan

[PATCH] D77732: [clangd] Shard preamble symbols in dynamic index

2020-04-14 Thread Sam McCall via Phabricator via cfe-commits
sammccall accepted this revision. sammccall added a comment. Still LG Comment at: clang-tools-extra/clangd/index/FileIndex.h:165 + /// Returns absolute paths for all files that has a shard. + std::vector getAllFiles() const; + kadircet wrote: > sammccall wrot

[PATCH] D77732: [clangd] Shard preamble symbols in dynamic index

2020-04-14 Thread Kadir Cetinkaya via Phabricator via cfe-commits
kadircet added inline comments. Comment at: clang-tools-extra/clangd/index/FileIndex.h:165 + /// Returns absolute paths for all files that has a shard. + std::vector getAllFiles() const; + sammccall wrote: > I do find it a little weird not to expose the map-str

[PATCH] D77732: [clangd] Shard preamble symbols in dynamic index

2020-04-14 Thread Kadir Cetinkaya via Phabricator via cfe-commits
kadircet updated this revision to Diff 257242. kadircet marked 7 inline comments as done. kadircet added a comment. - Address comments - Merge slab generations into a single member that returns an `IndexFileIn`. Repository: rG LLVM Github Monorepo CHANGES SINCE LAST ACTION https://reviews.l

[PATCH] D77732: [clangd] Shard preamble symbols in dynamic index

2020-04-13 Thread Sam McCall via Phabricator via cfe-commits
sammccall accepted this revision. sammccall added a comment. This revision is now accepted and ready to land. LG, API quibbles. It would be nice to test this but the good things about it (memory usage) aren't easy to test, and the bad things (sensitivity to header parsing context) seem odd to b

[PATCH] D77732: [clangd] Shard preamble symbols in dynamic index

2020-04-13 Thread Kadir Cetinkaya via Phabricator via cfe-commits
kadircet marked an inline comment as done. kadircet added inline comments. Comment at: clang-tools-extra/clangd/index/SymbolCollector.cpp:286 + // ND is the canonical (i.e. first) declaration. If it's in the main file + // (which is not a header), then no public declaration w

[PATCH] D77732: [clangd] Shard preamble symbols in dynamic index

2020-04-13 Thread Kadir Cetinkaya via Phabricator via cfe-commits
kadircet added inline comments. Comment at: clang-tools-extra/clangd/index/FileIndex.cpp:97 +/// paths used by \p FileSyms. +void shardSlabToFiles(const SymbolSlab &Syms, const RelationSlab &Rels, + FileSymbols &FileSyms, llvm::StringRef HintPath) { -

[PATCH] D77732: [clangd] Shard preamble symbols in dynamic index

2020-04-13 Thread Kadir Cetinkaya via Phabricator via cfe-commits
kadircet updated this revision to Diff 257003. kadircet marked 4 inline comments as done. kadircet added a comment. - Unify sharding logic in BackgroundIndex and FileIndex. - Make sure relations have valid subjects. Repository: rG LLVM Github Monorepo CHANGES SINCE LAST ACTION https://revie

[PATCH] D77732: [clangd] Shard preamble symbols in dynamic index

2020-04-12 Thread Kadir Cetinkaya via Phabricator via cfe-commits
kadircet marked an inline comment as done. kadircet added inline comments. Comment at: clang-tools-extra/clangd/index/FileIndex.cpp:97 +/// paths used by \p FileSyms. +void shardSlabToFiles(const SymbolSlab &Syms, const RelationSlab &Rels, + FileSymbols &File

[PATCH] D77732: [clangd] Shard preamble symbols in dynamic index

2020-04-09 Thread Sam McCall via Phabricator via cfe-commits
sammccall added a comment. Can't believe we didn't do this before. Nice catch. Comment at: clang-tools-extra/clangd/index/FileIndex.cpp:97 +/// paths used by \p FileSyms. +void shardSlabToFiles(const SymbolSlab &Syms, const RelationSlab &Rels, + FileSymbols

[PATCH] D77732: [clangd] Shard preamble symbols in dynamic index

2020-04-08 Thread Kadir Cetinkaya via Phabricator via cfe-commits
kadircet created this revision. kadircet added a reviewer: sammccall. Herald added subscribers: cfe-commits, usaxena95, arphaman, jkorous, MaskRay, ilya-biryukov. Herald added a project: clang. This reduces memory usage by dynamic index from more than 400MB to 32MB when all files in clang-tools-e