pub fn get_operand(val: &ValueRef, index: u32) -> Option<ValueRef>
Expand description
Obtain an operand at a specific index in a LLVM User
value.
§Details
Retrieves an operand at a specified index from a value in LLVM IR.
This function wraps the LLVMGetOperand
function from the LLVM core library. It returns the operand
at the specified index (index
) from the value represented by ValueRef
. Operands are the inputs to instructions
or other values in LLVM IR. If the index is out of bounds or the operand cannot be retrieved, the function
returns None
.
§Parameters
index
: The index of the operand to retrieve. This index should be within the bounds of the number of operands the value has.
§Returns
Returns an Option<ValueRef>
:
Some(ValueRef)
containing the retrieved operand if the index is valid and the operand is found.None
if the index is out of bounds or the operand cannot be retrieved.