Value references¶
A value reference is a wrapper around an LLVM value for you to
inspect. You cannot create a value reference yourself. You get them
from methods of the ModuleRef
and ValueRef
classes.
Enumerations¶
-
class
llvmlite.binding.
Linkage
¶ The linkage types allowed for global values are:
-
class
llvmlite.binding.
Visibility
¶ The visibility styles allowed for global values are:
-
class
llvmlite.binding.
StorageClass
¶ The storage classes allowed for global values are:
-
class
llvmlite.binding.
ValueKind
¶ The value kinds allowed are:
-
argument
¶
-
-
basic_block
¶
-
-
memory_use
¶
-
-
memory_def
¶
-
-
memory_phi
¶
-
-
function
¶
-
-
global_alias
¶
-
-
global_ifunc
¶
-
-
global_variable
¶
-
-
block_address
¶
-
-
constant_expr
¶
-
-
constant_array
¶
-
-
constant_struct
¶
-
-
constant_vector
¶
-
-
undef_value
¶
-
-
constant_aggregate_zero
¶
-
-
constant_data_array
¶
-
-
constant_data_vector
¶
-
-
constant_int
¶
-
-
constant_fp
¶
-
-
constant_pointer_null
¶
-
-
constant_token_none
¶
-
-
metadata_as_value
¶
-
-
inline_asm
¶
-
-
instruction
¶
-
-
poison_value
¶
-
The ValueRef class¶
-
class
llvmlite.binding.
ValueRef
¶ A wrapper around an LLVM value. The attributes available are:
-
is_declaration
¶ True
—The global value is a mere declaration.False
—The global value is defined in the given module.
-
-
name
¶ This value’s name, as a string. This attribute can be set.
-
-
storage_class
¶ The storage class—a
StorageClass
instance—for this value. This attribute can be set.
-
-
visibility
¶ The visibility style—a
Visibility
instance—for this value. This attribute can be set.
-
-
opcode
¶ The instruction’s opcode, as a string.
-
-
is_global
¶ The value is a global variable.
-
-
is_function
¶ The value is a function.
-
-
is_argument
¶ The value is a function’s argument.
-
-
is_block
¶ The value is a function’s basic block.
-
-
is_instruction
¶ The value is a basic block’s instruction.
-
-
is_operand
¶ The value is a instruction’s operand.
-
-
is_constant
¶ The value is a constant.
-
-
get_constant_value
(self, signed_int=False, round_fp=False)¶ Return the constant value, either as a literal (for example, int or float) when supported, or as a string otherwise. Keyword arguments specify the preferences during conversion:
- If
signed_int
is True and the constant is an integer, returns a signed integer. - If
round_fp
True and the constant is a floating point value, rounds the result upon accuracy loss (e.g., when querying an fp128 value). By default, raises an exception on accuracy loss.
- If
-