Struct lovm2_core::gen::ModuleBuilder[][src]

pub struct ModuleBuilder { /* fields omitted */ }

Representation of modules before lowering.

Implementations

impl ModuleBuilder[src]

pub fn new() -> Self[src]

Create a builder.

pub fn named<T>(name: T) -> Self where
    T: ToString
[src]

Create a builder with a name.

pub fn with_meta<T>(meta: T) -> Self where
    T: Into<ModuleMeta>, 
[src]

Create a builder with module meta information.

pub fn add_dependency<T>(&mut self, name: T) where
    T: ToString
[src]

Add a module dependency for static inclusion.

pub fn add<T>(&mut self, name: T) -> &mut Hir where
    T: Into<Variable>, 
[src]

Create a new function hir without arguments.

pub fn add_with_args<T>(&mut self, name: T, args: Vec<Variable>) -> &mut Hir where
    T: Into<Variable>, 
[src]

Create a new function hir with arguments.

pub fn build(&self) -> Lovm2CompileResult<Module>[src]

Generate a module from the current data. This uses the default CompileOptions e.g. optimization is enabled.

pub fn build_with_options(
    &self,
    options: CompileOptions
) -> Lovm2CompileResult<Module>
[src]

Generate a module from the current data but use custom compile options.

pub fn entry(&mut self) -> &mut Hir[src]

Create a new function handle with the ENTRY_POINT name.

Trait Implementations

impl Clone for ModuleBuilder[src]

Auto Trait Implementations

Blanket Implementations

impl<T> Any for T where
    T: 'static + ?Sized
[src]

impl<T> Borrow<T> for T where
    T: ?Sized
[src]

impl<T> BorrowMut<T> for T where
    T: ?Sized
[src]

impl<T> From<T> for T[src]

impl<T, U> Into<U> for T where
    U: From<T>, 
[src]

impl<T> ToOwned for T where
    T: Clone
[src]

type Owned = T

The resulting type after obtaining ownership.

impl<T, U> TryFrom<U> for T where
    U: Into<T>, 
[src]

type Error = Infallible

The type returned in the event of a conversion error.

impl<T, U> TryInto<U> for T where
    U: TryFrom<T>, 
[src]

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.