Struct rustc::middle::dataflow::DataFlowContext [−] [src]

pub struct DataFlowContext<'a, 'tcx, O> {
    // some fields omitted
}
Unstable

Methods

impl<'a, 'tcx, O: DataFlowOperator> DataFlowContext<'a, 'tcx, O>

fn new(tcx: &'a ctxt<'tcx>, analysis_name: &'static str, decl: Option<&FnDecl>, cfg: &CFG, oper: O, id_range: IdRange, bits_per_id: usize) -> DataFlowContext<'a, 'tcx, O>

Unstable

fn add_gen(&mut self, id: NodeId, bit: usize)

Unstable

Indicates that id generates bit

fn add_kill(&mut self, kind: KillFrom, id: NodeId, bit: usize)

Unstable

Indicates that id kills bit

fn each_bit_on_entry<F>(&self, id: NodeId, f: F) -> bool where F: FnMut(usize) -> bool

Unstable

Iterates through each bit that is set on entry to id. Only useful after propagate() has been called.

fn each_bit_for_node<F>(&self, e: EntryOrExit, cfgidx: CFGIndex, f: F) -> bool where F: FnMut(usize) -> bool

Unstable

Iterates through each bit that is set on entry/exit to cfgidx. Only useful after propagate() has been called.

fn each_gen_bit<F>(&self, id: NodeId, f: F) -> bool where F: FnMut(usize) -> bool

Unstable

Iterates through each bit in the gen set for id.

fn add_kills_from_flow_exits(&mut self, cfg: &CFG)

Unstable

Whenever you have a break or continue statement, flow exits through any number of enclosing scopes on its way to the new destination. This function infers the kill bits of those control operators based on the kill bits associated with those scopes.

This is usually called (if it is called at all), after all add_gen and add_kill calls, but before propagate.

impl<'a, 'tcx, O: DataFlowOperator + Clone + 'static> DataFlowContext<'a, 'tcx, O>

fn propagate(&mut self, cfg: &CFG, blk: &Block)

Unstable

Performs the data flow analysis.

Trait Implementations

impl<'a, 'tcx, O: DataFlowOperator> PpAnn for DataFlowContext<'a, 'tcx, O>

fn pre(&self, ps: &mut State, node: AnnNode) -> Result<()>

fn post(&self, _state: &mut State, _node: AnnNode) -> Result<(), Error>

Derived Implementations

impl<'a, 'tcx, O: Clone> Clone for DataFlowContext<'a, 'tcx, O> where O: Clone

fn clone(&self) -> DataFlowContext<'a, 'tcx, O>

fn clone_from(&mut self, source: &Self)