Move the default block to the front of the underlying jump table storage (#5770)
The new api on JumpTableData makese it easy to keep the default label first, and that shrinks the diff in #5731 a bit.
This commit is contained in:
@@ -1010,7 +1010,7 @@ mod tests {
|
||||
ssa.def_var(x_var, x1, block0);
|
||||
ssa.use_var(&mut func, x_var, I32, block0).0;
|
||||
let br_table = {
|
||||
let jump_table = JumpTableData::new(block2, vec![block2, block1]);
|
||||
let jump_table = JumpTableData::new(block2, &[block2, block1]);
|
||||
let jt = func.create_jump_table(jump_table);
|
||||
let mut cur = FuncCursor::new(&mut func).at_bottom(block0);
|
||||
cur.ins().br_table(x1, jt)
|
||||
|
||||
@@ -220,7 +220,7 @@ impl Switch {
|
||||
"Jump tables bigger than 2^32-1 are not yet supported"
|
||||
);
|
||||
|
||||
let jt_data = JumpTableData::new(otherwise, Vec::from(blocks));
|
||||
let jt_data = JumpTableData::new(otherwise, blocks);
|
||||
let jump_table = bx.create_jump_table(jt_data);
|
||||
|
||||
let discr = if first_index == 0 {
|
||||
|
||||
Reference in New Issue
Block a user