9.1
8 Accessors (Getter Functions)
Functions to query and retrieve information from LLVM IR objects.
8.1 Value Accessors
procedure
(llvm-get-aggregate-element agg-val index) → LLVMValueRef?
agg-val : LLVMValueRef? index : exact-nonnegative-integer?
Returns the element at index from an aggregate value.
procedure
val : LLVMValueRef?
Returns the alignment of a value in bytes.
procedure
(llvm-get-allocated-type val) → LLVMTypeRef?
val : LLVMValueRef?
Returns the allocated type of an allocation instruction (e.g., from malloc or alloca).
procedure
(llvm-get-arg-operand val index) → LLVMValueRef?
val : LLVMValueRef? index : exact-nonnegative-integer?
Returns the operand at index for a function call or invoke instruction.
8.2 Basic Block Accessors
procedure
(llvm-get-basic-block-name bb) → string?
bb : LLVMBasicBlockRef?
Returns the name of a basic block.
procedure
bb : LLVMBasicBlockRef?
Returns the function that contains the given basic block.
procedure
bb : LLVMBasicBlockRef?
Returns the terminator instruction of a basic block, or #f if none exists.
8.3 Instruction Accessors
procedure
→ exact-nonnegative-integer? inst : LLVMValueRef?
Returns the synchronization scope ID of an atomic instruction.
procedure
(llvm-get-attribute-count-at-index fn index) → exact-nonnegative-integer? fn : LLVMValueRef? index : exact-nonnegative-integer?
Returns the number of attributes at the given index on a function.
procedure
(llvm-get-block-address-basic-block fn) → LLVMBasicBlockRef?
fn : LLVMValueRef?
Returns the basic block for a block address value.
8.4 Constant Accessors
procedure
(llvm-get-as-string c out-param) → string?
c : LLVMValueRef? out-param : (box/c any?)
Returns the string value of a string constant.
8.5 Module and Function Accessors
procedure
fn : LLVMValueRef?
Returns the first basic block of a function.
procedure
fn : LLVMValueRef?
Returns the last basic block of a function.
procedure
bb : LLVMBasicBlockRef?
Returns the next basic block in a function, or #f if this is the last block.
procedure
bb : LLVMBasicBlockRef?
Returns the previous basic block in a function, or #f if this is the first block.
procedure
bb : LLVMBasicBlockRef?
Returns the first instruction in a basic block.
procedure
bb : LLVMBasicBlockRef?
Returns the last instruction in a basic block.
8.6 Instruction Navigation
procedure
(llvm-get-next-instruction inst) → LLVMValueRef?
inst : LLVMValueRef?
Returns the next instruction after the given instruction, or #f if none exists.
procedure
inst : LLVMValueRef?
Returns the previous instruction before the given instruction, or #f if none exists.
8.7 Operand Access
procedure
val : LLVMValueRef?
Returns the number of operands in a value.
procedure
(llvm-get-operand val index) → LLVMValueRef?
val : LLVMValueRef? index : exact-nonnegative-integer?
Returns the operand at index in a value.
8.8 Value and Type Classification
procedure
(llvm-get-value-kind val) → _llvm-value-kind
val : LLVMValueRef?
Returns the kind (classification) of a value.
procedure
fn : LLVMValueRef?
Returns the calling convention of a function.
8.9 Diagnostic Information
procedure
(llvm-get-diag-info-severity diag-info)
→ _llvm-diagnostic-severity diag-info : LLVMDiagnosticInfoRef?
Returns the severity level of a diagnostic message.