Skip to content

Commit 4d7950a

Browse files
committed
Serialization: Remove obsolete 'HasUnderlyingModule' hack
1 parent 8408f82 commit 4d7950a

File tree

4 files changed

+1
-30
lines changed

4 files changed

+1
-30
lines changed

include/swift/Serialization/ModuleFile.h

Lines changed: 0 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -156,8 +156,6 @@ class ModuleFile
156156
bool isHeader() const { return IsHeader; }
157157
bool isScoped() const { return IsScoped; }
158158

159-
void forceExported() { IsExported = true; }
160-
161159
std::string getPrettyPrintedPath() const;
162160
};
163161

@@ -399,12 +397,6 @@ class ModuleFile
399397
/// Whether this module file comes from a framework.
400398
unsigned IsFramework : 1;
401399

402-
/// THIS SETTING IS OBSOLETE BUT IS STILL USED BY OLDER MODULES.
403-
///
404-
/// Whether this module has a shadowed module that's part of its public
405-
/// interface.
406-
unsigned HasUnderlyingModule : 1;
407-
408400
/// Whether or not ImportDecls is valid.
409401
unsigned ComputedImportDecls : 1;
410402

include/swift/Serialization/ModuleFormat.h

Lines changed: 1 addition & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -583,7 +583,7 @@ namespace input_block {
583583
LINK_LIBRARY,
584584
IMPORTED_HEADER,
585585
IMPORTED_HEADER_CONTENTS,
586-
MODULE_FLAGS,
586+
MODULE_FLAGS, // [unused]
587587
SEARCH_PATH
588588
};
589589

@@ -616,11 +616,6 @@ namespace input_block {
616616
BCBlob
617617
>;
618618

619-
using ModuleFlagsLayout = BCRecordLayout<
620-
MODULE_FLAGS,
621-
BCFixed<1> // has underlying module? [[UNUSED]]
622-
>;
623-
624619
using SearchPathLayout = BCRecordLayout<
625620
SEARCH_PATH,
626621
BCFixed<1>, // framework?

lib/Serialization/ModuleFile.cpp

Lines changed: 0 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -1128,7 +1128,6 @@ ModuleFile::ModuleFile(
11281128
}
11291129

11301130
cursor.EnterSubBlock(INPUT_BLOCK_ID);
1131-
bool seenFlags = false;
11321131

11331132
auto next = cursor.advance();
11341133
while (next.Kind == llvm::BitstreamEntry::Record) {
@@ -1169,15 +1168,6 @@ ModuleFile::ModuleFile(
11691168
importedHeaderInfo.contents = blobData;
11701169
break;
11711170
}
1172-
case input_block::MODULE_FLAGS: {
1173-
assert(!seenFlags && "only one flags record allowed");
1174-
seenFlags = true;
1175-
bool hasUnderlyingModule;
1176-
input_block::ModuleFlagsLayout::readRecord(scratch,
1177-
hasUnderlyingModule);
1178-
Bits.HasUnderlyingModule = hasUnderlyingModule;
1179-
break;
1180-
}
11811171
case input_block::SEARCH_PATH: {
11821172
bool isFramework;
11831173
bool isSystem;
@@ -1433,11 +1423,6 @@ Status ModuleFile::associateWithFileContext(FileUnit *file,
14331423
continue;
14341424
}
14351425

1436-
// This is for backwards-compatibility with modules that still rely on the
1437-
// "HasUnderlyingModule" flag.
1438-
if (Bits.HasUnderlyingModule && module == ShadowedModule)
1439-
dependency.forceExported();
1440-
14411426
if (scopePath.empty()) {
14421427
dependency.Import = { {}, module };
14431428
} else {

lib/Serialization/Serialization.cpp

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1043,7 +1043,6 @@ void Serializer::writeInputBlock(const SerializationOptions &options) {
10431043
input_block::LinkLibraryLayout LinkLibrary(Out);
10441044
input_block::ImportedHeaderLayout ImportedHeader(Out);
10451045
input_block::ImportedHeaderContentsLayout ImportedHeaderContents(Out);
1046-
input_block::ModuleFlagsLayout ModuleFlags(Out);
10471046
input_block::SearchPathLayout SearchPath(Out);
10481047

10491048
if (options.SerializeOptionsForDebugging) {

0 commit comments

Comments
 (0)