Skip to content

Commit 56ab120

Browse files
committed
[silgen] Eliminate unnecessary code.
This is really old code that I put in when I was still understanding SILGenPattern. If we are emitting code in ownership form we will never have a TakeOnSuccess consumption kind, so we should not forward in that case "automagically". rdar://29791263
1 parent ac92166 commit 56ab120

File tree

1 file changed

+3
-12
lines changed

1 file changed

+3
-12
lines changed

lib/SILGen/SILGenPattern.cpp

Lines changed: 3 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -900,18 +900,9 @@ class ArgUnforwarder {
900900

901901
static bool requiresUnforwarding(SILGenFunction &SGF,
902902
ConsumableManagedValue operand) {
903-
if (SGF.F.getModule().getOptions().EnableSILOwnership &&
904-
operand.getType().isObject()) {
905-
assert(operand.getFinalConsumption() !=
906-
CastConsumptionKind::TakeOnSuccess &&
907-
"When compiling with sil ownership take on success is disabled");
908-
// No unforwarding is needed, we always borrow/copy.
909-
return false;
910-
}
911-
912-
return (operand.hasCleanup() &&
913-
operand.getFinalConsumption()
914-
== CastConsumptionKind::TakeOnSuccess);
903+
return operand.hasCleanup() &&
904+
operand.getFinalConsumption()
905+
== CastConsumptionKind::TakeOnSuccess;
915906
}
916907

917908
/// Given that an aggregate was divided into a set of borrowed

0 commit comments

Comments
 (0)