Struct rustc::middle::dataflow::DataFlowContext [−][src]
pub struct DataFlowContext<'a, 'tcx: 'a, O> { tcx: TyCtxt<'a, 'tcx, 'tcx>, analysis_name: &'static str, oper: O, bits_per_id: usize, words_per_id: usize, local_id_to_index: FxHashMap<ItemLocalId, Vec<CFGIndex>>, gens: Vec<usize>, scope_kills: Vec<usize>, action_kills: Vec<usize>, on_entry: Vec<usize>, }
🔬 This is a nightly-only experimental API. (rustc_private
)
this crate is being loaded from the sysroot, an unstable location; did you mean to load this crate from crates.io via Cargo.toml
instead?
Fields
tcx: TyCtxt<'a, 'tcx, 'tcx>
🔬 This is a nightly-only experimental API. (rustc_private
)
this crate is being loaded from the sysroot, an unstable location; did you mean to load this crate from crates.io via Cargo.toml
instead?
analysis_name: &'static str
🔬 This is a nightly-only experimental API. (rustc_private
)
this crate is being loaded from the sysroot, an unstable location; did you mean to load this crate from crates.io via Cargo.toml
instead?
a name for the analysis using this dataflow instance
oper: O
🔬 This is a nightly-only experimental API. (rustc_private
)
this crate is being loaded from the sysroot, an unstable location; did you mean to load this crate from crates.io via Cargo.toml
instead?
the data flow operator
bits_per_id: usize
🔬 This is a nightly-only experimental API. (rustc_private
)
this crate is being loaded from the sysroot, an unstable location; did you mean to load this crate from crates.io via Cargo.toml
instead?
number of bits to propagate per id
words_per_id: usize
🔬 This is a nightly-only experimental API. (rustc_private
)
this crate is being loaded from the sysroot, an unstable location; did you mean to load this crate from crates.io via Cargo.toml
instead?
number of words we will use to store bits_per_id. equal to bits_per_id/usize::BITS rounded up.
local_id_to_index: FxHashMap<ItemLocalId, Vec<CFGIndex>>
🔬 This is a nightly-only experimental API. (rustc_private
)
this crate is being loaded from the sysroot, an unstable location; did you mean to load this crate from crates.io via Cargo.toml
instead?
gens: Vec<usize>
🔬 This is a nightly-only experimental API. (rustc_private
)
this crate is being loaded from the sysroot, an unstable location; did you mean to load this crate from crates.io via Cargo.toml
instead?
bits generated as we exit the cfg node. Updated by add_gen()
.
scope_kills: Vec<usize>
🔬 This is a nightly-only experimental API. (rustc_private
)
this crate is being loaded from the sysroot, an unstable location; did you mean to load this crate from crates.io via Cargo.toml
instead?
bits killed as we exit the cfg node, or non-locally jump over
it. Updated by add_kill(KillFrom::ScopeEnd)
.
action_kills: Vec<usize>
🔬 This is a nightly-only experimental API. (rustc_private
)
this crate is being loaded from the sysroot, an unstable location; did you mean to load this crate from crates.io via Cargo.toml
instead?
bits killed as we exit the cfg node directly; if it is jumped
over, e.g. via break
, the kills are not reflected in the
jump's effects. Updated by add_kill(KillFrom::Execution)
.
on_entry: Vec<usize>
🔬 This is a nightly-only experimental API. (rustc_private
)
this crate is being loaded from the sysroot, an unstable location; did you mean to load this crate from crates.io via Cargo.toml
instead?
bits that are valid on entry to the cfg node. Updated by
propagate()
.
Methods
impl<'a, 'tcx, O: DataFlowOperator> DataFlowContext<'a, 'tcx, O>
[src]
impl<'a, 'tcx, O: DataFlowOperator> DataFlowContext<'a, 'tcx, O>
fn has_bitset_for_local_id(&self, n: ItemLocalId) -> bool
[src]
fn has_bitset_for_local_id(&self, n: ItemLocalId) -> bool
🔬 This is a nightly-only experimental API. (rustc_private
)
this crate is being loaded from the sysroot, an unstable location; did you mean to load this crate from crates.io via Cargo.toml
instead?
impl<'a, 'tcx, O: DataFlowOperator> DataFlowContext<'a, 'tcx, O>
[src]
impl<'a, 'tcx, O: DataFlowOperator> DataFlowContext<'a, 'tcx, O>
pub fn new(
tcx: TyCtxt<'a, 'tcx, 'tcx>,
analysis_name: &'static str,
body: Option<&Body>,
cfg: &CFG,
oper: O,
id_range: IdRange,
bits_per_id: usize
) -> DataFlowContext<'a, 'tcx, O>
[src]
pub fn new(
tcx: TyCtxt<'a, 'tcx, 'tcx>,
analysis_name: &'static str,
body: Option<&Body>,
cfg: &CFG,
oper: O,
id_range: IdRange,
bits_per_id: usize
) -> DataFlowContext<'a, 'tcx, O>
🔬 This is a nightly-only experimental API. (rustc_private
)
this crate is being loaded from the sysroot, an unstable location; did you mean to load this crate from crates.io via Cargo.toml
instead?
pub fn add_gen(&mut self, id: ItemLocalId, bit: usize)
[src]
pub fn add_gen(&mut self, id: ItemLocalId, bit: usize)
🔬 This is a nightly-only experimental API. (rustc_private
)
this crate is being loaded from the sysroot, an unstable location; did you mean to load this crate from crates.io via Cargo.toml
instead?
Indicates that id
generates bit
pub fn add_kill(&mut self, kind: KillFrom, id: ItemLocalId, bit: usize)
[src]
pub fn add_kill(&mut self, kind: KillFrom, id: ItemLocalId, bit: usize)
🔬 This is a nightly-only experimental API. (rustc_private
)
this crate is being loaded from the sysroot, an unstable location; did you mean to load this crate from crates.io via Cargo.toml
instead?
Indicates that id
kills bit
fn apply_gen_kill(&self, cfgidx: CFGIndex, bits: &mut [usize])
[src]
fn apply_gen_kill(&self, cfgidx: CFGIndex, bits: &mut [usize])
🔬 This is a nightly-only experimental API. (rustc_private
)
this crate is being loaded from the sysroot, an unstable location; did you mean to load this crate from crates.io via Cargo.toml
instead?
Applies the gen and kill sets for cfgidx
to bits
fn compute_id_range(&self, cfgidx: CFGIndex) -> (usize, usize)
[src]
fn compute_id_range(&self, cfgidx: CFGIndex) -> (usize, usize)
🔬 This is a nightly-only experimental API. (rustc_private
)
this crate is being loaded from the sysroot, an unstable location; did you mean to load this crate from crates.io via Cargo.toml
instead?
pub fn each_bit_on_entry<F>(&self, id: ItemLocalId, f: F) -> bool where
F: FnMut(usize) -> bool,
[src]
pub fn each_bit_on_entry<F>(&self, id: ItemLocalId, f: F) -> bool where
F: FnMut(usize) -> bool,
🔬 This is a nightly-only experimental API. (rustc_private
)
this crate is being loaded from the sysroot, an unstable location; did you mean to load this crate from crates.io via Cargo.toml
instead?
Iterates through each bit that is set on entry to id
.
Only useful after propagate()
has been called.
pub fn each_bit_for_node<F>(
&self,
e: EntryOrExit,
cfgidx: CFGIndex,
f: F
) -> bool where
F: FnMut(usize) -> bool,
[src]
pub fn each_bit_for_node<F>(
&self,
e: EntryOrExit,
cfgidx: CFGIndex,
f: F
) -> bool where
F: FnMut(usize) -> bool,
🔬 This is a nightly-only experimental API. (rustc_private
)
this crate is being loaded from the sysroot, an unstable location; did you mean to load this crate from crates.io via Cargo.toml
instead?
Iterates through each bit that is set on entry/exit to cfgidx
.
Only useful after propagate()
has been called.
pub fn each_gen_bit<F>(&self, id: ItemLocalId, f: F) -> bool where
F: FnMut(usize) -> bool,
[src]
pub fn each_gen_bit<F>(&self, id: ItemLocalId, f: F) -> bool where
F: FnMut(usize) -> bool,
🔬 This is a nightly-only experimental API. (rustc_private
)
this crate is being loaded from the sysroot, an unstable location; did you mean to load this crate from crates.io via Cargo.toml
instead?
Iterates through each bit in the gen set for id
.
fn each_bit<F>(&self, words: &[usize], f: F) -> bool where
F: FnMut(usize) -> bool,
[src]
fn each_bit<F>(&self, words: &[usize], f: F) -> bool where
F: FnMut(usize) -> bool,
🔬 This is a nightly-only experimental API. (rustc_private
)
this crate is being loaded from the sysroot, an unstable location; did you mean to load this crate from crates.io via Cargo.toml
instead?
Helper for iterating over the bits in a bit set.
Returns false on the first call to f
that returns false;
if all calls to f
return true, then returns true.
pub fn add_kills_from_flow_exits(&mut self, cfg: &CFG)
[src]
pub fn add_kills_from_flow_exits(&mut self, cfg: &CFG)
🔬 This is a nightly-only experimental API. (rustc_private
)
this crate is being loaded from the sysroot, an unstable location; did you mean to load this crate from crates.io via Cargo.toml
instead?
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>
[src]
impl<'a, 'tcx, O: DataFlowOperator + Clone + 'static> DataFlowContext<'a, 'tcx, O>
pub fn propagate(&mut self, cfg: &CFG, body: &Body)
[src]
pub fn propagate(&mut self, cfg: &CFG, body: &Body)
🔬 This is a nightly-only experimental API. (rustc_private
)
this crate is being loaded from the sysroot, an unstable location; did you mean to load this crate from crates.io via Cargo.toml
instead?
Performs the data flow analysis.
Trait Implementations
impl<'a, 'tcx: 'a, O: Clone> Clone for DataFlowContext<'a, 'tcx, O>
[src]
impl<'a, 'tcx: 'a, O: Clone> Clone for DataFlowContext<'a, 'tcx, O>
fn clone(&self) -> DataFlowContext<'a, 'tcx, O>
[src]
fn clone(&self) -> DataFlowContext<'a, 'tcx, O>
Returns a copy of the value. Read more
fn clone_from(&mut self, source: &Self)
1.0.0[src]
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from source
. Read more
impl<'a, 'tcx, O: DataFlowOperator> PpAnn for DataFlowContext<'a, 'tcx, O>
[src]
impl<'a, 'tcx, O: DataFlowOperator> PpAnn for DataFlowContext<'a, 'tcx, O>
fn nested(&self, state: &mut State, nested: Nested) -> Result<()>
[src]
fn nested(&self, state: &mut State, nested: Nested) -> Result<()>
🔬 This is a nightly-only experimental API. (rustc_private
)
this crate is being loaded from the sysroot, an unstable location; did you mean to load this crate from crates.io via Cargo.toml
instead?
fn pre(&self, ps: &mut State, node: AnnNode) -> Result<()>
[src]
fn pre(&self, ps: &mut State, node: AnnNode) -> Result<()>
🔬 This is a nightly-only experimental API. (rustc_private
)
this crate is being loaded from the sysroot, an unstable location; did you mean to load this crate from crates.io via Cargo.toml
instead?
fn post(&self, _state: &mut State, _node: AnnNode) -> Result<()>
[src]
fn post(&self, _state: &mut State, _node: AnnNode) -> Result<()>
🔬 This is a nightly-only experimental API. (rustc_private
)
this crate is being loaded from the sysroot, an unstable location; did you mean to load this crate from crates.io via Cargo.toml
instead?
Auto Trait Implementations
impl<'a, 'tcx, O> !Send for DataFlowContext<'a, 'tcx, O>
impl<'a, 'tcx, O> !Send for DataFlowContext<'a, 'tcx, O>
impl<'a, 'tcx, O> !Sync for DataFlowContext<'a, 'tcx, O>
impl<'a, 'tcx, O> !Sync for DataFlowContext<'a, 'tcx, O>