[][src]Struct llhd::ir::DataFlowGraph

pub struct DataFlowGraph { /* fields omitted */ }

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 inst_type(&self, inst: Inst) -> Type[src]

Returns the type of an instruction.

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 get_anonymous_hint(&self, value: Value) -> Option<u32>[src]

Return the anonymous name hint of a value.

pub fn set_anonymous_hint(&mut self, value: Value, hint: u32)[src]

Set the anonymous name hint of a value.

pub fn clear_anonymous_hint(&mut self, value: Value) -> Option<u32>[src]

Clear the anonymous name hint 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.

pub fn replace_block_use(&mut self, from: Block, to: Block) -> usize[src]

Replace all uses of a block with another.

Returns how many blocks were replaced.

pub fn remove_block_use(&mut self, block: Block) -> usize[src]

Remove all uses of a block.

Replaces all uses of the block with an invalid block placeholder, and removes phi node entries for the block.

Returns how many blocks were replaced.

pub fn get_const(&self, value: Value) -> Option<Value>[src]

Resolve a constant value.

Returns None if the value is not constant. Note that this does not perform constant folding. Rather, the value must resolve to an instruction which produces a constant value.

pub fn get_const_time(&self, value: Value) -> Option<&TimeValue>[src]

Resolve a constant time value.

Returns None if the value is not constant. Note that this does not perform constant folding. Rather, the value must resolve to an instruction which produces a constant value.

pub fn get_const_int(&self, value: Value) -> Option<&IntValue>[src]

Resolve a constant integer value.

Returns None if the value is not constant. Note that this does not perform constant folding. Rather, the value must resolve to an instruction which produces a constant value.

pub fn get_const_array(&self, value: Value) -> Option<ArrayValue>[src]

Resolve a constant array value.

Returns None if the value is not constant. Note that this does not perform constant folding. Rather, the value must resolve to an instruction which produces a constant value.

pub fn get_const_struct(&self, value: Value) -> Option<StructValue>[src]

Resolve a constant struct value.

Returns None if the value is not constant. Note that this does not perform constant folding. Rather, the value must resolve to an instruction which produces a constant value.

pub fn set_location_hint(&mut self, inst: Inst, loc: usize)[src]

Add a location hint to an instruction.

Annotates the byte offset of an instruction in the input file.

pub fn location_hint(&self, inst: Inst) -> Option<usize>[src]

Get the location hint associated with an instruction.

Returns the byte offset of the instruction in the input file, or None if there is no hint for the instruction.

Trait Implementations

impl Default for DataFlowGraph[src]

impl<'de> Deserialize<'de> for DataFlowGraph[src]

impl Index<ExtUnit> for DataFlowGraph[src]

type Output = ExtUnitData

The returned type after indexing.

impl Index<Inst> for DataFlowGraph[src]

type Output = InstData

The returned type after indexing.

impl Index<Value> for DataFlowGraph[src]

type Output = ValueData

The returned type after indexing.

impl IndexMut<ExtUnit> for DataFlowGraph[src]

impl IndexMut<Inst> for DataFlowGraph[src]

impl IndexMut<Value> for DataFlowGraph[src]

impl Serialize for DataFlowGraph[src]

Auto Trait Implementations

Blanket Implementations

impl<T> Any for T where
    T: 'static + ?Sized
[src]

impl<T> Borrow<T> for T where
    T: ?Sized
[src]

impl<T> BorrowMut<T> for T where
    T: ?Sized
[src]

impl<T> DeserializeOwned for T where
    T: Deserialize<'de>, 
[src]

impl<T> From<T> for T[src]

impl<T, U> Into<U> for T where
    U: From<T>, 
[src]

impl<T, U> TryFrom<U> for T where
    U: Into<T>, 
[src]

type Error = Infallible

The type returned in the event of a conversion error.

impl<T, U> TryInto<U> for T where
    U: TryFrom<T>, 
[src]

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.