Skip to content

Commit d5bd4a0

Browse files
committed
Runtime: The ivar destroyer can be null
This reverts commit b3a50ea9fdd6fb8cb0cbcba059dcb5b8029db7c4.
1 parent f2422d4 commit d5bd4a0

File tree

1 file changed

+7
-4
lines changed

1 file changed

+7
-4
lines changed

include/swift/ABI/Metadata.h

Lines changed: 7 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1059,8 +1059,9 @@ struct TargetClassMetadata : public TargetAnyClassMetadata<Runtime> {
10591059
ConstTargetMetadataPointer<Runtime, TargetClassDescriptor> Description;
10601060

10611061
public:
1062-
/// A function for destroying instance variables, used to clean up
1063-
/// after an early return from a constructor.
1062+
/// A function for destroying instance variables, used to clean up after an
1063+
/// early return from a constructor. If null, no clean up will be performed
1064+
/// and all ivars must be trivial.
10641065
TargetPointer<Runtime, ClassIVarDestroyer> IVarDestroyer;
10651066

10661067
// After this come the class members, laid out as follows:
@@ -3110,7 +3111,8 @@ struct TargetGenericClassMetadataPattern final :
31103111
TargetRelativeDirectPointer<Runtime, HeapObjectDestroyer> Destroy;
31113112

31123113
/// The ivar-destructor function.
3113-
TargetRelativeDirectPointer<Runtime, ClassIVarDestroyer> IVarDestroyer;
3114+
TargetRelativeDirectPointer<Runtime, ClassIVarDestroyer, /*nullable*/ true>
3115+
IVarDestroyer;
31143116

31153117
/// The class flags.
31163118
ClassFlags Flags;
@@ -3353,7 +3355,8 @@ struct TargetResilientClassMetadataPattern {
33533355
TargetRelativeDirectPointer<Runtime, HeapObjectDestroyer> Destroy;
33543356

33553357
/// The ivar-destructor function.
3356-
TargetRelativeDirectPointer<Runtime, ClassIVarDestroyer> IVarDestroyer;
3358+
TargetRelativeDirectPointer<Runtime, ClassIVarDestroyer, /*nullable*/ true>
3359+
IVarDestroyer;
33573360

33583361
/// The class flags.
33593362
ClassFlags Flags;

0 commit comments

Comments
 (0)