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/all.html | 2 +- llvm_kaleidoscope_rs/codegen/index.html | 2 +- llvm_kaleidoscope_rs/codegen/sidebar-items.js | 2 +- llvm_kaleidoscope_rs/codegen/struct.Codegen.html | 22 ++++++--- llvm_kaleidoscope_rs/constant.SMALL_STR_SIZE.html | 4 +- llvm_kaleidoscope_rs/enum.Either.html | 28 ++++++++--- llvm_kaleidoscope_rs/index.html | 2 +- llvm_kaleidoscope_rs/lexer/enum.Token.html | 26 ++++++---- llvm_kaleidoscope_rs/lexer/index.html | 2 +- llvm_kaleidoscope_rs/lexer/sidebar-items.js | 2 +- llvm_kaleidoscope_rs/lexer/struct.Lexer.html | 23 +++++++-- .../llvm/fn.initialize_native_taget.html | 4 +- llvm_kaleidoscope_rs/llvm/fn.shutdown.html | 4 +- llvm_kaleidoscope_rs/llvm/index.html | 4 +- llvm_kaleidoscope_rs/llvm/sidebar-items.js | 2 +- llvm_kaleidoscope_rs/llvm/struct.BasicBlock.html | 19 +++++--- llvm_kaleidoscope_rs/llvm/struct.FnValue.html | 42 +++++++++------- .../llvm/struct.FunctionPassManager.html | 20 +++++--- llvm_kaleidoscope_rs/llvm/struct.IRBuilder.html | 57 ++++++++++++++-------- llvm_kaleidoscope_rs/llvm/struct.LLJit.html | 24 +++++---- llvm_kaleidoscope_rs/llvm/struct.Module.html | 47 +++++++++++------- llvm_kaleidoscope_rs/llvm/struct.PhiValue.html | 31 +++++++----- .../llvm/struct.ResourceTracker.html | 16 ++++-- llvm_kaleidoscope_rs/llvm/struct.Type.html | 21 +++++--- llvm_kaleidoscope_rs/llvm/struct.Value.html | 29 ++++++----- llvm_kaleidoscope_rs/parser/enum.ExprAST.html | 56 +++++++++++---------- llvm_kaleidoscope_rs/parser/index.html | 4 +- llvm_kaleidoscope_rs/parser/sidebar-items.js | 2 +- .../parser/struct.FunctionAST.html | 20 +++++--- llvm_kaleidoscope_rs/parser/struct.Parser.html | 33 +++++++++---- .../parser/struct.PrototypeAST.html | 21 +++++--- llvm_kaleidoscope_rs/sidebar-items.js | 2 +- llvm_kaleidoscope_rs/struct.SmallCStr.html | 26 ++++++---- 33 files changed, 384 insertions(+), 215 deletions(-) (limited to 'llvm_kaleidoscope_rs') diff --git a/llvm_kaleidoscope_rs/all.html b/llvm_kaleidoscope_rs/all.html index be46318..efe1713 100644 --- a/llvm_kaleidoscope_rs/all.html +++ b/llvm_kaleidoscope_rs/all.html @@ -1 +1 @@ -List of all items in this crate
\ No newline at end of file +List of all items in this crate
\ No newline at end of file diff --git a/llvm_kaleidoscope_rs/codegen/index.html b/llvm_kaleidoscope_rs/codegen/index.html index 05c6cde..31b168a 100644 --- a/llvm_kaleidoscope_rs/codegen/index.html +++ b/llvm_kaleidoscope_rs/codegen/index.html @@ -1 +1 @@ -llvm_kaleidoscope_rs::codegen - Rust

Structs

Code generator from kaleidoscope AST to LLVM IR.
\ No newline at end of file +llvm_kaleidoscope_rs::codegen - Rust

Structs

  • Code generator from kaleidoscope AST to LLVM IR.
\ No newline at end of file diff --git a/llvm_kaleidoscope_rs/codegen/sidebar-items.js b/llvm_kaleidoscope_rs/codegen/sidebar-items.js index 3bcd581..f5bf8e0 100644 --- a/llvm_kaleidoscope_rs/codegen/sidebar-items.js +++ b/llvm_kaleidoscope_rs/codegen/sidebar-items.js @@ -1 +1 @@ -window.SIDEBAR_ITEMS = {"struct":[["Codegen","Code generator from kaleidoscope AST to LLVM IR."]]}; \ No newline at end of file +window.SIDEBAR_ITEMS = {"struct":["Codegen"]}; \ No newline at end of file diff --git a/llvm_kaleidoscope_rs/codegen/struct.Codegen.html b/llvm_kaleidoscope_rs/codegen/struct.Codegen.html index c84fc43..27b7c6b 100644 --- a/llvm_kaleidoscope_rs/codegen/struct.Codegen.html +++ b/llvm_kaleidoscope_rs/codegen/struct.Codegen.html @@ -1,7 +1,17 @@ -Codegen in llvm_kaleidoscope_rs::codegen - Rust
pub struct Codegen<'llvm, 'a> { /* private fields */ }
Expand description

Code generator from kaleidoscope AST to LLVM IR.

-

Implementations

Compile either a PrototypeAST or a FunctionAST into the LLVM module.

-

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

+Codegen in llvm_kaleidoscope_rs::codegen - Rust
pub struct Codegen<'llvm, 'a> { /* private fields */ }
Expand description

Code generator from kaleidoscope AST to LLVM IR.

+

Implementations§

source§

impl<'llvm, 'a> Codegen<'llvm, 'a>

source

