Skip to content

Commit 341d531

Browse files
committed
nfc: simplify ManualOwnership check
1 parent da49663 commit 341d531

File tree

1 file changed

+1
-2
lines changed

1 file changed

+1
-2
lines changed

lib/SILGen/SILGenExpr.cpp

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -7282,8 +7282,7 @@ RValue RValueEmitter::visitCopyExpr(CopyExpr *E, SGFContext C) {
72827282

72837283
// If we're relying on ManualOwnership for explicit-copies enforcement,
72847284
// avoid doing address-based emission for loadable types.
7285-
if (subType.isLoadableOrOpaque(SGF.F) &&
7286-
SGF.F.getPerfConstraints() == PerformanceConstraints::ManualOwnership) {
7285+
if (subType.isLoadableOrOpaque(SGF.F) && SGF.B.hasManualOwnershipAttr()) {
72877286
// Interpret this 'load' as a borrow + copy instead.
72887287
LValue lv =
72897288
SGF.emitLValue(li->getSubExpr(), SGFAccessKind::BorrowedObjectRead);

0 commit comments

Comments
 (0)