Indirect_Field_Operand

class Indirect_Field_Operand (abstract, logical)

Access to a field of a dereferenced object: obj->field. A single field operand can reach into nested structures: obj->a.b.c.field Only the last field in the chain is allowed to be a union member. Subclasses distinguish: read/write/address

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

Execution_Node, Field_Operand_Interface, Indirect_Operand, Indirect_Partial_Operand, Logical_IR_Root, Operand, Partial_Operand_Interface

Direct child classes:

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.