Skip to content

Commit 2d92af4

Browse files
committed
Remove an assert from visitForwardedGuaranteedOperands
Some guaranteed forwarding instructions have multiple operands: mark_dependence, ref_to_bridge_object. The corresponding instruction types checked here already have documentation that the forwarded operand is the first operand. The assert is overly cautious, and checking for indiviudal opcodes would be tedious maintenance.
1 parent 447e524 commit 2d92af4

File tree

1 file changed

+0
-2
lines changed

1 file changed

+0
-2
lines changed

lib/SIL/Utils/OwnershipUtils.cpp

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1779,8 +1779,6 @@ bool swift::visitForwardedGuaranteedOperands(
17791779
|| isa<OwnershipForwardingMultipleValueInstruction>(inst)
17801780
|| isa<MoveOnlyWrapperToCopyableValueInst>(inst)
17811781
|| isa<CopyableToMoveOnlyWrapperValueInst>(inst)) {
1782-
assert(inst->getNumRealOperands() == 1
1783-
&& "forwarding instructions must have a single real operand");
17841782
assert(!isa<SingleValueInstruction>(inst)
17851783
|| !BorrowedValue(cast<SingleValueInstruction>(inst))
17861784
&& "forwarded operand cannot begin a borrow scope");

0 commit comments

Comments
 (0)