[clang] ef99617 - [clang] NFCI: Use `FileEntryRef` in `diagnoseFrameworkInclude()`
Jan Svoboda via cfe-commits
cfe-commits at lists.llvm.org
Sat Sep 9 09:12:41 PDT 2023
Author: Jan Svoboda
Date: 2023-09-09T09:12:35-07:00
New Revision: ef996175a7d38f7b4a0b60264dc861ab36376a47
URL: https://github.com/llvm/llvm-project/commit/ef996175a7d38f7b4a0b60264dc861ab36376a47
DIFF: https://github.com/llvm/llvm-project/commit/ef996175a7d38f7b4a0b60264dc861ab36376a47.diff
LOG: [clang] NFCI: Use `FileEntryRef` in `diagnoseFrameworkInclude()`
Added:
Modified:
clang/lib/Lex/HeaderSearch.cpp
Removed:
################################################################################
diff --git a/clang/lib/Lex/HeaderSearch.cpp b/clang/lib/Lex/HeaderSearch.cpp
index f5f4bbf85fa92c2..ec7cb583b6f810c 100644
--- a/clang/lib/Lex/HeaderSearch.cpp
+++ b/clang/lib/Lex/HeaderSearch.cpp
@@ -818,7 +818,7 @@ static bool isFrameworkStylePath(StringRef Path, bool &IsPrivateHeader,
static void
diagnoseFrameworkInclude(DiagnosticsEngine &Diags, SourceLocation IncludeLoc,
StringRef Includer, StringRef IncludeFilename,
- const FileEntry *IncludeFE, bool isAngled = false,
+ FileEntryRef IncludeFE, bool isAngled = false,
bool FoundByHeaderMap = false) {
bool IsIncluderPrivateHeader = false;
SmallString<128> FromFramework, ToFramework;
@@ -828,7 +828,7 @@ diagnoseFrameworkInclude(DiagnosticsEngine &Diags, SourceLocation IncludeLoc,
return;
bool IsIncludeePrivateHeader = false;
bool IsIncludeeInFramework =
- isFrameworkStylePath(IncludeFE->getName(), IsIncludeePrivateHeader,
+ isFrameworkStylePath(IncludeFE.getName(), IsIncludeePrivateHeader,
ToFramework, ToIncludeSpelling);
if (!isAngled && !FoundByHeaderMap) {
@@ -965,7 +965,7 @@ OptionalFileEntryRef HeaderSearch::LookupFile(
if (First) {
diagnoseFrameworkInclude(Diags, IncludeLoc,
IncluderAndDir.second.getName(), Filename,
- &FE->getFileEntry());
+ *FE);
return FE;
}
@@ -1119,9 +1119,9 @@ OptionalFileEntryRef HeaderSearch::LookupFile(
bool FoundByHeaderMap = !IsMapped ? false : *IsMapped;
if (!Includers.empty())
- diagnoseFrameworkInclude(
- Diags, IncludeLoc, Includers.front().second.getName(), Filename,
- &File->getFileEntry(), isAngled, FoundByHeaderMap);
+ diagnoseFrameworkInclude(Diags, IncludeLoc,
+ Includers.front().second.getName(), Filename,
+ *File, isAngled, FoundByHeaderMap);
// Remember this location for the next lookup we do.
cacheLookupSuccess(CacheLookup, It, IncludeLoc);
More information about the cfe-commits
mailing list