aboutsummaryrefslogtreecommitdiff
path: root/clang/lib/Lex/ModuleMap.cpp
diff options
context:
space:
mode:
authorJan Svoboda <jan_svoboda@apple.com>2023-09-10 11:15:59 -0700
committerJan Svoboda <jan_svoboda@apple.com>2023-09-13 13:32:26 -0700
commit1b07d4329880c98f313da426272be5cf50c0768d (patch)
tree16df652c1040e2fb14ff286fd1e48ae5ca47cc51 /clang/lib/Lex/ModuleMap.cpp
parent86735a4353aee4a3ba1e2feea173a7cc659c7a60 (diff)
downloadllvm-1b07d4329880c98f313da426272be5cf50c0768d.zip
llvm-1b07d4329880c98f313da426272be5cf50c0768d.tar.gz
llvm-1b07d4329880c98f313da426272be5cf50c0768d.tar.bz2
[clang] NFCI: Use `FileEntryRef` in `ModuleMap::InferredModuleAllowedBy`
Diffstat (limited to 'clang/lib/Lex/ModuleMap.cpp')
-rw-r--r--clang/lib/Lex/ModuleMap.cpp10
1 files changed, 5 insertions, 5 deletions
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;
}