Skip to content

Commit 7f88908

Browse files
committed
[SIL-opaque] minor NFC review feedback
1 parent e116998 commit 7f88908

File tree

1 file changed

+4
-10
lines changed

1 file changed

+4
-10
lines changed

lib/SILOptimizer/Mandatory/AddressLowering.cpp

Lines changed: 4 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -1092,8 +1092,7 @@ checkStorageDominates(AllocStackInst *allocInst,
10921092

10931093
void OpaqueStorageAllocation::allocatePhi(PhiValue phi) {
10941094
// Coalesces phi operand storage with the phi storage. The algorithm processes
1095-
// all incoming values at once, so it is is run when visiting the block
1096-
// argument.
1095+
// all incoming values at once, so it is run when visiting the block argument.
10971096
//
10981097
// The phi operand projections are computed first to give them priority. Then
10991098
// we determine if the phi itself can share storage with one of its users.
@@ -1143,17 +1142,12 @@ createStackAllocation(SILValue value) {
11431142
assert(value.getOwnershipKind() != OwnershipKind::Guaranteed &&
11441143
"creating storage for a guaranteed value implies a copy");
11451144

1146-
#ifndef NDEBUG
11471145
// Instructions that produce an opened type never reach here because they
11481146
// have guaranteed ownership--they project their storage. We reach this
11491147
// point after the opened value has been copied.
1150-
if (auto *defInst = value->getDefiningInstruction()) {
1151-
if (auto *singleValue = dyn_cast<SingleValueInstruction>(defInst)) {
1152-
assert(!cast<SingleValueInstruction>(defInst)->getDefinedOpenedArchetype()
1153-
&& "owned open_existential is unsupported");
1154-
}
1155-
}
1156-
#endif
1148+
assert((!isa<SingleValueInstruction>(value)
1149+
|| !cast<SingleValueInstruction>(value)->getDefinedOpenedArchetype())
1150+
&& "owned open_existential is unsupported");
11571151

11581152
SILType allocTy = value->getType();
11591153

0 commit comments

Comments
 (0)