Pseudocode: Generate merge instruction regardless of number of branches

This commit is contained in:
Alexey Sedunov
2014-07-25 20:59:00 +04:00
parent d008cb8c21
commit 9f3ebe5f3b
21 changed files with 525 additions and 500 deletions
@@ -220,17 +220,7 @@ public class JetControlFlowProcessor {
}
private void mergeValues(@NotNull List<JetExpression> from, @NotNull JetExpression to) {
List<PseudoValue> values = elementsToValues(from);
switch (values.size()) {
case 0:
break;
case 1:
builder.bindValue(values.get(0), to);
break;
default:
builder.merge(to, values);
break;
}
builder.merge(to, elementsToValues(from));
}
private void copyValue(@Nullable JetElement from, @NotNull JetElement to) {