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

@@ -340,7 +340,7 @@ struct ModuleRebuildInfo {
/// normal cache, the prebuilt cache, a module adjacent to the interface, or
/// a module that we'll build from a module interface.
class ModuleInterfaceLoaderImpl {
using AccessPathElem = std::pair<Identifier, SourceLoc>;
using AccessPathElem = Located<Identifier>;
friend class swift::ModuleInterfaceLoader;
ASTContext &ctx;
llvm::vfs::FileSystem &fs;
@@ -1020,10 +1020,10 @@ std::error_code ModuleInterfaceLoader::findModuleFilesInDirectory(
}
// Create an instance of the Impl to do the heavy lifting.
auto ModuleName = ModuleID.first.str();
auto ModuleName = ModuleID.item.str();
ModuleInterfaceLoaderImpl Impl(
Ctx, ModPath, InPath, ModuleName,
CacheDir, PrebuiltCacheDir, ModuleID.second,
CacheDir, PrebuiltCacheDir, ModuleID.loc,
RemarkOnRebuildFromInterface, dependencyTracker,
llvm::is_contained(PreferInterfaceForModules,
ModuleName) ?