mirror of
https://github.com/apple/swift.git
synced 2025-12-14 20:36:38 +01:00
[Serialization] Keep track of whether a module has an underlying Clang module.
Previously, we depended on whether or not a serialized module was located within a framework bundle to consider whether or not it may have a "Clang half". However, LLDB loads serialized modules from dSYM bundles. Rather than try to figure out if such a module is "really" a framework, just track whether the original module was built with -import-underlying-module. If so, consider the underlying Clang module to be re-exported. rdar://problem/18099523 Swift SVN r21544
This commit is contained in:
@@ -580,6 +580,7 @@ ModuleFile::ModuleFile(
|
||||
}
|
||||
|
||||
cursor.EnterSubBlock(INPUT_BLOCK_ID);
|
||||
bool seenFlags = false;
|
||||
|
||||
auto next = cursor.advance();
|
||||
while (next.Kind == llvm::BitstreamEntry::Record) {
|
||||
@@ -624,6 +625,14 @@ ModuleFile::ModuleFile(
|
||||
importedHeaderInfo.contents = blobData;
|
||||
break;
|
||||
}
|
||||
case input_block::MODULE_FLAGS: {
|
||||
assert(!seenFlags && "only one flags record allowed");
|
||||
bool hasUnderlyingModule;
|
||||
input_block::ModuleFlagsLayout::readRecord(scratch,
|
||||
hasUnderlyingModule);
|
||||
Bits.HasUnderlyingModule = hasUnderlyingModule;
|
||||
break;
|
||||
}
|
||||
default:
|
||||
// Unknown input kind, possibly for use by a future version of the
|
||||
// module format.
|
||||
@@ -865,7 +874,7 @@ bool ModuleFile::associateWithFileContext(FileUnit *file, SourceLoc diagLoc) {
|
||||
return false;
|
||||
}
|
||||
|
||||
if (Bits.IsFramework)
|
||||
if (Bits.HasUnderlyingModule)
|
||||
(void)getModule(FileContext->getParentModule()->Name);
|
||||
|
||||
return getStatus() == ModuleStatus::Valid;
|
||||
@@ -936,7 +945,7 @@ void ModuleFile::getImportedModules(
|
||||
Module::ImportFilter filter) {
|
||||
PrettyModuleFileDeserialization stackEntry(*this);
|
||||
bool includeShadowedModule = (filter != Module::ImportFilter::Private &&
|
||||
ShadowedModule && Bits.IsFramework);
|
||||
ShadowedModule && Bits.HasUnderlyingModule);
|
||||
|
||||
for (auto &dep : Dependencies) {
|
||||
if (filter != Module::ImportFilter::All &&
|
||||
|
||||
Reference in New Issue
Block a user