layout: page |
title: Values |
llvm.core.Value is the base class of all values computed by a program that may be used as operands to other values. A value has a type associated with it (an object of llvm.core.Type).
The class hierarchy is:
Value
User
Constant
ConstantExpr
ConstantAggregateZero
ConstantInt
ConstantFP
ConstantArray
ConstantStruct
ConstantVector
ConstantPointerNull
UndefValue
GlobalValue
GlobalVariable
Function
Instruction
CallOrInvokeInstruction
PHINode
SwitchInstruction
CompareInstruction
Argument
BasicBlock
The Value class is abstract, it’s not meant to be instantiated. User is a Value that in turn uses (i.e., can refer to) other values (for e.g., a constant expression 1+2 refers to two constant values 1 and 2).
Constant-s represent constants that appear within code or as initializers of globals. They are constructed using static methods of Constant. Various types of constants are represented by various subclasses of Constant. However, most of them are empty and do not provide any additional attributes or methods over Constant.
The Function object represents an instance of a function type. Such objects contain Argument objects, which represent the actual, local-variable-like arguments of the function (not to be confused with the arguments returned by a function type object – these represent the type of the arguments).
The various Instruction-s are created by the Builder class. Most instructions are represented by Instruction itself, but there are a few subclasses that represent interesting instructions.
Value objects have a type (read-only), and a name (read-write).
Related Links functions, comparision, llvm.core.Value, llvm.core.User, llvm.core.Constant, llvm.core.GlobalValue, llvm.core.GlobalVariable, llvm.core.Argument, llvm.core.Instruction, llvm.core.Builder, llvm.core.BasicBlock