[][src]Struct llhd::ir::Module

pub struct Module { /* fields omitted */ }

A module.

This is the root node of an LLHD intermediate representation. Contains Function, Process, and Entity declarations and definitions.

Methods

impl Module[src]

pub fn new() -> Self[src]

Create a new empty module.

pub fn dump(&self) -> ModuleDumper[src]

Dump the module in human-readable form.

pub fn add_function(&mut self, func: Function) -> ModUnit[src]

Add a function to the module.

pub fn add_process(&mut self, prok: Process) -> ModUnit[src]

Add a process to the module.

pub fn add_entity(&mut self, ent: Entity) -> ModUnit[src]

Add an entity to the module.

pub fn declare(&mut self, name: UnitName, sig: Signature) -> ModUnit[src]

Declare an external unit.

pub fn remove_unit(&mut self, unit: ModUnit)[src]

Remove a unit from the module.

pub fn units<'a>(&'a self) -> impl Iterator<Item = ModUnit> + 'a[src]

Return an iterator over the units in this module.

pub fn functions<'a>(&'a self) -> impl Iterator<Item = &'a Function> + 'a[src]

Return an iterator over the functions in this module.

pub fn processes<'a>(&'a self) -> impl Iterator<Item = &'a Process> + 'a[src]

Return an iterator over the processes in this module.

pub fn entities<'a>(&'a self) -> impl Iterator<Item = &'a Entity> + 'a[src]

Return an iterator over the entities in this module.

pub fn declarations<'a>(
    &'a self
) -> impl Iterator<Item = (&'a UnitName, &'a Signature)> + 'a
[src]

Return an iterator over the external unit declarations in this module.

pub fn is_function(&self, unit: ModUnit) -> bool[src]

Check whether a unit is a function.

pub fn is_process(&self, unit: ModUnit) -> bool[src]

Check whether a unit is a process.

pub fn is_entity(&self, unit: ModUnit) -> bool[src]

Check whether a unit is an entity.

pub fn is_declaration(&self, unit: ModUnit) -> bool[src]

Check whether a unit is externally declared.

pub fn unit_name(&self, unit: ModUnit) -> &UnitName[src]

Get the name of a unit.

pub fn unit_sig(&self, unit: ModUnit) -> &Signature[src]

Get the signature of a unit.

pub fn get_function(&self, unit: ModUnit) -> Option<&Function>[src]

Return a function in the module, or None if the unit is not a function.

pub fn get_function_mut(&mut self, unit: ModUnit) -> Option<&mut Function>[src]

Return a mutable function in the module, or None if the unit is not a function.

pub fn function(&self, unit: ModUnit) -> &Function[src]

Return a function in the module. Panic if the unit is not a function.

pub fn function_mut(&mut self, unit: ModUnit) -> &mut Function[src]

Return a mutable function in the module. Panic if the unit is not a function.

pub fn get_process(&self, unit: ModUnit) -> Option<&Process>[src]

Return a process in the module, or None if the unit is not a process.

pub fn get_process_mut(&mut self, unit: ModUnit) -> Option<&mut Process>[src]

Return a mutable process in the module, or None if the unit is not a process.

pub fn process(&self, unit: ModUnit) -> &Process[src]

Return a process in the module. Panic if the unit is not a process.

pub fn process_mut(&mut self, unit: ModUnit) -> &mut Process[src]

Return a mutable process in the module. Panic if the unit is not a process.

pub fn get_entity(&self, unit: ModUnit) -> Option<&Entity>[src]

Return an entity in the module, or None if the unit is not an entity.

pub fn get_entity_mut(&mut self, unit: ModUnit) -> Option<&mut Entity>[src]

Return a mutable entity in the module, or None if the unit is not an entity.

pub fn entity(&self, unit: ModUnit) -> &Entity[src]

Return an entity in the module. Panic if the unit is not an entity.

pub fn entity_mut(&mut self, unit: ModUnit) -> &mut Entity[src]

Return a mutable entity in the module. Panic if the unit is not an entity.

pub fn symbols<'a>(&'a self) -> impl Iterator<Item = (&UnitName, ModUnit)> + 'a[src]

Return an iterator over the symbols in the module.

pub fn local_symbols<'a>(
    &'a self
) -> impl Iterator<Item = (&UnitName, ModUnit)> + 'a
[src]

Return an iterator over the local symbols in the module.

pub fn global_symbols<'a>(
    &'a self
) -> impl Iterator<Item = (&UnitName, ModUnit)> + 'a
[src]

Return an iterator over the global symbols in the module.

pub fn is_linked(&self) -> bool[src]

Check whether the module is internally linked.

Adding or modifying a unit invalidates the linkage within the module.

Locally link the module.

pub fn verify(&self)[src]

Panic if the module is not well-formed.

Trait Implementations

impl Index<ModUnit> for Module[src]

type Output = ModUnitData

The returned type after indexing.

impl IndexMut<ModUnit> for Module[src]

Auto Trait Implementations

impl Sync for Module

impl Send for Module

impl Unpin for Module

impl RefUnwindSafe for Module

impl UnwindSafe for Module

Blanket Implementations

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.

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

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

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