@@ -372,13 +372,28 @@ class alignas(1 << DeclAlignInBits) Decl {
372
372
unsigned StaticSpelling : 2 ;
373
373
BITFIELD_END;
374
374
375
- BITFIELD_START (ConstructorDecl, AbstractFunctionDecl, 3 );
375
+ BITFIELD_START (ConstructorDecl, AbstractFunctionDecl, 8 );
376
376
// / The body initialization kind (+1), or zero if not yet computed.
377
377
// /
378
378
// / This value is cached but is not serialized, because it is a property
379
379
// / of the definition of the constructor that is useful only to semantic
380
380
// / analysis and SIL generation.
381
381
unsigned ComputedBodyInitKind : 3 ;
382
+
383
+ // / The kind of initializer we have.
384
+ unsigned InitKind : 2 ;
385
+
386
+ // / The failability of this initializer, which is an OptionalTypeKind.
387
+ unsigned Failability : 2 ;
388
+
389
+ // / Whether this initializer is a stub placed into a subclass to
390
+ // / catch invalid delegations to a designated initializer not
391
+ // / overridden by the subclass. A stub will always trap at runtime.
392
+ // /
393
+ // / Initializer stubs can be invoked from Objective-C or through
394
+ // / the Objective-C runtime; there is no way to directly express
395
+ // / an object construction that will invoke a stub.
396
+ unsigned HasStubImplementation : 1 ;
382
397
BITFIELD_END;
383
398
384
399
BITFIELD_START (TypeDecl, ValueDecl, 1 );
@@ -5644,21 +5659,6 @@ enum class CtorInitializerKind {
5644
5659
// / }
5645
5660
// / \endcode
5646
5661
class ConstructorDecl : public AbstractFunctionDecl {
5647
- // / The kind of initializer we have.
5648
- unsigned InitKind : 2 ;
5649
-
5650
- // / The failability of this initializer, which is an OptionalTypeKind.
5651
- unsigned Failability : 2 ;
5652
-
5653
- // / Whether this initializer is a stub placed into a subclass to
5654
- // / catch invalid delegations to a designated initializer not
5655
- // / overridden by the subclass. A stub will always trap at runtime.
5656
- // /
5657
- // / Initializer stubs can be invoked from Objective-C or through
5658
- // / the Objective-C runtime; there is no way to directly express
5659
- // / an object construction that will invoke a stub.
5660
- unsigned HasStubImplementation : 1 ;
5661
-
5662
5662
// / The location of the '!' or '?' for a failable initializer.
5663
5663
SourceLoc FailabilityLoc;
5664
5664
@@ -5763,12 +5763,12 @@ class ConstructorDecl : public AbstractFunctionDecl {
5763
5763
5764
5764
// / Determine the kind of initializer this is.
5765
5765
CtorInitializerKind getInitKind () const {
5766
- return static_cast <CtorInitializerKind>(InitKind);
5766
+ return static_cast <CtorInitializerKind>(ConstructorDeclBits. InitKind );
5767
5767
}
5768
5768
5769
5769
// / Set whether this is a convenience initializer.
5770
5770
void setInitKind (CtorInitializerKind kind) {
5771
- InitKind = static_cast <unsigned >(kind);
5771
+ ConstructorDeclBits. InitKind = static_cast <unsigned >(kind);
5772
5772
}
5773
5773
5774
5774
// / Whether this is a designated initializer.
@@ -5812,21 +5812,21 @@ class ConstructorDecl : public AbstractFunctionDecl {
5812
5812
5813
5813
// / Determine the failability of the initializer.
5814
5814
OptionalTypeKind getFailability () const {
5815
- return static_cast <OptionalTypeKind>(Failability);
5815
+ return static_cast <OptionalTypeKind>(ConstructorDeclBits. Failability );
5816
5816
}
5817
5817
5818
5818
// / Retrieve the location of the '!' or '?' in a failable initializer.
5819
5819
SourceLoc getFailabilityLoc () const { return FailabilityLoc; }
5820
5820
5821
5821
// / Whether the implementation of this method is a stub that traps at runtime.
5822
5822
bool hasStubImplementation () const {
5823
- return HasStubImplementation;
5823
+ return ConstructorDeclBits. HasStubImplementation ;
5824
5824
}
5825
5825
5826
5826
// / Set whether the implementation of this method is a stub that
5827
5827
// / traps at runtime.
5828
5828
void setStubImplementation (bool stub) {
5829
- HasStubImplementation = stub;
5829
+ ConstructorDeclBits. HasStubImplementation = stub;
5830
5830
}
5831
5831
5832
5832
ConstructorDecl *getOverriddenDecl () const { return OverriddenDecl; }
0 commit comments