-- predef-prim-op-thunk-2'address,
-- ...
-- predef-prim-op-thunk-n'address);
- -- for Predef_Prims'Alignment use Address'Alignment
-- Create the thunks associated with the predefined primitives and
-- save their entity to fill the aggregate.
Object_Definition => New_Occurrence_Of
(Defining_Identifier (Decl), Loc),
Expression => New_Node));
-
- Append_To (Result,
- Make_Attribute_Definition_Clause (Loc,
- Name => New_Occurrence_Of (Predef_Prims, Loc),
- Chars => Name_Alignment,
- Expression =>
- Make_Attribute_Reference (Loc,
- Prefix =>
- New_Occurrence_Of (RTE (RE_Integer_Address), Loc),
- Attribute_Name => Name_Alignment)));
end;
-- Generate
-- (OSD_Table => (1 => <value>,
-- ...
-- N => <value>));
+ -- for OSD'Alignment use Address'Alignment;
-- Iface_DT : Dispatch_Table (Nb_Prims) :=
-- ([ Signature => <sig-value> ],
-- prim-op-2'address,
-- ...
-- prim-op-n'address));
- -- for Iface_DT'Alignment use Address'Alignment;
-- Stage 3: Initialize the discriminant and the record components
Make_Aggregate (Loc,
Expressions => DT_Aggr_List)));
- Append_To (Result,
- Make_Attribute_Definition_Clause (Loc,
- Name => New_Occurrence_Of (Iface_DT, Loc),
- Chars => Name_Alignment,
-
- Expression =>
- Make_Attribute_Reference (Loc,
- Prefix =>
- New_Occurrence_Of (RTE (RE_Integer_Address), Loc),
- Attribute_Name => Name_Alignment)));
-
if Exporting_Table then
Export_DT (Typ, Iface_DT, Suffix_Index);
-- Generate:
-- DT : No_Dispatch_Table_Wrapper;
- -- for DT'Alignment use Address'Alignment;
-- DT_Ptr : Tag := !Tag (DT.NDT_Prims_Ptr'Address);
if not Has_DT (Typ) then
New_Occurrence_Of
(RTE (RE_No_Dispatch_Table_Wrapper), Loc)));
- Append_To (Result,
- Make_Attribute_Definition_Clause (Loc,
- Name => New_Occurrence_Of (DT, Loc),
- Chars => Name_Alignment,
- Expression =>
- Make_Attribute_Reference (Loc,
- Prefix =>
- New_Occurrence_Of (RTE (RE_Integer_Address), Loc),
- Attribute_Name => Name_Alignment)));
-
Append_To (Result,
Make_Object_Declaration (Loc,
Defining_Identifier => DT_Ptr,
-- Generate:
-- DT : Dispatch_Table_Wrapper (Nb_Prim);
- -- for DT'Alignment use Address'Alignment;
-- DT_Ptr : Tag := !Tag (DT.Prims_Ptr'Address);
else
Make_Index_Or_Discriminant_Constraint (Loc,
Constraints => DT_Constr_List))));
- Append_To (Result,
- Make_Attribute_Definition_Clause (Loc,
- Name => New_Occurrence_Of (DT, Loc),
- Chars => Name_Alignment,
- Expression =>
- Make_Attribute_Reference (Loc,
- Prefix =>
- New_Occurrence_Of (RTE (RE_Integer_Address), Loc),
- Attribute_Name => Name_Alignment)));
-
Append_To (Result,
Make_Object_Declaration (Loc,
Defining_Identifier => DT_Ptr,
-- Tags_Table => (0 => null,
-- 1 => Parent'Tag
-- ...);
- -- for TSD'Alignment use Address'Alignment
TSD_Aggr_List := New_List;
Make_Integer_Literal (Loc, Num_Ifaces),
Make_Aggregate (Loc, TSD_Ifaces_List)))));
- Append_To (Result,
- Make_Attribute_Definition_Clause (Loc,
- Name => New_Occurrence_Of (ITable, Loc),
- Chars => Name_Alignment,
- Expression =>
- Make_Attribute_Reference (Loc,
- Prefix =>
- New_Occurrence_Of (RTE (RE_Integer_Address), Loc),
- Attribute_Name => Name_Alignment)));
-
Iface_Table_Node :=
Make_Attribute_Reference (Loc,
Prefix => New_Occurrence_Of (ITable, Loc),
Set_Is_True_Constant (TSD, Building_Static_DT (Typ));
- Append_To (Result,
- Make_Attribute_Definition_Clause (Loc,
- Name => New_Occurrence_Of (TSD, Loc),
- Chars => Name_Alignment,
- Expression =>
- Make_Attribute_Reference (Loc,
- Prefix =>
- New_Occurrence_Of (RTE (RE_Integer_Address), Loc),
- Attribute_Name => Name_Alignment)));
-
-- Initialize or declare the dispatch table object
if not Has_DT (Typ) then
-- DT : aliased constant No_Dispatch_Table :=
-- (NDT_TSD => TSD'Address;
-- NDT_Prims_Ptr => 0);
- -- for DT'Alignment use Address'Alignment;
else
Append_To (Result,
New_Occurrence_Of (RTE (RE_No_Dispatch_Table_Wrapper), Loc),
Expression => Make_Aggregate (Loc, DT_Aggr_List)));
- Append_To (Result,
- Make_Attribute_Definition_Clause (Loc,
- Name => New_Occurrence_Of (DT, Loc),
- Chars => Name_Alignment,
- Expression =>
- Make_Attribute_Reference (Loc,
- Prefix =>
- New_Occurrence_Of (RTE (RE_Integer_Address), Loc),
- Attribute_Name => Name_Alignment)));
-
Export_DT (Typ, DT);
end if;
-- predef-prim-op-2'address,
-- ...
-- predef-prim-op-n'address);
- -- for Predef_Prims'Alignment use Address'Alignment
-- DT : Dispatch_Table (Nb_Prims) :=
-- (Signature => <sig-value>,
-- Remember aggregates initializing dispatch tables
Append_Elmt (New_Node, DT_Aggr);
-
- Append_To (Result,
- Make_Attribute_Definition_Clause (Loc,
- Name => New_Occurrence_Of (Predef_Prims, Loc),
- Chars => Name_Alignment,
- Expression =>
- Make_Attribute_Reference (Loc,
- Prefix =>
- New_Occurrence_Of (RTE (RE_Integer_Address), Loc),
- Attribute_Name => Name_Alignment)));
end;
-- Stage 1: Initialize the discriminant and the record components
Constraints => DT_Constr_List)),
Expression => Make_Aggregate (Loc, DT_Aggr_List)));
- Append_To (Result,
- Make_Attribute_Definition_Clause (Loc,
- Name => New_Occurrence_Of (DT, Loc),
- Chars => Name_Alignment,
- Expression =>
- Make_Attribute_Reference (Loc,
- Prefix =>
- New_Occurrence_Of (RTE (RE_Integer_Address), Loc),
- Attribute_Name => Name_Alignment)));
-
Export_DT (Typ, DT);
end if;
end if;