Trait cranelift_codegen::ir::ProgramOrder
source · [−]pub trait ProgramOrder {
fn cmp<A, B>(&self, a: A, b: B) -> Ordering
where
A: Into<ExpandedProgramPoint>,
B: Into<ExpandedProgramPoint>;
fn is_block_gap(&self, inst: Inst, block: Block) -> bool;
}
Expand description
Context for ordering program points.
ProgramPoint
objects don’t carry enough information to be ordered independently, they need a
context providing the program order.
Required Methods
fn cmp<A, B>(&self, a: A, b: B) -> Ordering where
A: Into<ExpandedProgramPoint>,
B: Into<ExpandedProgramPoint>,
fn cmp<A, B>(&self, a: A, b: B) -> Ordering where
A: Into<ExpandedProgramPoint>,
B: Into<ExpandedProgramPoint>,
Compare the program points a
and b
relative to this program order.
Return Less
if a
appears in the program before b
.
This is declared as a generic such that it can be called with Inst
and Block
arguments
directly. Depending on the implementation, there is a good chance performance will be
improved for those cases where the type of either argument is known statically.
fn is_block_gap(&self, inst: Inst, block: Block) -> bool
fn is_block_gap(&self, inst: Inst, block: Block) -> bool
Is the range from inst
to block
just the gap between consecutive blocks?
This returns true if inst
is the terminator in the block immediately before block
.