Skip to content

Commit 1df8ef7

Browse files
committed
[Serialization] ProtocolLayout: Serialize superclass
1 parent 755f260 commit 1df8ef7

File tree

3 files changed

+7
-1
lines changed

3 files changed

+7
-1
lines changed

lib/Serialization/Deserialization.cpp

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4423,13 +4423,15 @@ class DeclDeserializer {
44234423
IdentifierID nameID;
44244424
DeclContextID contextID;
44254425
bool isImplicit, isClassBounded, isObjC, hasSelfOrAssocTypeRequirements;
4426+
TypeID superclassID;
44264427
uint8_t rawAccessLevel;
44274428
unsigned numInheritedTypes;
44284429
ArrayRef<uint64_t> rawInheritedAndDependencyIDs;
44294430

44304431
decls_block::ProtocolLayout::readRecord(scratch, nameID, contextID,
44314432
isImplicit, isClassBounded, isObjC,
44324433
hasSelfOrAssocTypeRequirements,
4434+
superclassID,
44334435
rawAccessLevel, numInheritedTypes,
44344436
rawInheritedAndDependencyIDs);
44354437

@@ -4455,6 +4457,8 @@ class DeclDeserializer {
44554457
/*TrailingWhere=*/nullptr);
44564458
declOrOffset = proto;
44574459

4460+
proto->setSuperclass(MF.getType(superclassID));
4461+
44584462
ctx.evaluator.cacheOutput(ProtocolRequiresClassRequest{proto},
44594463
std::move(isClassBounded));
44604464
ctx.evaluator.cacheOutput(HasSelfOrAssociatedTypeRequirementsRequest{proto},

lib/Serialization/ModuleFormat.h

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -58,7 +58,7 @@ const uint16_t SWIFTMODULE_VERSION_MAJOR = 0;
5858
/// describe what change you made. The content of this comment isn't important;
5959
/// it just ensures a conflict if two people change the module format.
6060
/// Don't worry about adhering to the 80-column limit for this line.
61-
const uint16_t SWIFTMODULE_VERSION_MINOR = 855; // ref_adhoc_requirement_witness attributes are back
61+
const uint16_t SWIFTMODULE_VERSION_MINOR = 857; // Add superclass to protocol layout
6262

6363
/// A standard hash seed used for all string hashes in a serialized module.
6464
///
@@ -1527,6 +1527,7 @@ namespace decls_block {
15271527
BCFixed<1>, // class-bounded?
15281528
BCFixed<1>, // objc?
15291529
BCFixed<1>, // existential-type-supported?
1530+
TypeIDField, // superclass
15301531
AccessLevelField, // access level
15311532
BCVBR<4>, // number of inherited types
15321533
BCArray<TypeIDField> // inherited types, followed by dependency types

lib/Serialization/Serialization.cpp

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4325,6 +4325,7 @@ class Serializer::DeclSerializer : public DeclVisitor<DeclSerializer> {
43254325
->requiresClass(),
43264326
proto->isObjC(),
43274327
proto->hasSelfOrAssociatedTypeRequirements(),
4328+
S.addTypeRef(proto->getSuperclass()),
43284329
rawAccessLevel, numInherited,
43294330
inheritedAndDependencyTypes);
43304331

0 commit comments

Comments
 (0)