Skip to content

Commit

Permalink
[clang] NFCI: Use FileEntryRef in diagnoseFrameworkInclude()
Browse files Browse the repository at this point in the history
  • Loading branch information
jansvoboda11 committed Sep 9, 2023
1 parent 119c489 commit ef99617
Showing 1 changed file with 6 additions and 6 deletions.
12 changes: 6 additions & 6 deletions clang/lib/Lex/HeaderSearch.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand All @@ -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) {
Expand Down Expand Up @@ -965,7 +965,7 @@ OptionalFileEntryRef HeaderSearch::LookupFile(
if (First) {
diagnoseFrameworkInclude(Diags, IncludeLoc,
IncluderAndDir.second.getName(), Filename,
&FE->getFileEntry());
*FE);
return FE;
}

Expand Down Expand Up @@ -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);
Expand Down

0 comments on commit ef99617

Please sign in to comment.