|
@@ -83,16 +83,15 @@ class MultipleBlock(object):
|
|
|
|
|
|
def lower_handled_blocks(self, state):
|
|
|
"""Lowers the handled blocks of this 'multiple' block to a tree."""
|
|
|
- result = tree_ir.EmptyInstruction()
|
|
|
+ cond_clause_pairs = []
|
|
|
for entry, block in self.handled_blocks:
|
|
|
- result = tree_ir.SelectInstruction(
|
|
|
+ cond_clause_pairs.append((
|
|
|
tree_ir.BinaryInstruction(
|
|
|
tree_ir.LoadLocalInstruction(state.label_variable),
|
|
|
'==',
|
|
|
tree_ir.LiteralInstruction(entry.index)),
|
|
|
- block.lower(state),
|
|
|
- result)
|
|
|
- return result
|
|
|
+ block.lower(state)))
|
|
|
+ return tree_ir.SwitchInstruction(cond_clause_pairs)
|
|
|
|
|
|
def lower(self, state):
|
|
|
"""Lowers this 'multiple' block to a tree."""
|