Skip to content

Commit

Permalink
[clang] NFCI: Use FileEntryRef in ModuleMap
Browse files Browse the repository at this point in the history
  • Loading branch information
jansvoboda11 committed Sep 9, 2023
1 parent c23d65b commit 37b0889
Show file tree
Hide file tree
Showing 3 changed files with 5 additions and 5 deletions.
4 changes: 2 additions & 2 deletions clang/include/clang/Lex/ModuleMap.h
Original file line number Diff line number Diff line change
Expand Up @@ -194,7 +194,7 @@ class ModuleMap {
}
};

using AdditionalModMapsSet = llvm::SmallPtrSet<const FileEntry *, 1>;
using AdditionalModMapsSet = llvm::SmallPtrSet<FileEntryRef, 1>;

private:
friend class ModuleMapParser;
Expand Down Expand Up @@ -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.
///
Expand Down
2 changes: 1 addition & 1 deletion clang/lib/Lex/ModuleMap.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -1339,7 +1339,7 @@ ModuleMap::canonicalizeModuleMapPath(SmallVectorImpl<char> &Path) {
}

void ModuleMap::addAdditionalModuleMapFile(const Module *M,
const FileEntry *ModuleMap) {
FileEntryRef ModuleMap) {
AdditionalModMaps[M].insert(ModuleMap);
}

Expand Down
4 changes: 2 additions & 2 deletions clang/lib/Serialization/ASTReader.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -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;
}
}
Expand Down

0 comments on commit 37b0889

Please sign in to comment.