Use CursorBase utility functions to reduce repositioning clutter.

This commit is contained in:
Dan Gohman
2017-09-20 06:58:45 -07:00
parent 144d39a53d
commit b888894fbb
5 changed files with 22 additions and 9 deletions

View File

@@ -63,8 +63,7 @@ fn legalize_entry_arguments(func: &mut Function, entry: Ebb) {
// We want to insert instructions before the first instruction in the entry block.
// If the entry block is empty, append instructions to it instead.
let mut pos = Cursor::new(&mut func.layout);
pos.goto_top(entry);
pos.next_inst();
pos.goto_first_inst(entry);
// Keep track of the argument types in the ABI-legalized signature.
let abi_types = &func.signature.argument_types;

View File

@@ -235,8 +235,7 @@ fn split_value(
//
// Note that it is safe to move `pos` here since `reuse` was set above, so we don't
// need to insert a split instruction before returning.
pos.goto_top(ebb);
pos.next_inst();
pos.goto_first_inst(ebb);
dfg.ins(pos).with_result(value).Binary(
concat,
split_type,