From 37b08892fc1ada83f09b4630190f8fb7346923cd Mon Sep 17 00:00:00 2001 From: Jan Svoboda Date: Sat, 9 Sep 2023 08:43:50 -0700 Subject: [PATCH] [clang] NFCI: Use `FileEntryRef` in `ModuleMap` --- clang/include/clang/Lex/ModuleMap.h | 4 ++-- clang/lib/Lex/ModuleMap.cpp | 2 +- clang/lib/Serialization/ASTReader.cpp | 4 ++-- 3 files changed, 5 insertions(+), 5 deletions(-) diff --git a/clang/include/clang/Lex/ModuleMap.h b/clang/include/clang/Lex/ModuleMap.h index 05f30dd2eaa373..a25a790e544e23 100644 --- a/clang/include/clang/Lex/ModuleMap.h +++ b/clang/include/clang/Lex/ModuleMap.h @@ -194,7 +194,7 @@ class ModuleMap { } }; - using AdditionalModMapsSet = llvm::SmallPtrSet; + using AdditionalModMapsSet = llvm::SmallPtrSet; private: friend class ModuleMapParser; @@ -653,7 +653,7 @@ class ModuleMap { return &I->second; } - void addAdditionalModuleMapFile(const Module *M, const FileEntry *ModuleMap); + void addAdditionalModuleMapFile(const Module *M, FileEntryRef ModuleMap); /// Resolve all of the unresolved exports in the given module. /// diff --git a/clang/lib/Lex/ModuleMap.cpp b/clang/lib/Lex/ModuleMap.cpp index 7a759a2039d158..39af2e8df106a6 100644 --- a/clang/lib/Lex/ModuleMap.cpp +++ b/clang/lib/Lex/ModuleMap.cpp @@ -1339,7 +1339,7 @@ ModuleMap::canonicalizeModuleMapPath(SmallVectorImpl &Path) { } void ModuleMap::addAdditionalModuleMapFile(const Module *M, - const FileEntry *ModuleMap) { + FileEntryRef ModuleMap) { AdditionalModMaps[M].insert(ModuleMap); } diff --git a/clang/lib/Serialization/ASTReader.cpp b/clang/lib/Serialization/ASTReader.cpp index 576da09095002b..0cfecddc198db5 100644 --- a/clang/lib/Serialization/ASTReader.cpp +++ b/clang/lib/Serialization/ASTReader.cpp @@ -4096,13 +4096,13 @@ ASTReader::ReadModuleMapFileBlock(RecordData &Record, ModuleFile &F, // Check any additional module map files (e.g. module.private.modulemap) // that are not in the pcm. if (auto *AdditionalModuleMaps = Map.getAdditionalModuleMapFiles(M)) { - for (const FileEntry *ModMap : *AdditionalModuleMaps) { + for (FileEntryRef ModMap : *AdditionalModuleMaps) { // Remove files that match // Note: SmallPtrSet::erase is really remove if (!AdditionalStoredMaps.erase(ModMap)) { if (!canRecoverFromOutOfDate(F.FileName, ClientLoadCapabilities)) Diag(diag::err_module_different_modmap) - << F.ModuleName << /*new*/0 << ModMap->getName(); + << F.ModuleName << /*new*/0 << ModMap.getName(); return OutOfDate; } }