mirror of
https://github.com/apple/swift.git
synced 2025-12-21 12:14:44 +01:00
[serialization] Serialize import access paths, and only the TU's own imports.
Previously, a module contained references to every module listed in the ASTContext. Now, we actually only encode the imports from the TU itself, which allows us to include access paths for scoped imports. This is necessary to implement proper name lookup shadowing rules. Swift SVN r7013
This commit is contained in:
@@ -179,20 +179,21 @@ Module *SerializedModuleLoader::loadModule(SourceLoc importLoc,
|
||||
loadedModuleFile->getDependencies().end(),
|
||||
std::back_inserter(missing),
|
||||
[](const ModuleFile::Dependency &dependency) {
|
||||
return dependency.Mod == nullptr;
|
||||
return !dependency.isLoaded();
|
||||
});
|
||||
|
||||
// FIXME: only show module part of RawAccessPath
|
||||
assert(!missing.empty() && "unknown missing dependency?");
|
||||
if (missing.size() == 1) {
|
||||
Ctx.Diags.diagnose(moduleID.second,
|
||||
diag::serialization_missing_single_dependency,
|
||||
missing.front().Name);
|
||||
missing.front().RawAccessPath);
|
||||
} else {
|
||||
llvm::SmallString<64> missingNames;
|
||||
missingNames += '\'';
|
||||
interleave(missing,
|
||||
[&](const ModuleFile::Dependency &next) {
|
||||
missingNames += next.Name;
|
||||
missingNames += next.RawAccessPath;
|
||||
},
|
||||
[&] { missingNames += "', '"; });
|
||||
missingNames += '\'';
|
||||
|
||||
Reference in New Issue
Block a user