pub struct Module { /* private fields */ }
Expand description

Wrapper for a LLVM Module with its own LLVM Context.

Implementations

Create a new Module instance.

Panics

Panics if creating the context or the module fails.

Dump LLVM IR emitted into the Module to stdout.

Get a type reference representing a f64 float.

Panics

Panics if LLVM API returns a null pointer.

Get a type reference representing a fn(args) -> ret function.

Panics

Panics if LLVM API returns a null pointer.

Add a function with the given name and fn_type to the module and return a value reference representing the function.

Panics

Panics if LLVM API returns a null pointer or name could not be converted to a SmallCStr.

Get a function value reference to the function with the given name if it was previously added to the module with add_fn.

Panics

Panics if name could not be converted to a SmallCStr.

Append a Basic Block to the end of the function referenced by the value reference fn_value.

Panics

Panics if LLVM API returns a null pointer.

Create a free-standing Basic Block without adding it to a function. This can be added to a function at a later point in time with FnValue::append_basic_block.

Panics

Panics if LLVM API returns a null pointer.

Trait Implementations

Executes the destructor for this type. Read more

Auto Trait Implementations

Blanket Implementations

Gets the TypeId of self. Read more
Immutably borrows from an owned value. Read more
Mutably borrows from an owned value. Read more

Returns the argument unchanged.

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

The type returned in the event of a conversion error.
Performs the conversion.
The type returned in the event of a conversion error.
Performs the conversion.