@@ -1468,12 +1468,12 @@ ClangModuleLoader *ASTContext::getDWARFModuleLoader() const {
1468
1468
}
1469
1469
1470
1470
ModuleDecl *ASTContext::getLoadedModule (
1471
- ArrayRef<std::pair <Identifier, SourceLoc >> ModulePath) const {
1471
+ ArrayRef<Located <Identifier>> ModulePath) const {
1472
1472
assert (!ModulePath.empty ());
1473
1473
1474
1474
// TODO: Swift submodules.
1475
1475
if (ModulePath.size () == 1 ) {
1476
- return getLoadedModule (ModulePath[0 ].first );
1476
+ return getLoadedModule (ModulePath[0 ].item );
1477
1477
}
1478
1478
return nullptr ;
1479
1479
}
@@ -1723,13 +1723,13 @@ bool ASTContext::shouldPerformTypoCorrection() {
1723
1723
return NumTypoCorrections <= LangOpts.TypoCorrectionLimit ;
1724
1724
}
1725
1725
1726
- bool ASTContext::canImportModule (std::pair <Identifier, SourceLoc > ModulePath) {
1726
+ bool ASTContext::canImportModule (Located <Identifier> ModulePath) {
1727
1727
// If this module has already been successfully imported, it is importable.
1728
1728
if (getLoadedModule (ModulePath) != nullptr )
1729
1729
return true ;
1730
1730
1731
1731
// 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 ))
1733
1733
return false ;
1734
1734
1735
1735
// Otherwise, ask the module loaders.
@@ -1739,20 +1739,20 @@ bool ASTContext::canImportModule(std::pair<Identifier, SourceLoc> ModulePath) {
1739
1739
}
1740
1740
}
1741
1741
1742
- FailedModuleImportNames.insert (ModulePath.first );
1742
+ FailedModuleImportNames.insert (ModulePath.item );
1743
1743
return false ;
1744
1744
}
1745
1745
1746
1746
ModuleDecl *
1747
- ASTContext::getModule (ArrayRef<std::pair <Identifier, SourceLoc >> ModulePath) {
1747
+ ASTContext::getModule (ArrayRef<Located <Identifier>> ModulePath) {
1748
1748
assert (!ModulePath.empty ());
1749
1749
1750
1750
if (auto *M = getLoadedModule (ModulePath))
1751
1751
return M;
1752
1752
1753
1753
auto moduleID = ModulePath[0 ];
1754
1754
for (auto &importer : getImpl ().ModuleLoaders ) {
1755
- if (ModuleDecl *M = importer->loadModule (moduleID.second , ModulePath)) {
1755
+ if (ModuleDecl *M = importer->loadModule (moduleID.loc , ModulePath)) {
1756
1756
return M;
1757
1757
}
1758
1758
}
@@ -1761,7 +1761,7 @@ ASTContext::getModule(ArrayRef<std::pair<Identifier, SourceLoc>> ModulePath) {
1761
1761
}
1762
1762
1763
1763
ModuleDecl *ASTContext::getModuleByName (StringRef ModuleName) {
1764
- SmallVector<std::pair <Identifier, SourceLoc >, 4 >
1764
+ SmallVector<Located <Identifier>, 4 >
1765
1765
AccessPath;
1766
1766
while (!ModuleName.empty ()) {
1767
1767
StringRef SubModuleName;
@@ -1778,7 +1778,7 @@ ModuleDecl *ASTContext::getStdlibModule(bool loadIfAbsent) {
1778
1778
if (loadIfAbsent) {
1779
1779
auto mutableThis = const_cast <ASTContext*>(this );
1780
1780
TheStdlibModule =
1781
- mutableThis->getModule ({ std::make_pair ( StdlibModuleName, SourceLoc ()) });
1781
+ mutableThis->getModule ({{ StdlibModuleName, SourceLoc () } });
1782
1782
} else {
1783
1783
TheStdlibModule = getLoadedModule (StdlibModuleName);
1784
1784
}
0 commit comments