From 3dfc8f0258ab0884eef50cc8f33b8666cdb4c3cf Mon Sep 17 00:00:00 2001 From: johannst Date: Mon, 20 Nov 2023 23:28:40 +0000 Subject: deploy: 4e3898b34a5dbcfabbcf861998d915c261831b60 --- llvm_kaleidoscope_rs/llvm/struct.Module.html | 47 ++++++++++++++++++---------- 1 file changed, 30 insertions(+), 17 deletions(-) (limited to 'llvm_kaleidoscope_rs/llvm/struct.Module.html') diff --git a/llvm_kaleidoscope_rs/llvm/struct.Module.html b/llvm_kaleidoscope_rs/llvm/struct.Module.html index 5a3d463..875c51c 100644 --- a/llvm_kaleidoscope_rs/llvm/struct.Module.html +++ b/llvm_kaleidoscope_rs/llvm/struct.Module.html @@ -1,34 +1,47 @@ -Module in llvm_kaleidoscope_rs::llvm - Rust
pub struct Module { /* private fields */ }
Expand description

Wrapper for a LLVM Module with its own LLVM Context.

-

Implementations

Create a new Module instance.

+Module in llvm_kaleidoscope_rs::llvm - Rust
pub struct Module { /* private fields */ }
Expand description

Wrapper for a LLVM Module with its own LLVM Context.

+

Implementations§

source§

impl<'llvm> Module

source

pub fn new() -> Self

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.

+
source

pub fn dump(&self)

Dump LLVM IR emitted into the Module to stdout.

+
source

pub fn type_f64(&self) -> Type<'llvm>

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.

+
source

pub fn type_fn( + &'llvm self, + args: &mut [Type<'llvm>], + ret: Type<'llvm> +) -> Type<'llvm>

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 +

source

pub fn add_fn(&'llvm self, name: &str, fn_type: Type<'llvm>) -> FnValue<'llvm>

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.

+SmallCStr.

+
source

pub fn get_fn(&'llvm self, name: &str) -> Option<FnValue<'llvm>>

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 +

Panics if name could not be converted to a SmallCStr.

+
source

pub fn append_basic_block( + &'llvm self, + fn_value: FnValue<'llvm> +) -> BasicBlock<'llvm>

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. +

source

pub fn create_basic_block(&self) -> BasicBlock<'llvm>

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.

+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).

+

Trait Implementations§

source§

impl Drop for Module

source§

fn drop(&mut self)

Executes the destructor for this type. Read more

Auto Trait Implementations§

§

impl RefUnwindSafe for Module

§

impl !Send for Module

§

impl !Sync for Module

§

impl Unpin for Module

§

impl UnwindSafe for Module

Blanket Implementations§

source§

impl<T> Any for Twhere + T: 'static + ?Sized,

source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
source§

impl<T> Borrow<T> for Twhere + T: ?Sized,

source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
source§

impl<T> BorrowMut<T> for Twhere + T: ?Sized,

source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
source§

impl<T> From<T> for T

source§

fn from(t: T) -> T

Returns the argument unchanged.

+
source§

impl<T, U> Into<U> for Twhere + U: From<T>,

source§

fn into(self) -> U

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.
\ No newline at end of file +From<T> for U chooses to do.

+
source§

impl<T, U> TryFrom<U> for Twhere + U: Into<T>,

§

type Error = Infallible

The type returned in the event of a conversion error.
source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
source§

impl<T, U> TryInto<U> for Twhere + U: TryFrom<T>,

§

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

The type returned in the event of a conversion error.
source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.
\ No newline at end of file -- cgit v1.2.3