diff --git a/clang/include/clang/Lex/HeaderSearch.h b/clang/include/clang/Lex/HeaderSearch.h index 533de59c5a061..6dbca6eec07fe 100644 --- a/clang/include/clang/Lex/HeaderSearch.h +++ b/clang/include/clang/Lex/HeaderSearch.h @@ -516,7 +516,7 @@ class HeaderSearch { /// /// \return false if \#including the file will have no effect or true /// if we should include it. - bool ShouldEnterIncludeFile(Preprocessor &PP, const FileEntry *File, + bool ShouldEnterIncludeFile(Preprocessor &PP, FileEntryRef File, bool isImport, bool ModulesEnabled, Module *M, bool &IsFirstIncludeOfFile); diff --git a/clang/include/clang/Lex/ModuleMap.h b/clang/include/clang/Lex/ModuleMap.h index 8b1ae6944f320..fc49742ad4af2 100644 --- a/clang/include/clang/Lex/ModuleMap.h +++ b/clang/include/clang/Lex/ModuleMap.h @@ -415,7 +415,7 @@ class ModuleMap { } /// Is this a compiler builtin header? - bool isBuiltinHeader(const FileEntry *File); + bool isBuiltinHeader(FileEntryRef File); /// Add a module map callback. void addModuleMapCallbacks(std::unique_ptr Callback) { diff --git a/clang/lib/Lex/HeaderSearch.cpp b/clang/lib/Lex/HeaderSearch.cpp index fc23bbf839334..e54a19ebfdbb8 100644 --- a/clang/lib/Lex/HeaderSearch.cpp +++ b/clang/lib/Lex/HeaderSearch.cpp @@ -1401,7 +1401,7 @@ void HeaderSearch::MarkFileModuleHeader(const FileEntry *FE, } bool HeaderSearch::ShouldEnterIncludeFile(Preprocessor &PP, - const FileEntry *File, bool isImport, + FileEntryRef File, bool isImport, bool ModulesEnabled, Module *M, bool &IsFirstIncludeOfFile) { ++NumIncluded; // Count # of attempted #includes. diff --git a/clang/lib/Lex/ModuleMap.cpp b/clang/lib/Lex/ModuleMap.cpp index 4d93a2d79be72..e8437572ebf4b 100644 --- a/clang/lib/Lex/ModuleMap.cpp +++ b/clang/lib/Lex/ModuleMap.cpp @@ -412,9 +412,9 @@ static StringRef sanitizeFilenameAsIdentifier(StringRef Name, return Name; } -bool ModuleMap::isBuiltinHeader(const FileEntry *File) { - return File->getDir() == BuiltinIncludeDir && LangOpts.BuiltinHeadersInSystemModules && - isBuiltinHeaderName(llvm::sys::path::filename(File->getName())); +bool ModuleMap::isBuiltinHeader(FileEntryRef File) { + return File.getDir() == BuiltinIncludeDir && LangOpts.BuiltinHeadersInSystemModules && + isBuiltinHeaderName(llvm::sys::path::filename(File.getName())); } ModuleMap::HeadersMap::iterator ModuleMap::findKnownHeader(FileEntryRef File) { diff --git a/clang/lib/Lex/PPDirectives.cpp b/clang/lib/Lex/PPDirectives.cpp index 7edcb0577c2b2..c3a191b09cb2f 100644 --- a/clang/lib/Lex/PPDirectives.cpp +++ b/clang/lib/Lex/PPDirectives.cpp @@ -2342,8 +2342,8 @@ Preprocessor::ImportAction Preprocessor::HandleHeaderIncludeOrImport( // Ask HeaderInfo if we should enter this #include file. If not, #including // this file will have no effect. if (Action == Enter && File && - !HeaderInfo.ShouldEnterIncludeFile(*this, &File->getFileEntry(), - EnterOnce, getLangOpts().Modules, SM, + !HeaderInfo.ShouldEnterIncludeFile(*this, *File, EnterOnce, + getLangOpts().Modules, SM, IsFirstIncludeOfFile)) { // C++ standard modules: // If we are not in the GMF, then we textually include only