Merge remote-tracking branch 'origin/master' into master-next

This commit is contained in:
swift-ci
2018-04-27 05:28:59 -07:00
14 changed files with 113 additions and 151 deletions

View File

@@ -1136,7 +1136,6 @@ ModuleFile::ModuleFile(
}
cursor.EnterSubBlock(INPUT_BLOCK_ID);
bool seenFlags = false;
auto next = cursor.advance();
while (next.Kind == llvm::BitstreamEntry::Record) {
@@ -1177,15 +1176,6 @@ ModuleFile::ModuleFile(
importedHeaderInfo.contents = blobData;
break;
}
case input_block::MODULE_FLAGS: {
assert(!seenFlags && "only one flags record allowed");
seenFlags = true;
bool hasUnderlyingModule;
input_block::ModuleFlagsLayout::readRecord(scratch,
hasUnderlyingModule);
Bits.HasUnderlyingModule = hasUnderlyingModule;
break;
}
case input_block::SEARCH_PATH: {
bool isFramework;
bool isSystem;
@@ -1441,11 +1431,6 @@ Status ModuleFile::associateWithFileContext(FileUnit *file,
continue;
}
// This is for backwards-compatibility with modules that still rely on the
// "HasUnderlyingModule" flag.
if (Bits.HasUnderlyingModule && module == ShadowedModule)
dependency.forceExported();
if (scopePath.empty()) {
dependency.Import = { {}, module };
} else {
@@ -1599,9 +1584,26 @@ void ModuleFile::getImportedModules(
PrettyStackTraceModuleFile stackEntry(*this);
for (auto &dep : Dependencies) {
if (filter != ModuleDecl::ImportFilter::All &&
(filter == ModuleDecl::ImportFilter::Public) ^ dep.isExported())
continue;
switch (filter) {
case ModuleDecl::ImportFilter::All:
// We're including all imports.
break;
case ModuleDecl::ImportFilter::Private:
// Skip @_exported imports.
if (dep.isExported())
continue;
break;
case ModuleDecl::ImportFilter::Public:
// Only include @_exported imports.
if (!dep.isExported())
continue;
break;
}
assert(dep.isLoaded());
results.push_back(dep.Import);
}