pub fn compile( + module: &'llvm Module, + fn_protos: &mut HashMap<String, PrototypeAST>, + compilee: Either<&PrototypeAST, &FunctionAST> +) -> Result<FnValue<'llvm>, String>

Compile either a PrototypeAST or a FunctionAST into the LLVM module.

+

Auto Trait Implementations§

§

impl<'llvm, 'a> RefUnwindSafe for Codegen<'llvm, 'a>

§

impl<'llvm, 'a> !Send for Codegen<'llvm, 'a>

§

impl<'llvm, 'a> !Sync for Codegen<'llvm, 'a>

§

impl<'llvm, 'a> Unpin for Codegen<'llvm, 'a>

§

impl<'llvm, 'a> !UnwindSafe for Codegen<'llvm, 'a>

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 diff --git a/llvm_kaleidoscope_rs/constant.SMALL_STR_SIZE.html b/llvm_kaleidoscope_rs/constant.SMALL_STR_SIZE.html index d96e14c..b26cb83 100644 --- a/llvm_kaleidoscope_rs/constant.SMALL_STR_SIZE.html +++ b/llvm_kaleidoscope_rs/constant.SMALL_STR_SIZE.html @@ -1,2 +1,2 @@ -SMALL_STR_SIZE in llvm_kaleidoscope_rs - Rust
pub const SMALL_STR_SIZE: usize = 16;
Expand description

Fixed size of SmallCStr including the trailing \0 byte.

-
\ No newline at end of file +SMALL_STR_SIZE in llvm_kaleidoscope_rs - Rust
pub const SMALL_STR_SIZE: usize = 16;
Expand description

Fixed size of SmallCStr including the trailing \0 byte.

+
\ No newline at end of file diff --git a/llvm_kaleidoscope_rs/enum.Either.html b/llvm_kaleidoscope_rs/enum.Either.html index 825138f..4da5022 100644 --- a/llvm_kaleidoscope_rs/enum.Either.html +++ b/llvm_kaleidoscope_rs/enum.Either.html @@ -1,9 +1,25 @@ -Either in llvm_kaleidoscope_rs - Rust
pub enum Either<A, B> {
+Either in llvm_kaleidoscope_rs - Rust
pub enum Either<A, B> {
     A(A),
     B(B),
-}
Expand description

Either type, for APIs accepting two types.

-

Variants

A(A)

B(B)

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

+}
Expand description

Either type, for APIs accepting two types.

+

Variants§

§

A(A)

§

B(B)

Auto Trait Implementations§

§

impl<A, B> RefUnwindSafe for Either<A, B>where + A: RefUnwindSafe, + B: RefUnwindSafe,

§

impl<A, B> Send for Either<A, B>where + A: Send, + B: Send,

§

impl<A, B> Sync for Either<A, B>where + A: Sync, + B: Sync,

§

impl<A, B> Unpin for Either<A, B>where + A: Unpin, + B: Unpin,

§

impl<A, B> UnwindSafe for Either<A, B>where + A: UnwindSafe, + B: UnwindSafe,

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 diff --git a/llvm_kaleidoscope_rs/index.html b/llvm_kaleidoscope_rs/index.html index 239da84..3b9fec9 100644 --- a/llvm_kaleidoscope_rs/index.html +++ b/llvm_kaleidoscope_rs/index.html @@ -1 +1 @@ -llvm_kaleidoscope_rs - Rust

Modules

Safe wrapper around the LLVM C API.

Structs

Small C string on the stack with fixed size SMALL_STR_SIZE.

Enums

Either type, for APIs accepting two types.

Constants

Fixed size of SmallCStr including the trailing \0 byte.
\ No newline at end of file +llvm_kaleidoscope_rs - Rust

Modules

Structs

Enums

  • Either type, for APIs accepting two types.

Constants

\ No newline at end of file diff --git a/llvm_kaleidoscope_rs/lexer/enum.Token.html b/llvm_kaleidoscope_rs/lexer/enum.Token.html index 3d8ea38..e883dee 100644 --- a/llvm_kaleidoscope_rs/lexer/enum.Token.html +++ b/llvm_kaleidoscope_rs/lexer/enum.Token.html @@ -1,19 +1,25 @@ -Token in llvm_kaleidoscope_rs::lexer - Rust
pub enum Token {
+Token in llvm_kaleidoscope_rs::lexer - Rust
pub enum Token {
     Eof,
     Def,
     Extern,
-    Identifier(String),
-    Number(f64),
-    Char(char),
+    Identifier(String),
+    Number(f64),
+    Char(char),
     If,
     Then,
     Else,
     For,
     In,
-}

Variants

Eof

Def

Extern

Identifier(String)

Number(f64)

Char(char)

If

Then

Else

For

In

Trait Implementations

Formats the value using the given formatter. Read more
This method tests for self and other values to be equal, and is used -by ==. Read more
This method tests for !=. The default implementation is almost always -sufficient, and should not be overridden without very good reason. 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).

+}

Variants§

§

Eof

§

Def

§

Extern

§

Identifier(String)

§

Number(f64)

§

Char(char)

§

If

§

Then

§

Else

§

For

§

In

Trait Implementations§

source§

impl Debug for Token

source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result

Formats the value using the given formatter. Read more
source§

impl PartialEq<Token> for Token

source§

fn eq(&self, other: &Token) -> bool

This method tests for self and other values to be equal, and is used +by ==.
1.0.0 · source§

fn ne(&self, other: &Rhs) -> bool

This method tests for !=. The default implementation is almost always +sufficient, and should not be overridden without very good reason.
source§

impl StructuralPartialEq for Token

Auto Trait Implementations§

§

impl RefUnwindSafe for Token

§

impl Send for Token

§

impl Sync for Token

§

impl Unpin for Token

§

impl UnwindSafe for Token

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 diff --git a/llvm_kaleidoscope_rs/lexer/index.html b/llvm_kaleidoscope_rs/lexer/index.html index 2b2c334..944e760 100644 --- a/llvm_kaleidoscope_rs/lexer/index.html +++ b/llvm_kaleidoscope_rs/lexer/index.html @@ -1 +1 @@ -llvm_kaleidoscope_rs::lexer - Rust
\ No newline at end of file +llvm_kaleidoscope_rs::lexer - Rust
\ No newline at end of file diff --git a/llvm_kaleidoscope_rs/lexer/sidebar-items.js b/llvm_kaleidoscope_rs/lexer/sidebar-items.js index a3ba100..cc3576c 100644 --- a/llvm_kaleidoscope_rs/lexer/sidebar-items.js +++ b/llvm_kaleidoscope_rs/lexer/sidebar-items.js @@ -1 +1 @@ -window.SIDEBAR_ITEMS = {"enum":[["Token",""]],"struct":[["Lexer",""]]}; \ No newline at end of file +window.SIDEBAR_ITEMS = {"enum":["Token"],"struct":["Lexer"]}; \ No newline at end of file diff --git a/llvm_kaleidoscope_rs/lexer/struct.Lexer.html b/llvm_kaleidoscope_rs/lexer/struct.Lexer.html index 6f08c48..c4e63a7 100644 --- a/llvm_kaleidoscope_rs/lexer/struct.Lexer.html +++ b/llvm_kaleidoscope_rs/lexer/struct.Lexer.html @@ -1,7 +1,20 @@ -Lexer in llvm_kaleidoscope_rs::lexer - Rust
pub struct Lexer<I>where
    I: Iterator<Item = char>,
{ /* private fields */ }

Implementations

Lex and return the next token.

+Lexer in llvm_kaleidoscope_rs::lexer - Rust
pub struct Lexer<I>where
+    I: Iterator<Item = char>,{ /* private fields */ }

Implementations§

source§

impl<I> Lexer<I>where + I: Iterator<Item = char>,

source

pub fn new(input: I) -> Lexer<I>

source

pub fn gettok(&mut self) -> Token

Lex and return the next token.

Implement int gettok(); from the tutorial.

-

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

+

Auto Trait Implementations§

§

impl<I> RefUnwindSafe for Lexer<I>where + I: RefUnwindSafe,

§

impl<I> Send for Lexer<I>where + I: Send,

§

impl<I> Sync for Lexer<I>where + I: Sync,

§

impl<I> Unpin for Lexer<I>where + I: Unpin,

§

impl<I> UnwindSafe for Lexer<I>where + I: UnwindSafe,

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 diff --git a/llvm_kaleidoscope_rs/llvm/fn.initialize_native_taget.html b/llvm_kaleidoscope_rs/llvm/fn.initialize_native_taget.html index fb42a17..de4f807 100644 --- a/llvm_kaleidoscope_rs/llvm/fn.initialize_native_taget.html +++ b/llvm_kaleidoscope_rs/llvm/fn.initialize_native_taget.html @@ -1,2 +1,2 @@ -initialize_native_taget in llvm_kaleidoscope_rs::llvm - Rust
pub fn initialize_native_taget()
Expand description

Initialize native target for corresponding to host (useful for jitting).

-
\ No newline at end of file +initialize_native_taget in llvm_kaleidoscope_rs::llvm - Rust
pub fn initialize_native_taget()
Expand description

Initialize native target for corresponding to host (useful for jitting).

+
\ No newline at end of file diff --git a/llvm_kaleidoscope_rs/llvm/fn.shutdown.html b/llvm_kaleidoscope_rs/llvm/fn.shutdown.html index d859aaa..4e32c97 100644 --- a/llvm_kaleidoscope_rs/llvm/fn.shutdown.html +++ b/llvm_kaleidoscope_rs/llvm/fn.shutdown.html @@ -1,2 +1,2 @@ -shutdown in llvm_kaleidoscope_rs::llvm - Rust
pub fn shutdown()
Expand description

Deallocate and destroy all “ManagedStatic” variables.

-
\ No newline at end of file +shutdown in llvm_kaleidoscope_rs::llvm - Rust
pub fn shutdown()
Expand description

