@@ -3440,6 +3440,8 @@ namespace {
3440
3440
MetadataLayout(IGM.getClassMetadataLayout(theClass)) {}
3441
3441
3442
3442
public:
3443
+ const ClassLayout &getFieldLayout () const { return FieldLayout; }
3444
+
3443
3445
SILType getLoweredType () {
3444
3446
return IGM.getLoweredType (Target->getDeclaredTypeInContext ());
3445
3447
}
@@ -3452,7 +3454,7 @@ namespace {
3452
3454
ClassFlags getClassFlags () { return ::getClassFlags (Target); }
3453
3455
3454
3456
void addClassFlags () {
3455
- if (FieldLayout .hasObjCImplementation ())
3457
+ if (asImpl (). getFieldLayout () .hasObjCImplementation ())
3456
3458
return ;
3457
3459
3458
3460
B.addInt32 ((uint32_t )asImpl ().getClassFlags ());
@@ -3490,7 +3492,7 @@ namespace {
3490
3492
}
3491
3493
3492
3494
void addValueWitnessTable () {
3493
- if (FieldLayout .hasObjCImplementation ())
3495
+ if (asImpl (). getFieldLayout () .hasObjCImplementation ())
3494
3496
return ;
3495
3497
3496
3498
B.add (asImpl ().getValueWitnessTable (false ).getValue ());
@@ -3583,7 +3585,7 @@ namespace {
3583
3585
}
3584
3586
3585
3587
void addDestructorFunction () {
3586
- if (FieldLayout .hasObjCImplementation ())
3588
+ if (asImpl (). getFieldLayout () .hasObjCImplementation ())
3587
3589
return ;
3588
3590
3589
3591
if (auto ptr = getAddrOfDestructorFunction (IGM, Target)) {
@@ -3598,7 +3600,7 @@ namespace {
3598
3600
}
3599
3601
3600
3602
void addIVarDestroyer () {
3601
- if (FieldLayout .hasObjCImplementation ())
3603
+ if (asImpl (). getFieldLayout () .hasObjCImplementation ())
3602
3604
return ;
3603
3605
3604
3606
auto dtorFunc = IGM.getAddrOfIVarInitDestroy (Target,
@@ -3623,7 +3625,7 @@ namespace {
3623
3625
}
3624
3626
3625
3627
void addNominalTypeDescriptor () {
3626
- if (FieldLayout .hasObjCImplementation ())
3628
+ if (asImpl (). getFieldLayout () .hasObjCImplementation ())
3627
3629
return ;
3628
3630
3629
3631
B.addSignedPointer (asImpl ().getNominalTypeDescriptor (),
@@ -3640,7 +3642,7 @@ namespace {
3640
3642
}
3641
3643
3642
3644
void addInstanceAddressPoint () {
3643
- if (FieldLayout .hasObjCImplementation ())
3645
+ if (asImpl (). getFieldLayout () .hasObjCImplementation ())
3644
3646
return ;
3645
3647
3646
3648
// Right now, we never allocate fields before the address point.
@@ -3652,7 +3654,7 @@ namespace {
3652
3654
const ClassLayout &getFieldLayout () { return FieldLayout; }
3653
3655
3654
3656
void addInstanceSize () {
3655
- if (FieldLayout .hasObjCImplementation ())
3657
+ if (asImpl (). getFieldLayout () .hasObjCImplementation ())
3656
3658
return ;
3657
3659
3658
3660
if (asImpl ().hasFixedLayout ()) {
@@ -3664,7 +3666,7 @@ namespace {
3664
3666
}
3665
3667
3666
3668
void addInstanceAlignMask () {
3667
- if (FieldLayout .hasObjCImplementation ())
3669
+ if (asImpl (). getFieldLayout () .hasObjCImplementation ())
3668
3670
return ;
3669
3671
3670
3672
if (asImpl ().hasFixedLayout ()) {
@@ -3676,22 +3678,22 @@ namespace {
3676
3678
}
3677
3679
3678
3680
void addRuntimeReservedBits () {
3679
- if (FieldLayout .hasObjCImplementation ())
3681
+ if (asImpl (). getFieldLayout () .hasObjCImplementation ())
3680
3682
return ;
3681
3683
3682
3684
B.addInt16 (0 );
3683
3685
}
3684
3686
3685
3687
void addClassSize () {
3686
- if (FieldLayout .hasObjCImplementation ())
3688
+ if (asImpl (). getFieldLayout () .hasObjCImplementation ())
3687
3689
return ;
3688
3690
3689
3691
auto size = MetadataLayout.getSize ();
3690
3692
B.addInt32 (size.FullSize .getValue ());
3691
3693
}
3692
3694
3693
3695
void addClassAddressPoint () {
3694
- if (FieldLayout .hasObjCImplementation ())
3696
+ if (asImpl (). getFieldLayout () .hasObjCImplementation ())
3695
3697
return ;
3696
3698
3697
3699
// FIXME: Wrong
@@ -3725,7 +3727,7 @@ namespace {
3725
3727
// Derive the RO-data.
3726
3728
llvm::Constant *data = asImpl ().getROData ();
3727
3729
3728
- if (!FieldLayout .hasObjCImplementation ()) {
3730
+ if (!asImpl (). getFieldLayout () .hasObjCImplementation ()) {
3729
3731
// Set a low bit to indicate this class has Swift metadata.
3730
3732
auto bit = llvm::ConstantInt::get (
3731
3733
IGM.IntPtrTy , asImpl ().getClassDataPointerHasSwiftMetadataBits ());
@@ -3833,7 +3835,7 @@ namespace {
3833
3835
: super(IGM, theClass, builder, fieldLayout) {}
3834
3836
3835
3837
void addFieldOffset (VarDecl *var) {
3836
- if (FieldLayout .hasObjCImplementation ())
3838
+ if (asImpl (). getFieldLayout () .hasObjCImplementation ())
3837
3839
return ;
3838
3840
3839
3841
addFixedFieldOffset (IGM, B, var, [](DeclContext *dc) {
@@ -3872,7 +3874,7 @@ namespace {
3872
3874
: super(IGM, theClass, builder, fieldLayout) {}
3873
3875
3874
3876
void addFieldOffset (VarDecl *var) {
3875
- if (FieldLayout .hasObjCImplementation ())
3877
+ if (asImpl (). getFieldLayout () .hasObjCImplementation ())
3876
3878
return ;
3877
3879
3878
3880
// Field offsets are either copied from the superclass or calculated
@@ -3881,7 +3883,7 @@ namespace {
3881
3883
}
3882
3884
3883
3885
void addFieldOffsetPlaceholders (MissingMemberDecl *placeholder) {
3884
- if (FieldLayout .hasObjCImplementation ())
3886
+ if (asImpl (). getFieldLayout () .hasObjCImplementation ())
3885
3887
return ;
3886
3888
3887
3889
for (unsigned i = 0 ,
@@ -4343,7 +4345,7 @@ namespace {
4343
4345
}
4344
4346
4345
4347
void addFieldOffset (VarDecl *var) {
4346
- if (FieldLayout .hasObjCImplementation ())
4348
+ if (asImpl (). getFieldLayout () .hasObjCImplementation ())
4347
4349
return ;
4348
4350
4349
4351
addFixedFieldOffset (IGM, B, var, [&](DeclContext *dc) {
0 commit comments