[clang] [clang-tools-extra] [clang][modules] Do not resolve `HeaderFileInfo` externally in `ASTWriter` (PR #87848)

Jan Svoboda via cfe-commits cfe-commits at lists.llvm.org
Tue Apr 9 15:51:16 PDT 2024


================
@@ -409,7 +409,7 @@ class SymbolCollector::HeaderFileURICache {
     // Framework headers are spelled as <FrameworkName/Foo.h>, not
     // "path/FrameworkName.framework/Headers/Foo.h".
     auto &HS = PP->getHeaderSearchInfo();
-    if (const auto *HFI = HS.getExistingFileInfo(*FE, /*WantExternal*/ false))
+    if (const auto *HFI = HS.getExistingFileInfo(*FE))
----------------
jansvoboda11 wrote:

I think that would be closer to the original semantics, but my feeling is that it's not correct. This `FileEntry` corresponds to a `FileID` containing the `SourceLocation` of a `NamedDecl` which (I think) might've been deserialized from a PCM file. So I think including external `HeaderFileInfo` here is the right thing to do.

https://github.com/llvm/llvm-project/pull/87848


More information about the cfe-commits mailing list