Move most Cursor methods into a CursorBase trait.
The Cursor navigation methods all just depend on the cursor's position and layout reference. Make a CursorBase trait that provides access to this information with methods and implement the navigation methods on top of that. This makes it possible to have multiple types implement the cursor interface.
This commit is contained in:
@@ -355,7 +355,7 @@ def gen_xform_group(xgrp, fmt, type_sets):
|
||||
'cfg: &mut ::flowgraph::ControlFlowGraph, '
|
||||
'pos: &mut ir::Cursor) -> '
|
||||
'bool {{'.format(xgrp.name), '}'):
|
||||
fmt.line('use ir::InstBuilder;')
|
||||
fmt.line('use ir::{InstBuilder, CursorBase};')
|
||||
|
||||
# Gen the instruction to be legalized. The cursor we're passed must be
|
||||
# pointing at an instruction.
|
||||
|
||||
Reference in New Issue
Block a user