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:
Trevor Elliott
2023-02-16 09:23:27 -08:00
committed by GitHub
parent c3c16eb207
commit 80c147d9c0
26 changed files with 475 additions and 269 deletions

View File

@@ -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