Switch to a FuncCursor in the top-level legalizer loop.
Stop passing Cursor references to legalizer functions. Give them the whole &mut Function instead. Given the whole Function reference, these functions can create their own cursors. This lets legalizer actions access other Function data structures like the global variables.
This commit is contained in:
@@ -138,9 +138,9 @@ impl settings::Configurable for Builder {
|
||||
/// legalize it?
|
||||
///
|
||||
/// The `Encodings` iterator returns a legalization function to call.
|
||||
pub type Legalize = fn(&mut ir::DataFlowGraph,
|
||||
&mut flowgraph::ControlFlowGraph,
|
||||
&mut ir::Cursor)
|
||||
pub type Legalize = fn(ir::Inst,
|
||||
&mut ir::Function,
|
||||
&mut flowgraph::ControlFlowGraph)
|
||||
-> bool;
|
||||
|
||||
/// Methods that are specialized to a target ISA.
|
||||
|
||||
Reference in New Issue
Block a user