[−][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.
Implementations
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_unit(&mut self, data: UnitData) -> UnitId
[src]
Add a unit to the module.
pub fn remove_unit(&mut self, unit: UnitId)
[src]
Remove a unit from the module.
pub fn declare(&mut self, name: UnitName, sig: Signature) -> DeclId
[src]
Declare an external unit.
pub fn add_decl(&mut self, data: DeclData) -> DeclId
[src]
Declare an external unit.
pub fn remove_decl(&mut self, decl: DeclId)
[src]
Remove a declaration from the module.
pub fn units<'a>(&'a self) -> impl Iterator<Item = Unit<'a>> + 'a
[src]
Return an iterator over the units in this module.
pub fn units_mut<'a>(&'a mut self) -> impl Iterator<Item = UnitBuilder<'a>> + 'a
[src]
Return a mutable iterator over the units in this module.
pub fn par_units<'a>(&'a self) -> impl ParallelIterator<Item = Unit<'a>> + 'a
[src]
Return a parallel iterator over the units in this module.
pub fn par_units_mut<'a>(
&'a mut self
) -> impl ParallelIterator<Item = UnitBuilder<'a>> + 'a
[src]
&'a mut self
) -> impl ParallelIterator<Item = UnitBuilder<'a>> + 'a
Return a parallel mutable iterator over the units in this module.
pub fn functions<'a>(&'a self) -> impl Iterator<Item = Unit<'a>> + 'a
[src]
Return an iterator over the functions in this module.
pub fn processes<'a>(&'a self) -> impl Iterator<Item = Unit<'a>> + 'a
[src]
Return an iterator over the processes in this module.
pub fn entities<'a>(&'a self) -> impl Iterator<Item = Unit<'a>> + 'a
[src]
Return an iterator over the entities in this module.
pub fn decls<'a>(&'a self) -> impl Iterator<Item = DeclId> + 'a
[src]
Return an iterator over the external unit declarations in this module.
pub fn unit(&self, unit: UnitId) -> Unit<'_>
[src]
Return an unit in the module.
pub fn unit_mut(&mut self, unit: UnitId) -> UnitBuilder<'_>
[src]
Return a mutable unit in the module.
pub fn symbols<'a>(
&'a self
) -> impl Iterator<Item = (&UnitName, LinkedUnit, &Signature)> + 'a
[src]
&'a self
) -> impl Iterator<Item = (&UnitName, LinkedUnit, &Signature)> + 'a
Return an iterator over the symbols in the module.
pub fn local_symbols<'a>(
&'a self
) -> impl Iterator<Item = (&UnitName, LinkedUnit, &Signature)> + 'a
[src]
&'a self
) -> impl Iterator<Item = (&UnitName, LinkedUnit, &Signature)> + 'a
Return an iterator over the local symbols in the module.
pub fn global_symbols<'a>(
&'a self
) -> impl Iterator<Item = (&UnitName, LinkedUnit, &Signature)> + 'a
[src]
&'a self
) -> impl Iterator<Item = (&UnitName, LinkedUnit, &Signature)> + '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.
pub fn lookup_ext_unit(
&self,
ext_unit: ExtUnit,
within: UnitId
) -> Option<LinkedUnit>
[src]
&self,
ext_unit: ExtUnit,
within: UnitId
) -> Option<LinkedUnit>
Lookup what an external unit links to.
The module must be linked for this to work.
pub fn set_location_hint(&mut self, mod_unit: UnitId, loc: usize)
[src]
Add a location hint to a unit.
Annotates the byte offset of a unit in the input file.
pub fn location_hint(&self, mod_unit: UnitId) -> Option<usize>
[src]
Get the location hint associated with a unit.
Returns the byte offset of the unit in the input file, or None if there is no hint for the value.
Trait Implementations
impl<'de> Deserialize<'de> for Module
[src]
fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error> where
__D: Deserializer<'de>,
[src]
__D: Deserializer<'de>,
impl Index<DeclId> for Module
[src]
type Output = DeclData
The returned type after indexing.
fn index(&self, idx: DeclId) -> &DeclData
[src]
impl Index<UnitId> for Module
[src]
type Output = UnitData
The returned type after indexing.
fn index(&self, idx: UnitId) -> &UnitData
[src]
impl IndexMut<DeclId> for Module
[src]
impl IndexMut<UnitId> for Module
[src]
impl Serialize for Module
[src]
Auto Trait Implementations
impl RefUnwindSafe for Module
impl Send for Module
impl Sync for Module
impl Unpin for Module
impl UnwindSafe for Module
Blanket Implementations
impl<T> Any for T where
T: 'static + ?Sized,
[src]
T: 'static + ?Sized,
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> DeserializeOwned for T where
T: for<'de> Deserialize<'de>,
[src]
T: for<'de> Deserialize<'de>,
impl<T> From<T> for T
[src]
impl<T, U> Into<U> for T where
U: From<T>,
[src]
U: From<T>,
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>,