@@ -659,8 +659,7 @@ namespace {
659
659
void consume (IRGenFunction &IGF, Explosion &src,
660
660
Atomicity atomicity,
661
661
SILType T) const override {
662
- if (ElementsAreABIAccessible &&
663
- tryEmitConsumeUsingDeinit (IGF, src, T)) {
662
+ if (tryEmitConsumeUsingDeinit (IGF, src, T)) {
664
663
return ;
665
664
}
666
665
@@ -682,8 +681,7 @@ namespace {
682
681
683
682
void destroy (IRGenFunction &IGF, Address addr, SILType T,
684
683
bool isOutlined) const override {
685
- if (ElementsAreABIAccessible &&
686
- tryEmitDestroyUsingDeinit (IGF, addr, T)) {
684
+ if (tryEmitDestroyUsingDeinit (IGF, addr, T)) {
687
685
return ;
688
686
}
689
687
@@ -2858,8 +2856,7 @@ namespace {
2858
2856
2859
2857
void consume (IRGenFunction &IGF, Explosion &src,
2860
2858
Atomicity atomicity, SILType T) const override {
2861
- if (ElementsAreABIAccessible &&
2862
- tryEmitConsumeUsingDeinit (IGF, src, T)) {
2859
+ if (tryEmitConsumeUsingDeinit (IGF, src, T)) {
2863
2860
return ;
2864
2861
}
2865
2862
@@ -2987,8 +2984,7 @@ namespace {
2987
2984
2988
2985
void destroy (IRGenFunction &IGF, Address addr, SILType T,
2989
2986
bool isOutlined) const override {
2990
- if (ElementsAreABIAccessible &&
2991
- tryEmitDestroyUsingDeinit (IGF, addr, T)) {
2987
+ if (tryEmitDestroyUsingDeinit (IGF, addr, T)) {
2992
2988
return ;
2993
2989
}
2994
2990
@@ -4899,8 +4895,7 @@ namespace {
4899
4895
4900
4896
void consume (IRGenFunction &IGF, Explosion &src,
4901
4897
Atomicity atomicity, SILType T) const override {
4902
- if (ElementsAreABIAccessible &&
4903
- tryEmitConsumeUsingDeinit (IGF, src, T)) {
4898
+ if (tryEmitConsumeUsingDeinit (IGF, src, T)) {
4904
4899
return ;
4905
4900
}
4906
4901
@@ -5259,8 +5254,7 @@ namespace {
5259
5254
5260
5255
void destroy (IRGenFunction &IGF, Address addr, SILType T,
5261
5256
bool isOutlined) const override {
5262
- if (ElementsAreABIAccessible &&
5263
- tryEmitDestroyUsingDeinit (IGF, addr, T)) {
5257
+ if (tryEmitDestroyUsingDeinit (IGF, addr, T)) {
5264
5258
return ;
5265
5259
}
5266
5260
@@ -6919,11 +6913,8 @@ SingletonEnumImplStrategy::completeEnumTypeLayout(TypeConverter &TC,
6919
6913
auto alignment = fixedEltTI.getFixedAlignment ();
6920
6914
applyLayoutAttributes (TC.IGM , theEnum, /* fixed*/ true , alignment);
6921
6915
6922
- IsABIAccessible_t isABIAccessible = IsABIAccessible;
6923
- if (Type.getASTType ()->isNoncopyable () &&
6924
- !IGM.getSILModule ().isTypeMetadataAccessible (Type.getASTType ()))
6925
- isABIAccessible = IsNotABIAccessible;
6926
-
6916
+ auto isABIAccessible = isTypeABIAccessibleIfFixedSize (TC.IGM ,
6917
+ Type.getASTType ());
6927
6918
return getFixedEnumTypeInfo (enumTy,
6928
6919
fixedEltTI.getFixedSize (),
6929
6920
fixedEltTI.getSpareBits (),
@@ -7086,11 +7077,8 @@ TypeInfo *SinglePayloadEnumImplStrategy::completeFixedLayout(
7086
7077
auto copyable = !theEnum->canBeCopyable ()
7087
7078
? IsNotCopyable : IsCopyable;
7088
7079
7089
- IsABIAccessible_t isABIAccessible = IsABIAccessible;
7090
- if (Type.getASTType ()->isNoncopyable () &&
7091
- !IGM.getSILModule ().isTypeMetadataAccessible (Type.getASTType ()))
7092
- isABIAccessible = IsNotABIAccessible;
7093
-
7080
+ auto isABIAccessible = isTypeABIAccessibleIfFixedSize (TC.IGM ,
7081
+ Type.getASTType ());
7094
7082
getFixedEnumTypeInfo (
7095
7083
enumTy, Size (sizeWithTag), spareBits.build (), alignment,
7096
7084
deinit & payloadTI.isTriviallyDestroyable (ResilienceExpansion::Maximal),
@@ -7303,11 +7291,8 @@ MultiPayloadEnumImplStrategy::completeFixedLayout(TypeConverter &TC,
7303
7291
7304
7292
applyLayoutAttributes (TC.IGM , theEnum, /* fixed*/ true , worstAlignment);
7305
7293
7306
- IsABIAccessible_t isABIAccessible = IsABIAccessible;
7307
- if (Type.getASTType ()->isNoncopyable () &&
7308
- !IGM.getSILModule ().isTypeMetadataAccessible (Type.getASTType ()))
7309
- isABIAccessible = IsNotABIAccessible;
7310
-
7294
+ auto isABIAccessible = isTypeABIAccessibleIfFixedSize (TC.IGM ,
7295
+ Type.getASTType ());
7311
7296
getFixedEnumTypeInfo (enumTy, Size (sizeWithTag), std::move (spareBits),
7312
7297
worstAlignment, isTriviallyDestroyable, isBT,
7313
7298
isCopyable, isABIAccessible);
0 commit comments