[][src]Trait llhd::ir::prelude::Unit

pub trait Unit {
    fn dfg(&self) -> &DataFlowGraph;
fn dfg_mut(&mut self) -> &mut DataFlowGraph;
fn try_cfg(&self) -> Option<&ControlFlowGraph>;
fn try_cfg_mut(&mut self) -> Option<&mut ControlFlowGraph>;
fn sig(&self) -> &Signature;
fn sig_mut(&mut self) -> &mut Signature;
fn name(&self) -> &UnitName;
fn name_mut(&mut self) -> &mut UnitName;
fn func_layout(&self) -> &FunctionLayout;
fn func_layout_mut(&mut self) -> &mut FunctionLayout;
fn inst_layout(&self) -> &InstLayout;
fn inst_layout_mut(&mut self) -> &mut InstLayout;
fn dump_fmt(&self, f: &mut Formatter) -> Result;
fn verify(&self);
fn kind(&self) -> UnitKind; fn cfg(&self) -> &ControlFlowGraph { ... }
fn cfg_mut(&mut self) -> &mut ControlFlowGraph { ... }
fn dump(&self) -> UnitDumper
    where
        Self: Sized
, { ... }
fn is_function(&self) -> bool { ... }
fn is_process(&self) -> bool { ... }
fn is_entity(&self) -> bool { ... }
fn get_function(&self) -> Option<&Function> { ... }
fn get_function_mut(&mut self) -> Option<&mut Function> { ... }
fn get_process(&self) -> Option<&Process> { ... }
fn get_process_mut(&mut self) -> Option<&mut Process> { ... }
fn get_entity(&self) -> Option<&Entity> { ... }
fn get_entity_mut(&mut self) -> Option<&mut Entity> { ... }
fn arg_value(&self, arg: Arg) -> Value { ... }
fn input_args<'a>(&'a self) -> Box<dyn Iterator<Item = Value> + 'a> { ... }
fn output_args<'a>(&'a self) -> Box<dyn Iterator<Item = Value> + 'a> { ... }
fn args<'a>(&'a self) -> Box<dyn Iterator<Item = Value> + 'a> { ... }
fn input_arg(&self, pos: usize) -> Value { ... }
fn output_arg(&self, pos: usize) -> Value { ... }
fn has_result(&self, inst: Inst) -> bool { ... }
fn inst_result(&self, inst: Inst) -> Value { ... }
fn value_type(&self, value: Value) -> Type { ... }
fn extern_name(&self, ext: ExtUnit) -> &UnitName { ... }
fn extern_sig(&self, ext: ExtUnit) -> &Signature { ... } }

A Function, Process, or Entity.

Required methods

fn dfg(&self) -> &DataFlowGraph

Get the unit's DFG.

fn dfg_mut(&mut self) -> &mut DataFlowGraph

Get the unit's mutable DFG.

fn try_cfg(&self) -> Option<&ControlFlowGraph>

Get the unit's CFG.

fn try_cfg_mut(&mut self) -> Option<&mut ControlFlowGraph>

Get the unit's mutable CFG.

fn sig(&self) -> &Signature

Get the unit's signature.

fn sig_mut(&mut self) -> &mut Signature

Get the unit's mutable signature.

fn name(&self) -> &UnitName

Get the unit's name.

fn name_mut(&mut self) -> &mut UnitName

Get the unit's mutable name.

fn func_layout(&self) -> &FunctionLayout

Get the unit's function/process layout.

Panics if the unit is an Entity.

fn func_layout_mut(&mut self) -> &mut FunctionLayout

Get the unit's function/process layout.

Panics if the unit is an Entity.

fn inst_layout(&self) -> &InstLayout

Get the unit's entity layout.

Panics if the unit is a Function or Process.

fn inst_layout_mut(&mut self) -> &mut InstLayout

Get the unit's entity layout.

Panics if the unit is a Function or Process.

fn dump_fmt(&self, f: &mut Formatter) -> Result

Actual implementation of dump().

fn verify(&self)

Panic if the unit is not well-formed.

fn kind(&self) -> UnitKind

Return the kind of this unit.

Loading content...

Provided methods

fn cfg(&self) -> &ControlFlowGraph

Get the unit's CFG.

fn cfg_mut(&mut self) -> &mut ControlFlowGraph

Get the unit's mutable CFG.

fn dump(&self) -> UnitDumper where
    Self: Sized

Dump the unit in human-readable form.

fn is_function(&self) -> bool

Check if this unit is a Function.

fn is_process(&self) -> bool

Check if this unit is a Process.

fn is_entity(&self) -> bool

Check if this unit is an Entity.

fn get_function(&self) -> Option<&Function>

Access this unit as a Function, if it is one.

fn get_function_mut(&mut self) -> Option<&mut Function>

Access this unit as a mutable Function, if it is one.

fn get_process(&self) -> Option<&Process>

Access this unit as a Process, if it is one.

fn get_process_mut(&mut self) -> Option<&mut Process>

Access this unit as a mutable Process, if it is one.

fn get_entity(&self) -> Option<&Entity>

Access this unit as an Entity, if it is one.

fn get_entity_mut(&mut self) -> Option<&mut Entity>

Access this unit as a mutablen Entity, if it is one.

fn arg_value(&self, arg: Arg) -> Value

Get the value of argument arg.

fn input_args<'a>(&'a self) -> Box<dyn Iterator<Item = Value> + 'a>

Return an iterator over the unit's input arguments.

fn output_args<'a>(&'a self) -> Box<dyn Iterator<Item = Value> + 'a>

Return an iterator over the unit's output arguments.

fn args<'a>(&'a self) -> Box<dyn Iterator<Item = Value> + 'a>

Return an iterator over the unit's arguments.

fn input_arg(&self, pos: usize) -> Value

Get the input argument at position pos.

fn output_arg(&self, pos: usize) -> Value

Get the output argument at position pos.

fn has_result(&self, inst: Inst) -> bool

Returns whether an instruction produces a result.

fn inst_result(&self, inst: Inst) -> Value

Returns the result of an instruction.

fn value_type(&self, value: Value) -> Type

Returns the type of a value.

fn extern_name(&self, ext: ExtUnit) -> &UnitName

Return the name of an external unit.

fn extern_sig(&self, ext: ExtUnit) -> &Signature

Return the signature of an external unit.

Loading content...

Implementors

impl Unit for Entity[src]

impl Unit for Function[src]

impl Unit for Process[src]

Loading content...