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
- rCTE Clang Tools Extra
- Build Status
Buildable 20723 Build 20723: arc lint + arc unit
Event Timeline
clangd/TUScheduler.cpp | ||
---|---|---|
357 | nit: (OldPreamble == NewPreamble) Do you intend to compare the shared pointer instead of the values? | |
360 | Why reset? | |
376 | Do we choose to ignore this because it's rare? What are non-preamble #includes? | |
379 | I think this can be a log. | |
test/clangd/extra-flags.test | ||
26 | Why this change? |
clangd/TUScheduler.cpp | ||
---|---|---|
357 | Yes, this is intentional. buildPreamble will either return the old one, if it can be reused, or build the new one. | |
360 | We don't need the old preamble at this point, so we give it a chance to die (if there are no more references). | |
376 | Exactly, we don't have the code to track and check for all accessed files. | |
test/clangd/extra-flags.test | ||
26 | 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 | 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 | Guarding with mutex is not actually required. Moved it out of the locked section and added a comment, thanks! |
nit: (OldPreamble == NewPreamble)
Do you intend to compare the shared pointer instead of the values?