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

pub trait Unit {
    fn dfg(&self) -> &DataFlowGraph;
fn dfg_mut(&mut self) -> &mut DataFlowGraph;
fn cfg(&self) -> &ControlFlowGraph;
fn cfg_mut(&mut self) -> &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 dump_fmt(&self, f: &mut Formatter) -> Result;
fn verify(&self);
fn kind(&self) -> UnitKind; fn dump(&self) -> UnitDumper<&Self> { ... }
fn is_function(&self) -> bool { ... }
fn is_process(&self) -> bool { ... }
fn is_entity(&self) -> bool { ... }
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 cfg(&self) -> &ControlFlowGraph

Get the unit's CFG.

fn cfg_mut(&mut self) -> &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 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 dump(&self) -> UnitDumper<&Self>

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 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]

fn dump(&self) -> UnitDumper<&Self>[src]

fn is_function(&self) -> bool[src]

fn is_process(&self) -> bool[src]

fn is_entity(&self) -> bool[src]

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

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

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

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

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

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

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

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

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

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

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

impl Unit for Function[src]

fn dump(&self) -> UnitDumper<&Self>[src]

fn is_function(&self) -> bool[src]

fn is_process(&self) -> bool[src]

fn is_entity(&self) -> bool[src]

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

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

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

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

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

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

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

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

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

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

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

impl Unit for Process[src]

fn dump(&self) -> UnitDumper<&Self>[src]

fn is_function(&self) -> bool[src]

fn is_process(&self) -> bool[src]

fn is_entity(&self) -> bool[src]

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

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

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

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

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

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

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

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

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

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

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

Loading content...