Function const_extract_element

Source
pub fn const_extract_element(val: &ValueRef, index: &ValueRef) -> ValueRef
Expand description

Extract an element from a vector constant at the specified index.

§Details

Extracts a single element from a constant vector at a specified index.

This function wraps the LLVMConstExtractElement function from the LLVM core library. It generates a constant extract element instruction, which retrieves a specific element from the vector value represented by ValueRef at the position specified by index. This is commonly used when working with constant vectors, allowing you to extract a single element at compile time.

§Parameters

  • index: A reference to a constant value that specifies the index of the element to extract. The index should be an integer value and within the bounds of the vector.

§Returns

Returns an instance of ValueRef, which encapsulates the extracted element as a constant value determined at compile time.