Use more helper functions on CursorBase to reduce cursor repositioning.

This commit is contained in:
Dan Gohman
2017-09-20 11:19:35 -07:00
parent 482439c94b
commit 74845fed6c
6 changed files with 139 additions and 79 deletions

View File

@@ -148,8 +148,7 @@ impl<'a> Context<'a> {
self.divert.clear();
// Now go through the instructions in `ebb` and color the values they define.
let mut pos = Cursor::new(&mut func.layout);
pos.goto_top(ebb);
let mut pos = Cursor::new(&mut func.layout).at_top(ebb);
while let Some(inst) = pos.next_inst() {
if let Some(constraints) = self.encinfo.operand_constraints(func.encodings[inst]) {
self.visit_inst(