llvm_lib::core::values::constants

Module expressions

source
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) and NUW (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ยง

  • Obtain the alignment of the specified type.
  • Obtain the address of a basic block in a function.
  • Create an addition operation on two constant values.
  • Perform an address space cast operation on a constant value to the specified type.
  • Perform a bitcast operation on a constant value to the specified type.
  • Extract an element from a vector constant at the specified index.
  • Create a GEP (GetElementPtr) operation on a constant value.
  • Create an in-bounds GEP (GetElementPtr) operation on a constant value.
  • Insert an element into a vector constant at the specified index.
  • Convert a constant integer to a pointer of the specified type.
  • Create a multiplication operation on two constant values.
  • Create a negation operation on a constant value.
  • Create a logical NOT operation on a constant value.
  • Create a NSW (No Signed Wrap) addition operation on two constant values.
  • Create a NSW (No Signed Wrap) multiplication operation on two constant values.
  • Create a NSW negation operation on a constant value.
  • Create a NSW (No Signed Wrap) subtraction operation on two constant values.
  • Create a NUW (No Unsigned Wrap) addition operation on two constant values.
  • Create a NUW (No Unsigned Wrap) multiplication operation on two constant values.
  • Create a NUW (No Unsigned Wrap) subtraction operation on two constant values.
  • Perform a pointer cast operation on a constant value to the specified type.
  • Convert a constant pointer to an integer of the specified type.
  • Create a shuffle vector operation on two vector constants.
  • Create a subtraction operation on two constant values.
  • Truncate a constant value to the specified type.
  • Perform either a truncation or bitcast operation on a constant value to the specified type.
  • Create a logical XOR operation on two constant values.
  • Get the opcode for a constant value.
  • Obtain the size of the specified type.