Expand description
Functions in this group operate on constants expressions.
This module provides a set of functions and methods for operating on constants expressions within the LLVM framework.
The functions in this module allow for various operations and manipulations of constant values, such as obtaining the alignment or size of a type, performing arithmetic operations, and creating constant expressions. These operations are essential for low-level programming tasks that require precise control over memory layout and arithmetic behavior.
The module includes:
- Opcode Retrieval: Functions to get the opcode of a constant expression.
- Type Information: Functions to obtain the alignment and size of a type.
- Arithmetic Operations: Functions to perform negation, addition, subtraction, multiplication, and other arithmetic operations on constant values, with support for
NSW
(No Signed Wrap) andNUW
(No Unsigned Wrap) flags. - Logical Operations: Functions to perform logical NOT and XOR operations on constant values.
- Comparison Operations: Functions to perform integer and floating-point comparisons on constant values.
- Bitwise Operations: Functions to perform bitwise operations such as left shift and bit-cast on constant values.
- Pointer Operations: Functions to convert between pointers and integers, and to perform address space casts.
- Vector Operations: Functions to extract and insert elements in vector constants, and to create shuffle vector operations.
- Block Addressing: Functions to obtain the address of a basic block in a function.
These functions wrap the corresponding LLVM core library functions, providing a safe and idiomatic Rust interface for interacting with LLVM constants.
Functionsยง
- align_
of - Obtain the alignment of the specified type.
- block_
address - Obtain the address of a basic block in a function.
- const_
add - Create an addition operation on two constant values.
- const_
addr_ space_ cast - Perform an address space cast operation on a constant value to the specified type.
- const_
bit_ cast - Perform a bitcast operation on a constant value to the specified type.
- const_
extract_ element - Extract an element from a vector constant at the specified index.
- const_
gep2 - Create a GEP (
GetElementPtr
) operation on a constant value. - const_
in_ bounds_ gep2 - Create an in-bounds GEP (
GetElementPtr
) operation on a constant value. - const_
insert_ element - Insert an element into a vector constant at the specified index.
- const_
int_ to_ ptr - Convert a constant integer to a pointer of the specified type.
- const_
mul - Create a multiplication operation on two constant values.
- const_
neg - Create a negation operation on a constant value.
- const_
not - Create a logical NOT operation on a constant value.
- const_
nsw_ add - Create a NSW (No Signed Wrap) addition operation on two constant values.
- const_
nsw_ mul - Create a NSW (No Signed Wrap) multiplication operation on two constant values.
- const_
nsw_ neg - Create a
NSW
negation operation on a constant value. - const_
nsw_ sub - Create a NSW (No Signed Wrap) subtraction operation on two constant values.
- const_
nuw_ add - Create a NUW (No Unsigned Wrap) addition operation on two constant values.
- const_
nuw_ mul - Create a NUW (No Unsigned Wrap) multiplication operation on two constant values.
- const_
nuw_ sub - Create a NUW (No Unsigned Wrap) subtraction operation on two constant values.
- const_
pointer_ cast - Perform a pointer cast operation on a constant value to the specified type.
- const_
ptr_ to_ int - Convert a constant pointer to an integer of the specified type.
- const_
shuffle_ vector - Create a shuffle vector operation on two vector constants.
- const_
sub - Create a subtraction operation on two constant values.
- const_
trunc - Truncate a constant value to the specified type.
- const_
trunc_ or_ bit_ cast - Perform either a truncation or bitcast operation on a constant value to the specified type.
- const_
xor - Create a logical XOR operation on two constant values.
- get_
const_ opcode - Get the opcode for a constant value.
- size_of
- Obtain the size of the specified type.