sammccall accepted this revision. sammccall added inline comments. This revision is now accepted and ready to land.
================ Comment at: clang-tools-extra/clangd/Preamble.cpp:691 + // it's coming from baseline preamble. + if (It->second) + PatchedInc = *It->second; ---------------- 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. ================ Comment at: clang-tools-extra/clangd/unittests/PreambleTests.cpp:236 +TEST(PreamblePatchTest, IncludesArePreserved) { + llvm::StringLiteral Baseline = "//error-ok\n#include <foo>\n#include <bar>\n"; + auto Modified = Baseline + "#define FOO\n"; ---------------- rawstrings? Repository: rG LLVM Github Monorepo CHANGES SINCE LAST ACTION https://reviews.llvm.org/D143197/new/ https://reviews.llvm.org/D143197 _______________________________________________ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits