Struct cranelift_module::ModuleDeclarations
source · [−]pub struct ModuleDeclarations { /* private fields */ }
Expand description
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
sourceimpl ModuleDeclarations
impl ModuleDeclarations
sourcepub fn get_name(&self, name: &str) -> Option<FuncOrDataId>
pub fn get_name(&self, name: &str) -> Option<FuncOrDataId>
Get the module identifier for a given name, if that name has been declared.
sourcepub fn get_functions(
&self
) -> impl Iterator<Item = (FuncId, &FunctionDeclaration)>
pub fn get_functions(
&self
) -> impl Iterator<Item = (FuncId, &FunctionDeclaration)>
Get an iterator of all function declarations
sourcepub fn is_function(name: &ExternalName) -> bool
pub fn is_function(name: &ExternalName) -> bool
Return whether name
names a function, rather than a data object.
sourcepub fn get_function_decl(&self, func_id: FuncId) -> &FunctionDeclaration
pub fn get_function_decl(&self, func_id: FuncId) -> &FunctionDeclaration
Get the FunctionDeclaration
for the function named by name
.
sourcepub fn get_data_objects(
&self
) -> impl Iterator<Item = (DataId, &DataDeclaration)>
pub fn get_data_objects(
&self
) -> impl Iterator<Item = (DataId, &DataDeclaration)>
Get an iterator of all data declarations
sourcepub fn get_data_decl(&self, data_id: DataId) -> &DataDeclaration
pub fn get_data_decl(&self, data_id: DataId) -> &DataDeclaration
Get the DataDeclaration
for the data object named by name
.
sourcepub fn declare_function(
&mut self,
name: &str,
linkage: Linkage,
signature: &Signature
) -> ModuleResult<(FuncId, Linkage)>
pub fn declare_function(
&mut self,
name: &str,
linkage: Linkage,
signature: &Signature
) -> ModuleResult<(FuncId, Linkage)>
Declare a function in this module.
sourcepub fn declare_anonymous_function(
&mut self,
signature: &Signature
) -> ModuleResult<FuncId>
pub fn declare_anonymous_function(
&mut self,
signature: &Signature
) -> ModuleResult<FuncId>
Declare an anonymous function in this module.
sourcepub fn declare_data(
&mut self,
name: &str,
linkage: Linkage,
writable: bool,
tls: bool
) -> ModuleResult<(DataId, Linkage)>
pub fn declare_data(
&mut self,
name: &str,
linkage: Linkage,
writable: bool,
tls: bool
) -> ModuleResult<(DataId, Linkage)>
Declare a data object in this module.
sourcepub fn declare_anonymous_data(
&mut self,
writable: bool,
tls: bool
) -> ModuleResult<DataId>
pub fn declare_anonymous_data(
&mut self,
writable: bool,
tls: bool
) -> ModuleResult<DataId>
Declare an anonymous data object in this module.
Trait Implementations
sourceimpl Debug for ModuleDeclarations
impl Debug for ModuleDeclarations
sourceimpl Default for ModuleDeclarations
impl Default for ModuleDeclarations
sourcefn default() -> ModuleDeclarations
fn default() -> ModuleDeclarations
Returns the “default value” for a type. Read more
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
sourceimpl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
const: unstable · sourcefn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more