Skip to content

Commit c3955d1

Browse files
authored
Merge pull request #5543 from gottesmm/deepnoenum_to_deep
2 parents 58056a6 + 05c5fcc commit c3955d1

File tree

4 files changed

+15
-18
lines changed

4 files changed

+15
-18
lines changed

include/swift/SIL/TypeLowering.h

Lines changed: 7 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -230,10 +230,7 @@ class TypeLowering {
230230
virtual void emitDestroyRValue(SILBuilder &B, SILLocation loc,
231231
SILValue value) const = 0;
232232

233-
enum class LoweringStyle {
234-
Shallow,
235-
DeepNoEnum
236-
};
233+
enum class LoweringStyle { Shallow, Deep };
237234

238235
/// Emit a lowered 'release_value' operation.
239236
///
@@ -261,9 +258,9 @@ class TypeLowering {
261258
/// Emit a lowered 'release_value' operation.
262259
///
263260
/// This type must be loadable.
264-
void emitLoweredDestroyValueDeepNoEnum(SILBuilder &B, SILLocation loc,
265-
SILValue value) const {
266-
emitLoweredDestroyValue(B, loc, value, LoweringStyle::DeepNoEnum);
261+
void emitLoweredDestroyValueDeep(SILBuilder &B, SILLocation loc,
262+
SILValue value) const {
263+
emitLoweredDestroyValue(B, loc, value, LoweringStyle::Deep);
267264
}
268265

269266
/// Given a primitively loaded value of this type (which must be
@@ -295,9 +292,9 @@ class TypeLowering {
295292
/// Emit a lowered 'retain_value' operation.
296293
///
297294
/// This type must be loadable.
298-
SILValue emitLoweredCopyValueDeepNoEnum(SILBuilder &B, SILLocation loc,
299-
SILValue value) const {
300-
return emitLoweredCopyValue(B, loc, value, LoweringStyle::DeepNoEnum);
295+
SILValue emitLoweredCopyValueDeep(SILBuilder &B, SILLocation loc,
296+
SILValue value) const {
297+
return emitLoweredCopyValue(B, loc, value, LoweringStyle::Deep);
301298
}
302299

303300
/// Given a primitively loaded value of this type (which must be

lib/SIL/TypeLowering.cpp

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -714,8 +714,8 @@ namespace {
714714
case LoweringStyle::Shallow:
715715
Fn = &TypeLowering::emitDestroyValue;
716716
break;
717-
case LoweringStyle::DeepNoEnum:
718-
Fn = &TypeLowering::emitLoweredDestroyValueDeepNoEnum;
717+
case LoweringStyle::Deep:
718+
Fn = &TypeLowering::emitLoweredDestroyValueDeep;
719719
break;
720720
}
721721

lib/SILOptimizer/Transforms/SILLowerAggregateInstrs.cpp

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -110,7 +110,7 @@ static bool expandCopyAddr(CopyAddrInst *CA) {
110110
IsTake_t IsTake = CA->isTakeOfSrc();
111111
if (IsTake_t::IsNotTake == IsTake) {
112112
TL.emitLoweredCopyValue(Builder, CA->getLoc(), New,
113-
TypeLowering::LoweringStyle::DeepNoEnum);
113+
TypeLowering::LoweringStyle::Deep);
114114
}
115115

116116
// If we are not initializing:
@@ -119,7 +119,7 @@ static bool expandCopyAddr(CopyAddrInst *CA) {
119119
// release_value %old : $*T
120120
if (Old) {
121121
TL.emitLoweredDestroyValue(Builder, CA->getLoc(), Old,
122-
TypeLowering::LoweringStyle::DeepNoEnum);
122+
TypeLowering::LoweringStyle::Deep);
123123
}
124124
}
125125

@@ -151,7 +151,7 @@ static bool expandDestroyAddr(DestroyAddrInst *DA) {
151151
LoadOwnershipQualifier::Unqualified);
152152
auto &TL = Module.getTypeLowering(Type);
153153
TL.emitLoweredDestroyValue(Builder, DA->getLoc(), LI,
154-
TypeLowering::LoweringStyle::DeepNoEnum);
154+
TypeLowering::LoweringStyle::Deep);
155155
}
156156

157157
++NumExpand;
@@ -173,7 +173,7 @@ static bool expandReleaseValue(ReleaseValueInst *DV) {
173173

174174
auto &TL = Module.getTypeLowering(Type);
175175
TL.emitLoweredDestroyValue(Builder, DV->getLoc(), Value,
176-
TypeLowering::LoweringStyle::DeepNoEnum);
176+
TypeLowering::LoweringStyle::Deep);
177177

178178
DEBUG(llvm::dbgs() << " Expanding Destroy Value: " << *DV);
179179

@@ -196,7 +196,7 @@ static bool expandRetainValue(RetainValueInst *CV) {
196196

197197
auto &TL = Module.getTypeLowering(Type);
198198
TL.emitLoweredCopyValue(Builder, CV->getLoc(), Value,
199-
TypeLowering::LoweringStyle::DeepNoEnum);
199+
TypeLowering::LoweringStyle::Deep);
200200

201201
DEBUG(llvm::dbgs() << " Expanding Copy Value: " << *CV);
202202

lib/SILOptimizer/Transforms/SILMem2Reg.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -348,7 +348,7 @@ static void replaceDestroy(DestroyAddrInst *DAI, SILValue NewValue) {
348348
auto Ty = DAI->getOperand()->getType();
349349
auto &TL = DAI->getModule().getTypeLowering(Ty);
350350
TL.emitLoweredDestroyValue(Builder, DAI->getLoc(), NewValue,
351-
Lowering::TypeLowering::LoweringStyle::DeepNoEnum);
351+
Lowering::TypeLowering::LoweringStyle::Deep);
352352
DAI->eraseFromParent();
353353
}
354354

0 commit comments

Comments
 (0)