Skip to content

Commit 092a931

Browse files
committed
Serialization: Remove some unused code
Previous refactorings introducing GenericEnvironment left behind some lint.
1 parent 5ab94a6 commit 092a931

File tree

5 files changed

+8
-31
lines changed

5 files changed

+8
-31
lines changed

include/swift/Serialization/ModuleFormat.h

Lines changed: 6 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -54,7 +54,7 @@ const uint16_t VERSION_MAJOR = 0;
5454
/// in source control, you should also update the comment to briefly
5555
/// describe what change you made. The content of this comment isn't important;
5656
/// it just ensures a conflict if two people change the module format.
57-
const uint16_t VERSION_MINOR = 274; // Last change: SIL generic environment sugar
57+
const uint16_t VERSION_MINOR = 275; // Last change: remove some unused bits
5858

5959
using DeclID = PointerEmbeddedInt<unsigned, 31>;
6060
using DeclIDField = BCFixed<31>;
@@ -769,12 +769,11 @@ namespace decls_block {
769769

770770
using GenericTypeParamDeclLayout = BCRecordLayout<
771771
GENERIC_TYPE_PARAM_DECL,
772-
IdentifierIDField, // name
773-
DeclContextIDField,// context decl
774-
BCFixed<1>, // implicit flag
775-
BCVBR<4>, // depth
776-
BCVBR<4>, // index
777-
BCArray<TypeIDField> // inherited types
772+
IdentifierIDField, // name
773+
DeclContextIDField, // context decl
774+
BCFixed<1>, // implicit flag
775+
BCVBR<4>, // depth
776+
BCVBR<4> // index
778777
>;
779778

780779
using AssociatedTypeDeclLayout = BCRecordLayout<

lib/Serialization/Deserialization.cpp

Lines changed: 1 addition & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -2240,14 +2240,12 @@ Decl *ModuleFile::getDecl(DeclID DID, Optional<DeclContext *> ForcedContext) {
22402240
bool isImplicit;
22412241
unsigned depth;
22422242
unsigned index;
2243-
ArrayRef<uint64_t> rawInheritedIDs;
22442243

22452244
decls_block::GenericTypeParamDeclLayout::readRecord(scratch, nameID,
22462245
contextID,
22472246
isImplicit,
22482247
depth,
2249-
index,
2250-
rawInheritedIDs);
2248+
index);
22512249

22522250
auto DC = ForcedContext ? *ForcedContext : getDeclContext(contextID);
22532251

@@ -2264,12 +2262,6 @@ Decl *ModuleFile::getDecl(DeclID DID, Optional<DeclContext *> ForcedContext) {
22642262
if (isImplicit)
22652263
genericParam->setImplicit();
22662264

2267-
auto inherited = ctx.Allocate<TypeLoc>(rawInheritedIDs.size());
2268-
for_each(inherited, rawInheritedIDs, [this](TypeLoc &loc, uint64_t rawID) {
2269-
loc.setType(getType(rawID));
2270-
});
2271-
genericParam->setInherited(inherited);
2272-
genericParam->setCheckedInheritanceClause();
22732265
break;
22742266
}
22752267

lib/Serialization/SILFormat.h

Lines changed: 0 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -141,7 +141,6 @@ namespace sil_block {
141141
SIL_DEFAULT_WITNESS_TABLE,
142142
SIL_DEFAULT_WITNESS_TABLE_ENTRY,
143143
SIL_DEFAULT_WITNESS_TABLE_NO_ENTRY,
144-
SIL_GENERIC_OUTER_PARAMS,
145144
SIL_INST_WITNESS_METHOD,
146145
SIL_SPECIALIZE_ATTR,
147146

@@ -154,7 +153,6 @@ namespace sil_block {
154153
= decls_block::SPECIALIZED_PROTOCOL_CONFORMANCE,
155154
INHERITED_PROTOCOL_CONFORMANCE
156155
= decls_block::INHERITED_PROTOCOL_CONFORMANCE,
157-
GENERIC_PARAM_LIST = decls_block::GENERIC_PARAM_LIST,
158156
GENERIC_PARAM = decls_block::GENERIC_PARAM,
159157
GENERIC_REQUIREMENT = decls_block::GENERIC_REQUIREMENT,
160158
};
@@ -385,11 +383,6 @@ namespace sil_block {
385383
TypeIDField // Result type
386384
>;
387385

388-
using SILGenericOuterParamsLayout = BCRecordLayout<
389-
SIL_GENERIC_OUTER_PARAMS,
390-
DeclIDField // The decl id of the outer param if any.
391-
>;
392-
393386
using SILInstWitnessMethodLayout = BCRecordLayout<
394387
SIL_INST_WITNESS_METHOD,
395388
TypeIDField, // result type

lib/Serialization/Serialization.cpp

Lines changed: 1 addition & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -501,7 +501,6 @@ void Serializer::writeBlockInfoBlock() {
501501
BLOCK_RECORD(sil_block, SIL_DEFAULT_WITNESS_TABLE);
502502
BLOCK_RECORD(sil_block, SIL_DEFAULT_WITNESS_TABLE_ENTRY);
503503
BLOCK_RECORD(sil_block, SIL_DEFAULT_WITNESS_TABLE_NO_ENTRY);
504-
BLOCK_RECORD(sil_block, SIL_GENERIC_OUTER_PARAMS);
505504
BLOCK_RECORD(sil_block, SIL_INST_WITNESS_METHOD);
506505
BLOCK_RECORD(sil_block, SIL_SPECIALIZE_ATTR);
507506

@@ -2213,18 +2212,13 @@ void Serializer::writeDecl(const Decl *D) {
22132212

22142213
auto contextID = addDeclContextRef(genericParam->getDeclContext());
22152214

2216-
SmallVector<TypeID, 4> inheritedTypes;
2217-
for (auto inherited : genericParam->getInherited())
2218-
inheritedTypes.push_back(addTypeRef(inherited.getType()));
2219-
22202215
unsigned abbrCode = DeclTypeAbbrCodes[GenericTypeParamDeclLayout::Code];
22212216
GenericTypeParamDeclLayout::emitRecord(Out, ScratchRecord, abbrCode,
22222217
addIdentifierRef(genericParam->getName()),
22232218
contextID,
22242219
genericParam->isImplicit(),
22252220
genericParam->getDepth(),
2226-
genericParam->getIndex(),
2227-
inheritedTypes);
2221+
genericParam->getIndex());
22282222
break;
22292223
}
22302224

lib/Serialization/SerializeSIL.cpp

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1860,7 +1860,6 @@ void SILSerializer::writeSILBlock(const SILModule *SILMod) {
18601860
registerSILAbbr<DefaultWitnessTableLayout>();
18611861
registerSILAbbr<DefaultWitnessTableEntryLayout>();
18621862
registerSILAbbr<DefaultWitnessTableNoEntryLayout>();
1863-
registerSILAbbr<SILGenericOuterParamsLayout>();
18641863

18651864
registerSILAbbr<SILInstCastLayout>();
18661865
registerSILAbbr<SILInstWitnessMethodLayout>();

0 commit comments

Comments
 (0)