From fc76b4ad3da3c1f5fdc34370a55d613b3ca7af73 Mon Sep 17 00:00:00 2001 From: Richard Smith Date: Fri, 17 Apr 2020 16:23:41 -0700 Subject: Rename IsMissingRequirement to IsUnimportable and set it for shadowed modules too. This more accurately reflects the semantics of this flag, as distinct from "IsAvailable", which (in an explicit modules world) only describes whether a module is buildable, not whether it's importable. --- clang/lib/Lex/ModuleMap.cpp | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) (limited to 'clang/lib/Lex/ModuleMap.cpp') diff --git a/clang/lib/Lex/ModuleMap.cpp b/clang/lib/Lex/ModuleMap.cpp index bff4e11..2c79bb2 100644 --- a/clang/lib/Lex/ModuleMap.cpp +++ b/clang/lib/Lex/ModuleMap.cpp @@ -282,7 +282,7 @@ void ModuleMap::resolveHeader(Module *Mod, // resolved. (Such a module still can't be built though, except from // preprocessed source.) if (!Header.Size && !Header.ModTime) - Mod->markUnavailable(); + Mod->markUnavailable(/*Unimportable=*/false); } } @@ -1094,7 +1094,7 @@ Module *ModuleMap::createShadowedModule(StringRef Name, bool IsFramework, new Module(Name, SourceLocation(), /*Parent=*/nullptr, IsFramework, /*IsExplicit=*/false, NumCreatedModules++); Result->ShadowingModule = ShadowingModule; - Result->IsAvailable = false; + Result->markUnavailable(/*Unimportable*/true); ModuleScopeIDs[Result] = CurrentModuleScopeID; ShadowModules.push_back(Result); @@ -2096,9 +2096,9 @@ void ModuleMapParser::parseModuleDecl() { // If the module meets all requirements but is still unavailable, mark the // whole tree as unavailable to prevent it from building. - if (!ActiveModule->IsAvailable && !ActiveModule->IsMissingRequirement && + if (!ActiveModule->IsAvailable && !ActiveModule->IsUnimportable && ActiveModule->Parent) { - ActiveModule->getTopLevelModule()->markUnavailable(); + ActiveModule->getTopLevelModule()->markUnavailable(/*Unimportable=*/false); ActiveModule->getTopLevelModule()->MissingHeaders.append( ActiveModule->MissingHeaders.begin(), ActiveModule->MissingHeaders.end()); } -- cgit v1.1