SR-11889: Using Located<T> instead of std::pair<SourceLoc, T>

This commit is contained in:
Kita, Maksim
2019-12-08 22:51:48 +03:00
parent 06014e6226
commit b7cb3b67bf
38 changed files with 209 additions and 171 deletions

View File

@@ -68,7 +68,7 @@ bool swift::emitImportedModules(ASTContext &Context, ModuleDecl *mainModule,
auto accessPath = ID->getModulePath();
// only the top-level name is needed (i.e. A in A.B.C)
Modules.insert(accessPath[0].first.str());
Modules.insert(accessPath[0].item.str());
}
// And now look in the C code we're possibly using.
@@ -98,8 +98,7 @@ bool swift::emitImportedModules(ASTContext &Context, ModuleDecl *mainModule,
}
if (opts.ImportUnderlyingModule) {
auto underlyingModule = clangImporter->loadModule(
SourceLoc(), std::make_pair(mainModule->getName(), SourceLoc()));
auto underlyingModule = clangImporter->loadModule(SourceLoc(), {{ mainModule->getName(), SourceLoc() }});
if (!underlyingModule) {
Context.Diags.diagnose(SourceLoc(),
diag::error_underlying_module_not_found,