[−][src]Struct llhd::ir::prelude::Module
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]
&'a self
) -> impl Iterator<Item = (&'a UnitName, &'a Signature)> + 'a
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]
&'a self
) -> impl Iterator<Item = (&UnitName, ModUnit)> + 'a
Return an iterator over the local symbols in the module.
pub fn global_symbols<'a>(
&'a self
) -> impl Iterator<Item = (&UnitName, ModUnit)> + 'a
[src]
&'a self
) -> impl Iterator<Item = (&UnitName, ModUnit)> + 'a
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.
pub fn link(&mut self)
[src]
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.
fn index(&self, idx: ModUnit) -> &ModUnitData
[src]
impl IndexMut<ModUnit> for Module
[src]
fn index_mut(&mut self, idx: ModUnit) -> &mut ModUnitData
[src]
Auto Trait Implementations
Blanket Implementations
impl<T, U> Into for T where
U: From<T>,
[src]
U: From<T>,
impl<T> From for T
[src]
impl<T, U> TryFrom 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 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 for T where
T: ?Sized,
[src]
T: ?Sized,
impl<T> Any for T where
T: 'static + ?Sized,
[src]
T: 'static + ?Sized,
impl<T> BorrowMut for T where
T: ?Sized,
[src]
T: ?Sized,