[PATCH] D143197: [clangd] Fix bugs in main-file include patching for stale preambles

Kadir Cetinkaya via Phabricator via cfe-commits cfe-commits at lists.llvm.org
Wed Feb 8 10:55:26 PST 2023


kadircet added inline comments.


================
Comment at: clang-tools-extra/clangd/Preamble.cpp:691
+        // it's coming from baseline preamble.
+        if (It->second)
+          PatchedInc = *It->second;
----------------
sammccall wrote:
> 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.
agreed. as discussed sent out D143597


Repository:
  rG LLVM Github Monorepo

CHANGES SINCE LAST ACTION
  https://reviews.llvm.org/D143197/new/

https://reviews.llvm.org/D143197



More information about the cfe-commits mailing list