If the contents are the same, the update most likely comes from the
fact that compile commands were invalidated. In that case we want to
avoid rebuilds in case the compile commands are actually the same.
Details
Diff Detail
- Repository
- rL LLVM
Event Timeline
clangd/TUScheduler.cpp | ||
---|---|---|
357 ↗ | (On Diff #157217) | nit: (OldPreamble == NewPreamble) Do you intend to compare the shared pointer instead of the values? |
360 ↗ | (On Diff #157217) | Why reset? |
373 ↗ | (On Diff #157217) | Do we choose to ignore this because it's rare? What are non-preamble #includes? |
376 ↗ | (On Diff #157217) | I think this can be a log. |
test/clangd/extra-flags.test | ||
26 ↗ | (On Diff #157217) | Why this change? |
clangd/TUScheduler.cpp | ||
---|---|---|
357 ↗ | (On Diff #157217) | Yes, this is intentional. buildPreamble will either return the old one, if it can be reused, or build the new one. |
360 ↗ | (On Diff #157217) | We don't need the old preamble at this point, so we give it a chance to die (if there are no more references). |
373 ↗ | (On Diff #157217) | Exactly, we don't have the code to track and check for all accessed files. |
test/clangd/extra-flags.test | ||
26 ↗ | (On Diff #157217) | The test expects two publishDiagnostics, but it won't get the second one since if the contents of the file are the same :-) |
lg
clangd/TUScheduler.cpp | ||
---|---|---|
360 ↗ | (On Diff #157217) | sg. and do we guard this with mutex because the same old preamble data can be accessed by other threads? might worth a comment. |
Thanks, that's simple and efficient. I'll update D49267 (to call reparseOpenFiles once again) once this is merged.
clangd/TUScheduler.cpp | ||
---|---|---|
360 ↗ | (On Diff #157217) | Guarding with mutex is not actually required. Moved it out of the locked section and added a comment, thanks! |