Remove the concept of non-dense jump tables.

WebAssembly doesn't have non-dense jump tables, and higher-level users
are better served by the facilities in lib/frontend/src/switch.rs for
working with non-dense switches.

This eliminates the concept of "absent" jump table entries, which
were represented as "0" in the text format.

Also, jump table contents are now enclosed in `[` and `]`, so that
we can unambiguously display empty jump tables. Previously, empty jump
tables were displayed as if they had a single absent entry.
This commit is contained in:
Dan Gohman
2018-10-04 10:35:31 -07:00
parent dc9221a70c
commit 1098eafb45
22 changed files with 113 additions and 208 deletions

View File

@@ -244,7 +244,7 @@ mod tests {
let func = setup!(0, [0, 1,]);
assert_eq!(
func,
" jt0 = jump_table ebb1, ebb2
" jt0 = jump_table [ebb1, ebb2]
ebb0:
v0 = iconst.i8 0
@@ -280,8 +280,8 @@ ebb3:
let func = setup!(0, [0, 1, 5, 7, 10, 11, 12,]);
assert_eq!(
func,
" jt0 = jump_table ebb1, ebb2
jt1 = jump_table ebb5, ebb6, ebb7
" jt0 = jump_table [ebb1, ebb2]
jt1 = jump_table [ebb5, ebb6, ebb7]
ebb0:
v0 = iconst.i8 0