Skip to content

Commit cc0976a

Browse files
committed
[AST] NFC: Reorder inline bitfield for performance
As documented in the inline bitfield header, naturally sized fields should be last for optimal code gen.
1 parent bd36ce1 commit cc0976a

File tree

1 file changed

+5
-5
lines changed

1 file changed

+5
-5
lines changed

include/swift/AST/Decl.h

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -487,7 +487,7 @@ class alignas(1 << DeclAlignInBits) Decl {
487487
HasValidatedLayout : 1
488488
);
489489

490-
SWIFT_INLINE_BITFIELD_FULL(ProtocolDecl, NominalTypeDecl, 1+1+1+1+1+1+1+2+8+16+1,
490+
SWIFT_INLINE_BITFIELD_FULL(ProtocolDecl, NominalTypeDecl, 1+1+1+1+1+1+1+1+2+8+16,
491491
/// Whether the \c RequiresClass bit is valid.
492492
RequiresClassValid : 1,
493493

@@ -510,6 +510,9 @@ class alignas(1 << DeclAlignInBits) Decl {
510510
/// because they could not be imported from Objective-C).
511511
HasMissingRequirements : 1,
512512

513+
/// Whether we are currently computing inherited protocols.
514+
ComputingInheritedProtocols : 1,
515+
513516
/// The stage of the circularity check for this protocol.
514517
Circularity : 2,
515518

@@ -520,10 +523,7 @@ class alignas(1 << DeclAlignInBits) Decl {
520523
KnownProtocol : 8, // '8' for speed. This only needs 6.
521524

522525
/// The number of requirements in the requirement signature.
523-
NumRequirementsInSignature : 16,
524-
525-
/// Whether we are currently computing inherited protocols.
526-
ComputingInheritedProtocols : 1
526+
NumRequirementsInSignature : 16
527527
);
528528

529529
SWIFT_INLINE_BITFIELD(ClassDecl, NominalTypeDecl, 1+2+1+2+1+3+1+1,

0 commit comments

Comments
 (0)