From 1b07d4329880c98f313da426272be5cf50c0768d Mon Sep 17 00:00:00 2001 From: Jan Svoboda Date: Sun, 10 Sep 2023 11:15:59 -0700 Subject: [clang] NFCI: Use `FileEntryRef` in `ModuleMap::InferredModuleAllowedBy` --- clang/lib/Lex/ModuleMap.cpp | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) (limited to 'clang/lib/Lex/ModuleMap.cpp') diff --git a/clang/lib/Lex/ModuleMap.cpp b/clang/lib/Lex/ModuleMap.cpp index b4483cd..bee3a48 100644 --- a/clang/lib/Lex/ModuleMap.cpp +++ b/clang/lib/Lex/ModuleMap.cpp @@ -622,7 +622,7 @@ ModuleMap::findOrCreateModuleForHeaderInUmbrellaDir(FileEntryRef File) { UmbrellaModule = UmbrellaModule->Parent; if (UmbrellaModule->InferSubmodules) { - OptionalFileEntryRefDegradesToFileEntryPtr UmbrellaModuleMap = + OptionalFileEntryRef UmbrellaModuleMap = getModuleMapFileForUniquing(UmbrellaModule); // Infer submodules for each of the directories we found between @@ -993,7 +993,7 @@ Module *ModuleMap::inferFrameworkModule(DirectoryEntryRef FrameworkDir, // If the framework has a parent path from which we're allowed to infer // a framework module, do so. - const FileEntry *ModuleMapFile = nullptr; + OptionalFileEntryRef ModuleMapFile; if (!Parent) { // Determine whether we're allowed to infer a module map. bool canInfer = false; @@ -1294,13 +1294,13 @@ OptionalFileEntryRef ModuleMap::getModuleMapFileForUniquing(const Module *M) const { if (M->IsInferred) { assert(InferredModuleAllowedBy.count(M) && "missing inferred module map"); - // FIXME: Update InferredModuleAllowedBy to use FileEntryRef. - return InferredModuleAllowedBy.find(M)->second->getLastRef(); + return InferredModuleAllowedBy.find(M)->second; } return getContainingModuleMapFile(M); } -void ModuleMap::setInferredModuleAllowedBy(Module *M, const FileEntry *ModMap) { +void ModuleMap::setInferredModuleAllowedBy(Module *M, + OptionalFileEntryRef ModMap) { assert(M->IsInferred && "module not inferred"); InferredModuleAllowedBy[M] = ModMap; } -- cgit v1.1