[clang][modules] Use FileEntryRef in ModuleMap (2/2)

This commit is contained in:
Jan Svoboda 2023-09-08 20:32:13 -07:00
parent 12cb98fe04
commit 12866a2b87
5 changed files with 8 additions and 8 deletions

View File

@ -516,7 +516,7 @@ public:
///
/// \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);

View File

@ -415,7 +415,7 @@ public:
}
/// 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<ModuleMapCallbacks> Callback) {

View File

@ -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.

View File

@ -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) {

View File

@ -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