Use CursorBase utility functions to reduce repositioning clutter.
This commit is contained in:
@@ -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;
|
||||
|
||||
@@ -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,
|
||||
|
||||
Reference in New Issue
Block a user