Honor [exported] or lack thereof for the imports of serialized modules.

This should complete support for Swift-side export control.

Note that a TU's imports are still all "re-exported" (i.e. returned from
getReexportedModules) whether they are marked [exported] or not. This is
a convenient trick to get lookup in the main source file to look at all
imported modules, but if we allow real multi-TU compilation we'll have to
revisit this.

Swift SVN r7052
This commit is contained in:
Jordan Rose
2013-08-08 19:09:30 +00:00
parent a35f7cbd4b
commit 13e9e94059

View File

@@ -2206,8 +2206,9 @@ OperatorDecl *ModuleFile::lookupOperator(Identifier name, DeclKind fixity) {
void ModuleFile::getReexportedModules(
SmallVectorImpl<Module::ImportedModule> &results) {
// FIXME: Lock down on re-exports.
for (auto &dep : Dependencies) {
if (!dep.IsExported)
continue;
assert(dep.isLoaded());
results.push_back(dep.Import);
}