pub struct ModuleBuilder { /* private fields */ }
Expand description
Representation of modules before lowering.
Implementations§
Source§impl ModuleBuilder
impl ModuleBuilder
Sourcepub fn with_meta<T>(meta: T) -> Selfwhere
T: Into<ModuleMeta>,
pub fn with_meta<T>(meta: T) -> Selfwhere
T: Into<ModuleMeta>,
Create a builder with module meta information.
Sourcepub fn add_dependency<T>(&mut self, name: T)where
T: ToString,
pub fn add_dependency<T>(&mut self, name: T)where
T: ToString,
Add a module dependency for static inclusion.
Sourcepub fn add_with_args<T>(&mut self, name: T, args: Vec<Variable>) -> &mut Hir
pub fn add_with_args<T>(&mut self, name: T, args: Vec<Variable>) -> &mut Hir
Create a new function hir with arguments.
Sourcepub fn build(&self) -> Lovm2CompileResult<Module>
pub fn build(&self) -> Lovm2CompileResult<Module>
Generate a module from the current data. This uses the default CompileOptions e.g. optimization is enabled.
Sourcepub fn build_with_options(
&self,
options: CompileOptions,
) -> Lovm2CompileResult<Module>
pub fn build_with_options( &self, options: CompileOptions, ) -> Lovm2CompileResult<Module>
Generate a module from the current data but use custom compile options.
Sourcepub fn entry(&mut self) -> &mut Hir
pub fn entry(&mut self) -> &mut Hir
Create a new function handle with the ENTRY_POINT name.
Trait Implementations§
Source§impl Clone for ModuleBuilder
impl Clone for ModuleBuilder
Source§fn clone(&self) -> ModuleBuilder
fn clone(&self) -> ModuleBuilder
Returns a duplicate of the value. Read more
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source
. Read moreAuto Trait Implementations§
impl Freeze for ModuleBuilder
impl !RefUnwindSafe for ModuleBuilder
impl !Send for ModuleBuilder
impl !Sync for ModuleBuilder
impl Unpin for ModuleBuilder
impl !UnwindSafe for ModuleBuilder
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more