[−][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 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 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.
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]
impl Serialize for DataFlowGraph
[src]
fn serialize<__S>(&self, __serializer: __S) -> Result<__S::Ok, __S::Error> where
__S: Serializer,
[src]
__S: Serializer,
impl<'de> Deserialize<'de> for DataFlowGraph
[src]
fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error> where
__D: Deserializer<'de>,
[src]
__D: Deserializer<'de>,
Auto Trait Implementations
impl Send for DataFlowGraph
impl Sync for DataFlowGraph
impl Unpin for DataFlowGraph
impl UnwindSafe for DataFlowGraph
impl RefUnwindSafe for DataFlowGraph
Blanket Implementations
impl<T, U> Into<U> for T where
U: From<T>,
[src]
U: From<T>,
impl<T> From<T> for T
[src]
impl<T, U> TryFrom<U> 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<U> 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<T> for T where
T: ?Sized,
[src]
T: ?Sized,
impl<T> BorrowMut<T> for T where
T: ?Sized,
[src]
T: ?Sized,
fn borrow_mut(&mut self) -> &mut T
[src]
impl<T> Any for T where
T: 'static + ?Sized,
[src]
T: 'static + ?Sized,
impl<T> DeserializeOwned for T where
T: Deserialize<'de>,
[src]
T: Deserialize<'de>,