diff --git a/clang/include/clang/Lex/HeaderSearch.h b/clang/include/clang/Lex/HeaderSearch.h index 347c4ecd29341..2e9c1f0329cf6 100644 --- a/clang/include/clang/Lex/HeaderSearch.h +++ b/clang/include/clang/Lex/HeaderSearch.h @@ -316,7 +316,7 @@ class HeaderSearch { std::unique_ptr IncludeAliases; /// This is a mapping from FileEntry -> HeaderMap, uniquing headermaps. - std::vector>> HeaderMaps; + std::vector>> HeaderMaps; /// The mapping between modules and headers. mutable ModuleMap ModMap; @@ -573,7 +573,7 @@ class HeaderSearch { /// This method returns a HeaderMap for the specified /// FileEntry, uniquing them through the 'HeaderMaps' datastructure. - const HeaderMap *CreateHeaderMap(const FileEntry *FE); + const HeaderMap *CreateHeaderMap(FileEntryRef FE); /// Get filenames for all registered header maps. void getHeaderMapFileNames(SmallVectorImpl &Names) const; diff --git a/clang/lib/Lex/HeaderSearch.cpp b/clang/lib/Lex/HeaderSearch.cpp index e7195cbe91413..4deabf2c49bb8 100644 --- a/clang/lib/Lex/HeaderSearch.cpp +++ b/clang/lib/Lex/HeaderSearch.cpp @@ -144,7 +144,7 @@ std::vector HeaderSearch::computeUserEntryUsage() const { /// CreateHeaderMap - This method returns a HeaderMap for the specified /// FileEntry, uniquing them through the 'HeaderMaps' datastructure. -const HeaderMap *HeaderSearch::CreateHeaderMap(const FileEntry *FE) { +const HeaderMap *HeaderSearch::CreateHeaderMap(FileEntryRef FE) { // We expect the number of headermaps to be small, and almost always empty. // If it ever grows, use of a linear search should be re-evaluated. if (!HeaderMaps.empty()) { @@ -167,7 +167,7 @@ const HeaderMap *HeaderSearch::CreateHeaderMap(const FileEntry *FE) { void HeaderSearch::getHeaderMapFileNames( SmallVectorImpl &Names) const { for (auto &HM : HeaderMaps) - Names.push_back(std::string(HM.first->getName())); + Names.push_back(std::string(HM.first.getName())); } std::string HeaderSearch::getCachedModuleFileName(Module *Module) { diff --git a/clang/lib/Lex/InitHeaderSearch.cpp b/clang/lib/Lex/InitHeaderSearch.cpp index 2aaaca89a6a3a..1f4c7a6d67b7f 100644 --- a/clang/lib/Lex/InitHeaderSearch.cpp +++ b/clang/lib/Lex/InitHeaderSearch.cpp @@ -167,7 +167,7 @@ bool InitHeaderSearch::AddUnmappedPath(const Twine &Path, IncludeDirGroup Group, // Check to see if this is an apple-style headermap (which are not allowed to // be frameworks). if (!isFramework) { - if (auto FE = FM.getFile(MappedPathStr)) { + if (auto FE = FM.getOptionalFileRef(MappedPathStr)) { if (const HeaderMap *HM = Headers.CreateHeaderMap(*FE)) { // It is a headermap, add it to the search path. IncludePath.emplace_back(