Rework br_table to use BlockCall (#5731)
Rework br_table to use BlockCall, allowing us to avoid adding new nodes during ssa construction to hold block arguments. Additionally, many places where we previously matched on InstructionData to extract branch destinations can be replaced with a use of branch_destination or branch_destination_mut.
This commit is contained in:
@@ -63,12 +63,10 @@ function %fn_call_incorrect_arg_type(i64) {
|
||||
return
|
||||
}
|
||||
|
||||
; TODO: Should we instead just verify that jump tables contain no blocks that take arguments? This
|
||||
; error doesn't occur if no instruction uses the jump table.
|
||||
function %jump_table_args() {
|
||||
block0:
|
||||
v0 = iconst.i32 0
|
||||
br_table v0, block2, [block1] ; error: takes no arguments, but had target block1 with 1 arguments
|
||||
br_table v0, block2, [block1] ; error: mismatched argument count
|
||||
|
||||
block1(v5: i32):
|
||||
return
|
||||
|
||||
Reference in New Issue
Block a user