[clang-tools-extra] [clangd] Don't ignore external HFI in `SymbolCollector` (PR #88446)

2024-04-11 Thread Jan Svoboda via cfe-commits

https://github.com/jansvoboda11 created 
https://github.com/llvm/llvm-project/pull/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.

>From 46dc5989793e234f078626519e0d6bffe79b5ffc Mon Sep 17 00:00:00 2001
From: Jan Svoboda 
Date: Thu, 11 Apr 2024 14:48:35 -0700
Subject: [PATCH] [clangd] Don't ignore external HFI

The `FileEntry` corresponds to a `FileID` containing the `SourceLocation` of a 
`NamedDecl` which (I think) might've been deserialized from a PCM file. 
Including external HeaderFileInfo here is most likely the right thing to do 
here in order to get the correct spelling.
---
 clang-tools-extra/clangd/index/SymbolCollector.cpp | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/clang-tools-extra/clangd/index/SymbolCollector.cpp 
b/clang-tools-extra/clangd/index/SymbolCollector.cpp
index 969f27af6fb1d8..5c4e2150cf3123 100644
--- a/clang-tools-extra/clangd/index/SymbolCollector.cpp
+++ b/clang-tools-extra/clangd/index/SymbolCollector.cpp
@@ -409,7 +409,7 @@ class SymbolCollector::HeaderFileURICache {
 // Framework headers are spelled as , not
 // "path/FrameworkName.framework/Headers/Foo.h".
 auto &HS = PP->getHeaderSearchInfo();
-if (const auto *HFI = HS.getExistingLocalFileInfo(*FE))
+if (const auto *HFI = HS.getExistingFileInfo(*FE))
   if (!HFI->Framework.empty())
 if (auto Spelling =
 getFrameworkHeaderIncludeSpelling(*FE, HFI->Framework, HS))

___
cfe-commits mailing list
cfe-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits


[clang-tools-extra] [clangd] Don't ignore external HFI in `SymbolCollector` (PR #88446)

2024-04-11 Thread via cfe-commits

llvmbot wrote:




@llvm/pr-subscribers-clang-tools-extra

Author: Jan Svoboda (jansvoboda11)


Changes

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.

---
Full diff: https://github.com/llvm/llvm-project/pull/88446.diff


1 Files Affected:

- (modified) clang-tools-extra/clangd/index/SymbolCollector.cpp (+1-1) 


``diff
diff --git a/clang-tools-extra/clangd/index/SymbolCollector.cpp 
b/clang-tools-extra/clangd/index/SymbolCollector.cpp
index 969f27af6fb1d8..5c4e2150cf3123 100644
--- a/clang-tools-extra/clangd/index/SymbolCollector.cpp
+++ b/clang-tools-extra/clangd/index/SymbolCollector.cpp
@@ -409,7 +409,7 @@ class SymbolCollector::HeaderFileURICache {
 // Framework headers are spelled as , not
 // "path/FrameworkName.framework/Headers/Foo.h".
 auto &HS = PP->getHeaderSearchInfo();
-if (const auto *HFI = HS.getExistingLocalFileInfo(*FE))
+if (const auto *HFI = HS.getExistingFileInfo(*FE))
   if (!HFI->Framework.empty())
 if (auto Spelling =
 getFrameworkHeaderIncludeSpelling(*FE, HFI->Framework, HS))

``




https://github.com/llvm/llvm-project/pull/88446
___
cfe-commits mailing list
cfe-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits


[clang-tools-extra] [clangd] Don't ignore external HFI in `SymbolCollector` (PR #88446)

2024-04-11 Thread David Goldman via cfe-commits

https://github.com/DavidGoldman approved this pull request.


https://github.com/llvm/llvm-project/pull/88446
___
cfe-commits mailing list
cfe-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits


[clang-tools-extra] [clangd] Don't ignore external HFI in `SymbolCollector` (PR #88446)

2024-04-11 Thread Jan Svoboda via cfe-commits

https://github.com/jansvoboda11 closed 
https://github.com/llvm/llvm-project/pull/88446
___
cfe-commits mailing list
cfe-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits