mirror of
https://github.com/apple/swift.git
synced 2025-12-14 20:36:38 +01:00
Merge branch 'main' into allowable-serialization
This commit is contained in:
@@ -574,7 +574,7 @@ SerializedModuleLoaderBase::findModule(ImportPath::Element moduleID,
|
||||
SerializedModuleBaseName
|
||||
absoluteBaseName{currPath, targetSpecificBaseName};
|
||||
|
||||
if (!firstAbsoluteBaseName.hasValue())
|
||||
if (!firstAbsoluteBaseName.has_value())
|
||||
firstAbsoluteBaseName.emplace(absoluteBaseName);
|
||||
|
||||
auto result = findModuleFilesInDirectory(
|
||||
@@ -784,7 +784,7 @@ LoadedFile *SerializedModuleLoaderBase::loadAST(
|
||||
for (auto name: loadedModuleFile->getAllowableClientNames()) {
|
||||
M.addAllowableClientName(Ctx.getIdentifier(name));
|
||||
}
|
||||
auto diagLocOrInvalid = diagLoc.getValueOr(SourceLoc());
|
||||
auto diagLocOrInvalid = diagLoc.value_or(SourceLoc());
|
||||
loadInfo.status = loadedModuleFile->associateWithFileContext(
|
||||
fileUnit, diagLocOrInvalid, Ctx.LangOpts.AllowModuleWithCompilerErrors);
|
||||
|
||||
@@ -809,7 +809,7 @@ LoadedFile *SerializedModuleLoaderBase::loadAST(
|
||||
Ctx.bumpGeneration();
|
||||
LoadedModuleFiles.emplace_back(std::move(loadedModuleFile),
|
||||
Ctx.getCurrentGeneration());
|
||||
findOverlayFiles(diagLoc.getValueOr(SourceLoc()), &M, fileUnit);
|
||||
findOverlayFiles(diagLoc.value_or(SourceLoc()), &M, fileUnit);
|
||||
} else {
|
||||
fileUnit = nullptr;
|
||||
}
|
||||
@@ -836,7 +836,7 @@ LoadedFile *SerializedModuleLoaderBase::loadAST(
|
||||
// If the imported module was built with -experimental-hermetic-seal-at-link
|
||||
// but the current module isn't, error out.
|
||||
if (M.hasHermeticSealAtLink() && !Ctx.LangOpts.HermeticSealAtLink) {
|
||||
Ctx.Diags.diagnose(diagLoc.getValueOr(SourceLoc()),
|
||||
Ctx.Diags.diagnose(diagLoc.value_or(SourceLoc()),
|
||||
diag::need_hermetic_seal_to_import_module, M.getName());
|
||||
}
|
||||
|
||||
@@ -952,7 +952,7 @@ void swift::serialization::diagnoseSerializedASTLoadFailure(
|
||||
loadedModuleFile->getDependencies(),
|
||||
[](const ModuleFile::Dependency &next) {
|
||||
return next.isLoaded() &&
|
||||
!(next.Import.hasValue() &&
|
||||
!(next.Import.has_value() &&
|
||||
next.Import->importedModule->hasResolvedImports());
|
||||
});
|
||||
assert(circularDependencyIter !=
|
||||
@@ -1493,7 +1493,7 @@ void SerializedASTFile::lookupImportedSPIGroups(
|
||||
auto M = getParentModule();
|
||||
auto &imports = M->getASTContext().getImportCache();
|
||||
for (auto &dep : File.Dependencies) {
|
||||
if (!dep.Import.hasValue())
|
||||
if (!dep.Import.has_value())
|
||||
continue;
|
||||
|
||||
if (dep.Import->importedModule == importedModule ||
|
||||
|
||||
Reference in New Issue
Block a user