[PATCH] D158469: [clang][deps] Compute command lines and file deps on-demand

2023-08-23 Thread Jan Svoboda via Phabricator via cfe-commits
jansvoboda11 added a comment. In D158469#4612012 , @benlangmuir wrote: >> I tried that approach, but found it way too easy to keep `ModuleDeps` >> around, which keep scanning instances alive, and use tons of memory. > > It seems like the problem (too ea

[PATCH] D158469: [clang][deps] Compute command lines and file deps on-demand

2023-08-23 Thread Ben Langmuir via Phabricator via cfe-commits
benlangmuir added a comment. > I tried that approach, but found it way too easy to keep `ModuleDeps` around, > which keep scanning instances alive, and use tons of memory. It seems like the problem (too easy to keep around MD) is the same either way, it's just instead of wasting memory it's lea

[PATCH] D158469: [clang][deps] Compute command lines and file deps on-demand

2023-08-23 Thread Jan Svoboda via Phabricator via cfe-commits
jansvoboda11 added a comment. Hmm, maybe we could avoid holding on to the whole `CompilerInstance`. For generating the command-line, we only need the `CompilerInvocation`. For collecting file dependencies, we could hold on to the `MemoryBuffer` (and maybe offset to the input files block), and d

[PATCH] D158469: [clang][deps] Compute command lines and file deps on-demand

2023-08-23 Thread Jan Svoboda via Phabricator via cfe-commits
jansvoboda11 added a comment. In D158469#4611923 , @benlangmuir wrote: > I find this a bit hard to understand as far as object lifetime is concerned: > you're storing the `ScanInstance` in `TranslationUnitDeps`, but that's a > layer above the actual co

[PATCH] D158469: [clang][deps] Compute command lines and file deps on-demand

2023-08-23 Thread Ben Langmuir via Phabricator via cfe-commits
benlangmuir added a comment. I find this a bit hard to understand as far as object lifetime is concerned: you're storing the `ScanInstance` in `TranslationUnitDeps`, but that's a layer above the actual consumer interface, which means every consumer needs to understand how this lifetime is manag

[PATCH] D158469: [clang][deps] Compute command lines and file deps on-demand

2023-08-22 Thread Jan Svoboda via Phabricator via cfe-commits
jansvoboda11 updated this revision to Diff 552566. jansvoboda11 added a comment. Rebase. Repository: rG LLVM Github Monorepo CHANGES SINCE LAST ACTION https://reviews.llvm.org/D158469/new/ https://reviews.llvm.org/D158469 Files: clang/include/clang/Tooling/DependencyScanning/DependencyS

[PATCH] D158469: [clang][deps] Compute command lines and file deps on-demand

2023-08-21 Thread Jan Svoboda via Phabricator via cfe-commits
jansvoboda11 created this revision. jansvoboda11 added a reviewer: benlangmuir. Herald added a subscriber: ributzka. Herald added a project: All. jansvoboda11 requested review of this revision. Herald added a project: clang. Herald added a subscriber: cfe-commits. Although generating command lines