aboutsummaryrefslogtreecommitdiff
path: root/clang/lib/Lex/HeaderSearch.cpp
diff options
context:
space:
mode:
authorJan Svoboda <jan_svoboda@apple.com>2023-05-30 21:24:51 -0700
committerJan Svoboda <jan_svoboda@apple.com>2023-05-30 21:42:01 -0700
commit3473f728b36e21d322f141e576377c20a02c9aad (patch)
tree3278ce83dac82e61a6adaca4e7c08e6accdb5de8 /clang/lib/Lex/HeaderSearch.cpp
parent9bd3ff8bf9e05e7bf95a4a068aa3b50813a93975 (diff)
downloadllvm-3473f728b36e21d322f141e576377c20a02c9aad.zip
llvm-3473f728b36e21d322f141e576377c20a02c9aad.tar.gz
llvm-3473f728b36e21d322f141e576377c20a02c9aad.tar.bz2
[clang][lex] NFCI: Use DirectoryEntryRef in HeaderSearch::LookupFile
This patch changes the argument type to `HeaderSearch::LookupFile()` from `const DirectoryEntry *` to `DirectoryEntryRef` in order to remove some calls to the deprecated `DirectoryEntry::getName()`. Depends on D127660. Reviewed By: bnbarham, benlangmuir Differential Revision: https://reviews.llvm.org/D127663
Diffstat (limited to 'clang/lib/Lex/HeaderSearch.cpp')
-rw-r--r--clang/lib/Lex/HeaderSearch.cpp10
1 files changed, 5 insertions, 5 deletions
diff --git a/clang/lib/Lex/HeaderSearch.cpp b/clang/lib/Lex/HeaderSearch.cpp
index 7df1ca1..3366f15 100644
--- a/clang/lib/Lex/HeaderSearch.cpp
+++ b/clang/lib/Lex/HeaderSearch.cpp
@@ -863,7 +863,7 @@ diagnoseFrameworkInclude(DiagnosticsEngine &Diags, SourceLocation IncludeLoc,
OptionalFileEntryRef HeaderSearch::LookupFile(
StringRef Filename, SourceLocation IncludeLoc, bool isAngled,
ConstSearchDirIterator FromDir, ConstSearchDirIterator *CurDirArg,
- ArrayRef<std::pair<const FileEntry *, const DirectoryEntry *>> Includers,
+ ArrayRef<std::pair<const FileEntry *, DirectoryEntryRef>> Includers,
SmallVectorImpl<char> *SearchPath, SmallVectorImpl<char> *RelativePath,
Module *RequestingModule, ModuleMap::KnownHeader *SuggestedModule,
bool *IsMapped, bool *IsFrameworkFound, bool SkipCache,
@@ -918,7 +918,7 @@ OptionalFileEntryRef HeaderSearch::LookupFile(
// Concatenate the requested file onto the directory.
// FIXME: Portability. Filename concatenation should be in sys::Path.
- TmpDir = IncluderAndDir.second->getName();
+ TmpDir = IncluderAndDir.second.getName();
TmpDir.push_back('/');
TmpDir.append(Filename.begin(), Filename.end());
@@ -957,7 +957,7 @@ OptionalFileEntryRef HeaderSearch::LookupFile(
ToHFI.Framework = Framework;
if (SearchPath) {
- StringRef SearchPathRef(IncluderAndDir.second->getName());
+ StringRef SearchPathRef(IncluderAndDir.second.getName());
SearchPath->clear();
SearchPath->append(SearchPathRef.begin(), SearchPathRef.end());
}
@@ -967,7 +967,7 @@ OptionalFileEntryRef HeaderSearch::LookupFile(
}
if (First) {
diagnoseFrameworkInclude(Diags, IncludeLoc,
- IncluderAndDir.second->getName(), Filename,
+ IncluderAndDir.second.getName(), Filename,
&FE->getFileEntry());
return FE;
}
@@ -1122,7 +1122,7 @@ OptionalFileEntryRef HeaderSearch::LookupFile(
bool FoundByHeaderMap = !IsMapped ? false : *IsMapped;
if (!Includers.empty())
diagnoseFrameworkInclude(
- Diags, IncludeLoc, Includers.front().second->getName(), Filename,
+ Diags, IncludeLoc, Includers.front().second.getName(), Filename,
&File->getFileEntry(), isAngled, FoundByHeaderMap);
// Remember this location for the next lookup we do.