with Nlists; use Nlists;
with Nmake; use Nmake;
with Rtsfind; use Rtsfind;
+with Sem_Util; use Sem_Util;
with Stand; use Stand;
with Snames; use Snames;
with Tbuild; use Tbuild;
Make_Assignment_Statement (Loc,
Name => Make_Identifier (Loc, Name_uF),
Expression => New_Reference_To (Standard_True, Loc)),
- Make_Return_Statement (Loc))));
+ Make_Simple_Return_Statement (Loc))));
end Build_Common_Dispatching_Select_Statements;
-------------------------
function Build_Inherit_Prims
(Loc : Source_Ptr;
+ Typ : Entity_Id;
Old_Tag_Node : Node_Id;
New_Tag_Node : Node_Id;
Num_Prims : Nat) return Node_Id
is
begin
- return
- Make_Assignment_Statement (Loc,
- Name =>
- Make_Slice (Loc,
- Prefix =>
- Make_Selected_Component (Loc,
- Prefix =>
- Build_DT (Loc, New_Tag_Node),
- Selector_Name =>
- New_Reference_To
- (RTE_Record_Component (RE_Prims_Ptr), Loc)),
- Discrete_Range =>
- Make_Range (Loc,
- Low_Bound => Make_Integer_Literal (Loc, 1),
- High_Bound => Make_Integer_Literal (Loc, Num_Prims))),
-
- Expression =>
- Make_Slice (Loc,
- Prefix =>
- Make_Selected_Component (Loc,
- Prefix =>
- Build_DT (Loc, Old_Tag_Node),
- Selector_Name =>
- New_Reference_To
- (RTE_Record_Component (RE_Prims_Ptr), Loc)),
- Discrete_Range =>
- Make_Range (Loc,
- Low_Bound => Make_Integer_Literal (Loc, 1),
- High_Bound => Make_Integer_Literal (Loc, Num_Prims))));
+ if RTE_Available (RE_DT) then
+ return
+ Make_Assignment_Statement (Loc,
+ Name =>
+ Make_Slice (Loc,
+ Prefix =>
+ Make_Selected_Component (Loc,
+ Prefix =>
+ Build_DT (Loc, New_Tag_Node),
+ Selector_Name =>
+ New_Reference_To
+ (RTE_Record_Component (RE_Prims_Ptr), Loc)),
+ Discrete_Range =>
+ Make_Range (Loc,
+ Low_Bound => Make_Integer_Literal (Loc, 1),
+ High_Bound => Make_Integer_Literal (Loc, Num_Prims))),
+
+ Expression =>
+ Make_Slice (Loc,
+ Prefix =>
+ Make_Selected_Component (Loc,
+ Prefix =>
+ Build_DT (Loc, Old_Tag_Node),
+ Selector_Name =>
+ New_Reference_To
+ (RTE_Record_Component (RE_Prims_Ptr), Loc)),
+ Discrete_Range =>
+ Make_Range (Loc,
+ Low_Bound => Make_Integer_Literal (Loc, 1),
+ High_Bound => Make_Integer_Literal (Loc, Num_Prims))));
+ else
+ return
+ Make_Assignment_Statement (Loc,
+ Name =>
+ Make_Slice (Loc,
+ Prefix =>
+ Unchecked_Convert_To
+ (Node (Last_Elmt (Access_Disp_Table (Typ))),
+ New_Tag_Node),
+ Discrete_Range =>
+ Make_Range (Loc,
+ Low_Bound => Make_Integer_Literal (Loc, 1),
+ High_Bound => Make_Integer_Literal (Loc, Num_Prims))),
+
+ Expression =>
+ Make_Slice (Loc,
+ Prefix =>
+ Unchecked_Convert_To
+ (Node (Last_Elmt (Access_Disp_Table (Typ))),
+ Old_Tag_Node),
+ Discrete_Range =>
+ Make_Range (Loc,
+ Low_Bound => Make_Integer_Literal (Loc, 1),
+ High_Bound => Make_Integer_Literal (Loc, Num_Prims))));
+ end if;
end Build_Inherit_Prims;
-------------------------------
New_Tag_Node : Node_Id) return Node_Id
is
begin
- return
- Make_Assignment_Statement (Loc,
- Name =>
- Make_Slice (Loc,
- Prefix =>
- Make_Explicit_Dereference (Loc,
- Unchecked_Convert_To (RTE (RE_Predef_Prims_Table_Ptr),
- Make_Selected_Component (Loc,
- Prefix =>
- Build_DT (Loc, New_Tag_Node),
- Selector_Name =>
- New_Reference_To
- (RTE_Record_Component (RE_Predef_Prims), Loc)))),
- Discrete_Range => Make_Range (Loc,
- Make_Integer_Literal (Loc, Uint_1),
- New_Reference_To (RTE (RE_Default_Prim_Op_Count), Loc))),
-
- Expression =>
- Make_Slice (Loc,
- Prefix =>
- Make_Explicit_Dereference (Loc,
- Unchecked_Convert_To (RTE (RE_Predef_Prims_Table_Ptr),
- Make_Selected_Component (Loc,
- Prefix =>
- Build_DT (Loc, Old_Tag_Node),
- Selector_Name =>
- New_Reference_To
- (RTE_Record_Component (RE_Predef_Prims), Loc)))),
- Discrete_Range =>
- Make_Range (Loc,
- Low_Bound => Make_Integer_Literal (Loc, 1),
- High_Bound =>
- New_Reference_To (RTE (RE_Default_Prim_Op_Count), Loc))));
+ if RTE_Available (RE_DT) then
+ return
+ Make_Assignment_Statement (Loc,
+ Name =>
+ Make_Slice (Loc,
+ Prefix =>
+ Make_Explicit_Dereference (Loc,
+ Unchecked_Convert_To (RTE (RE_Predef_Prims_Table_Ptr),
+ Make_Selected_Component (Loc,
+ Prefix =>
+ Build_DT (Loc, New_Tag_Node),
+ Selector_Name =>
+ New_Reference_To
+ (RTE_Record_Component (RE_Predef_Prims), Loc)))),
+ Discrete_Range => Make_Range (Loc,
+ Make_Integer_Literal (Loc, Uint_1),
+ New_Reference_To (RTE (RE_Max_Predef_Prims), Loc))),
+
+ Expression =>
+ Make_Slice (Loc,
+ Prefix =>
+ Make_Explicit_Dereference (Loc,
+ Unchecked_Convert_To (RTE (RE_Predef_Prims_Table_Ptr),
+ Make_Selected_Component (Loc,
+ Prefix =>
+ Build_DT (Loc, Old_Tag_Node),
+ Selector_Name =>
+ New_Reference_To
+ (RTE_Record_Component (RE_Predef_Prims), Loc)))),
+
+ Discrete_Range =>
+ Make_Range (Loc,
+ Low_Bound => Make_Integer_Literal (Loc, 1),
+ High_Bound =>
+ New_Reference_To (RTE (RE_Max_Predef_Prims), Loc))));
+ else
+ return
+ Make_Assignment_Statement (Loc,
+ Name =>
+ Make_Slice (Loc,
+ Prefix =>
+ Make_Explicit_Dereference (Loc,
+ Build_Predef_Prims (Loc, New_Tag_Node)),
+ Discrete_Range => Make_Range (Loc,
+ Make_Integer_Literal (Loc, Uint_1),
+ New_Reference_To (RTE (RE_Max_Predef_Prims), Loc))),
+
+ Expression =>
+ Make_Slice (Loc,
+ Prefix =>
+ Make_Explicit_Dereference (Loc,
+ Build_Predef_Prims (Loc, Old_Tag_Node)),
+ Discrete_Range =>
+ Make_Range (Loc,
+ Low_Bound => Make_Integer_Literal (Loc, 1),
+ High_Bound =>
+ New_Reference_To (RTE (RE_Max_Predef_Prims), Loc))));
+ end if;
end Build_Inherit_Predefined_Prims;
------------------------