- Make sure main file includes are present even when they're not patched (because they didn't change or we're explicitly not patching them).
- Populate extra fields for includes, which can be used by include-cleaner.
Details
Diff Detail
- Repository
- rG LLVM Github Monorepo
Event Timeline
Code looks reasonable, but I don't understand why the changes are being made - can you explain/link to a bug in the commit message?
clang-tools-extra/clangd/Preamble.cpp | ||
---|---|---|
688 | This doesn't seem related to the patch description, can you update it? | |
690 | why the null check? | |
691 | seems a bit more future-proof to copy the whole thing and just overwrite the fields you want to preserve. (also would avoid the need for the comment) | |
701 | this just echoes the code - say why instead? (would also be good to have the reason in the commit message) |
- Address comments & update commit message
clang-tools-extra/clangd/Preamble.cpp | ||
---|---|---|
690 | as discussed offline, we might have includes coming from scanned contents whose are not part of the preamble, e.g. because they're in a disabled PP region. |
clang-tools-extra/clangd/Preamble.cpp | ||
---|---|---|
692 | if It->second is null, then all the #includes of this header from the baseline preamble were in disabled sections, so it's *very* likely this one is too. I think we're better not pushing onto PP.PreambleIncludes at all in this case, rather than pushing an unresolved one - this is how the MainFileIncludes looks like when an #include is in a disabled section and there's no patching happening. | |
clang-tools-extra/clangd/unittests/PreambleTests.cpp | ||
229 | rawstrings? |
This doesn't seem related to the patch description, can you update it?