@@ -1468,12 +1468,12 @@ ClangModuleLoader *ASTContext::getDWARFModuleLoader() const {
14681468}
14691469
14701470ModuleDecl *ASTContext::getLoadedModule (
1471- ArrayRef<std::pair <Identifier, SourceLoc >> ModulePath) const {
1471+ ArrayRef<Located <Identifier>> ModulePath) const {
14721472 assert (!ModulePath.empty ());
14731473
14741474 // TODO: Swift submodules.
14751475 if (ModulePath.size () == 1 ) {
1476- return getLoadedModule (ModulePath[0 ].first );
1476+ return getLoadedModule (ModulePath[0 ].item );
14771477 }
14781478 return nullptr ;
14791479}
@@ -1723,13 +1723,13 @@ bool ASTContext::shouldPerformTypoCorrection() {
17231723 return NumTypoCorrections <= LangOpts.TypoCorrectionLimit ;
17241724}
17251725
1726- bool ASTContext::canImportModule (std::pair <Identifier, SourceLoc > ModulePath) {
1726+ bool ASTContext::canImportModule (Located <Identifier> ModulePath) {
17271727 // If this module has already been successfully imported, it is importable.
17281728 if (getLoadedModule (ModulePath) != nullptr )
17291729 return true ;
17301730
17311731 // If we've failed loading this module before, don't look for it again.
1732- if (FailedModuleImportNames.count (ModulePath.first ))
1732+ if (FailedModuleImportNames.count (ModulePath.item ))
17331733 return false ;
17341734
17351735 // Otherwise, ask the module loaders.
@@ -1739,20 +1739,20 @@ bool ASTContext::canImportModule(std::pair<Identifier, SourceLoc> ModulePath) {
17391739 }
17401740 }
17411741
1742- FailedModuleImportNames.insert (ModulePath.first );
1742+ FailedModuleImportNames.insert (ModulePath.item );
17431743 return false ;
17441744}
17451745
17461746ModuleDecl *
1747- ASTContext::getModule (ArrayRef<std::pair <Identifier, SourceLoc >> ModulePath) {
1747+ ASTContext::getModule (ArrayRef<Located <Identifier>> ModulePath) {
17481748 assert (!ModulePath.empty ());
17491749
17501750 if (auto *M = getLoadedModule (ModulePath))
17511751 return M;
17521752
17531753 auto moduleID = ModulePath[0 ];
17541754 for (auto &importer : getImpl ().ModuleLoaders ) {
1755- if (ModuleDecl *M = importer->loadModule (moduleID.second , ModulePath)) {
1755+ if (ModuleDecl *M = importer->loadModule (moduleID.loc , ModulePath)) {
17561756 return M;
17571757 }
17581758 }
@@ -1761,7 +1761,7 @@ ASTContext::getModule(ArrayRef<std::pair<Identifier, SourceLoc>> ModulePath) {
17611761}
17621762
17631763ModuleDecl *ASTContext::getModuleByName (StringRef ModuleName) {
1764- SmallVector<std::pair <Identifier, SourceLoc >, 4 >
1764+ SmallVector<Located <Identifier>, 4 >
17651765 AccessPath;
17661766 while (!ModuleName.empty ()) {
17671767 StringRef SubModuleName;
@@ -1778,7 +1778,7 @@ ModuleDecl *ASTContext::getStdlibModule(bool loadIfAbsent) {
17781778 if (loadIfAbsent) {
17791779 auto mutableThis = const_cast <ASTContext*>(this );
17801780 TheStdlibModule =
1781- mutableThis->getModule ({ std::make_pair ( StdlibModuleName, SourceLoc ()) });
1781+ mutableThis->getModule ({{ StdlibModuleName, SourceLoc () } });
17821782 } else {
17831783 TheStdlibModule = getLoadedModule (StdlibModuleName);
17841784 }
0 commit comments