Deallocate and destroy all “ManagedStatic” variables.

+
\ No newline at end of file diff --git a/llvm_kaleidoscope_rs/llvm/index.html b/llvm_kaleidoscope_rs/llvm/index.html index 716a7f9..dba2538 100644 --- a/llvm_kaleidoscope_rs/llvm/index.html +++ b/llvm_kaleidoscope_rs/llvm/index.html @@ -1,8 +1,8 @@ -llvm_kaleidoscope_rs::llvm - Rust
Expand description

Safe wrapper around the LLVM C API.

+llvm_kaleidoscope_rs::llvm - Rust
Expand description

Safe wrapper around the LLVM C API.

References returned from the LLVM API are tied to the 'llvm lifetime which is bound to the context where the objects are created in. We do not offer wrappers to remove or delete any objects in the context and therefore all the references will be valid for the liftime of the context.

For the scope of this tutorial we mainly use assertions to validate the results from the LLVM API calls.

-

Structs

Wrapper for a LLVM Basic Block.
Wrapper for a LLVM Value Reference specialized for contexts where function values are needed.
Wrapper for a LLVM Function PassManager (legacy).
Wrapper for a LLVM IR Builder.
Wrapper for a LLVM LLJIT.
Wrapper for a LLVM Module with its own LLVM Context.
Wrapper for a LLVM Value Reference specialized for contexts where phi values are needed.
A resource handle for code added to an LLJit instance.
Wrapper for a LLVM Type Reference.
Wrapper for a LLVM Value Reference.

Functions

Initialize native target for corresponding to host (useful for jitting).
Deallocate and destroy all “ManagedStatic” variables.
\ No newline at end of file +

Structs

  • Wrapper for a LLVM Basic Block.
  • Wrapper for a LLVM Value Reference specialized for contexts where function values are needed.
  • Wrapper for a LLVM Function PassManager (legacy).
  • Wrapper for a LLVM IR Builder.
  • Wrapper for a LLVM LLJIT.
  • Wrapper for a LLVM Module with its own LLVM Context.
  • Wrapper for a LLVM Value Reference specialized for contexts where phi values are needed.
  • A resource handle for code added to an LLJit instance.
  • Wrapper for a LLVM Type Reference.
  • Wrapper for a LLVM Value Reference.

Functions

  • Initialize native target for corresponding to host (useful for jitting).
  • Deallocate and destroy all “ManagedStatic” variables.
\ No newline at end of file diff --git a/llvm_kaleidoscope_rs/llvm/sidebar-items.js b/llvm_kaleidoscope_rs/llvm/sidebar-items.js index eda7ea8..d4f6ee3 100644 --- a/llvm_kaleidoscope_rs/llvm/sidebar-items.js +++ b/llvm_kaleidoscope_rs/llvm/sidebar-items.js @@ -1 +1 @@ -window.SIDEBAR_ITEMS = {"fn":[["initialize_native_taget","Initialize native target for corresponding to host (useful for jitting)."],["shutdown","Deallocate and destroy all “ManagedStatic” variables."]],"struct":[["BasicBlock","Wrapper for a LLVM Basic Block."],["FnValue","Wrapper for a LLVM Value Reference specialized for contexts where function values are needed."],["FunctionPassManager","Wrapper for a LLVM Function PassManager (legacy)."],["IRBuilder","Wrapper for a LLVM IR Builder."],["LLJit","Wrapper for a LLVM LLJIT."],["Module","Wrapper for a LLVM Module with its own LLVM Context."],["PhiValue","Wrapper for a LLVM Value Reference specialized for contexts where phi values are needed."],["ResourceTracker","A resource handle for code added to an [`LLJit`] instance."],["Type","Wrapper for a LLVM Type Reference."],["Value","Wrapper for a LLVM Value Reference."]]}; \ No newline at end of file +window.SIDEBAR_ITEMS = {"fn":["initialize_native_taget","shutdown"],"struct":["BasicBlock","FnValue","FunctionPassManager","IRBuilder","LLJit","Module","PhiValue","ResourceTracker","Type","Value"]}; \ No newline at end of file diff --git a/llvm_kaleidoscope_rs/llvm/struct.BasicBlock.html b/llvm_kaleidoscope_rs/llvm/struct.BasicBlock.html index f338ec4..4cf8ae1 100644 --- a/llvm_kaleidoscope_rs/llvm/struct.BasicBlock.html +++ b/llvm_kaleidoscope_rs/llvm/struct.BasicBlock.html @@ -1,9 +1,16 @@ -BasicBlock in llvm_kaleidoscope_rs::llvm - Rust
pub struct BasicBlock<'llvm>(_, _);
Expand description

Wrapper for a LLVM Basic Block.

-

Implementations

Get the function to which the basic block belongs.

+BasicBlock in llvm_kaleidoscope_rs::llvm - Rust
pub struct BasicBlock<'llvm>(_, _);
Expand description

Wrapper for a LLVM Basic Block.

+

Implementations§

source§

impl<'llvm> BasicBlock<'llvm>

source

pub fn get_parent(&self) -> FnValue<'llvm>

Get the function to which the basic block belongs.

Panics

Panics if LLVM API returns a null pointer.

-

Trait Implementations

Returns a copy of the value. Read more
Performs copy-assignment from source. 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<'llvm> Clone for BasicBlock<'llvm>

source§

fn clone(&self) -> BasicBlock<'llvm>

Returns a copy of the value. Read more
1.0.0 · source§

fn clone_from(&mut self, source: &Self)

Performs copy-assignment from source. Read more
source§

impl<'llvm> Copy for BasicBlock<'llvm>

Auto Trait Implementations§

§

impl<'llvm> RefUnwindSafe for BasicBlock<'llvm>

§

impl<'llvm> !Send for BasicBlock<'llvm>

§

impl<'llvm> !Sync for BasicBlock<'llvm>

§

impl<'llvm> Unpin for BasicBlock<'llvm>

§

impl<'llvm> UnwindSafe for BasicBlock<'llvm>

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 resulting type after obtaining ownership.
Creates owned data from borrowed data, usually by cloning. Read more
Uses borrowed data to replace owned data, usually by cloning. Read more
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> ToOwned for Twhere + T: Clone,

§

type Owned = T

The resulting type after obtaining ownership.
source§

fn to_owned(&self) -> T

Creates owned data from borrowed data, usually by cloning. Read more
source§

fn clone_into(&self, target: &mut T)

Uses borrowed data to replace owned data, usually by cloning. Read more
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 diff --git a/llvm_kaleidoscope_rs/llvm/struct.FnValue.html b/llvm_kaleidoscope_rs/llvm/struct.FnValue.html index 7a63d42..98fab18 100644 --- a/llvm_kaleidoscope_rs/llvm/struct.FnValue.html +++ b/llvm_kaleidoscope_rs/llvm/struct.FnValue.html @@ -1,28 +1,36 @@ -FnValue in llvm_kaleidoscope_rs::llvm - Rust
#[repr(transparent)]
pub struct FnValue<'llvm>(_);
Expand description

Wrapper for a LLVM Value Reference specialized for contexts where function values are needed.

-

Implementations

Get a type reference representing the return value of the given function value.

+FnValue in llvm_kaleidoscope_rs::llvm - Rust
#[repr(transparent)]
pub struct FnValue<'llvm>(_);
Expand description

Wrapper for a LLVM Value Reference specialized for contexts where function values are needed.

+

Implementations§

source§

impl<'llvm> FnValue<'llvm>

source

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

Get a type reference representing the function type (return + args) of the given function +value.

Panics

Panics if LLVM API returns a null pointer.

-

Get the number of function arguments for the given function value.

-

Get a value reference for the function argument at index idx.

+
source

pub fn args(&self) -> usize

