Generate basic blocks for Wasm br_if.

This commit is contained in:
Sean Stangl
2019-07-22 14:49:39 -06:00
parent ffa9d315e6
commit 926e4c8bf8

View File

@@ -1244,6 +1244,14 @@ fn translate_br_if(
let val = state.pop1(); let val = state.pop1();
let (br_destination, inputs) = translate_br_if_args(relative_depth, state); let (br_destination, inputs) = translate_br_if_args(relative_depth, state);
builder.ins().brnz(val, br_destination, inputs); builder.ins().brnz(val, br_destination, inputs);
#[cfg(feature = "basic-blocks")]
{
let next_ebb = builder.create_ebb();
builder.ins().jump(next_ebb, &[]);
builder.seal_block(next_ebb); // The only predecessor is the current block.
builder.switch_to_block(next_ebb);
}
} }
fn translate_br_if_args( fn translate_br_if_args(