Use EncCursor for reload.rs.
Same deal as for spilling. Place an EncCursor in the context and use that to reference into the IR function when necessary.
This commit is contained in:
@@ -709,8 +709,7 @@ pub trait CursorBase {
|
||||
fn at_first_inst(mut self, ebb: Ebb) -> Self
|
||||
where Self: Sized
|
||||
{
|
||||
let inst = self.layout().ebbs[ebb].first_inst.expect("Empty EBB");
|
||||
self.goto_inst(inst);
|
||||
self.goto_first_inst(ebb);
|
||||
self
|
||||
}
|
||||
|
||||
@@ -740,6 +739,12 @@ pub trait CursorBase {
|
||||
self.set_position(CursorPosition::At(inst));
|
||||
}
|
||||
|
||||
/// Go to the first instruction in `ebb`.
|
||||
fn goto_first_inst(&mut self, ebb: Ebb) {
|
||||
let inst = self.layout().ebbs[ebb].first_inst.expect("Empty EBB");
|
||||
self.set_position(CursorPosition::At(inst));
|
||||
}
|
||||
|
||||
/// Go to the top of `ebb` which must be inserted into the layout.
|
||||
/// At this position, instructions cannot be inserted, but `next_inst()` will move to the first
|
||||
/// instruction in `ebb`.
|
||||
|
||||
Reference in New Issue
Block a user