Struct llvm_rs::Builder

source ·
pub struct Builder(_);
Expand description

This provides a uniform API for creating instructions and inserting them into a basic block.

Implementations§

Create a new builder in the context given.

Position the builder at the end of block.

Build an instruction that returns from the function with void.

Build an instruction that returns from the function with value.

Build an instruction that allocates an array with the element type elem and the size size.

The size of this array will be the size of elem times size.

Build an instruction that allocates a pointer to fit the size of ty then returns this pointer.

Make sure to call build_free with the pointer value when you’re done with it, or you’re gonna have a bad time.

Build an instruction that frees the val, which MUST be a pointer that was returned from build_alloca.

Build an instruction that store the value val in the pointer ptr.

Build an instruction that branches to the block dest.

Build an instruction that branches to if_block if cond evaluates to true, and else_block otherwise.

Build an instruction that calls the function func with the arguments args.

This will return the return value of the function.

Build an instruction that calls the function func with the arguments args.

This will return the return value of the function.

Build an instruction that converts val to a floating point dest.

Build an instruction that converts val to an integer dest.

Build an instruction that yields to true_val if cond is equal to 1, and false_val otherwise.

Build an instruction that casts a value into a certain type.

Build an instruction that casts an integer to a pointer.

Build an instruction that casts a pointer to an integer.

Build an instruction that zero extends its operand to the type dest.

Build an instruction that truncates the high-order bits of value to fit into a certain type.

Build an instruction that inserts a value into an aggregate data value.

Build an instruction that computes the address of a subelement of an aggregate data structure.

Basically type-safe pointer arithmetic.

Build an instruction that runs whichever block matches the value, or default if none of them matched it.

Build a phi node which is used together with branching to select a value depending on the predecessor of the current block

Build an instruction to compare two values with the predicate given.

Trait Implementations§

What a reference to this type represents as a C pointer.
Destroy the contents at the pointer’s location. Read more
Converts to this type from the input type.
Converts to this type from the input type.
Converts to this type from the input type.
Converts to this type from the input type.
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
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).

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.