mirror of
https://github.com/apple/swift.git
synced 2025-12-14 20:36:38 +01:00
Converting ModuleDecl::ImportedModule from std::pair to a dedicated struct. (#31360)
This commit is contained in:
@@ -47,9 +47,9 @@ version::Version swift::InterfaceFormatVersion({1, 0});
|
||||
static void diagnoseScopedImports(DiagnosticEngine &diags,
|
||||
ArrayRef<ModuleDecl::ImportedModule> imports){
|
||||
for (const ModuleDecl::ImportedModule &importPair : imports) {
|
||||
if (importPair.first.empty())
|
||||
if (importPair.accessPath.empty())
|
||||
continue;
|
||||
diags.diagnose(importPair.first.front().Loc,
|
||||
diags.diagnose(importPair.accessPath.front().Loc,
|
||||
diag::module_interface_scoped_import_unsupported);
|
||||
}
|
||||
}
|
||||
@@ -115,10 +115,11 @@ static void printImports(raw_ostream &out,
|
||||
M->getImportedModules(publicImports, ModuleDecl::ImportFilterKind::Public);
|
||||
llvm::SmallSet<ModuleDecl::ImportedModule, 8,
|
||||
ModuleDecl::OrderImportedModules> publicImportSet;
|
||||
|
||||
publicImportSet.insert(publicImports.begin(), publicImports.end());
|
||||
|
||||
for (auto import : allImports) {
|
||||
auto importedModule = import.second;
|
||||
auto importedModule = import.importedModule;
|
||||
if (importedModule->isOnoneSupportModule() ||
|
||||
importedModule->isBuiltinModule()) {
|
||||
continue;
|
||||
@@ -140,9 +141,9 @@ static void printImports(raw_ostream &out,
|
||||
|
||||
// Write the access path we should be honoring but aren't.
|
||||
// (See diagnoseScopedImports above.)
|
||||
if (!import.first.empty()) {
|
||||
if (!import.accessPath.empty()) {
|
||||
out << "/*";
|
||||
for (const auto &accessPathElem : import.first)
|
||||
for (const auto &accessPathElem : import.accessPath)
|
||||
out << "." << accessPathElem.Item;
|
||||
out << "*/";
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user