Skip to content

Commit 2126fea

Browse files
committed
[clangd] Don't ignore external HFI in SymbolCollector (llvm#88446)
The `FileEntry` corresponds to a `FileID` containing the `SourceLocation` of a `NamedDecl` which (I think) might've been deserialized from a PCM file. Considering external `HeaderFileInfo` here is most likely the right thing to do here in order to get the correct spelling in case the current compiler instance has not register this file as a header yet. (cherry picked from commit 95fbd8d)
1 parent 91b0501 commit 2126fea

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

clang-tools-extra/clangd/index/SymbolCollector.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -440,7 +440,7 @@ class SymbolCollector::HeaderFileURICache {
440440
// Framework headers are spelled as <FrameworkName/Foo.h>, not
441441
// "path/FrameworkName.framework/Headers/Foo.h".
442442
auto &HS = PP->getHeaderSearchInfo();
443-
if (const auto *HFI = HS.getExistingLocalFileInfo(*FE))
443+
if (const auto *HFI = HS.getExistingFileInfo(*FE))
444444
if (!HFI->Framework.empty())
445445
if (auto Spelling =
446446
getFrameworkHeaderIncludeSpelling(*FE, HFI->Framework, HS))

0 commit comments

Comments
 (0)