VLA_Allocate_Instruction¶
- class VLA_Allocate_Instruction (concrete, logical)¶
Allocate memory for a C99 variable-length-array. The VLA variable is listed as Direct_Full_Write_Operand. After this instruction completes, the VLA is allocated but still uninitialized.
- Direct parents:
inherits Instruction
- Ancestor classes and implemented interfaces:
Field
Kind
Type
Description
Left (from Instruction)
syntactic
Operand specifying the VLA variable being allocated.
Variable_Dimensions
syntactic
list of class Direct_Full_Read_Operand
Operands reading from helper variables that hold the number of elements of this VLA. (one helper for each variable-length dimension, e.g.,
int arr[2][n][3][m]has two dimension variables: [n, m]) Note that a single dimension variable can be reused for multiple arrays, e.g., intypedef int vla_t[n]; vla_t arr1, arr2;. Dimension variables are always compiler-generated helpers which are initialized prior to the VLA_Allocate_Instruction and are never mutated after initialization.Left_Physical (from Instruction)
semantic to physical
class Physical_IR_Root
This edge instead points to the expression that represents the left operand, i.e., the expression that computed the glvalue where the result of the instruction will be stored.
For example, in
v = 42;(a LIR Integer_Literal_Instruction):The
Physicaledge points to the PIR Integer_Literal.The
Left_Physicaledge points to the Unqualified_Direct_Object_Selection for the variablev.And the
Physical_For_Assignmentedge points to the Assignment expression.
Its_Type (from Instruction)
semantic
class Type
Result type of the instruction, needed especially to distinguish assignments of complete structs from assignments of their first fields. Also needed to determine multiplication factor for pointer additions. For Cast_Instructions, this is the type casted to
Physical_For_Assignment (from Instruction)
semantic to physical
class Physical_IR_Root
Returns a PIR node for the assignment of the value that was computed by this instruction.
For example, in
v = 42;(a LIR Integer_Literal_Instruction):The
Physicaledge points to the PIR Integer_Literal.The
Left_Physicaledge points to the Unqualified_Direct_Object_Selection for the variablev.And the
Physical_For_Assignmentedge points to the Assignment expression.
Parent (from Logical_IR_Root)
semantic
class Logical_IR_Root
Physical (from Logical_IR_Root)
semantic to physical
class Physical_IR_Root