Get the number of function arguments for the given function value.

+
source

pub fn arg(&self, idx: usize) -> Value<'llvm>

Get a value reference for the function argument at index idx.

Panics

Panics if LLVM API returns a null pointer or indexed out of bounds.

-

Get the number of Basic Blocks for the given function value.

-

Append a Basic Block to the end of the function value.

-

Verify that the given function is valid.

-

Methods from Deref<Target = Value<'llvm>>

Dump the LLVM Value to stdout.

-

Get a type reference representing for the given value reference.

+
source

pub fn basic_blocks(&self) -> usize

Get the number of Basic Blocks for the given function value.

+
source

pub fn append_basic_block(&self, bb: BasicBlock<'llvm>)

Append a Basic Block to the end of the function value.

+
source

pub fn verify(&self) -> bool

Verify that the given function is valid.

+

Methods from Deref<Target = Value<'llvm>>§

source

pub fn dump(&self)

Dump the LLVM Value to stdout.

+
source

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

Get a type reference representing for the given value reference.

Panics

Panics if LLVM API returns a null pointer.

-

Set the name for the given value reference.

+
source

pub fn set_name(&self, name: &str)

Set the name for the given value reference.

Panics

Panics if LLVM API returns a null pointer.

-

Get the name for the given value reference.

+
source

pub fn get_name(&self) -> &'llvm str

Get the name for the given value reference.

Panics

Panics if LLVM API returns a null pointer.

-

Check if value is of f64 type.

-

Check if value is of integer type.

-

Trait Implementations

Returns a copy of the value. Read more
Performs copy-assignment from source. Read more
The resulting type after dereferencing.
Dereferences the value.

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

+
source

pub fn is_f64(&self) -> bool

Check if value is of f64 type.

+
source

pub fn is_int(&self) -> bool

Check if value is of integer type.

+

Trait Implementations§

source§

impl<'llvm> Clone for FnValue<'llvm>

source§

fn clone(&self) -> FnValue<'llvm>

Returns a copy of the value. Read more
1.0.0 · source§

fn clone_from(&mut self, source: &Self)

Performs copy-assignment from source. Read more
source§

impl<'llvm> Deref for FnValue<'llvm>

§

type Target = Value<'llvm>

The resulting type after dereferencing.
source§

fn deref(&self) -> &Self::Target

Dereferences the value.
source§

impl<'llvm> Copy for FnValue<'llvm>

Auto Trait Implementations§

§

impl<'llvm> RefUnwindSafe for FnValue<'llvm>

§

impl<'llvm> !Send for FnValue<'llvm>

§

impl<'llvm> !Sync for FnValue<'llvm>

§

impl<'llvm> Unpin for FnValue<'llvm>

§

impl<'llvm> UnwindSafe for FnValue<'llvm>

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 resulting type after obtaining ownership.
Creates owned data from borrowed data, usually by cloning. Read more
Uses borrowed data to replace owned data, usually by cloning. Read more
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> ToOwned for Twhere + T: Clone,

§

type Owned = T

The resulting type after obtaining ownership.
source§

fn to_owned(&self) -> T

Creates owned data from borrowed data, usually by cloning. Read more
source§

fn clone_into(&self, target: &mut T)

Uses borrowed data to replace owned data, usually by cloning. Read more
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 diff --git a/llvm_kaleidoscope_rs/llvm/struct.FunctionPassManager.html b/llvm_kaleidoscope_rs/llvm/struct.FunctionPassManager.html index 5800a38..26b4236 100644 --- a/llvm_kaleidoscope_rs/llvm/struct.FunctionPassManager.html +++ b/llvm_kaleidoscope_rs/llvm/struct.FunctionPassManager.html @@ -1,5 +1,5 @@ -FunctionPassManager in llvm_kaleidoscope_rs::llvm - Rust
pub struct FunctionPassManager<'llvm> { /* private fields */ }
Expand description

Wrapper for a LLVM Function PassManager (legacy).

-

Implementations

Create a new Function PassManager with the following optimization passes

+FunctionPassManager in llvm_kaleidoscope_rs::llvm - Rust
pub struct FunctionPassManager<'llvm> { /* private fields */ }
Expand description

Wrapper for a LLVM Function PassManager (legacy).

+

Implementations§

source§

impl<'llvm> FunctionPassManager<'llvm>

source

pub fn with_ctx(module: &'llvm Module) -> FunctionPassManager<'llvm>

Create a new Function PassManager with the following optimization passes

  • InstructionCombiningPass
  • ReassociatePass
  • @@ -8,10 +8,16 @@

The list of selected optimization passes is taken from the tutorial chapter LLVM Optimization Passes.

-

Run the optimization passes registered with the Function PassManager on the function +

source

pub fn run(&'llvm self, fn_value: FnValue<'llvm>)

Run the optimization passes registered with the Function PassManager on the function referenced by fn_value.

-

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 FunctionPassManager<'_>

source§

fn drop(&mut self)

Executes the destructor for this type. Read more

Auto Trait Implementations§

§

impl<'llvm> RefUnwindSafe for FunctionPassManager<'llvm>

§

impl<'llvm> !Send for FunctionPassManager<'llvm>

§

impl<'llvm> !Sync for FunctionPassManager<'llvm>

§

impl<'llvm> Unpin for FunctionPassManager<'llvm>

§

impl<'llvm> UnwindSafe for FunctionPassManager<'llvm>

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 diff --git a/llvm_kaleidoscope_rs/llvm/struct.IRBuilder.html b/llvm_kaleidoscope_rs/llvm/struct.IRBuilder.html index b98503a..5c8049e 100644 --- a/llvm_kaleidoscope_rs/llvm/struct.IRBuilder.html +++ b/llvm_kaleidoscope_rs/llvm/struct.IRBuilder.html @@ -1,46 +1,65 @@ -IRBuilder in llvm_kaleidoscope_rs::llvm - Rust
pub struct IRBuilder<'llvm> { /* private fields */ }
Expand description

Wrapper for a LLVM IR Builder.

-

Implementations

Create a new LLVM IR Builder with the modules context.

+IRBuilder in llvm_kaleidoscope_rs::llvm - Rust
pub struct IRBuilder<'llvm> { /* private fields */ }
Expand description

Wrapper for a LLVM IR Builder.

+

Implementations§

source§

impl<'llvm> IRBuilder<'llvm>

source

pub fn with_ctx(module: &'llvm Module) -> IRBuilder<'llvm>

Create a new LLVM IR Builder with the modules context.

Panics

Panics if creating the IR Builder fails.

-

Position the IR Builder at the end of the given Basic Block.

-

Get the BasicBlock the IRBuilder currently inputs into.

+
source

pub fn pos_at_end(&self, bb: BasicBlock<'llvm>)

Position the IR Builder at the end of the given Basic Block.

+
source

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

Get the BasicBlock the IRBuilder currently inputs into.

Panics

Panics if LLVM API returns a null pointer.

-

Emit a fadd instruction.

+
source

pub fn fadd(&self, lhs: Value<'llvm>, rhs: Value<'llvm>) -> Value<'llvm>

Emit a fadd instruction.

Panics

Panics if LLVM API returns a null pointer.

-

Emit a fsub instruction.

+
source

pub fn fsub(&self, lhs: Value<'llvm>, rhs: Value<'llvm>) -> Value<'llvm>

Emit a fsub instruction.

Panics

Panics if LLVM API returns a null pointer.

-

Emit a fmul instruction.

+
source

pub fn fmul(&self, lhs: Value<'llvm>, rhs: Value<'llvm>) -> Value<'llvm>

Emit a fmul instruction.

Panics

Panics if LLVM API returns a null pointer.

-

Emit a fcmpult instruction.

+
source

pub fn fcmpult(&self, lhs: Value<'llvm>, rhs: Value<'llvm>) -> Value<'llvm>

Emit a fcmpult instruction.

Panics

Panics if LLVM API returns a null pointer.

-

Emit a fcmpone instruction.

+
source

pub fn fcmpone(&self, lhs: Value<'llvm>, rhs: Value<'llvm>) -> Value<'llvm>

Emit a fcmpone instruction.

Panics

Panics if LLVM API returns a null pointer.

-

Emit a uitofp instruction.

+
source

pub fn uitofp(&self, val: Value<'llvm>, dest_type: Type<'llvm>) -> Value<'llvm>

Emit a uitofp instruction.

Panics

Panics if LLVM API returns a null pointer.

-

Emit a call instruction.

+
source

pub fn call( + &self, + fn_value: FnValue<'llvm>, + args: &mut [Value<'llvm>] +) -> Value<'llvm>

Emit a call instruction.

Panics

Panics if LLVM API returns a null pointer.

-

Emit a ret instruction.

+
source

pub fn ret(&self, ret: Value<'llvm>)

Emit a ret instruction.

Panics

Panics if LLVM API returns a null pointer.

-

Emit an unconditional br instruction.

+
source

pub fn br(&self, dest: BasicBlock<'llvm>)

Emit an unconditional br instruction.

Panics

Panics if LLVM API returns a null pointer.

-

Emit a conditional br instruction.

+
source

pub fn cond_br( + &self, + cond: Value<'llvm>, + then: BasicBlock<'llvm>, + else_: BasicBlock<'llvm> +)

Emit a conditional br instruction.

Panics

Panics if LLVM API returns a null pointer.

-

Emit a phi instruction.

+
source

pub fn phi( + &self, + phi_type: Type<'llvm>, + incoming: &[(Value<'llvm>, BasicBlock<'llvm>)] +) -> PhiValue<'llvm>

Emit a phi instruction.

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 IRBuilder<'_>

source§

fn drop(&mut self)

Executes the destructor for this type. Read more

Auto Trait Implementations§

§

impl<'llvm> RefUnwindSafe for IRBuilder<'llvm>

§

impl<'llvm> !Send for IRBuilder<'llvm>

§

impl<'llvm> !Sync for IRBuilder<'llvm>

§

impl<'llvm> Unpin for IRBuilder<'llvm>

§

impl<'llvm> UnwindSafe for IRBuilder<'llvm>

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 diff --git a/llvm_kaleidoscope_rs/llvm/struct.LLJit.html b/llvm_kaleidoscope_rs/llvm/struct.LLJit.html index 35fced9..f5f3434 100644 --- a/llvm_kaleidoscope_rs/llvm/struct.LLJit.html +++ b/llvm_kaleidoscope_rs/llvm/struct.LLJit.html @@ -1,19 +1,25 @@ -LLJit in llvm_kaleidoscope_rs::llvm - Rust
pub struct LLJit { /* private fields */ }
Expand description

Wrapper for a LLVM LLJIT.

-

Implementations

Create a new LLJit instance.

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

Wrapper for a LLVM LLJIT.

+

Implementations§

source§

impl LLJit

source

pub fn new() -> LLJit

Create a new LLJit instance.

Panics

Panics if LLVM API returns a null pointer or an error.

-

Add an LLVM IR module to the JIT. Return a ResourceTracker, which when dropped, will +

source

pub fn add_module(&self, module: Module) -> ResourceTracker<'_>

Add an LLVM IR module to the JIT. Return a ResourceTracker, which when dropped, will remove the code of the LLVM IR module from the JIT.

Panics

Panics if LLVM API returns a null pointer or an error.

-

Find the symbol with the name sym in the JIT.

+
source

pub fn find_symbol<F: JitFn>(&self, sym: &str) -> F

Find the symbol with the name sym in the JIT.

Panics

Panics if the symbol is not found in the JIT.

-

Enable lookup of dynamic symbols available in the current process from the JIT.

+
source

pub fn enable_process_symbols(&self)

Enable lookup of dynamic symbols available in the current process from the JIT.

Panics

Panics if LLVM API returns an error.

-

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

+

Auto Trait Implementations§

§

impl RefUnwindSafe for LLJit

§

impl !Send for LLJit

§

impl !Sync for LLJit

§

impl Unpin for LLJit

§

impl UnwindSafe for LLJit

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 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 diff --git a/llvm_kaleidoscope_rs/llvm/struct.PhiValue.html b/llvm_kaleidoscope_rs/llvm/struct.PhiValue.html index bfbd3f0..12b5c98 100644 --- a/llvm_kaleidoscope_rs/llvm/struct.PhiValue.html +++ b/llvm_kaleidoscope_rs/llvm/struct.PhiValue.html @@ -1,19 +1,26 @@ -PhiValue in llvm_kaleidoscope_rs::llvm - Rust
#[repr(transparent)]
pub struct PhiValue<'llvm>(_);
Expand description

Wrapper for a LLVM Value Reference specialized for contexts where phi values are needed.

-

Implementations

Add an incoming value to the end of a PHI list.

-

Methods from Deref<Target = Value<'llvm>>

Dump the LLVM Value to stdout.

-

Get a type reference representing for the given value reference.

+PhiValue in llvm_kaleidoscope_rs::llvm - Rust
#[repr(transparent)]
pub struct PhiValue<'llvm>(_);
Expand description

Wrapper for a LLVM Value Reference specialized for contexts where phi values are needed.

+

Implementations§

source§

impl<'llvm> PhiValue<'llvm>

source

pub fn add_incoming(&self, ival: Value<'llvm>, ibb: BasicBlock<'llvm>)

Add an incoming value to the end of a PHI list.

+

Methods from Deref<Target = Value<'llvm>>§

source

pub fn dump(&self)

Dump the LLVM Value to stdout.

+
source

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

Get a type reference representing for the given value reference.

Panics

Panics if LLVM API returns a null pointer.

-

Set the name for the given value reference.

+
source

pub fn set_name(&self, name: &str)

Set the name for the given value reference.

Panics

Panics if LLVM API returns a null pointer.

-

Get the name for the given value reference.

+
source

pub fn get_name(&self) -> &'llvm str

Get the name for the given value reference.

Panics

Panics if LLVM API returns a null pointer.

-

Check if value is of f64 type.

-

Check if value is of integer type.

-

Trait Implementations

Returns a copy of the value. Read more
Performs copy-assignment from source. Read more
The resulting type after dereferencing.
Dereferences the value.

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

+
source

pub fn is_f64(&self) -> bool

Check if value is of f64 type.

+
source

pub fn is_int(&self) -> bool

Check if value is of integer type.

+

Trait Implementations§

source§

impl<'llvm> Clone for PhiValue<'llvm>

source§

fn clone(&self) -> PhiValue<'llvm>

Returns a copy of the value. Read more
1.0.0 · source§

fn clone_from(&mut self, source: &Self)

Performs copy-assignment from source. Read more
source§

impl<'llvm> Deref for PhiValue<'llvm>

§

type Target = Value<'llvm>

The resulting type after dereferencing.
source§

fn deref(&self) -> &Self::Target

Dereferences the value.
source§

impl<'llvm> Copy for PhiValue<'llvm>

Auto Trait Implementations§

§

impl<'llvm> RefUnwindSafe for PhiValue<'llvm>

§

impl<'llvm> !Send for PhiValue<'llvm>

§

impl<'llvm> !Sync for PhiValue<'llvm>

§

impl<'llvm> Unpin for PhiValue<'llvm>

§

impl<'llvm> UnwindSafe for PhiValue<'llvm>

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 resulting type after obtaining ownership.
Creates owned data from borrowed data, usually by cloning. Read more
Uses borrowed data to replace owned data, usually by cloning. Read more
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> ToOwned for Twhere + T: Clone,

§

type Owned = T

The resulting type after obtaining ownership.
source§

fn to_owned(&self) -> T

Creates owned data from borrowed data, usually by cloning. Read more
source§

fn clone_into(&self, target: &mut T)

Uses borrowed data to replace owned data, usually by cloning. Read more
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 diff --git a/llvm_kaleidoscope_rs/llvm/struct.ResourceTracker.html b/llvm_kaleidoscope_rs/llvm/struct.ResourceTracker.html index 2c4e72f..3cf682e 100644 --- a/llvm_kaleidoscope_rs/llvm/struct.ResourceTracker.html +++ b/llvm_kaleidoscope_rs/llvm/struct.ResourceTracker.html @@ -1,8 +1,14 @@ -ResourceTracker in llvm_kaleidoscope_rs::llvm - Rust
pub struct ResourceTracker<'jit>(_, _);
Expand description

A resource handle for code added to an LLJit instance.

+ResourceTracker in llvm_kaleidoscope_rs::llvm - Rust
pub struct ResourceTracker<'jit>(_, _);
Expand description

A resource handle for code added to an LLJit instance.

When a ResourceTracker handle is dropped, the code corresponding to the handle will be removed from the JIT.

-

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 ResourceTracker<'_>

source§

fn drop(&mut self)

Executes the destructor for this type. Read more

Auto Trait Implementations§

§

impl<'jit> RefUnwindSafe for ResourceTracker<'jit>

§

impl<'jit> !Send for ResourceTracker<'jit>

§

impl<'jit> !Sync for ResourceTracker<'jit>

§

impl<'jit> Unpin for ResourceTracker<'jit>

§

impl<'jit> UnwindSafe for ResourceTracker<'jit>

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 diff --git a/llvm_kaleidoscope_rs/llvm/struct.Type.html b/llvm_kaleidoscope_rs/llvm/struct.Type.html index 678e905..bea8907 100644 --- a/llvm_kaleidoscope_rs/llvm/struct.Type.html +++ b/llvm_kaleidoscope_rs/llvm/struct.Type.html @@ -1,10 +1,17 @@ -Type in llvm_kaleidoscope_rs::llvm - Rust
#[repr(transparent)]
pub struct Type<'llvm>(_, _);
Expand description

Wrapper for a LLVM Type Reference.

-

Implementations

Dump the LLVM Type to stdout.

-

Get a value reference representing the const f64 value.

+Type in llvm_kaleidoscope_rs::llvm - Rust
#[repr(transparent)]
pub struct Type<'llvm>(_, _);
Expand description

Wrapper for a LLVM Type Reference.

+

Implementations§

source§

impl<'llvm> Type<'llvm>

source

pub fn dump(&self)

Dump the LLVM Type to stdout.

+
source

pub fn const_f64(self, n: f64) -> Value<'llvm>

Get a value reference representing the const f64 value.

Panics

Panics if LLVM API returns a null pointer.

-

Trait Implementations

Returns a copy of the value. Read more
Performs copy-assignment from source. 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<'llvm> Clone for Type<'llvm>

source§

fn clone(&self) -> Type<'llvm>

Returns a copy of the value. Read more
1.0.0 · source§

fn clone_from(&mut self, source: &Self)

Performs copy-assignment from source. Read more
source§

impl<'llvm> Copy for Type<'llvm>

Auto Trait Implementations§

§

impl<'llvm> RefUnwindSafe for Type<'llvm>

§

impl<'llvm> !Send for Type<'llvm>

§

impl<'llvm> !Sync for Type<'llvm>

§

impl<'llvm> Unpin for Type<'llvm>

§

impl<'llvm> UnwindSafe for Type<'llvm>

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 resulting type after obtaining ownership.
Creates owned data from borrowed data, usually by cloning. Read more
Uses borrowed data to replace owned data, usually by cloning. Read more
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> ToOwned for Twhere + T: Clone,

§

type Owned = T

The resulting type after obtaining ownership.
source§

fn to_owned(&self) -> T

Creates owned data from borrowed data, usually by cloning. Read more
source§

fn clone_into(&self, target: &mut T)

Uses borrowed data to replace owned data, usually by cloning. Read more
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 diff --git a/llvm_kaleidoscope_rs/llvm/struct.Value.html b/llvm_kaleidoscope_rs/llvm/struct.Value.html index cb3ab2a..4908317 100644 --- a/llvm_kaleidoscope_rs/llvm/struct.Value.html +++ b/llvm_kaleidoscope_rs/llvm/struct.Value.html @@ -1,18 +1,25 @@ -Value in llvm_kaleidoscope_rs::llvm - Rust
#[repr(transparent)]
pub struct Value<'llvm>(_, _);
Expand description

Wrapper for a LLVM Value Reference.

-

Implementations

Dump the LLVM Value to stdout.

-

Get a type reference representing for the given value reference.

+Value in llvm_kaleidoscope_rs::llvm - Rust
#[repr(transparent)]
pub struct Value<'llvm>(_, _);
Expand description

Wrapper for a LLVM Value Reference.

+

Implementations§

source§

impl<'llvm> Value<'llvm>

source

pub fn dump(&self)

Dump the LLVM Value to stdout.

+
source

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

Get a type reference representing for the given value reference.

Panics

Panics if LLVM API returns a null pointer.

-

Set the name for the given value reference.

+
source

pub fn set_name(&self, name: &str)

Set the name for the given value reference.

Panics

Panics if LLVM API returns a null pointer.

-

Get the name for the given value reference.

+
source

pub fn get_name(&self) -> &'llvm str

Get the name for the given value reference.

Panics

Panics if LLVM API returns a null pointer.

-

Check if value is of f64 type.

-

Check if value is of integer type.

-

Trait Implementations

Returns a copy of the value. Read more
Performs copy-assignment from source. 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).

+
source

pub fn is_f64(&self) -> bool

Check if value is of f64 type.

+
source

pub fn is_int(&self) -> bool

Check if value is of integer type.

+

Trait Implementations§

source§

impl<'llvm> Clone for Value<'llvm>

source§

fn clone(&self) -> Value<'llvm>

Returns a copy of the value. Read more
1.0.0 · source§

fn clone_from(&mut self, source: &Self)

Performs copy-assignment from source. Read more
source§

impl<'llvm> Copy for Value<'llvm>

Auto Trait Implementations§

§

impl<'llvm> RefUnwindSafe for Value<'llvm>

§

impl<'llvm> !Send for Value<'llvm>

§

impl<'llvm> !Sync for Value<'llvm>

§

impl<'llvm> Unpin for Value<'llvm>

§

impl<'llvm> UnwindSafe for Value<'llvm>

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 resulting type after obtaining ownership.
Creates owned data from borrowed data, usually by cloning. Read more
Uses borrowed data to replace owned data, usually by cloning. Read more
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> ToOwned for Twhere + T: Clone,

§

type Owned = T

The resulting type after obtaining ownership.
source§

fn to_owned(&self) -> T

Creates owned data from borrowed data, usually by cloning. Read more
source§

fn clone_into(&self, target: &mut T)

Uses borrowed data to replace owned data, usually by cloning. Read more
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 diff --git a/llvm_kaleidoscope_rs/parser/enum.ExprAST.html b/llvm_kaleidoscope_rs/parser/enum.ExprAST.html index b716736..b5915ac 100644 --- a/llvm_kaleidoscope_rs/parser/enum.ExprAST.html +++ b/llvm_kaleidoscope_rs/parser/enum.ExprAST.html @@ -1,30 +1,36 @@ -ExprAST in llvm_kaleidoscope_rs::parser - Rust
pub enum ExprAST {
-    Number(f64),
-    Variable(String),
-    Binary(charBox<ExprAST>, Box<ExprAST>),
-    Call(StringVec<ExprAST>),
+ExprAST in llvm_kaleidoscope_rs::parser - Rust
pub enum ExprAST {
+    Number(f64),
+    Variable(String),
+    Binary(char, Box<ExprAST>, Box<ExprAST>),
+    Call(String, Vec<ExprAST>),
     If {
-        cond: Box<ExprAST>,
-        then: Box<ExprAST>,
-        else_: Box<ExprAST>,
+        cond: Box<ExprAST>,
+        then: Box<ExprAST>,
+        else_: Box<ExprAST>,
     },
     For {
-        var: String,
-        start: Box<ExprAST>,
-        end: Box<ExprAST>,
-        step: Option<Box<ExprAST>>,
-        body: Box<ExprAST>,
+        var: String,
+        start: Box<ExprAST>,
+        end: Box<ExprAST>,
+        step: Option<Box<ExprAST>>,
+        body: Box<ExprAST>,
     },
-}

Variants

Number(f64)

Number - Expression class for numeric literals like “1.0”.

-

Variable(String)

Variable - Expression class for referencing a variable, like “a”.

-

Binary(charBox<ExprAST>, Box<ExprAST>)

Binary - Expression class for a binary operator.

-

Call(StringVec<ExprAST>)

Call - Expression class for function calls.

-

If

Fields

cond: Box<ExprAST>
then: Box<ExprAST>
else_: Box<ExprAST>

If - Expression class for if/then/else.

-

For

Fields

var: String
start: Box<ExprAST>
end: Box<ExprAST>
step: Option<Box<ExprAST>>
body: Box<ExprAST>

ForExprAST - Expression class for for/in.

-

Trait Implementations

Formats the value using the given formatter. Read more
This method tests for self and other values to be equal, and is used -by ==. Read more
This method tests for !=. The default implementation is almost always -sufficient, and should not be overridden without very good reason. 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).

+}

Variants§

§

Number(f64)

Number - Expression class for numeric literals like “1.0”.

+
§

Variable(String)

Variable - Expression class for referencing a variable, like “a”.

+
§

Binary(char, Box<ExprAST>, Box<ExprAST>)

Binary - Expression class for a binary operator.

+
§

Call(String, Vec<ExprAST>)

Call - Expression class for function calls.

+
§

If

Fields

§cond: Box<ExprAST>
§then: Box<ExprAST>
§else_: Box<ExprAST>

If - Expression class for if/then/else.

+
§

For

Fields

§start: Box<ExprAST>
§body: Box<ExprAST>

ForExprAST - Expression class for for/in.

+

Trait Implementations§

source§

impl Debug for ExprAST

source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result

Formats the value using the given formatter. Read more
source§

impl PartialEq<ExprAST> for ExprAST

source§

fn eq(&self, other: &ExprAST) -> bool

This method tests for self and other values to be equal, and is used +by ==.
1.0.0 · source§

fn ne(&self, other: &Rhs) -> bool

This method tests for !=. The default implementation is almost always +sufficient, and should not be overridden without very good reason.
source§

impl StructuralPartialEq for ExprAST

Auto Trait Implementations§

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 diff --git a/llvm_kaleidoscope_rs/parser/index.html b/llvm_kaleidoscope_rs/parser/index.html index c30a5ab..7baa90d 100644 --- a/llvm_kaleidoscope_rs/parser/index.html +++ b/llvm_kaleidoscope_rs/parser/index.html @@ -1,3 +1,3 @@ -llvm_kaleidoscope_rs::parser - Rust

Structs

FunctionAST - This class represents a function definition itself.
Parser for the kaleidoscope language.
PrototypeAST - This class represents the “prototype” for a function, +llvm_kaleidoscope_rs::parser - Rust

Structs

  • FunctionAST - This class represents a function definition itself.
  • Parser for the kaleidoscope language.
  • PrototypeAST - This class represents the “prototype” for a function, which captures its name, and its argument names (thus implicitly the number -of arguments the function takes).

Enums

\ No newline at end of file +of arguments the function takes).

Enums

\ No newline at end of file diff --git a/llvm_kaleidoscope_rs/parser/sidebar-items.js b/llvm_kaleidoscope_rs/parser/sidebar-items.js index e4efd12..8fbdb6e 100644 --- a/llvm_kaleidoscope_rs/parser/sidebar-items.js +++ b/llvm_kaleidoscope_rs/parser/sidebar-items.js @@ -1 +1 @@ -window.SIDEBAR_ITEMS = {"enum":[["ExprAST",""]],"struct":[["FunctionAST","FunctionAST - This class represents a function definition itself."],["Parser","Parser for the `kaleidoscope` language."],["PrototypeAST","PrototypeAST - This class represents the “prototype” for a function, which captures its name, and its argument names (thus implicitly the number of arguments the function takes)."]]}; \ No newline at end of file +window.SIDEBAR_ITEMS = {"enum":["ExprAST"],"struct":["FunctionAST","Parser","PrototypeAST"]}; \ No newline at end of file diff --git a/llvm_kaleidoscope_rs/parser/struct.FunctionAST.html b/llvm_kaleidoscope_rs/parser/struct.FunctionAST.html index b0fd251..567ed7e 100644 --- a/llvm_kaleidoscope_rs/parser/struct.FunctionAST.html +++ b/llvm_kaleidoscope_rs/parser/struct.FunctionAST.html @@ -1,8 +1,14 @@ -FunctionAST in llvm_kaleidoscope_rs::parser - Rust
pub struct FunctionAST(pub PrototypeAST, pub ExprAST);
Expand description

FunctionAST - This class represents a function definition itself.

-

Tuple Fields

0: PrototypeAST1: ExprAST

Trait Implementations

Formats the value using the given formatter. Read more
This method tests for self and other values to be equal, and is used -by ==. Read more
This method tests for !=. The default implementation is almost always -sufficient, and should not be overridden without very good reason. 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).

+FunctionAST in llvm_kaleidoscope_rs::parser - Rust
pub struct FunctionAST(pub PrototypeAST, pub ExprAST);
Expand description

FunctionAST - This class represents a function definition itself.

+

Tuple Fields§

§0: PrototypeAST§1: ExprAST

Trait Implementations§

source§

impl Debug for FunctionAST

source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result

Formats the value using the given formatter. Read more
source§

impl PartialEq<FunctionAST> for FunctionAST

source§

fn eq(&self, other: &FunctionAST) -> bool

This method tests for self and other values to be equal, and is used +by ==.
1.0.0 · source§

fn ne(&self, other: &Rhs) -> bool

This method tests for !=. The default implementation is almost always +sufficient, and should not be overridden without very good reason.
source§

impl StructuralPartialEq for FunctionAST

Auto Trait Implementations§

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 diff --git a/llvm_kaleidoscope_rs/parser/struct.Parser.html b/llvm_kaleidoscope_rs/parser/struct.Parser.html index 0014f06..2576756 100644 --- a/llvm_kaleidoscope_rs/parser/struct.Parser.html +++ b/llvm_kaleidoscope_rs/parser/struct.Parser.html @@ -1,17 +1,30 @@ -Parser in llvm_kaleidoscope_rs::parser - Rust
pub struct Parser<I>where
    I: Iterator<Item = char>,
{ /* private fields */ }
Expand description

Parser for the kaleidoscope language.

-

Implementations

Implement the global variable int CurTok; from the tutorial.

+Parser in llvm_kaleidoscope_rs::parser - Rust
pub struct Parser<I>where
+    I: Iterator<Item = char>,{ /* private fields */ }
Expand description

Parser for the kaleidoscope language.

+

Implementations§

source§

impl<I> Parser<I>where + I: Iterator<Item = char>,

source

pub fn new(lexer: Lexer<I>) -> Self

source

pub fn cur_tok(&self) -> &Token

Implement the global variable int CurTok; from the tutorial.

Panics

Panics if the parser doesn’t have a current token.

-

Advance the cur_tok by getting the next token from the lexer.

+
source

pub fn get_next_token(&mut self)

Advance the cur_tok by getting the next token from the lexer.

Implement the fucntion int getNextToken(); from the tutorial.

-

definition ::= ‘def’ prototype expression

+
source

pub fn parse_definition(&mut self) -> Result<FunctionAST, String>

definition ::= ‘def’ prototype expression

Implement std::unique_ptr<FunctionAST> ParseDefinition(); from the tutorial.

-

external ::= ‘extern’ prototype

+
source

pub fn parse_extern(&mut self) -> Result<PrototypeAST, String>

external ::= ‘extern’ prototype

Implement std::unique_ptr<PrototypeAST> ParseExtern(); from the tutorial.

-

toplevelexpr ::= expression

+
source

pub fn parse_top_level_expr(&mut self) -> Result<FunctionAST, String>

toplevelexpr ::= expression

Implement std::unique_ptr<FunctionAST> ParseTopLevelExpr(); from the tutorial.

-

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

+

Auto Trait Implementations§

§

impl<I> RefUnwindSafe for Parser<I>where + I: RefUnwindSafe,

§

impl<I> Send for Parser<I>where + I: Send,

§

impl<I> Sync for Parser<I>where + I: Sync,

§

impl<I> Unpin for Parser<I>where + I: Unpin,

§

impl<I> UnwindSafe for Parser<I>where + I: UnwindSafe,

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 diff --git a/llvm_kaleidoscope_rs/parser/struct.PrototypeAST.html b/llvm_kaleidoscope_rs/parser/struct.PrototypeAST.html index 875bd3e..5f5b757 100644 --- a/llvm_kaleidoscope_rs/parser/struct.PrototypeAST.html +++ b/llvm_kaleidoscope_rs/parser/struct.PrototypeAST.html @@ -1,10 +1,17 @@ -PrototypeAST in llvm_kaleidoscope_rs::parser - Rust
pub struct PrototypeAST(pub String, pub Vec<String>);
Expand description

PrototypeAST - This class represents the “prototype” for a function, +PrototypeAST in llvm_kaleidoscope_rs::parser - Rust

pub struct PrototypeAST(pub String, pub Vec<String>);
Expand description

PrototypeAST - This class represents the “prototype” for a function, which captures its name, and its argument names (thus implicitly the number of arguments the function takes).

-

Tuple Fields

0: String1: Vec<String>

Trait Implementations

Returns a copy of the value. Read more
Performs copy-assignment from source. Read more
Formats the value using the given formatter. Read more
This method tests for self and other values to be equal, and is used -by ==. Read more
This method tests for !=. The default implementation is almost always -sufficient, and should not be overridden without very good reason. 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).

+

Tuple Fields§

§0: String§1: Vec<String>

Trait Implementations§

source§

impl Clone for PrototypeAST

source§

fn clone(&self) -> PrototypeAST

Returns a copy of the value. Read more
1.0.0 · source§

fn clone_from(&mut self, source: &Self)

Performs copy-assignment from source. Read more
source§

impl Debug for PrototypeAST

source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result

Formats the value using the given formatter. Read more
source§

impl PartialEq<PrototypeAST> for PrototypeAST

source§

fn eq(&self, other: &PrototypeAST) -> bool

This method tests for self and other values to be equal, and is used +by ==.
1.0.0 · source§

fn ne(&self, other: &Rhs) -> bool

This method tests for !=. The default implementation is almost always +sufficient, and should not be overridden without very good reason.
source§

impl StructuralPartialEq for PrototypeAST

Auto Trait Implementations§

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 resulting type after obtaining ownership.
Creates owned data from borrowed data, usually by cloning. Read more
Uses borrowed data to replace owned data, usually by cloning. Read more
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> ToOwned for Twhere + T: Clone,

§

type Owned = T

The resulting type after obtaining ownership.
source§

fn to_owned(&self) -> T

Creates owned data from borrowed data, usually by cloning. Read more
source§

fn clone_into(&self, target: &mut T)

Uses borrowed data to replace owned data, usually by cloning. Read more
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 diff --git a/llvm_kaleidoscope_rs/sidebar-items.js b/llvm_kaleidoscope_rs/sidebar-items.js index 4a97b12..3590b2b 100644 --- a/llvm_kaleidoscope_rs/sidebar-items.js +++ b/llvm_kaleidoscope_rs/sidebar-items.js @@ -1 +1 @@ -window.SIDEBAR_ITEMS = {"constant":[["SMALL_STR_SIZE","Fixed size of [`SmallCStr`] including the trailing `\\0` byte."]],"enum":[["Either","Either type, for APIs accepting two types."]],"mod":[["codegen",""],["lexer",""],["llvm","Safe wrapper around the LLVM C API."],["parser",""]],"struct":[["SmallCStr","Small C string on the stack with fixed size [`SMALL_STR_SIZE`]."]]}; \ No newline at end of file +window.SIDEBAR_ITEMS = {"constant":["SMALL_STR_SIZE"],"enum":["Either"],"mod":["codegen","lexer","llvm","parser"],"struct":["SmallCStr"]}; \ No newline at end of file diff --git a/llvm_kaleidoscope_rs/struct.SmallCStr.html b/llvm_kaleidoscope_rs/struct.SmallCStr.html index f5ea2d8..0328046 100644 --- a/llvm_kaleidoscope_rs/struct.SmallCStr.html +++ b/llvm_kaleidoscope_rs/struct.SmallCStr.html @@ -1,12 +1,18 @@ -SmallCStr in llvm_kaleidoscope_rs - Rust
pub struct SmallCStr(_);
Expand description

Small C string on the stack with fixed size SMALL_STR_SIZE.

+SmallCStr in llvm_kaleidoscope_rs - Rust
pub struct SmallCStr(_);
Expand description

Small C string on the stack with fixed size SMALL_STR_SIZE.

This is specially crafted to interact with the LLVM C API and get rid of some heap allocations.

-

Implementations

Create a new C string from src. -Returns None if src exceeds the fixed size or contains any \0 bytes.

-

Return pointer to C string.

-

Trait Implementations

Formats the value using the given formatter. Read more
This method tests for self and other values to be equal, and is used -by ==. Read more
This method tests for !=. The default implementation is almost always -sufficient, and should not be overridden without very good reason. Read more
The type returned in the event of a conversion error.
Performs the conversion.

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

+

Implementations§

source§

impl SmallCStr

source

pub fn new<T: AsRef<[u8]>>(src: &T) -> Option<SmallCStr>

Create a new C string from src. +Returns None if src exceeds the fixed size or contains any \0 bytes.

+
source

pub const fn as_ptr(&self) -> *const c_char

Return pointer to C string.

+

Trait Implementations§

source§

impl Debug for SmallCStr

source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result

Formats the value using the given formatter. Read more
source§

impl PartialEq<SmallCStr> for SmallCStr

source§

fn eq(&self, other: &SmallCStr) -> bool

This method tests for self and other values to be equal, and is used +by ==.
1.0.0 · source§

fn ne(&self, other: &Rhs) -> bool

This method tests for !=. The default implementation is almost always +sufficient, and should not be overridden without very good reason.
source§

impl TryFrom<&str> for SmallCStr

§

type Error = ()

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

fn try_from(value: &str) -> Result<Self, Self::Error>

Performs the conversion.
source§

impl StructuralPartialEq for SmallCStr

Auto Trait Implementations§

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