A TargetInformationBlock provides certain information about the target machine that can often be useful at points in the compiler that are not target-specific.
concrete TargetInformationBlock : GlobalInformationBlock
{
list<IntegerType * reference > integer_types;
list<FloatingPointType * reference> floating_point_types;
| integer_types | The available integer types |
| floating_point_type | The available floating-point types |
bool is_big_endian optional;
IInteger byte_size optional;
IntegerType * reference word_type optional;
BooleanType * reference default_boolean_type optional;
VoidType * reference default_void_type optional;
| is_big_endian | Specifies the bit-order of the machine. |
| byte_size | Byte size of the machine. |
| word_type | A reference to the integer type that has the machine word size. |
| default_boolean_type | Default boolean type to use |
| default_void_type | Default void type to use. |
IInteger pointer_size optional;
int pointer_alignment optional;
int array_alignment_minimum optional;
int group_alignment_minimum optional;
int procedure_alignment optional;
bool integer_representation_is_twos_complement optional;
| pointer_size | size of a pointer. |
| pointer_alignment | alignment of a pointer. |
| array_alignment_minimum | The array alignment requirement is both that the element type alignment requirement be met and that the address be zero modulo the array_alignment_minimum value. |
| group_alignment_minimum | Similar as above; just replace the reference of array by group. |
| procedure_alignment | alignment of a procedure. |
| integer_representation_is_twos_complement | |
| If it is true, all integers are assumed to be represented in two's complement. Otherwise, see below. | |
In the case where the above parameters are inadequate to represent the mapping, we attempt to provide a more general mechanism with the fields below. For example, if we can simply represent the pointer_size as a constant, we set the boolean pointer_size_fixed to true. Otherwise, we set it to false, and specify a pointer_size_calculation_rule as a string, which when interpreted will yield the right mapping.
bool pointer_size_fixed optional;
LString pointer_size_calculation_rule;
bool pointer_alignment_fixed optional;
LString pointer_alignment_calculation_rule;
bool array_alignment_calculation_is_standard optional;
LString array_alignment_calculation_rule;
bool group_alignment_calculation_is_standard optional;
LString group_alignment_calculation_rule;
bool procedure_alignment_fixed optional;
LString procedure_alignment_calculation_rule;
LString integer_representation_rule;
LString floating_point_representation_rule;
};