Struct cranelift_module::ModuleDeclarations [−][src]
This provides a view to the state of a module which allows ir::ExternalName
s to be translated
into FunctionDeclaration
s and DataDeclaration
s.
Implementations
impl ModuleDeclarations
[src]
pub fn get_name(&self, name: &str) -> Option<FuncOrDataId>
[src]
Get the module identifier for a given name, if that name has been declared.
pub fn get_functions(
&self
) -> impl Iterator<Item = (FuncId, &FunctionDeclaration)>
[src]
&self
) -> impl Iterator<Item = (FuncId, &FunctionDeclaration)>
Get an iterator of all function declarations
pub fn is_function(name: &ExternalName) -> bool
[src]
Return whether name
names a function, rather than a data object.
pub fn get_function_decl(&self, func_id: FuncId) -> &FunctionDeclaration
[src]
Get the FunctionDeclaration
for the function named by name
.
pub fn get_data_objects(
&self
) -> impl Iterator<Item = (DataId, &DataDeclaration)>
[src]
&self
) -> impl Iterator<Item = (DataId, &DataDeclaration)>
Get an iterator of all data declarations
pub fn get_data_decl(&self, data_id: DataId) -> &DataDeclaration
[src]
Get the DataDeclaration
for the data object named by name
.
pub fn declare_function(
&mut self,
name: &str,
linkage: Linkage,
signature: &Signature
) -> ModuleResult<(FuncId, &FunctionDeclaration)>
[src]
&mut self,
name: &str,
linkage: Linkage,
signature: &Signature
) -> ModuleResult<(FuncId, &FunctionDeclaration)>
Declare a function in this module.
pub fn declare_data(
&mut self,
name: &str,
linkage: Linkage,
writable: bool,
tls: bool
) -> ModuleResult<(DataId, &DataDeclaration)>
[src]
&mut self,
name: &str,
linkage: Linkage,
writable: bool,
tls: bool
) -> ModuleResult<(DataId, &DataDeclaration)>
Declare a data object in this module.
Trait Implementations
impl Debug for ModuleDeclarations
[src]
impl Default for ModuleDeclarations
[src]
fn default() -> ModuleDeclarations
[src]
Auto Trait Implementations
impl RefUnwindSafe for ModuleDeclarations
impl Send for ModuleDeclarations
impl Sync for ModuleDeclarations
impl Unpin for ModuleDeclarations
impl UnwindSafe for ModuleDeclarations
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,
pub fn borrow_mut(&mut self) -> &mut T
[src]
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.
pub 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>,