WIP.
This commit is contained in:
parent
4e3fb51aa9
commit
8caba239fa
|
@ -1156,11 +1156,12 @@ impl<'a, 'b> FunctionBodyBuilder<'a, 'b> {
|
|||
.collect::<Vec<_>>();
|
||||
self.locals.start_block(*el, self.reachable);
|
||||
self.cur_block = *el;
|
||||
self.reachable = *head_reachable;
|
||||
self.emit_branch(*out, &else_result_values[..]);
|
||||
assert_eq!(self.op_stack.len(), *start_depth);
|
||||
}
|
||||
self.cur_block = *out;
|
||||
self.reachable = *head_reachable || self.reachable || *merge_reachable;
|
||||
self.reachable = *head_reachable || was_reachable || *merge_reachable;
|
||||
self.locals.seal_block_preds(*out, &mut self.body);
|
||||
self.locals.start_block(*out, was_reachable);
|
||||
self.push_block_params(results.len());
|
||||
|
@ -1455,6 +1456,11 @@ impl<'a, 'b> FunctionBodyBuilder<'a, 'b> {
|
|||
}
|
||||
|
||||
fn emit_unreachable(&mut self) {
|
||||
log::trace!(
|
||||
"emit_unreachable: cur_block {} reachable {}",
|
||||
self.cur_block,
|
||||
self.reachable
|
||||
);
|
||||
if self.reachable {
|
||||
self.body.end_block(self.cur_block, Terminator::Unreachable);
|
||||
self.reachable = false;
|
||||
|
|
|
@ -170,6 +170,7 @@ impl FunctionBody {
|
|||
}
|
||||
|
||||
pub fn end_block(&mut self, block: Block, terminator: Terminator) {
|
||||
log::trace!("block {} terminator {:?}", block, terminator);
|
||||
terminator.visit_successors(|succ| {
|
||||
self.add_edge(block, succ);
|
||||
});
|
||||
|
|
Loading…
Reference in a new issue