[−][src]Struct llhd::ir::DataFlowGraph
A data flow graph.
This is the main container for instructions, values, and the relationship
between them. Every Function
, Process
, and Entity
has an associated
data flow graph.
Methods
impl DataFlowGraph
[src]
pub fn new() -> Self
[src]
Create a new data flow graph.
pub fn add_placeholder(&mut self, ty: Type) -> Value
[src]
Add a placeholder value.
This function is intended to be used when constructing PHI nodes.
pub fn remove_placeholder(&mut self, value: Value)
[src]
Remove a placeholder value.
pub fn is_placeholder(&self, value: Value) -> bool
[src]
Check if a value is a placeholder.
pub fn add_inst(&mut self, data: InstData, ty: Type) -> Inst
[src]
Add an instruction.
pub fn remove_inst(&mut self, inst: Inst)
[src]
Remove an instruction.
pub fn has_result(&self, inst: Inst) -> bool
[src]
Returns whether an instruction produces a result.
pub fn inst_result(&self, inst: Inst) -> Value
[src]
Returns the result of an instruction.
pub fn arg_value(&self, arg: Arg) -> Value
[src]
Returns the value of an argument.
pub fn value_type(&self, value: Value) -> Type
[src]
Returns the type of a value.
pub fn get_value_inst(&self, value: Value) -> Option<Inst>
[src]
Return the instruction that produces value
.
pub fn value_inst(&self, value: Value) -> Inst
[src]
Return the instruction that produces value
, or panic.
pub fn get_name(&self, value: Value) -> Option<&str>
[src]
Return the name of a value.
pub fn set_name(&mut self, value: Value, name: String)
[src]
Set the name of a value.
pub fn clear_name(&mut self, value: Value) -> Option<String>
[src]
Clear the name of a value.
pub fn replace_use(&mut self, from: Value, to: Value) -> usize
[src]
Replace all uses of a value with another.
Returns how many uses were replaced.
pub fn uses(&self, value: Value) -> impl Iterator<Item = (Inst, usize)>
[src]
Iterate over all uses of a value.
pub fn has_uses(&self, value: Value) -> bool
[src]
Check if a value is used.
pub fn has_one_use(&self, value: Value) -> bool
[src]
Check if a value has exactly one use.
Trait Implementations
impl Default for DataFlowGraph
[src]
fn default() -> DataFlowGraph
[src]
impl Index<Inst> for DataFlowGraph
[src]
type Output = InstData
The returned type after indexing.
fn index(&self, idx: Inst) -> &InstData
[src]
impl Index<Value> for DataFlowGraph
[src]
type Output = ValueData
The returned type after indexing.
fn index(&self, idx: Value) -> &ValueData
[src]
impl Index<ExtUnit> for DataFlowGraph
[src]
type Output = ExtUnitData
The returned type after indexing.
fn index(&self, idx: ExtUnit) -> &ExtUnitData
[src]
impl IndexMut<Inst> for DataFlowGraph
[src]
impl IndexMut<Value> for DataFlowGraph
[src]
impl IndexMut<ExtUnit> for DataFlowGraph
[src]
fn index_mut(&mut self, idx: ExtUnit) -> &mut ExtUnitData
[src]
Auto Trait Implementations
impl Send for DataFlowGraph
impl Sync for DataFlowGraph
Blanket Implementations
impl<T, U> Into for T where
U: From<T>,
[src]
U: From<T>,
impl<T> From for T
[src]
impl<T, U> TryFrom for T where
U: Into<T>,
[src]
U: Into<T>,
type Error = Infallible
The type returned in the event of a conversion error.
fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>
[src]
impl<T, U> TryInto for T where
U: TryFrom<T>,
[src]
U: TryFrom<T>,
type Error = <U as TryFrom<T>>::Error
The type returned in the event of a conversion error.
fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>
[src]
impl<T> Borrow for T where
T: ?Sized,
[src]
T: ?Sized,
impl<T> Any for T where
T: 'static + ?Sized,
[src]
T: 'static + ?Sized,
impl<T> BorrowMut for T where
T: ?Sized,
[src]
T: ?Sized,