Direct_Field_Address_Operand

class Direct_Field_Address_Operand (concrete, logical)

Address of a field of a variable: &obj.a.b.c.field.

Implemented interfaces:
Direct parents:
Ancestor classes and implemented interfaces:

Address_Operand_Interface, Direct_Field_Operand, Direct_Operand, Direct_Partial_Operand, Execution_Node, Field_Operand_Interface, Logical_IR_Root, Operand, Partial_Operand_Interface, Reading_Or_Address_Operand_Interface

Field

Kind

Type

Description

The_Object (from Operand)

semantic

interface General_Object_Interface

Affected object (direct case) or pointer (indirect case). For address operands, this can also be a routine. WARNING: because the meaning of this field is drastically different between direct operands and indirect operands, it is usually wrong to access this field without a preceding check of operand type!

Its_Type (from Operand)

semantic

class Type

The type of the operand. WARNING: For address operands, this field returns the pointed-to-type. That is, for int i, the operand &i will report Its_Type=int. Code using this field must check the read/write/address kind to avoid bugs!

Parent (from Logical_IR_Root)

semantic

class Logical_IR_Root

Physical (from Logical_IR_Root)

semantic to physical

class Physical_IR_Root

Offset (from Field_Operand_Interface)

attribute

builtin Natural

direct case: The_Object + Offset denotes the object used/defined. indirect case: (*The_Object) + Offset as in p->field. The offset is relative to the start of the object, and is not necessarily uniquely identifying a field (union, EBO, [[no_unique_address]], bit-fields).

Offset_In_Bits (from Field_Operand_Interface)

attribute

builtin UInt64

Same as Offset * CHAR_BIT. The Offset_In_Bits does not include the Bit_Position for bit-fields.

Target (from Field_Operand_Interface)

semantic

class Field

The selected field, as symbolic information. If the operand represents a nested field access object.a.b.c, Target will be the last field (c). The combination of Offset+Target is uniquely identifying the whole field chain, which can be retrieved with the get_field_chain function. To ensure uniqueness, union field accesses may only appear as the last element in the chain.