diff options
author | charlet <charlet@138bc75d-0d04-0410-961f-82ee72b054a4> | 2014-02-20 13:38:06 +0000 |
---|---|---|
committer | charlet <charlet@138bc75d-0d04-0410-961f-82ee72b054a4> | 2014-02-20 13:38:06 +0000 |
commit | 83c6c069471b0dc63cb75e52026734759a6f65f3 (patch) | |
tree | cecff9bfdd85fd8f02159f7941edbadfef64e28c /gcc/ada/exp_ch9.adb | |
parent | fc635e8166ba8d7181727c4ba7953d786e4a16c8 (diff) | |
download | gcc-83c6c069471b0dc63cb75e52026734759a6f65f3.tar.gz |
2014-02-20 Robert Dewar <dewar@adacore.com>
* einfo.ads: Minor comment addition: Etype of package is
Standard_Void_Type.
* checks.adb, exp_aggr.adb, exp_atag.adb, exp_attr.adb, exp_ch13.adb,
exp_ch2.adb, exp_ch3.adb, exp_ch4.adb, exp_ch5.adb, exp_ch6.adb,
exp_ch7.adb, exp_ch9.adb, exp_dbug.adb, exp_disp.adb, exp_imgv.adb,
exp_intr.adb, exp_prag.adb, exp_sel.adb, exp_strm.adb, exp_util.adb,
freeze.adb, rtsfind.adb, sem_aggr.adb, sem_attr.adb, sem_ch10.adb,
sem_ch12.adb, sem_ch13.adb, sem_ch3.adb, sem_ch4.adb, sem_ch5.adb,
sem_ch6.adb, sem_ch8.adb, sem_dim.adb, sem_prag.adb, sem_res.adb,
sem_util.adb, tbuild.adb, tbuild.ads: Remove New_Reference_To.
Replace all calls with calls to New_Occurrence_Of.
2014-02-20 Robert Dewar <dewar@adacore.com>
* par-util.adb (Ignore, case of right paren): Make this a
serious error.
git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@207942 138bc75d-0d04-0410-961f-82ee72b054a4
Diffstat (limited to 'gcc/ada/exp_ch9.adb')
-rw-r--r-- | gcc/ada/exp_ch9.adb | 821 |
1 files changed, 420 insertions, 401 deletions
diff --git a/gcc/ada/exp_ch9.adb b/gcc/ada/exp_ch9.adb index 88e1ea79ea3..e1b02679196 100644 --- a/gcc/ada/exp_ch9.adb +++ b/gcc/ada/exp_ch9.adb @@ -582,7 +582,7 @@ package body Exp_Ch9 is Actual_Family_Offset ( Make_Attribute_Reference (Sloc, Attribute_Name => Name_Pos, - Prefix => New_Reference_To (Base_Type (S), Sloc), + Prefix => New_Occurrence_Of (Base_Type (S), Sloc), Expressions => New_List (Relocate_Node (Index))), Type_Low_Bound (S))); else @@ -728,7 +728,7 @@ package body Exp_Ch9 is Prefix => Unchecked_Convert_To (Entry_Parameters_Type (Ent), Make_Identifier (Loc, Chars (Ptr))), - Selector_Name => New_Reference_To (Comp, Loc)); + Selector_Name => New_Occurrence_Of (Comp, Loc)); Decl := Build_Renamed_Formal_Declaration @@ -772,7 +772,7 @@ package body Exp_Ch9 is Defining_Identifier => Make_Defining_Identifier (Loc, Name_uObject), Object_Definition => - New_Reference_To (Obj_Ptr, Loc), + New_Occurrence_Of (Obj_Ptr, Loc), Expression => Unchecked_Convert_To (Obj_Ptr, Make_Identifier (Loc, Name_uO))); Set_Debug_Info_Needed (Defining_Identifier (Decl)); @@ -788,7 +788,7 @@ package body Exp_Ch9 is Type_Definition => Make_Access_To_Object_Definition (Loc, Subtype_Indication => - New_Reference_To (Rec_Typ, Loc))); + New_Occurrence_Of (Rec_Typ, Loc))); Set_Debug_Info_Needed (Defining_Identifier (Decl)); Prepend_To (Decls, Decl); end Add_Object_Pointer; @@ -863,11 +863,11 @@ package body Exp_Ch9 is Statements => New_List ( Make_Procedure_Call_Statement (Sloc (Stats), - Name => New_Reference_To ( + Name => New_Occurrence_Of ( RTE (RE_Exceptional_Complete_Rendezvous), Sloc (Stats)), Parameter_Associations => New_List ( Make_Function_Call (Sloc (Stats), - Name => New_Reference_To ( + Name => New_Occurrence_Of ( RTE (RE_Get_GNAT_Exception), Sloc (Stats))))))))); Set_Parent (New_S, Astat); -- temp parent for Analyze call @@ -970,7 +970,7 @@ package body Exp_Ch9 is Defining_Identifier => Chain, Aliased_Present => True, Object_Definition => - New_Reference_To (RTE (RE_Activation_Chain), Loc)); + New_Occurrence_Of (RTE (RE_Activation_Chain), Loc)); Prepend_To (Decls, Decl); @@ -1074,16 +1074,16 @@ package body Exp_Ch9 is Defining_Identifier => Make_Defining_Identifier (Loc, Name_uO), Parameter_Type => - New_Reference_To (RTE (RE_Address), Loc)), + New_Occurrence_Of (RTE (RE_Address), Loc)), Make_Parameter_Specification (Loc, Defining_Identifier => Make_Defining_Identifier (Loc, Name_uE), Parameter_Type => - New_Reference_To (RTE (RE_Protected_Entry_Index), Loc))), + New_Occurrence_Of (RTE (RE_Protected_Entry_Index), Loc))), Result_Definition => - New_Reference_To (Standard_Boolean, Loc)); + New_Occurrence_Of (Standard_Boolean, Loc)); end Build_Barrier_Function_Specification; -------------------------- @@ -1098,7 +1098,7 @@ package body Exp_Ch9 is begin return Make_Function_Call (Loc, - Name => New_Reference_To (E, Loc), + Name => New_Occurrence_Of (E, Loc), Parameter_Associations => New_List (Concurrent_Ref (N))); end Build_Call_With_Task; @@ -1168,10 +1168,10 @@ package body Exp_Ch9 is Make_Defining_Identifier (Loc, Name_uMaster), Constant_Present => True, Object_Definition => - New_Reference_To (Standard_Integer, Loc), + New_Occurrence_Of (Standard_Integer, Loc), Expression => Make_Explicit_Dereference (Loc, - New_Reference_To (RTE (RE_Current_Master), Loc))); + New_Occurrence_Of (RTE (RE_Current_Master), Loc))); Insert_Action (Related_Node, Master_Decl); Analyze (Master_Decl); @@ -1215,7 +1215,7 @@ package body Exp_Ch9 is Ren_Decl := Make_Object_Renaming_Declaration (Loc, Defining_Identifier => Master_Id, - Subtype_Mark => New_Reference_To (Standard_Integer, Loc), + Subtype_Mark => New_Occurrence_Of (Standard_Integer, Loc), Name => Name_Id); Insert_Action (Related_Node, Ren_Decl); @@ -1317,15 +1317,21 @@ package body Exp_Ch9 is N : Node_Id) return Node_Id is Loc : constant Source_Ptr := Sloc (N); + begin return Make_Op_Or (Loc, Make_Op_Eq (Loc, - Left_Opnd => New_Reference_To (K, Loc), - Right_Opnd => New_Reference_To (RTE (RE_TK_Limited_Tagged), Loc)), + Left_Opnd => + New_Occurrence_Of (K, Loc), + Right_Opnd => + New_Occurrence_Of (RTE (RE_TK_Limited_Tagged), Loc)), + Make_Op_Eq (Loc, - Left_Opnd => New_Reference_To (K, Loc), - Right_Opnd => New_Reference_To (RTE (RE_TK_Tagged), Loc))); + Left_Opnd => + New_Occurrence_Of (K, Loc), + Right_Opnd => + New_Occurrence_Of (RTE (RE_TK_Tagged), Loc))); end Build_Dispatching_Tag_Check; ---------------------------------- @@ -1513,7 +1519,7 @@ package body Exp_Ch9 is Make_Object_Declaration (Loc, Defining_Identifier => Index, Object_Definition => - New_Reference_To (RTE (RE_Entry_Index), Loc), + New_Occurrence_Of (RTE (RE_Entry_Index), Loc), Expression => Make_Integer_Literal (Loc, 1))); -- Step 2: Generate the declaration of an array to house all @@ -1529,11 +1535,11 @@ package body Exp_Ch9 is Defining_Identifier => Size, Constant_Present => True, Object_Definition => - New_Reference_To (RTE (RE_Entry_Index), Loc), + New_Occurrence_Of (RTE (RE_Entry_Index), Loc), Expression => Make_Function_Call (Loc, Name => - New_Reference_To (RTE (Count), Loc), + New_Occurrence_Of (RTE (Count), Loc), Parameter_Associations => New_List (Object_Reference)))); @@ -1544,15 +1550,17 @@ package body Exp_Ch9 is Defining_Identifier => Data, Aliased_Present => True, Object_Definition => - New_Reference_To (RTE (Data_Typ), Loc), + New_Occurrence_Of (RTE (Data_Typ), Loc), Expression => Make_Aggregate (Loc, Component_Associations => New_List ( Make_Component_Association (Loc, Choices => New_List ( Make_Range (Loc, - Low_Bound => Make_Integer_Literal (Loc, 1), - High_Bound => New_Reference_To (Size, Loc))), + Low_Bound => + Make_Integer_Literal (Loc, 1), + High_Bound => + New_Occurrence_Of (Size, Loc))), Expression => Make_Null (Loc)))))); end; end if; @@ -1566,10 +1574,10 @@ package body Exp_Ch9 is begin return Make_Assignment_Statement (Loc, - Name => New_Reference_To (Index, Loc), + Name => New_Occurrence_Of (Index, Loc), Expression => Make_Op_Add (Loc, - Left_Opnd => New_Reference_To (Index, Loc), + Left_Opnd => New_Occurrence_Of (Index, Loc), Right_Opnd => Make_Integer_Literal (Loc, 1))); end Increment_Index; @@ -1584,7 +1592,8 @@ package body Exp_Ch9 is Defining_Identifier => Def_Id, Aliased_Present => True, Constant_Present => True, - Object_Definition => New_Reference_To (Standard_String, Loc), + Object_Definition => + New_Occurrence_Of (Standard_String, Loc), Expression => Make_String_Literal (Loc, String_From_Name_Buffer)); end Name_Declaration; @@ -1599,12 +1608,12 @@ package body Exp_Ch9 is Make_Assignment_Statement (Loc, Name => Make_Indexed_Component (Loc, - Prefix => New_Reference_To (Data, Loc), - Expressions => New_List (New_Reference_To (Index, Loc))), + Prefix => New_Occurrence_Of (Data, Loc), + Expressions => New_List (New_Occurrence_Of (Index, Loc))), Expression => Make_Attribute_Reference (Loc, - Prefix => New_Reference_To (Def_Id, Loc), + Prefix => New_Occurrence_Of (Def_Id, Loc), Attribute_Name => Name_Unchecked_Access)); end Set_Entry_Name; @@ -1766,11 +1775,11 @@ package body Exp_Ch9 is Append_To (Stmts, Make_Procedure_Call_Statement (Loc, - Name => New_Reference_To (RTE (Proc), Loc), + Name => New_Occurrence_Of (RTE (Proc), Loc), Parameter_Associations => New_List ( Object_Reference, Make_Attribute_Reference (Loc, - Prefix => New_Reference_To (Data, Loc), + Prefix => New_Occurrence_Of (Data, Loc), Attribute_Name => Name_Unchecked_Access)))); end if; end Build_Entry_Names; @@ -1813,7 +1822,7 @@ package body Exp_Ch9 is All_Present => True, Constant_Present => Ekind (Formal) = E_In_Parameter, Subtype_Indication => - New_Reference_To (Etype (Actual), Loc)))); + New_Occurrence_Of (Etype (Actual), Loc)))); -- Generate: -- Param : Ann; @@ -1827,7 +1836,7 @@ package body Exp_Ch9 is Aliased_Present => False, Subtype_Indication => - New_Reference_To (Comp_Nam, Loc)))); + New_Occurrence_Of (Comp_Nam, Loc)))); Has_Comp := True; end if; @@ -1900,14 +1909,14 @@ package body Exp_Ch9 is Decl := Make_Object_Renaming_Declaration (Loc, Defining_Identifier => New_F, - Subtype_Mark => New_Reference_To (Etype (Comp), Loc), + Subtype_Mark => New_Occurrence_Of (Etype (Comp), Loc), Name => Renamed_Formal); else Decl := Make_Object_Renaming_Declaration (Loc, Defining_Identifier => New_F, - Subtype_Mark => New_Reference_To (Etype (Formal), Loc), + Subtype_Mark => New_Occurrence_Of (Etype (Formal), Loc), Name => Make_Explicit_Dereference (Loc, Renamed_Formal)); end if; @@ -2055,10 +2064,10 @@ package body Exp_Ch9 is Make_Object_Renaming_Declaration (Loc, Defining_Identifier => Make_Defining_Identifier (Loc, Chars (D)), - Subtype_Mark => New_Reference_To (Etype (D), Loc), + Subtype_Mark => New_Occurrence_Of (Etype (D), Loc), Name => Make_Selected_Component (Loc, - Prefix => New_Reference_To (Synch_Id, Loc), + Prefix => New_Occurrence_Of (Synch_Id, Loc), Selector_Name => Make_Identifier (Loc, Chars (D)))); Prepend (Decl, Decls); Next_Discriminant (D); @@ -2176,7 +2185,7 @@ package body Exp_Ch9 is Chars => Chars (Defining_Identifier (First_Form)))); end if; - Nam := New_Reference_To (Subp_Id, Loc); + Nam := New_Occurrence_Of (Subp_Id, Loc); else -- An access-to-variable object parameter requires an explicit -- dereference in the unchecked conversion. This case occurs @@ -2200,7 +2209,7 @@ package body Exp_Ch9 is Prefix => Unchecked_Convert_To (Corresponding_Concurrent_Type (Obj_Typ), Conv_Id), - Selector_Name => New_Reference_To (Subp_Id, Loc)); + Selector_Name => New_Occurrence_Of (Subp_Id, Loc)); end if; -- Create the subprogram body. For a function, the call to the @@ -2487,7 +2496,7 @@ package body Exp_Ch9 is Param_Type := Copy_Separate_Tree (Parameter_Type (Formal)); else Param_Type := - New_Reference_To (Etype (Parameter_Type (Formal)), Loc); + New_Occurrence_Of (Etype (Parameter_Type (Formal)), Loc); end if; Append_To (New_Formals, @@ -2578,7 +2587,7 @@ package body Exp_Ch9 is Defining_Identifier => Make_Defining_Identifier (Loc, Name_uO), In_Present => True, Out_Present => False, - Parameter_Type => New_Reference_To (Obj_Typ, Loc)); + Parameter_Type => New_Occurrence_Of (Obj_Typ, Loc)); -- For entries and procedures of protected types the mode of -- the controlling argument must be in-out. @@ -2591,7 +2600,7 @@ package body Exp_Ch9 is Chars => Name_uO), In_Present => True, Out_Present => (Ekind (Subp_Id) /= E_Function), - Parameter_Type => New_Reference_To (Obj_Typ, Loc)); + Parameter_Type => New_Occurrence_Of (Obj_Typ, Loc)); end if; end if; @@ -2640,12 +2649,12 @@ package body Exp_Ch9 is Obj_Param_Typ := Make_Access_Definition (Loc, Subtype_Mark => - New_Reference_To (Obj_Typ, Loc)); + New_Occurrence_Of (Obj_Typ, Loc)); Set_Null_Exclusion_Present (Obj_Param_Typ, Null_Exclusion_Present (Parameter_Type (First_Param))); else - Obj_Param_Typ := New_Reference_To (Obj_Typ, Loc); + Obj_Param_Typ := New_Occurrence_Of (Obj_Typ, Loc); end if; Obj_Param := @@ -2672,7 +2681,7 @@ package body Exp_Ch9 is Make_Defining_Identifier (Loc, Name_uO), In_Present => In_Present (Parent (First_Entity (Subp_Id))), Out_Present => Ekind (Subp_Id) /= E_Function, - Parameter_Type => New_Reference_To (Obj_Typ, Loc)); + Parameter_Type => New_Occurrence_Of (Obj_Typ, Loc)); Prepend_To (New_Formals, Obj_Param); end if; @@ -2995,12 +3004,12 @@ package body Exp_Ch9 is Make_Parameter_Specification (Loc, Defining_Identifier => Parm1, Parameter_Type => - New_Reference_To (RTE (RE_Address), Loc)), + New_Occurrence_Of (RTE (RE_Address), Loc)), Make_Parameter_Specification (Loc, Defining_Identifier => Parm2, Parameter_Type => - New_Reference_To (RTE (RE_Protected_Entry_Index), Loc))), + New_Occurrence_Of (RTE (RE_Protected_Entry_Index), Loc))), Result_Definition => New_Occurrence_Of ( RTE (RE_Protected_Entry_Index), Loc)); @@ -3305,24 +3314,24 @@ package body Exp_Ch9 is Condition => Make_Function_Call (Loc, Name => - New_Reference_To (Try_Write, Loc), + New_Occurrence_Of (Try_Write, Loc), Parameter_Associations => New_List ( Make_Attribute_Reference (Loc, Prefix => Relocate_Node (Comp_Sel_Nam), Attribute_Name => Name_Address), Unchecked_Convert_To (Unsigned, - New_Reference_To (Expected_Comp, Loc)), + New_Occurrence_Of (Expected_Comp, Loc)), Unchecked_Convert_To (Unsigned, - New_Reference_To (Desired_Comp, Loc)))), + New_Occurrence_Of (Desired_Comp, Loc)))), Then_Statements => New_List (Relocate_Node (Stmt)), Else_Statements => New_List ( Make_Goto_Statement (Loc, Name => - New_Reference_To (Entity (Label_Id), Loc))))); + New_Occurrence_Of (Entity (Label_Id), Loc))))); end Wrap_Statement; -- Start of processing for Process_Node @@ -3431,12 +3440,12 @@ package body Exp_Ch9 is Decl := Make_Object_Declaration (Loc, Defining_Identifier => Expected_Comp, - Object_Definition => New_Reference_To (Comp_Type, Loc), + Object_Definition => New_Occurrence_Of (Comp_Type, Loc), Constant_Present => True, Expression => Unchecked_Convert_To (Comp_Type, Make_Function_Call (Loc, - Name => New_Reference_To (Read, Loc), + Name => New_Occurrence_Of (Read, Loc), Parameter_Associations => New_List ( Make_Attribute_Reference (Loc, Prefix => Relocate_Node (Comp_Sel_Nam), @@ -3468,9 +3477,9 @@ package body Exp_Ch9 is Insert_Before (Comp_Decl, Make_Object_Declaration (Loc, Defining_Identifier => Desired_Comp, - Object_Definition => New_Reference_To (Comp_Type, Loc), + Object_Definition => New_Occurrence_Of (Comp_Type, Loc), Expression => - New_Reference_To (Expected_Comp, Loc))); + New_Occurrence_Of (Expected_Comp, Loc))); -- Protected function @@ -3497,7 +3506,7 @@ package body Exp_Ch9 is Subtype_Mark => New_Occurrence_Of (Comp_Type, Loc), Name => - New_Reference_To (Desired_Comp, Loc))); + New_Occurrence_Of (Desired_Comp, Loc))); -- Wrap any return or raise statements in Stmts in same the manner -- described in Process_Stmts. @@ -3516,17 +3525,17 @@ package body Exp_Ch9 is Condition => Make_Function_Call (Loc, Name => - New_Reference_To (Try_Write, Loc), + New_Occurrence_Of (Try_Write, Loc), Parameter_Associations => New_List ( Make_Attribute_Reference (Loc, Prefix => Relocate_Node (Comp_Sel_Nam), Attribute_Name => Name_Address), Unchecked_Convert_To (Unsigned, - New_Reference_To (Expected_Comp, Loc)), + New_Occurrence_Of (Expected_Comp, Loc)), Unchecked_Convert_To (Unsigned, - New_Reference_To (Desired_Comp, Loc))))); + New_Occurrence_Of (Desired_Comp, Loc))))); -- Small optimization: transform the default return statement -- of a procedure into the atomic exit statement. @@ -3641,10 +3650,10 @@ package body Exp_Ch9 is Defining_Identifier => Make_Defining_Identifier (Loc, Name_uMaster), Constant_Present => True, - Object_Definition => New_Reference_To (RTE (RE_Master_Id), Loc), + Object_Definition => New_Occurrence_Of (RTE (RE_Master_Id), Loc), Expression => Make_Explicit_Dereference (Loc, - New_Reference_To (RTE (RE_Current_Master), Loc))); + New_Occurrence_Of (RTE (RE_Current_Master), Loc))); -- The master is inserted at the start of the declarative list of the -- context. @@ -3726,7 +3735,7 @@ package body Exp_Ch9 is Master_Decl := Make_Object_Renaming_Declaration (Loc, Defining_Identifier => Master_Id, - Subtype_Mark => New_Reference_To (RTE (RE_Master_Id), Loc), + Subtype_Mark => New_Occurrence_Of (RTE (RE_Master_Id), Loc), Name => Make_Identifier (Loc, Name_uMaster)); Insert_Action (Context, Master_Decl); @@ -3876,7 +3885,7 @@ package body Exp_Ch9 is Append_To (Op_Stats, Make_Procedure_Call_Statement (End_Loc, Name => - New_Reference_To (RTE (RE_Complete_Entry_Body), Loc), + New_Occurrence_Of (RTE (RE_Complete_Entry_Body), Loc), Parameter_Associations => New_List ( Make_Attribute_Reference (End_Loc, Prefix => @@ -3918,12 +3927,12 @@ package body Exp_Ch9 is case Corresponding_Runtime_Package (Pid) is when System_Tasking_Protected_Objects_Entries => Complete := - New_Reference_To + New_Occurrence_Of (RTE (RE_Exceptional_Complete_Entry_Body), Loc); when System_Tasking_Protected_Objects_Single_Entry => Complete := - New_Reference_To + New_Occurrence_Of (RTE (RE_Exceptional_Complete_Single_Entry_Body), Loc); when others => @@ -3963,7 +3972,7 @@ package body Exp_Ch9 is Attribute_Name => Name_Unchecked_Access), Make_Function_Call (Han_Loc, - Name => New_Reference_To ( + Name => New_Occurrence_Of ( RTE (RE_Get_GNAT_Exception), Loc))))))))); end if; end Build_Protected_Entry; @@ -3994,18 +4003,18 @@ package body Exp_Ch9 is Defining_Identifier => Make_Defining_Identifier (Loc, Name_uO), Parameter_Type => - New_Reference_To (RTE (RE_Address), Loc)), + New_Occurrence_Of (RTE (RE_Address), Loc)), Make_Parameter_Specification (Loc, Defining_Identifier => P, Parameter_Type => - New_Reference_To (RTE (RE_Address), Loc)), + New_Occurrence_Of (RTE (RE_Address), Loc)), Make_Parameter_Specification (Loc, Defining_Identifier => Make_Defining_Identifier (Loc, Name_uE), Parameter_Type => - New_Reference_To (RTE (RE_Protected_Entry_Index), Loc)))); + New_Occurrence_Of (RTE (RE_Protected_Entry_Index), Loc)))); end Build_Protected_Entry_Specification; -------------------------- @@ -4035,7 +4044,7 @@ package body Exp_Ch9 is Make_Defining_Identifier (Sloc (Formal), Chars (Formal)), In_Present => In_Present (Parent (Formal)), Out_Present => Out_Present (Parent (Formal)), - Parameter_Type => New_Reference_To (Etype (Formal), Loc)); + Parameter_Type => New_Occurrence_Of (Etype (Formal), Loc)); if Unprotected then Set_Protected_Formal (Formal, Defining_Identifier (New_Param)); @@ -4058,7 +4067,7 @@ package body Exp_Ch9 is (Etype (Ident) = Standard_Void_Type and then not Is_RTE (Obj_Type, RE_Address)), Parameter_Type => - New_Reference_To (Obj_Type, Loc)); + New_Occurrence_Of (Obj_Type, Loc)); Set_Debug_Info_Needed (Defining_Identifier (Decl)); Prepend_To (New_Plist, Decl); @@ -4204,7 +4213,7 @@ package body Exp_Ch9 is Return_Stmt := Make_Simple_Return_Statement (Loc, - Expression => New_Reference_To (R, Loc)); + Expression => New_Occurrence_Of (R, Loc)); else Unprot_Call := Make_Simple_Return_Statement (Loc, @@ -4241,13 +4250,13 @@ package body Exp_Ch9 is case Corresponding_Runtime_Package (Pid) is when System_Tasking_Protected_Objects_Entries => - Lock_Name := New_Reference_To (RTE (RE_Lock_Entries), Loc); + Lock_Name := New_Occurrence_Of (RTE (RE_Lock_Entries), Loc); when System_Tasking_Protected_Objects_Single_Entry => - Lock_Name := New_Reference_To (RTE (RE_Lock_Entry), Loc); + Lock_Name := New_Occurrence_Of (RTE (RE_Lock_Entry), Loc); when System_Tasking_Protected_Objects => - Lock_Name := New_Reference_To (RTE (Lock_Kind), Loc); + Lock_Name := New_Occurrence_Of (RTE (Lock_Kind), Loc); when others => raise Program_Error; @@ -4268,7 +4277,7 @@ package body Exp_Ch9 is if Abort_Allowed then Stmts := New_List ( Make_Procedure_Call_Statement (Loc, - Name => New_Reference_To (RTE (RE_Abort_Defer), Loc), + Name => New_Occurrence_Of (RTE (RE_Abort_Defer), Loc), Parameter_Associations => Empty_List), Lock_Stmt); @@ -4410,10 +4419,10 @@ package body Exp_Ch9 is then case Corresponding_Runtime_Package (Conc_Typ) is when System_Tasking_Protected_Objects_Entries => - Nam := New_Reference_To (RTE (RE_Service_Entries), Loc); + Nam := New_Occurrence_Of (RTE (RE_Service_Entries), Loc); when System_Tasking_Protected_Objects_Single_Entry => - Nam := New_Reference_To (RTE (RE_Service_Entry), Loc); + Nam := New_Occurrence_Of (RTE (RE_Service_Entry), Loc); when others => raise Program_Error; @@ -4436,13 +4445,13 @@ package body Exp_Ch9 is case Corresponding_Runtime_Package (Conc_Typ) is when System_Tasking_Protected_Objects_Entries => - Nam := New_Reference_To (RTE (RE_Unlock_Entries), Loc); + Nam := New_Occurrence_Of (RTE (RE_Unlock_Entries), Loc); when System_Tasking_Protected_Objects_Single_Entry => - Nam := New_Reference_To (RTE (RE_Unlock_Entry), Loc); + Nam := New_Occurrence_Of (RTE (RE_Unlock_Entry), Loc); when System_Tasking_Protected_Objects => - Nam := New_Reference_To (RTE (RE_Unlock), Loc); + Nam := New_Occurrence_Of (RTE (RE_Unlock), Loc); when others => raise Program_Error; @@ -4467,7 +4476,7 @@ package body Exp_Ch9 is Append_To (Stmts, Make_Procedure_Call_Statement (Loc, Name => - New_Reference_To (RTE (RE_Abort_Undefer), Loc), + New_Occurrence_Of (RTE (RE_Abort_Undefer), Loc), Parameter_Associations => Empty_List)); end if; end Build_Protected_Subprogram_Call_Cleanup; @@ -4693,12 +4702,12 @@ package body Exp_Ch9 is Make_Object_Declaration (Loc, Defining_Identifier => X, Object_Definition => - New_Reference_To (RTE (RE_Task_Entry_Index), Loc), + New_Occurrence_Of (RTE (RE_Task_Entry_Index), Loc), Expression => Actual_Index_Expression ( Loc, Entity (Ename), Index, Concval)); Append_To (Decls, Xdecl); - Parm2 := New_Reference_To (X, Loc); + Parm2 := New_Occurrence_Of (X, Loc); else Xdecl := Empty; @@ -4709,7 +4718,7 @@ package body Exp_Ch9 is -- none, then it is just the null address, since nothing is passed. if No (Parms) then - Parm3 := New_Reference_To (RTE (RE_Null_Address), Loc); + Parm3 := New_Occurrence_Of (RTE (RE_Null_Address), Loc); P := Empty; -- Case of parameters present, where third argument is the address @@ -4734,7 +4743,7 @@ package body Exp_Ch9 is Defining_Identifier => Make_Temporary (Loc, 'J'), Aliased_Present => True, Object_Definition => - New_Reference_To (Etype (Formal), Loc)); + New_Occurrence_Of (Etype (Formal), Loc)); -- Mark the object as not needing initialization since the -- initialization is performed separately, avoiding errors @@ -4752,7 +4761,7 @@ package body Exp_Ch9 is or else Is_Access_Type (Etype (Formal)) then N_Var := - New_Reference_To (Defining_Identifier (N_Node), Loc); + New_Occurrence_Of (Defining_Identifier (N_Node), Loc); Set_Assignment_OK (N_Var); Append_To (Stats, Make_Assignment_Statement (Loc, @@ -4766,7 +4775,7 @@ package body Exp_Ch9 is Make_Attribute_Reference (Loc, Attribute_Name => Name_Unchecked_Access, Prefix => - New_Reference_To (Defining_Identifier (N_Node), Loc))); + New_Occurrence_Of (Defining_Identifier (N_Node), Loc))); -- If it is a VM_By_Copy_Actual, copy it to a new variable @@ -4776,7 +4785,7 @@ package body Exp_Ch9 is Defining_Identifier => Make_Temporary (Loc, 'J'), Aliased_Present => True, Object_Definition => - New_Reference_To (Etype (Formal), Loc), + New_Occurrence_Of (Etype (Formal), Loc), Expression => New_Copy_Tree (Actual)); Set_Assignment_OK (N_Node); @@ -4786,7 +4795,7 @@ package body Exp_Ch9 is Make_Attribute_Reference (Loc, Attribute_Name => Name_Unchecked_Access, Prefix => - New_Reference_To (Defining_Identifier (N_Node), Loc))); + New_Occurrence_Of (Defining_Identifier (N_Node), Loc))); else -- Interface class-wide formal @@ -4811,7 +4820,7 @@ package body Exp_Ch9 is Prefix => Relocate_Node (Actual), Selector_Name => - New_Reference_To (Iface_Tag, Loc))))); + New_Occurrence_Of (Iface_Tag, Loc))))); else -- Generate: -- actual'reference @@ -4834,13 +4843,13 @@ package body Exp_Ch9 is Make_Object_Declaration (Loc, Defining_Identifier => P, Object_Definition => - New_Reference_To (Designated_Type (Ent_Acc), Loc), + New_Occurrence_Of (Designated_Type (Ent_Acc), Loc), Expression => Make_Aggregate (Loc, Expressions => Plist)); Parm3 := Make_Attribute_Reference (Loc, - Prefix => New_Reference_To (P, Loc), + Prefix => New_Occurrence_Of (P, Loc), Attribute_Name => Name_Address); Append (Pdecl, Decls); @@ -4855,7 +4864,7 @@ package body Exp_Ch9 is -- Change the type of the index declaration Set_Object_Definition (Xdecl, - New_Reference_To (RTE (RE_Protected_Entry_Index), Loc)); + New_Occurrence_Of (RTE (RE_Protected_Entry_Index), Loc)); -- Some additional declarations for protected entry calls @@ -4871,7 +4880,8 @@ package body Exp_Ch9 is Make_Object_Declaration (Loc, Defining_Identifier => Comm_Name, Object_Definition => - New_Reference_To (RTE (RE_Communication_Block), Loc))); + New_Occurrence_Of + (RTE (RE_Communication_Block), Loc))); -- Some additional statements for protected entry calls @@ -4885,7 +4895,7 @@ package body Exp_Ch9 is Call := Make_Procedure_Call_Statement (Loc, Name => - New_Reference_To (RTE (RE_Protected_Entry_Call), Loc), + New_Occurrence_Of (RTE (RE_Protected_Entry_Call), Loc), Parameter_Associations => New_List ( Make_Attribute_Reference (Loc, @@ -4893,7 +4903,7 @@ package body Exp_Ch9 is Prefix => Parm1), Parm2, Parm3, - New_Reference_To (RTE (RE_Simple_Call), Loc), + New_Occurrence_Of (RTE (RE_Simple_Call), Loc), New_Occurrence_Of (Comm_Name, Loc))); when System_Tasking_Protected_Objects_Single_Entry => @@ -4903,7 +4913,7 @@ package body Exp_Ch9 is Call := Make_Procedure_Call_Statement (Loc, - Name => New_Reference_To ( + Name => New_Occurrence_Of ( RTE (RE_Protected_Single_Entry_Call), Loc), Parameter_Associations => New_List ( @@ -4921,7 +4931,7 @@ package body Exp_Ch9 is else Call := Make_Procedure_Call_Statement (Loc, - Name => New_Reference_To (RTE (RE_Call_Simple), Loc), + Name => New_Occurrence_Of (RTE (RE_Call_Simple), Loc), Parameter_Associations => New_List (Parm1, Parm2, Parm3)); end if; @@ -4947,7 +4957,7 @@ package body Exp_Ch9 is Expression => Make_Explicit_Dereference (Loc, Make_Selected_Component (Loc, - Prefix => New_Reference_To (P, Loc), + Prefix => New_Occurrence_Of (P, Loc), Selector_Name => Make_Identifier (Loc, Chars (Formal))))); @@ -5036,9 +5046,11 @@ package body Exp_Ch9 is if Present (Chain) then if Restricted_Profile then - Name := New_Reference_To (RTE (RE_Activate_Restricted_Tasks), Loc); + Name := New_Occurrence_Of + (RTE (RE_Activate_Restricted_Tasks), Loc); else - Name := New_Reference_To (RTE (RE_Activate_Tasks), Loc); + Name := New_Occurrence_Of + (RTE (RE_Activate_Tasks), Loc); end if; Call := @@ -5134,7 +5146,7 @@ package body Exp_Ch9 is begin Block := Make_Block_Statement (Loc, - Identifier => New_Reference_To (Blkent, Loc), + Identifier => New_Occurrence_Of (Blkent, Loc), Declarations => New_List ( -- _Chain : Activation_Chain; @@ -5143,7 +5155,7 @@ package body Exp_Ch9 is Defining_Identifier => Chain, Aliased_Present => True, Object_Definition => - New_Reference_To (RTE (RE_Activation_Chain), Loc))), + New_Occurrence_Of (RTE (RE_Activation_Chain), Loc))), Handled_Statement_Sequence => Make_Handled_Sequence_Of_Statements (Loc, @@ -5153,16 +5165,16 @@ package body Exp_Ch9 is -- Init (Args); Make_Procedure_Call_Statement (Loc, - Name => New_Reference_To (Init, Loc), + Name => New_Occurrence_Of (Init, Loc), Parameter_Associations => Args), -- Activate_Tasks (_Chain); Make_Procedure_Call_Statement (Loc, - Name => New_Reference_To (RTE (RE_Activate_Tasks), Loc), + Name => New_Occurrence_Of (RTE (RE_Activate_Tasks), Loc), Parameter_Associations => New_List ( Make_Attribute_Reference (Loc, - Prefix => New_Reference_To (Chain, Loc), + Prefix => New_Occurrence_Of (Chain, Loc), Attribute_Name => Name_Unchecked_Access))))), Has_Created_Identifier => True, @@ -5196,15 +5208,15 @@ package body Exp_Ch9 is begin Append_To (Init_Stmts, Make_Procedure_Call_Statement (Loc, - Name => New_Reference_To (RTE (RE_Activate_Tasks), Loc), + Name => New_Occurrence_Of (RTE (RE_Activate_Tasks), Loc), Parameter_Associations => New_List ( Make_Attribute_Reference (Loc, - Prefix => New_Reference_To (Chain, Loc), + Prefix => New_Occurrence_Of (Chain, Loc), Attribute_Name => Name_Unchecked_Access)))); Block := Make_Block_Statement (Loc, - Identifier => New_Reference_To (Blkent, Loc), + Identifier => New_Occurrence_Of (Blkent, Loc), Declarations => New_List ( -- _Chain : Activation_Chain; @@ -5213,7 +5225,7 @@ package body Exp_Ch9 is Defining_Identifier => Chain, Aliased_Present => True, Object_Definition => - New_Reference_To (RTE (RE_Activation_Chain), Loc))), + New_Occurrence_Of (RTE (RE_Activation_Chain), Loc))), Handled_Statement_Sequence => Make_Handled_Sequence_Of_Statements (Loc, Init_Stmts), @@ -5272,7 +5284,7 @@ package body Exp_Ch9 is Parameter_Type => Make_Access_Definition (Loc, Subtype_Mark => - New_Reference_To (Corresponding_Record_Type (T), Loc))))); + New_Occurrence_Of (Corresponding_Record_Type (T), Loc))))); end Build_Task_Proc_Specification; --------------------------------------- @@ -5370,7 +5382,7 @@ package body Exp_Ch9 is Make_Component_Definition (Loc, Aliased_Present => False, Subtype_Indication => - New_Reference_To (Standard_Character, Loc)))); + New_Occurrence_Of (Standard_Character, Loc)))); end; Insert_After (Current_Node, Efam_Decl); @@ -5564,7 +5576,7 @@ package body Exp_Ch9 is if Is_Current_Task (Entity (N)) then return Make_Function_Call (Loc, - Name => New_Reference_To (RTE (RE_Self), Loc)); + Name => New_Occurrence_Of (RTE (RE_Self), Loc)); else declare @@ -5581,7 +5593,7 @@ package body Exp_Ch9 is New_Occurrence_Of (RTE (RO_ST_Task_Id), Loc), Expression => Make_Function_Call (Loc, - Name => New_Reference_To (RTE (RE_Self), Loc))); + Name => New_Occurrence_Of (RTE (RE_Self), Loc))); Prepend (Decl, Declarations (T_Body)); Analyze (Decl); Set_Scope (T_Self, Entity (N)); @@ -5593,7 +5605,7 @@ package body Exp_Ch9 is pragma Assert (Is_Protected_Type (Entity (N))); return - New_Reference_To (Find_Protection_Object (Current_Scope), Loc); + New_Occurrence_Of (Find_Protection_Object (Current_Scope), Loc); end if; else @@ -5761,7 +5773,7 @@ package body Exp_Ch9 is Sloc, Make_Attribute_Reference (Sloc, Attribute_Name => Name_Pos, - Prefix => New_Reference_To (Base_Type (S), Sloc), + Prefix => New_Occurrence_Of (Base_Type (S), Sloc), Expressions => New_List (Relocate_Node (Index))), Type_Low_Bound (S), Ttyp, @@ -5916,7 +5928,7 @@ package body Exp_Ch9 is begin Ent := Make_Temporary (Loc, 'L'); - Lab := Make_Label (Loc, New_Reference_To (Ent, Loc)); + Lab := Make_Label (Loc, New_Occurrence_Of (Ent, Loc)); Ldecl := Make_Implicit_Label_Declaration (Loc, Defining_Identifier => Ent, @@ -5924,7 +5936,7 @@ package body Exp_Ch9 is Append (Lab, Statements (Handled_Statement_Sequence (N))); Ent := Make_Temporary (Loc, 'L'); - Lab := Make_Label (Loc, New_Reference_To (Ent, Loc)); + Lab := Make_Label (Loc, New_Occurrence_Of (Ent, Loc)); Ldecl2 := Make_Implicit_Label_Declaration (Loc, Defining_Identifier => Ent, @@ -5948,7 +5960,7 @@ package body Exp_Ch9 is Make_Object_Declaration (Loc, Defining_Identifier => Ann, Object_Definition => - New_Reference_To (RTE (RE_Address), Loc)); + New_Occurrence_Of (RTE (RE_Address), Loc)); Insert_Before_And_Analyze (N, Adecl); Insert_Before_And_Analyze (N, Ldecl); @@ -5999,7 +6011,7 @@ package body Exp_Ch9 is Make_Object_Declaration (Loc, Defining_Identifier => Ann, Object_Definition => - New_Reference_To (RTE (RE_Address), Loc)); + New_Occurrence_Of (RTE (RE_Address), Loc)); Insert_Before_And_Analyze (Sel_Acc, Adecl); @@ -6071,9 +6083,9 @@ package body Exp_Ch9 is Prefix => Unchecked_Convert_To ( Entry_Parameters_Type (Ent), - New_Reference_To (Ann, Loc)), + New_Occurrence_Of (Ann, Loc)), Selector_Name => - New_Reference_To (Comp, Loc)); + New_Occurrence_Of (Comp, Loc)); Decl := Build_Renamed_Formal_Declaration @@ -6366,7 +6378,7 @@ package body Exp_Ch9 is Make_Unchecked_Type_Conversion (Loc, Subtype_Mark => - New_Reference_To (RTE (RO_ST_Task_Id), Loc), + New_Occurrence_Of (RTE (RO_ST_Task_Id), Loc), Expression => Make_Selected_Component (Loc, Prefix => New_Copy_Tree (Tasknm), @@ -6385,10 +6397,10 @@ package body Exp_Ch9 is Rewrite (N, Make_Procedure_Call_Statement (Loc, - Name => New_Reference_To (RTE (RE_Abort_Tasks), Loc), + Name => New_Occurrence_Of (RTE (RE_Abort_Tasks), Loc), Parameter_Associations => New_List ( Make_Qualified_Expression (Loc, - Subtype_Mark => New_Reference_To (RTE (RE_Task_List), Loc), + Subtype_Mark => New_Occurrence_Of (RTE (RE_Task_List), Loc), Expression => Aggr)))); Analyze (N); @@ -6508,7 +6520,7 @@ package body Exp_Ch9 is Rewrite (N, Make_Procedure_Call_Statement (Loc, - Name => New_Reference_To (RTE (RE_Accept_Trivial), Loc), + Name => New_Occurrence_Of (RTE (RE_Accept_Trivial), Loc), Parameter_Associations => New_List ( Entry_Index_Expression (Loc, Entity (Ename), Eindx, Ttyp)))); @@ -6535,7 +6547,7 @@ package body Exp_Ch9 is Block := Make_Block_Statement (Loc, - Identifier => New_Reference_To (Blkent, Loc), + Identifier => New_Occurrence_Of (Blkent, Loc), Declarations => Declarations (N), Handled_Statement_Sequence => Build_Accept_Body (N)); @@ -6552,10 +6564,10 @@ package body Exp_Ch9 is Call := Make_Procedure_Call_Statement (Loc, - Name => New_Reference_To (RTE (RE_Accept_Call), Loc), + Name => New_Occurrence_Of (RTE (RE_Accept_Call), Loc), Parameter_Associations => New_List ( Entry_Index_Expression (Loc, Entity (Ename), Eindx, Ttyp), - New_Reference_To (Ann, Loc))); + New_Occurrence_Of (Ann, Loc))); if Parent (Stats) = N then Prepend (Call, Statements (Stats)); @@ -7008,7 +7020,7 @@ package body Exp_Ch9 is Make_Object_Declaration (Loc, Defining_Identifier => Bnn, Object_Definition => - New_Reference_To (RTE (RE_Communication_Block), Loc))); + New_Occurrence_Of (RTE (RE_Communication_Block), Loc))); -- Call kind processing, generate: -- C : Ada.Tags.Prim_Op_Kind; @@ -7027,7 +7039,7 @@ package body Exp_Ch9 is Defining_Identifier => Make_Defining_Identifier (Loc, Name_uD), Object_Definition => - New_Reference_To + New_Occurrence_Of (RTE (RE_Dummy_Communication_Block), Loc))); K := Build_K (Loc, Decls, Obj); @@ -7052,7 +7064,7 @@ package body Exp_Ch9 is Make_Object_Declaration (Loc, Defining_Identifier => T, Object_Definition => - New_Reference_To (Standard_Boolean, Loc))); + New_Occurrence_Of (Standard_Boolean, Loc))); ------------------------------ -- Protected entry handling -- @@ -7070,11 +7082,11 @@ package body Exp_Ch9 is Prepend_To (Cleanup_Stmts, Make_Assignment_Statement (Loc, - Name => New_Reference_To (Bnn, Loc), + Name => New_Occurrence_Of (Bnn, Loc), Expression => Make_Unchecked_Type_Conversion (Loc, Subtype_Mark => - New_Reference_To (RTE (RE_Communication_Block), Loc), + New_Occurrence_Of (RTE (RE_Communication_Block), Loc), Expression => Make_Identifier (Loc, Name_uD)))); -- Generate: @@ -7083,19 +7095,19 @@ package body Exp_Ch9 is Prepend_To (Cleanup_Stmts, Make_Procedure_Call_Statement (Loc, Name => - New_Reference_To + New_Occurrence_Of (Find_Prim_Op (Etype (Etype (Obj)), Name_uDisp_Asynchronous_Select), Loc), Parameter_Associations => New_List ( New_Copy_Tree (Obj), -- <object> - New_Reference_To (S, Loc), -- S + New_Occurrence_Of (S, Loc), -- S Make_Attribute_Reference (Loc, -- P'Address - Prefix => New_Reference_To (P, Loc), + Prefix => New_Occurrence_Of (P, Loc), Attribute_Name => Name_Address), Make_Identifier (Loc, Name_uD), -- D - New_Reference_To (B, Loc)))); -- B + New_Occurrence_Of (B, Loc)))); -- B -- Generate: -- if Enqueued (Bnn) then @@ -7107,9 +7119,9 @@ package body Exp_Ch9 is Condition => Make_Function_Call (Loc, Name => - New_Reference_To (RTE (RE_Enqueued), Loc), + New_Occurrence_Of (RTE (RE_Enqueued), Loc), Parameter_Associations => - New_List (New_Reference_To (Bnn, Loc))), + New_List (New_Occurrence_Of (Bnn, Loc))), Then_Statements => New_Copy_List_Tree (Astats))); @@ -7165,9 +7177,9 @@ package body Exp_Ch9 is Right_Opnd => Make_Function_Call (Loc, Name => - New_Reference_To (RTE (RE_Cancelled), Loc), + New_Occurrence_Of (RTE (RE_Cancelled), Loc), Parameter_Associations => - New_List (New_Reference_To (Bnn, Loc)))), + New_List (New_Occurrence_Of (Bnn, Loc)))), Then_Statements => New_Copy_List_Tree (Tstats))); @@ -7189,11 +7201,11 @@ package body Exp_Ch9 is Append_To (TaskE_Stmts, Make_Assignment_Statement (Loc, Name => - New_Reference_To (Bnn, Loc), + New_Occurrence_Of (Bnn, Loc), Expression => Make_Unchecked_Type_Conversion (Loc, Subtype_Mark => - New_Reference_To (RTE (RE_Communication_Block), Loc), + New_Occurrence_Of (RTE (RE_Communication_Block), Loc), Expression => Make_Identifier (Loc, Name_uD)))); -- Generate: @@ -7202,7 +7214,7 @@ package body Exp_Ch9 is Prepend_To (TaskE_Stmts, Make_Procedure_Call_Statement (Loc, Name => - New_Reference_To ( + New_Occurrence_Of ( Find_Prim_Op (Etype (Etype (Obj)), Name_uDisp_Asynchronous_Select), Loc), @@ -7210,19 +7222,19 @@ package body Exp_Ch9 is Parameter_Associations => New_List ( New_Copy_Tree (Obj), -- <object> - New_Reference_To (S, Loc), -- S + New_Occurrence_Of (S, Loc), -- S Make_Attribute_Reference (Loc, -- P'Address - Prefix => New_Reference_To (P, Loc), + Prefix => New_Occurrence_Of (P, Loc), Attribute_Name => Name_Address), Make_Identifier (Loc, Name_uD), -- D - New_Reference_To (B, Loc)))); -- B + New_Occurrence_Of (B, Loc)))); -- B -- Generate: -- Abort_Defer; Prepend_To (TaskE_Stmts, Make_Procedure_Call_Statement (Loc, - Name => New_Reference_To (RTE (RE_Abort_Defer), Loc), + Name => New_Occurrence_Of (RTE (RE_Abort_Defer), Loc), Parameter_Associations => No_List)); -- Generate: @@ -7233,7 +7245,7 @@ package body Exp_Ch9 is Prepend_To (Cleanup_Stmts, Make_Procedure_Call_Statement (Loc, - Name => New_Reference_To (RTE (RE_Abort_Undefer), Loc), + Name => New_Occurrence_Of (RTE (RE_Abort_Undefer), Loc), Parameter_Associations => No_List)); -- Wrap the statements in a block. Exp_Ch7.Expand_Cleanup_Actions @@ -7282,7 +7294,7 @@ package body Exp_Ch9 is Append_To (TaskE_Stmts, Make_Implicit_If_Statement (N, Condition => - Make_Op_Not (Loc, Right_Opnd => New_Reference_To (T, Loc)), + Make_Op_Not (Loc, Right_Opnd => New_Occurrence_Of (T, Loc)), Then_Statements => New_Copy_List_Tree (Tstats))); @@ -7311,15 +7323,15 @@ package body Exp_Ch9 is Append_To (Conc_Typ_Stmts, Make_Procedure_Call_Statement (Loc, Name => - New_Reference_To + New_Occurrence_Of (Find_Prim_Op (Etype (Etype (Obj)), Name_uDisp_Get_Prim_Op_Kind), Loc), Parameter_Associations => New_List ( New_Copy_Tree (Obj), - New_Reference_To (S, Loc), - New_Reference_To (C, Loc)))); + New_Occurrence_Of (S, Loc), + New_Occurrence_Of (C, Loc)))); -- Generate: -- if C = POK_Procedure_Entry then @@ -7335,9 +7347,9 @@ package body Exp_Ch9 is Condition => Make_Op_Eq (Loc, Left_Opnd => - New_Reference_To (C, Loc), + New_Occurrence_Of (C, Loc), Right_Opnd => - New_Reference_To (RTE (RE_POK_Protected_Entry), Loc)), + New_Occurrence_Of (RTE (RE_POK_Protected_Entry), Loc)), Then_Statements => ProtE_Stmts, @@ -7348,9 +7360,9 @@ package body Exp_Ch9 is Condition => Make_Op_Eq (Loc, Left_Opnd => - New_Reference_To (C, Loc), + New_Occurrence_Of (C, Loc), Right_Opnd => - New_Reference_To (RTE (RE_POK_Task_Entry), Loc)), + New_Occurrence_Of (RTE (RE_POK_Task_Entry), Loc)), Then_Statements => TaskE_Stmts)), @@ -7402,19 +7414,19 @@ package body Exp_Ch9 is if Is_RTE (Pdef, RO_CA_Delay_For) then Enqueue_Call := - New_Reference_To (RTE (RE_Enqueue_Duration), Loc); + New_Occurrence_Of (RTE (RE_Enqueue_Duration), Loc); elsif Is_RTE (Pdef, RO_CA_Delay_Until) then Enqueue_Call := - New_Reference_To (RTE (RE_Enqueue_Calendar), Loc); + New_Occurrence_Of (RTE (RE_Enqueue_Calendar), Loc); else pragma Assert (Is_RTE (Pdef, RO_RT_Delay_Until)); - Enqueue_Call := New_Reference_To (RTE (RE_Enqueue_RT), Loc); + Enqueue_Call := New_Occurrence_Of (RTE (RE_Enqueue_RT), Loc); end if; Append_To (Parameter_Associations (Ecall), Make_Attribute_Reference (Loc, - Prefix => New_Reference_To (Dblock_Ent, Loc), + Prefix => New_Occurrence_Of (Dblock_Ent, Loc), Attribute_Name => Name_Unchecked_Access)); -- Create the inner block to protect the abortable part @@ -7423,11 +7435,11 @@ package body Exp_Ch9 is Prepend_To (Astats, Make_Procedure_Call_Statement (Loc, - Name => New_Reference_To (RTE (RE_Abort_Undefer), Loc))); + Name => New_Occurrence_Of (RTE (RE_Abort_Undefer), Loc))); Abortable_Block := Make_Block_Statement (Loc, - Identifier => New_Reference_To (Blk_Ent, Loc), + Identifier => New_Occurrence_Of (Blk_Ent, Loc), Handled_Statement_Sequence => Make_Handled_Sequence_Of_Statements (Loc, Statements => Astats), @@ -7461,11 +7473,11 @@ package body Exp_Ch9 is Make_Implicit_If_Statement (N, Condition => Make_Function_Call (Loc, - Name => New_Reference_To ( + Name => New_Occurrence_Of ( RTE (RE_Timed_Out), Loc), Parameter_Associations => New_List ( Make_Attribute_Reference (Loc, - Prefix => New_Reference_To (Dblock_Ent, Loc), + Prefix => New_Occurrence_Of (Dblock_Ent, Loc), Attribute_Name => Name_Unchecked_Access))), Then_Statements => Tstats)); @@ -7480,7 +7492,7 @@ package body Exp_Ch9 is Defining_Identifier => Dblock_Ent, Aliased_Present => True, Object_Definition => - New_Reference_To (RTE (RE_Delay_Block), Loc))), + New_Occurrence_Of (RTE (RE_Delay_Block), Loc))), Handled_Statement_Sequence => Make_Handled_Sequence_Of_Statements (Loc, Stmts))); @@ -7544,7 +7556,7 @@ package body Exp_Ch9 is end loop; pragma Assert (Present (Param)); - Rewrite (Param, New_Reference_To (RTE (RE_Asynchronous_Call), Loc)); + Rewrite (Param, New_Occurrence_Of (RTE (RE_Asynchronous_Call), Loc)); Analyze (Param); -- Append an if statement to execute the abortable part @@ -7556,14 +7568,14 @@ package body Exp_Ch9 is Make_Implicit_If_Statement (N, Condition => Make_Function_Call (Loc, - Name => New_Reference_To (RTE (RE_Enqueued), Loc), + Name => New_Occurrence_Of (RTE (RE_Enqueued), Loc), Parameter_Associations => New_List ( - New_Reference_To (Cancel_Param, Loc))), + New_Occurrence_Of (Cancel_Param, Loc))), Then_Statements => Astats)); Abortable_Block := Make_Block_Statement (Loc, - Identifier => New_Reference_To (Blk_Ent, Loc), + Identifier => New_Occurrence_Of (Blk_Ent, Loc), Handled_Statement_Sequence => Make_Handled_Sequence_Of_Statements (Loc, Statements => Stmts), Has_Created_Identifier => True, @@ -7582,12 +7594,12 @@ package body Exp_Ch9 is else Handler_Stmt := Make_Procedure_Call_Statement (Loc, - Name => New_Reference_To (RTE (RE_Abort_Undefer), Loc), + Name => New_Occurrence_Of (RTE (RE_Abort_Undefer), Loc), Parameter_Associations => No_List); end if; else Handler_Stmt := Make_Procedure_Call_Statement (Loc, - Name => New_Reference_To (RTE (RE_Update_Exception), Loc), + Name => New_Occurrence_Of (RTE (RE_Update_Exception), Loc), Parameter_Associations => New_List ( Make_Function_Call (Loc, Name => New_Occurrence_Of @@ -7613,7 +7625,7 @@ package body Exp_Ch9 is -- Abort_Undefer.all; Exception_Choices => - New_List (New_Reference_To (Stand.Abort_Signal, Loc)), + New_List (New_Occurrence_Of (Stand.Abort_Signal, Loc)), Statements => New_List (Handler_Stmt))))), -- if not Cancelled (Bnn) then @@ -7643,7 +7655,8 @@ package body Exp_Ch9 is Prepend_To (Decls, Make_Object_Declaration (Loc, Defining_Identifier => B, - Object_Definition => New_Reference_To (Standard_Boolean, Loc))); + Object_Definition => + New_Occurrence_Of (Standard_Boolean, Loc))); Cancel_Param := Make_Defining_Identifier (Loc, Name_uC); @@ -7652,7 +7665,8 @@ package body Exp_Ch9 is Prepend_To (Decls, Make_Object_Declaration (Loc, Defining_Identifier => Cancel_Param, - Object_Definition => New_Reference_To (Standard_Boolean, Loc))); + Object_Definition => + New_Occurrence_Of (Standard_Boolean, Loc))); -- Remove and save the call to Call_Simple @@ -7674,11 +7688,11 @@ package body Exp_Ch9 is Prepend_To (Astats, Make_Procedure_Call_Statement (Loc, - Name => New_Reference_To (RTE (RE_Abort_Undefer), Loc))); + Name => New_Occurrence_Of (RTE (RE_Abort_Undefer), Loc))); Abortable_Block := Make_Block_Statement (Loc, - Identifier => New_Reference_To (Blk_Ent, Loc), + Identifier => New_Occurrence_Of (Blk_Ent, Loc), Handled_Statement_Sequence => Make_Handled_Sequence_Of_Statements (Loc, Statements => Astats), Has_Created_Identifier => True, @@ -7700,12 +7714,12 @@ package body Exp_Ch9 is Params := Parameter_Associations (Call); Append_To (Params, - New_Reference_To (RTE (RE_Asynchronous_Call), Loc)); - Append_To (Params, New_Reference_To (B, Loc)); + New_Occurrence_Of (RTE (RE_Asynchronous_Call), Loc)); + Append_To (Params, New_Occurrence_Of (B, Loc)); Rewrite (Call, Make_Procedure_Call_Statement (Loc, - Name => New_Reference_To (RTE (RE_Task_Entry_Call), Loc), + Name => New_Occurrence_Of (RTE (RE_Task_Entry_Call), Loc), Parameter_Associations => Params)); -- Construct statement sequence for new block @@ -7713,14 +7727,14 @@ package body Exp_Ch9 is Append_To (Stmts, Make_Implicit_If_Statement (N, Condition => - Make_Op_Not (Loc, New_Reference_To (Cancel_Param, Loc)), + Make_Op_Not (Loc, New_Occurrence_Of (Cancel_Param, Loc)), Then_Statements => Tstats)); -- Protected the call against abort Prepend_To (Stmts, Make_Procedure_Call_Statement (Loc, - Name => New_Reference_To (RTE (RE_Abort_Defer), Loc), + Name => New_Occurrence_Of (RTE (RE_Abort_Defer), Loc), Parameter_Associations => Empty_List)); end if; @@ -7934,19 +7948,19 @@ package body Exp_Ch9 is Append_To (Conc_Typ_Stmts, Make_Procedure_Call_Statement (Loc, Name => - New_Reference_To ( + New_Occurrence_Of ( Find_Prim_Op (Etype (Etype (Obj)), Name_uDisp_Conditional_Select), Loc), Parameter_Associations => New_List ( New_Copy_Tree (Obj), -- <object> - New_Reference_To (S, Loc), -- S + New_Occurrence_Of (S, Loc), -- S Make_Attribute_Reference (Loc, -- P'Address - Prefix => New_Reference_To (P, Loc), + Prefix => New_Occurrence_Of (P, Loc), Attribute_Name => Name_Address), - New_Reference_To (C, Loc), -- C - New_Reference_To (B, Loc)))); -- B + New_Occurrence_Of (C, Loc), -- C + New_Occurrence_Of (B, Loc)))); -- B -- Generate: -- if C = POK_Protected_Entry @@ -7970,17 +7984,17 @@ package body Exp_Ch9 is Left_Opnd => Make_Op_Eq (Loc, Left_Opnd => - New_Reference_To (C, Loc), + New_Occurrence_Of (C, Loc), Right_Opnd => - New_Reference_To (RTE ( + New_Occurrence_Of (RTE ( RE_POK_Protected_Entry), Loc)), Right_Opnd => Make_Op_Eq (Loc, Left_Opnd => - New_Reference_To (C, Loc), + New_Occurrence_Of (C, Loc), Right_Opnd => - New_Reference_To (RTE (RE_POK_Task_Entry), Loc))), + New_Occurrence_Of (RTE (RE_POK_Task_Entry), Loc))), Then_Statements => Unpack)); end if; @@ -8007,26 +8021,26 @@ package body Exp_Ch9 is Left_Opnd => Make_Op_Eq (Loc, Left_Opnd => - New_Reference_To (C, Loc), + New_Occurrence_Of (C, Loc), Right_Opnd => - New_Reference_To (RTE (RE_POK_Procedure), Loc)), + New_Occurrence_Of (RTE (RE_POK_Procedure), Loc)), Right_Opnd => Make_Or_Else (Loc, Left_Opnd => Make_Op_Eq (Loc, Left_Opnd => - New_Reference_To (C, Loc), + New_Occurrence_Of (C, Loc), Right_Opnd => - New_Reference_To (RTE ( + New_Occurrence_Of (RTE ( RE_POK_Protected_Procedure), Loc)), Right_Opnd => Make_Op_Eq (Loc, Left_Opnd => - New_Reference_To (C, Loc), + New_Occurrence_Of (C, Loc), Right_Opnd => - New_Reference_To (RTE ( + New_Occurrence_Of (RTE ( RE_POK_Task_Procedure), Loc)))), Then_Statements => @@ -8034,7 +8048,7 @@ package body Exp_Ch9 is Append_To (Conc_Typ_Stmts, Make_Implicit_If_Statement (N, - Condition => New_Reference_To (B, Loc), + Condition => New_Occurrence_Of (B, Loc), Then_Statements => N_Stats, Else_Statements => Else_Statements (N))); @@ -8105,7 +8119,8 @@ package body Exp_Ch9 is end loop; pragma Assert (Present (Param)); - Rewrite (Param, New_Reference_To (RTE (RE_Conditional_Call), Loc)); + Rewrite (Param, + New_Occurrence_Of (RTE (RE_Conditional_Call), Loc)); Analyze (Param); @@ -8126,9 +8141,9 @@ package body Exp_Ch9 is Append_To (Stmts, Make_Implicit_If_Statement (N, Condition => Make_Function_Call (Loc, - Name => New_Reference_To (RTE (RE_Cancelled), Loc), + Name => New_Occurrence_Of (RTE (RE_Cancelled), Loc), Parameter_Associations => New_List ( - New_Reference_To (Defining_Identifier (Decl), Loc))), + New_Occurrence_Of (Defining_Identifier (Decl), Loc))), Then_Statements => Else_Statements (N), Else_Statements => Statements (Alt))); @@ -8145,24 +8160,24 @@ package body Exp_Ch9 is Make_Object_Declaration (Loc, Defining_Identifier => B, Object_Definition => - New_Reference_To (Standard_Boolean, Loc))); + New_Occurrence_Of (Standard_Boolean, Loc))); -- Create new call statement Append_To (Params, - New_Reference_To (RTE (RE_Conditional_Call), Loc)); - Append_To (Params, New_Reference_To (B, Loc)); + New_Occurrence_Of (RTE (RE_Conditional_Call), Loc)); + Append_To (Params, New_Occurrence_Of (B, Loc)); Rewrite (Call, Make_Procedure_Call_Statement (Loc, - Name => New_Reference_To (RTE (RE_Task_Entry_Call), Loc), + Name => New_Occurrence_Of (RTE (RE_Task_Entry_Call), Loc), Parameter_Associations => Params)); -- Construct statement sequence for new block Append_To (Stmts, Make_Implicit_If_Statement (N, - Condition => New_Reference_To (B, Loc), + Condition => New_Occurrence_Of (B, Loc), Then_Statements => Statements (Alt), Else_Statements => Else_Statements (N))); end if; @@ -8192,7 +8207,7 @@ package body Exp_Ch9 is begin Rewrite (N, Make_Procedure_Call_Statement (Loc, - Name => New_Reference_To (RTE (RO_CA_Delay_For), Loc), + Name => New_Occurrence_Of (RTE (RO_CA_Delay_For), Loc), Parameter_Associations => New_List (Expression (N)))); Analyze (N); end Expand_N_Delay_Relative_Statement; @@ -8217,7 +8232,7 @@ package body Exp_Ch9 is Rewrite (N, Make_Procedure_Call_Statement (Loc, - Name => New_Reference_To (Typ, Loc), + Name => New_Occurrence_Of (Typ, Loc), Parameter_Associations => New_List (Expression (N)))); Analyze (N); @@ -8335,7 +8350,7 @@ package body Exp_Ch9 is Make_Access_To_Object_Definition (Loc, All_Present => True, Constant_Present => Ekind (Formal) = E_In_Parameter, - Subtype_Indication => New_Reference_To (Ftype, Loc))); + Subtype_Indication => New_Occurrence_Of (Ftype, Loc))); Insert_After (Last_Decl, Decl); Last_Decl := Decl; @@ -8346,7 +8361,7 @@ package body Exp_Ch9 is Component_Definition => Make_Component_Definition (Loc, Aliased_Present => False, - Subtype_Indication => New_Reference_To (Ctype, Loc)))); + Subtype_Indication => New_Occurrence_Of (Ctype, Loc)))); Next_Formal_With_Extras (Formal); end loop; @@ -8379,7 +8394,7 @@ package body Exp_Ch9 is Type_Definition => Make_Access_To_Object_Definition (Loc, All_Present => True, - Subtype_Indication => New_Reference_To (Rec_Ent, Loc))); + Subtype_Indication => New_Occurrence_Of (Rec_Ent, Loc))); Insert_After (Last_Decl, Decl); end if; @@ -8549,7 +8564,7 @@ package body Exp_Ch9 is New_List ( Make_Procedure_Call_Statement (Loc, Name => - New_Reference_To (Corresponding_Spec (Prot_Bod), Loc), + New_Occurrence_Of (Corresponding_Spec (Prot_Bod), Loc), Parameter_Associations => Actuals)); else @@ -8561,7 +8576,7 @@ package body Exp_Ch9 is Expression => Make_Function_Call (Loc, Name => - New_Reference_To (Corresponding_Spec (Prot_Bod), Loc), + New_Occurrence_Of (Corresponding_Spec (Prot_Bod), Loc), Parameter_Associations => Actuals))); end if; @@ -8966,10 +8981,10 @@ package body Exp_Ch9 is Make_Aggregate (Loc, Expressions => New_List ( Make_Attribute_Reference (Loc, - Prefix => New_Reference_To (Bdef, Loc), + Prefix => New_Occurrence_Of (Bdef, Loc), Attribute_Name => Name_Unrestricted_Access), Make_Attribute_Reference (Loc, - Prefix => New_Reference_To (Edef, Loc), + Prefix => New_Occurrence_Of (Edef, Loc), Attribute_Name => Name_Unrestricted_Access)))); end Expand_Entry_Declaration; @@ -8987,13 +9002,13 @@ package body Exp_Ch9 is Proc_Address : constant Node_Id := Make_Attribute_Reference (Loc, Prefix => - New_Reference_To (Prot_Proc, Loc), + New_Occurrence_Of (Prot_Proc, Loc), Attribute_Name => Name_Address); RTS_Call : constant Entity_Id := Make_Procedure_Call_Statement (Loc, Name => - New_Reference_To + New_Occurrence_Of (RTE (RE_Register_Interrupt_Handler), Loc), Parameter_Associations => New_List (Proc_Address)); begin @@ -9201,7 +9216,7 @@ package body Exp_Ch9 is Protection_Subtype := Make_Subtype_Indication (Loc, Subtype_Mark => - New_Reference_To + New_Occurrence_Of (RTE (RE_Static_Interrupt_Protection), Loc), Constraint => Make_Index_Or_Discriminant_Constraint (Loc, @@ -9215,7 +9230,7 @@ package body Exp_Ch9 is Protection_Subtype := Make_Subtype_Indication (Loc, Subtype_Mark => - New_Reference_To + New_Occurrence_Of (RTE (RE_Dynamic_Interrupt_Protection), Loc), Constraint => Make_Index_Or_Discriminant_Constraint (Loc, @@ -9227,7 +9242,7 @@ package body Exp_Ch9 is Protection_Subtype := Make_Subtype_Indication (Loc, Subtype_Mark => - New_Reference_To + New_Occurrence_Of (RTE (RE_Protection_Entries), Loc), Constraint => Make_Index_Or_Discriminant_Constraint (Loc, @@ -9235,11 +9250,11 @@ package body Exp_Ch9 is when System_Tasking_Protected_Objects_Single_Entry => Protection_Subtype := - New_Reference_To (RTE (RE_Protection_Entry), Loc); + New_Occurrence_Of (RTE (RE_Protection_Entry), Loc); when System_Tasking_Protected_Objects => Protection_Subtype := - New_Reference_To (RTE (RE_Protection), Loc); + New_Occurrence_Of (RTE (RE_Protection), Loc); when others => raise Program_Error; @@ -9403,7 +9418,7 @@ package body Exp_Ch9 is Aliased_Present => True, Object_Definition => Make_Subtype_Indication (Loc, - Subtype_Mark => New_Reference_To ( + Subtype_Mark => New_Occurrence_Of ( RTE (RE_Protected_Entry_Body_Array), Loc), Constraint => Make_Index_Or_Discriminant_Constraint (Loc, @@ -9417,7 +9432,7 @@ package body Exp_Ch9 is Body_Arr := Make_Object_Declaration (Loc, Defining_Identifier => Body_Id, Aliased_Present => True, - Object_Definition => New_Reference_To + Object_Definition => New_Occurrence_Of (RTE (RE_Entry_Body), Loc), Expression => Remove_Head (Expressions (Entries_Aggr))); @@ -9747,7 +9762,7 @@ package body Exp_Ch9 is -- Process the "with abort" parameter Prepend_To (Params, - New_Reference_To (Boolean_Literals (Abort_Present (N)), Loc)); + New_Occurrence_Of (Boolean_Literals (Abort_Present (N)), Loc)); -- Process the entry wrapper's position in the primary dispatch -- table parameter. Generate: @@ -9765,7 +9780,7 @@ package body Exp_Ch9 is if Tagged_Type_Expansion then Prepend_To (Params, Make_Function_Call (Loc, - Name => New_Reference_To (RTE (RE_Get_Entry_Index), Loc), + Name => New_Occurrence_Of (RTE (RE_Get_Entry_Index), Loc), Parameter_Associations => New_List ( Make_Explicit_Dereference (Loc, @@ -9775,7 +9790,7 @@ package body Exp_Ch9 is Attribute_Name => Name_Address))), Make_Function_Call (Loc, - Name => New_Reference_To (RTE (RE_Get_Offset_Index), Loc), + Name => New_Occurrence_Of (RTE (RE_Get_Offset_Index), Loc), Parameter_Associations => New_List ( Unchecked_Convert_To (RTE (RE_Tag), Concval), Make_Integer_Literal (Loc, @@ -9786,7 +9801,7 @@ package body Exp_Ch9 is else Prepend_To (Params, Make_Function_Call (Loc, - Name => New_Reference_To (RTE (RE_Get_Entry_Index), Loc), + Name => New_Occurrence_Of (RTE (RE_Get_Entry_Index), Loc), Parameter_Associations => New_List ( Make_Attribute_Reference (Loc, @@ -9794,7 +9809,7 @@ package body Exp_Ch9 is Attribute_Name => Name_Tag), Make_Function_Call (Loc, - Name => New_Reference_To (RTE (RE_Get_Offset_Index), Loc), + Name => New_Occurrence_Of (RTE (RE_Get_Offset_Index), Loc), Parameter_Associations => New_List ( @@ -9807,7 +9822,7 @@ package body Exp_Ch9 is -- Tag_Typ Make_Attribute_Reference (Loc, - Prefix => New_Reference_To (Etype (Concval), Loc), + Prefix => New_Occurrence_Of (Etype (Concval), Loc), Attribute_Name => Name_Tag), -- Position @@ -9826,7 +9841,7 @@ package body Exp_Ch9 is Attribute_Name => Name_Address)); Prepend_To (Params, -- True - New_Reference_To (Standard_True, Loc)); + New_Occurrence_Of (Standard_True, Loc)); -- Specific actuals for task to XXX requeue @@ -9834,10 +9849,10 @@ package body Exp_Ch9 is pragma Assert (Is_Task_Type (Old_Typ)); Prepend_To (Params, -- null - New_Reference_To (RTE (RE_Null_Address), Loc)); + New_Occurrence_Of (RTE (RE_Null_Address), Loc)); Prepend_To (Params, -- False - New_Reference_To (Standard_False, Loc)); + New_Occurrence_Of (Standard_False, Loc)); end if; -- Add the object parameter @@ -9908,14 +9923,14 @@ package body Exp_Ch9 is Append_To (Stmts, Make_Procedure_Call_Statement (Loc, Name => - New_Reference_To ( + New_Occurrence_Of ( Find_Prim_Op (Etype (Etype (Obj)), Name_uDisp_Get_Prim_Op_Kind), Loc), Parameter_Associations => New_List ( New_Copy_Tree (Obj), - New_Reference_To (S, Loc), - New_Reference_To (C, Loc)))); + New_Occurrence_Of (S, Loc), + New_Occurrence_Of (C, Loc)))); Append_To (Stmts, @@ -9929,16 +9944,16 @@ package body Exp_Ch9 is Left_Opnd => Make_Op_Eq (Loc, Left_Opnd => - New_Reference_To (C, Loc), + New_Occurrence_Of (C, Loc), Right_Opnd => - New_Reference_To (RTE (RE_POK_Protected_Entry), Loc)), + New_Occurrence_Of (RTE (RE_POK_Protected_Entry), Loc)), Right_Opnd => Make_Op_Eq (Loc, Left_Opnd => - New_Reference_To (C, Loc), + New_Occurrence_Of (C, Loc), Right_Opnd => - New_Reference_To (RTE (RE_POK_Task_Entry), Loc))), + New_Occurrence_Of (RTE (RE_POK_Task_Entry), Loc))), -- Dispatching requeue equivalent @@ -9953,9 +9968,9 @@ package body Exp_Ch9 is Condition => Make_Op_Eq (Loc, Left_Opnd => - New_Reference_To (C, Loc), + New_Occurrence_Of (C, Loc), Right_Opnd => - New_Reference_To ( + New_Occurrence_Of ( RTE (RE_POK_Protected_Procedure), Loc)), -- Dispatching call equivalent @@ -9994,7 +10009,7 @@ package body Exp_Ch9 is -- Process the "with abort" parameter Prepend_To (Params, - New_Reference_To (Boolean_Literals (Abort_Present (N)), Loc)); + New_Occurrence_Of (Boolean_Literals (Abort_Present (N)), Loc)); -- Add the index expression to the parameters. It is common among all -- four cases. @@ -10018,7 +10033,7 @@ package body Exp_Ch9 is if Is_Protected_Type (Conc_Typ) then RT_Call := - New_Reference_To ( + New_Occurrence_Of ( RTE (RE_Requeue_Protected_Entry), Loc); Param := @@ -10032,7 +10047,7 @@ package body Exp_Ch9 is else pragma Assert (Is_Task_Type (Conc_Typ)); RT_Call := - New_Reference_To ( + New_Occurrence_Of ( RTE (RE_Requeue_Protected_To_Task_Entry), Loc); Param := Concurrent_Ref (Concval); @@ -10048,7 +10063,7 @@ package body Exp_Ch9 is if Is_Protected_Type (Conc_Typ) then RT_Call := - New_Reference_To ( + New_Occurrence_Of ( RTE (RE_Requeue_Task_To_Protected_Entry), Loc); Param := @@ -10062,7 +10077,7 @@ package body Exp_Ch9 is else pragma Assert (Is_Task_Type (Conc_Typ)); RT_Call := - New_Reference_To (RTE (RE_Requeue_Task_Entry), Loc); + New_Occurrence_Of (RTE (RE_Requeue_Task_Entry), Loc); Param := Concurrent_Ref (Concval); end if; @@ -10350,11 +10365,11 @@ package body Exp_Ch9 is Make_Selected_Component (Loc, Prefix => Make_Indexed_Component (Loc, - Prefix => New_Reference_To (Qnam, Loc), - Expressions => New_List (New_Reference_To (J, Loc))), + Prefix => New_Occurrence_Of (Qnam, Loc), + Expressions => New_List (New_Occurrence_Of (J, Loc))), Selector_Name => Make_Identifier (Loc, Name_S)), Right_Opnd => - New_Reference_To (RTE (RE_Null_Task_Entry), Loc)); + New_Occurrence_Of (RTE (RE_Null_Task_Entry), Loc)); Stats := New_List ( Make_Implicit_Loop_Statement (N, @@ -10365,7 +10380,7 @@ package body Exp_Ch9 is Defining_Identifier => J, Discrete_Subtype_Definition => Make_Attribute_Reference (Loc, - Prefix => New_Reference_To (Qnam, Loc), + Prefix => New_Occurrence_Of (Qnam, Loc), Attribute_Name => Name_Range, Expressions => New_List ( Make_Integer_Literal (Loc, 1))))), @@ -10375,15 +10390,15 @@ package body Exp_Ch9 is Condition => Cond, Then_Statements => New_List ( Make_Select_Call ( - New_Reference_To (RTE (RE_Simple_Mode), Loc)), + New_Occurrence_Of (RTE (RE_Simple_Mode), Loc)), Make_Exit_Statement (Loc)))))); Append_To (Stats, Make_Raise_Program_Error (Loc, Condition => Make_Op_Eq (Loc, - Left_Opnd => New_Reference_To (Xnam, Loc), + Left_Opnd => New_Occurrence_Of (Xnam, Loc), Right_Opnd => - New_Reference_To (RTE (RE_No_Rendezvous), Loc)), + New_Occurrence_Of (RTE (RE_No_Rendezvous), Loc)), Reason => PE_All_Guards_Closed)); return Stats; @@ -10415,7 +10430,7 @@ package body Exp_Ch9 is Make_If_Expression (Eloc, New_List ( Condition (Alt), Entry_Index_Expression (Eloc, Eent, Index, Scope (Eent)), - New_Reference_To (RTE (RE_Null_Task_Entry), Eloc))); + New_Occurrence_Of (RTE (RE_Null_Task_Entry), Eloc))); else Expr := Entry_Index_Expression @@ -10423,7 +10438,7 @@ package body Exp_Ch9 is end if; if Present (Handled_Statement_Sequence (Accept_Statement (Alt))) then - Null_Body := New_Reference_To (Standard_False, Eloc); + Null_Body := New_Occurrence_Of (Standard_False, Eloc); -- Always add call to Abort_Undefer when generating code, since -- this is what the runtime expects (abort deferred in @@ -10433,7 +10448,7 @@ package body Exp_Ch9 is if not CodePeer_Mode then Call := Make_Procedure_Call_Statement (Eloc, - Name => New_Reference_To (RTE (RE_Abort_Undefer), Eloc)); + Name => New_Occurrence_Of (RTE (RE_Abort_Undefer), Eloc)); Insert_Before (First (Statements (Handled_Statement_Sequence (Accept_Statement (Alt)))), @@ -10468,7 +10483,7 @@ package body Exp_Ch9 is Append (Proc_Body, Body_List); else - Null_Body := New_Reference_To (Standard_True, Eloc); + Null_Body := New_Occurrence_Of (Standard_True, Eloc); -- if accept statement has declarations, insert above, given that -- we are not creating a body for the accept. @@ -10515,16 +10530,16 @@ package body Exp_Ch9 is begin Append ( Make_Attribute_Reference (Loc, - Prefix => New_Reference_To (Qnam, Loc), + Prefix => New_Occurrence_Of (Qnam, Loc), Attribute_Name => Name_Unchecked_Access), Params); Append (Select_Mode, Params); - Append (New_Reference_To (Ann, Loc), Params); - Append (New_Reference_To (Xnam, Loc), Params); + Append (New_Occurrence_Of (Ann, Loc), Params); + Append (New_Occurrence_Of (Xnam, Loc), Params); return Make_Procedure_Call_Statement (Loc, - Name => New_Reference_To (RTE (RE_Selective_Wait), Loc), + Name => New_Occurrence_Of (RTE (RE_Selective_Wait), Loc), Parameter_Associations => Params); end Make_Select_Call; @@ -10550,7 +10565,7 @@ package body Exp_Ch9 is New_List ( Make_Procedure_Call_Statement (Sloc (Proc), Name => - New_Reference_To + New_Occurrence_Of (Defining_Unit_Name (Specification (Proc)), Sloc (Proc)))); @@ -10621,27 +10636,27 @@ package body Exp_Ch9 is Delay_Alt := New_List ( Make_Assignment_Statement (Loc, - Name => New_Reference_To (Delay_Min, Loc), + Name => New_Occurrence_Of (Delay_Min, Loc), Expression => Expression (Delay_Statement (Alt)))); if Delay_Count > 1 then Append_To (Delay_Alt, Make_Assignment_Statement (Loc, - Name => New_Reference_To (Delay_Index, Loc), + Name => New_Occurrence_Of (Delay_Index, Loc), Expression => Make_Integer_Literal (Loc, Index))); end if; else Delay_Alt := New_List ( Make_Assignment_Statement (Loc, - Name => New_Reference_To (Delay_Val, Loc), + Name => New_Occurrence_Of (Delay_Val, Loc), Expression => Expression (Delay_Statement (Alt)))); if Time_Type = Standard_Duration then Cond := Make_Op_Lt (Loc, - Left_Opnd => New_Reference_To (Delay_Val, Loc), - Right_Opnd => New_Reference_To (Delay_Min, Loc)); + Left_Opnd => New_Occurrence_Of (Delay_Val, Loc), + Right_Opnd => New_Occurrence_Of (Delay_Min, Loc)); else -- The scope of the time type must define a comparison @@ -10653,15 +10668,15 @@ package body Exp_Ch9 is Make_Function_Call (Loc, Name => Make_Selected_Component (Loc, Prefix => - New_Reference_To (Scope (Time_Type), Loc), + New_Occurrence_Of (Scope (Time_Type), Loc), Selector_Name => Make_Operator_Symbol (Loc, Chars => Name_Op_Lt, Strval => No_String)), Parameter_Associations => New_List ( - New_Reference_To (Delay_Val, Loc), - New_Reference_To (Delay_Min, Loc))); + New_Occurrence_Of (Delay_Val, Loc), + New_Occurrence_Of (Delay_Min, Loc))); Set_Entity (Prefix (Name (Cond)), Scope (Time_Type)); end if; @@ -10671,19 +10686,19 @@ package body Exp_Ch9 is Condition => Cond, Then_Statements => New_List ( Make_Assignment_Statement (Loc, - Name => New_Reference_To (Delay_Min, Loc), - Expression => New_Reference_To (Delay_Val, Loc)), + Name => New_Occurrence_Of (Delay_Min, Loc), + Expression => New_Occurrence_Of (Delay_Val, Loc)), Make_Assignment_Statement (Loc, - Name => New_Reference_To (Delay_Index, Loc), + Name => New_Occurrence_Of (Delay_Index, Loc), Expression => Make_Integer_Literal (Loc, Index))))); end if; if Check_Guard then Append_To (Delay_Alt, Make_Assignment_Statement (Loc, - Name => New_Reference_To (Guard_Open, Loc), - Expression => New_Reference_To (Standard_True, Loc))); + Name => New_Occurrence_Of (Guard_Open, Loc), + Expression => New_Occurrence_Of (Standard_True, Loc))); end if; if Present (Condition (Alt)) then @@ -10818,12 +10833,12 @@ package body Exp_Ch9 is Append_To (Decls, Make_Object_Declaration (Loc, Defining_Identifier => Qnam, - Object_Definition => New_Reference_To (RTE (RE_Accept_List), Loc), + Object_Definition => New_Occurrence_Of (RTE (RE_Accept_List), Loc), Aliased_Present => True, Expression => Make_Qualified_Expression (Loc, Subtype_Mark => - New_Reference_To (RTE (RE_Accept_List), Loc), + New_Occurrence_Of (RTE (RE_Accept_List), Loc), Expression => Make_Aggregate (Loc, Expressions => Accept_List)))); @@ -10836,9 +10851,9 @@ package body Exp_Ch9 is Make_Object_Declaration (Loc, Defining_Identifier => Xnam, Object_Definition => - New_Reference_To (RTE (RE_Select_Index), Loc), + New_Occurrence_Of (RTE (RE_Select_Index), Loc), Expression => - New_Reference_To (RTE (RE_No_Rendezvous), Loc))); + New_Occurrence_Of (RTE (RE_No_Rendezvous), Loc))); -- After this follow procedure declarations for each accept body @@ -10893,18 +10908,18 @@ package body Exp_Ch9 is Append_To (Decls, Make_Object_Declaration (Loc, Defining_Identifier => Delay_Val, - Object_Definition => New_Reference_To (Time_Type, Loc))); + Object_Definition => New_Occurrence_Of (Time_Type, Loc))); Append_To (Decls, Make_Object_Declaration (Loc, Defining_Identifier => Delay_Index, - Object_Definition => New_Reference_To (Standard_Integer, Loc), + Object_Definition => New_Occurrence_Of (Standard_Integer, Loc), Expression => Make_Integer_Literal (Loc, 0))); Append_To (Decls, Make_Object_Declaration (Loc, Defining_Identifier => Delay_Min, - Object_Definition => New_Reference_To (Time_Type, Loc), + Object_Definition => New_Occurrence_Of (Time_Type, Loc), Expression => Unchecked_Convert_To (Time_Type, Make_Attribute_Reference (Loc, @@ -10945,13 +10960,13 @@ package body Exp_Ch9 is Make_Object_Declaration (Loc, Defining_Identifier => D, Object_Definition => - New_Reference_To (Standard_Duration, Loc))); + New_Occurrence_Of (Standard_Duration, Loc))); Append_To (Decls, Make_Object_Declaration (Loc, Defining_Identifier => M, Object_Definition => - New_Reference_To (Standard_Integer, Loc), + New_Occurrence_Of (Standard_Integer, Loc), Expression => Discr)); end; @@ -10962,8 +10977,10 @@ package body Exp_Ch9 is Append_To (Decls, Make_Object_Declaration (Loc, Defining_Identifier => Guard_Open, - Object_Definition => New_Reference_To (Standard_Boolean, Loc), - Expression => New_Reference_To (Standard_False, Loc))); + Object_Definition => + New_Occurrence_Of (Standard_Boolean, Loc), + Expression => + New_Occurrence_Of (Standard_False, Loc))); end if; -- Delay_Count is zero, don't need M and D set (suppress warning) @@ -10981,17 +10998,17 @@ package body Exp_Ch9 is if Present (Condition (Terminate_Alt)) then Select_Mode := Make_If_Expression (Loc, New_List (Condition (Terminate_Alt), - New_Reference_To (RTE (RE_Terminate_Mode), Loc), - New_Reference_To (RTE (RE_Simple_Mode), Loc))); + New_Occurrence_Of (RTE (RE_Terminate_Mode), Loc), + New_Occurrence_Of (RTE (RE_Simple_Mode), Loc))); else - Select_Mode := New_Reference_To (RTE (RE_Terminate_Mode), Loc); + Select_Mode := New_Occurrence_Of (RTE (RE_Terminate_Mode), Loc); end if; elsif Else_Present or Delay_Count > 0 then - Select_Mode := New_Reference_To (RTE (RE_Else_Mode), Loc); + Select_Mode := New_Occurrence_Of (RTE (RE_Else_Mode), Loc); else - Select_Mode := New_Reference_To (RTE (RE_Simple_Mode), Loc); + Select_Mode := New_Occurrence_Of (RTE (RE_Simple_Mode), Loc); end if; Select_Call := Make_Select_Call (Select_Mode); @@ -11035,7 +11052,7 @@ package body Exp_Ch9 is -- First entry is the default case, when no rendezvous is possible - Choices := New_List (New_Reference_To (RTE (RE_No_Rendezvous), Loc)); + Choices := New_List (New_Occurrence_Of (RTE (RE_No_Rendezvous), Loc)); if Else_Present then @@ -11101,7 +11118,7 @@ package body Exp_Ch9 is Accept_Case := New_List ( Make_Case_Statement (Loc, - Expression => New_Reference_To (Xnam, Loc), + Expression => New_Occurrence_Of (Xnam, Loc), Alternatives => Alt_List)); Append_List (Trailing_List, Accept_Case); @@ -11120,7 +11137,7 @@ package body Exp_Ch9 is Delay_Case := New_List ( Make_Case_Statement (Loc, - Expression => New_Reference_To (Delay_Index, Loc), + Expression => New_Occurrence_Of (Delay_Index, Loc), Alternatives => Delay_Alt_List)); else Delay_Case := Delay_Alt_List; @@ -11160,24 +11177,24 @@ package body Exp_Ch9 is -- The type of the delay expression is known to be legal if Time_Type = Standard_Duration then - Conv := New_Reference_To (Delay_Min, Loc); + Conv := New_Occurrence_Of (Delay_Min, Loc); elsif Is_RTE (Base_Type (Etype (Time_Type)), RO_CA_Time) then Conv := Make_Function_Call (Loc, - New_Reference_To (RTE (RO_CA_To_Duration), Loc), - New_List (New_Reference_To (Delay_Min, Loc))); + New_Occurrence_Of (RTE (RO_CA_To_Duration), Loc), + New_List (New_Occurrence_Of (Delay_Min, Loc))); else pragma Assert (Is_RTE (Base_Type (Etype (Time_Type)), RO_RT_Time)); Conv := Make_Function_Call (Loc, - New_Reference_To (RTE (RO_RT_To_Duration), Loc), - New_List (New_Reference_To (Delay_Min, Loc))); + New_Occurrence_Of (RTE (RO_RT_To_Duration), Loc), + New_List (New_Occurrence_Of (Delay_Min, Loc))); end if; Stmt := Make_Assignment_Statement (Loc, - Name => New_Reference_To (D, Loc), + Name => New_Occurrence_Of (D, Loc), Expression => Conv); -- Change the value for Accept_Modes. (Else_Mode -> Delay_Mode) @@ -11190,21 +11207,21 @@ package body Exp_Ch9 is end loop; pragma Assert (Present (Parm)); - Rewrite (Parm, New_Reference_To (RTE (RE_Delay_Mode), Loc)); + Rewrite (Parm, New_Occurrence_Of (RTE (RE_Delay_Mode), Loc)); Analyze (Parm); -- Prepare two new parameters of Duration and Delay_Mode type -- which represent the value and the mode of the minimum delay. Next (Parm); - Insert_After (Parm, New_Reference_To (M, Loc)); - Insert_After (Parm, New_Reference_To (D, Loc)); + Insert_After (Parm, New_Occurrence_Of (M, Loc)); + Insert_After (Parm, New_Occurrence_Of (D, Loc)); -- Create a call to RTS Rewrite (Select_Call, Make_Procedure_Call_Statement (Loc, - Name => New_Reference_To (RTE (RE_Timed_Selective_Wait), Loc), + Name => New_Occurrence_Of (RTE (RE_Timed_Selective_Wait), Loc), Parameter_Associations => Parms)); -- This new call should follow the calculation of the minimum @@ -11215,7 +11232,7 @@ package body Exp_Ch9 is if Check_Guard then Stmt := Make_Implicit_If_Statement (N, - Condition => New_Reference_To (Guard_Open, Loc), + Condition => New_Occurrence_Of (Guard_Open, Loc), Then_Statements => New_List ( New_Copy_Tree (Stmt), New_Copy_Tree (Select_Call)), @@ -11228,9 +11245,9 @@ package body Exp_Ch9 is Cases := Make_Implicit_If_Statement (N, Condition => Make_Op_Eq (Loc, - Left_Opnd => New_Reference_To (Xnam, Loc), + Left_Opnd => New_Occurrence_Of (Xnam, Loc), Right_Opnd => - New_Reference_To (RTE (RE_No_Rendezvous), Loc)), + New_Occurrence_Of (RTE (RE_No_Rendezvous), Loc)), Then_Statements => Delay_Case, Else_Statements => Accept_Case); @@ -11408,7 +11425,7 @@ package body Exp_Ch9 is Make_Assignment_Statement (Loc, Name => Make_Identifier (Loc, New_External_Name (Chars (Ttyp), 'E')), - Expression => New_Reference_To (Standard_True, Loc))); + Expression => New_Occurrence_Of (Standard_True, Loc))); end if; -- Ada 2005 (AI-345): Construct the primitive entry wrapper bodies after @@ -11633,8 +11650,8 @@ package body Exp_Ch9 is Make_Defining_Identifier (Sloc (Tasktyp), Chars => New_External_Name (Tasknm, 'E')), Aliased_Present => True, - Object_Definition => New_Reference_To (Standard_Boolean, Loc), - Expression => New_Reference_To (Standard_False, Loc)); + Object_Definition => New_Occurrence_Of (Standard_Boolean, Loc), + Expression => New_Occurrence_Of (Standard_False, Loc)); Insert_After (N, Elab_Decl); @@ -11655,7 +11672,8 @@ package body Exp_Ch9 is Size_Decl := Make_Object_Declaration (Loc, Defining_Identifier => Storage_Size_Variable (Tasktyp), - Object_Definition => New_Reference_To (RTE (RE_Size_Type), Loc), + Object_Definition => + New_Occurrence_Of (RTE (RE_Size_Type), Loc), Expression => Convert_To (RTE (RE_Size_Type), Relocate_Node @@ -11668,9 +11686,9 @@ package body Exp_Ch9 is Make_Object_Declaration (Loc, Defining_Identifier => Storage_Size_Variable (Tasktyp), Object_Definition => - New_Reference_To (RTE (RE_Size_Type), Loc), + New_Occurrence_Of (RTE (RE_Size_Type), Loc), Expression => - New_Reference_To (RTE (RE_Unspecified_Size), Loc)); + New_Occurrence_Of (RTE (RE_Unspecified_Size), Loc)); end if; Insert_After (Elab_Decl, Size_Decl); @@ -11688,7 +11706,7 @@ package body Exp_Ch9 is Component_Definition => Make_Component_Definition (Loc, Aliased_Present => False, - Subtype_Indication => New_Reference_To (RTE (RO_ST_Task_Id), + Subtype_Indication => New_Occurrence_Of (RTE (RO_ST_Task_Id), Loc)))); -- Declare static ATCB (that is, created by the expander) if we are @@ -11743,7 +11761,7 @@ package body Exp_Ch9 is and then Present (Discriminal_Link (Entity (Expr_N))) then Task_Size := - New_Reference_To + New_Occurrence_Of (CR_Discriminant (Discriminal_Link (Entity (Expr_N))), Loc); Set_Parent (Task_Size, P); @@ -11757,7 +11775,7 @@ package body Exp_Ch9 is else Task_Size := - New_Reference_To (RTE (RE_Default_Stack_Size), Loc); + New_Occurrence_Of (RTE (RE_Default_Stack_Size), Loc); end if; Decl_Stack := Make_Component_Declaration (Loc, @@ -11800,7 +11818,7 @@ package body Exp_Ch9 is Make_Component_Definition (Loc, Aliased_Present => False, Subtype_Indication => - New_Reference_To (Standard_Integer, Loc)))); + New_Occurrence_Of (Standard_Integer, Loc)))); end if; -- Add the _Size component if a Storage_Size pragma is present @@ -11817,7 +11835,7 @@ package body Exp_Ch9 is Make_Component_Definition (Loc, Aliased_Present => False, Subtype_Indication => - New_Reference_To (RTE (RE_Size_Type), Loc)), + New_Occurrence_Of (RTE (RE_Size_Type), Loc)), Expression => Convert_To (RTE (RE_Size_Type), @@ -11839,7 +11857,7 @@ package body Exp_Ch9 is Make_Component_Definition (Loc, Aliased_Present => False, Subtype_Indication => - New_Reference_To (RTE (RE_Task_Info_Type), Loc)), + New_Occurrence_Of (RTE (RE_Task_Info_Type), Loc)), Expression => New_Copy ( Expression (First ( @@ -11860,7 +11878,7 @@ package body Exp_Ch9 is Make_Component_Definition (Loc, Aliased_Present => False, Subtype_Indication => - New_Reference_To (RTE (RE_CPU_Range), Loc)))); + New_Occurrence_Of (RTE (RE_CPU_Range), Loc)))); end if; -- Add the _Relative_Deadline component if a Relative_Deadline pragma is @@ -11880,7 +11898,7 @@ package body Exp_Ch9 is Make_Component_Definition (Loc, Aliased_Present => False, Subtype_Indication => - New_Reference_To (RTE (RE_Time_Span), Loc)), + New_Occurrence_Of (RTE (RE_Time_Span), Loc)), Expression => Convert_To (RTE (RE_Time_Span), @@ -11909,7 +11927,7 @@ package body Exp_Ch9 is Make_Component_Definition (Loc, Aliased_Present => False, Subtype_Indication => - New_Reference_To + New_Occurrence_Of (RTE (RE_Dispatching_Domain_Access), Loc)))); end if; @@ -12224,7 +12242,8 @@ package body Exp_Ch9 is Prepend_To (Decls, Make_Object_Declaration (Loc, Defining_Identifier => B, - Object_Definition => New_Reference_To (Standard_Boolean, Loc))); + Object_Definition => + New_Occurrence_Of (Standard_Boolean, Loc))); end if; -- Duration and mode processing @@ -12242,7 +12261,7 @@ package body Exp_Ch9 is D_Disc := Make_Integer_Literal (Loc, 1); D_Conv := Make_Function_Call (Loc, - Name => New_Reference_To (RTE (RO_CA_To_Duration), Loc), + Name => New_Occurrence_Of (RTE (RO_CA_To_Duration), Loc), Parameter_Associations => New_List (New_Copy (Expression (D_Stat)))); @@ -12250,7 +12269,7 @@ package body Exp_Ch9 is D_Disc := Make_Integer_Literal (Loc, 2); D_Conv := Make_Function_Call (Loc, - Name => New_Reference_To (RTE (RO_RT_To_Duration), Loc), + Name => New_Occurrence_Of (RTE (RO_RT_To_Duration), Loc), Parameter_Associations => New_List (New_Copy (Expression (D_Stat)))); end if; @@ -12263,7 +12282,7 @@ package body Exp_Ch9 is Append_To (Decls, Make_Object_Declaration (Loc, Defining_Identifier => D, - Object_Definition => New_Reference_To (Standard_Duration, Loc))); + Object_Definition => New_Occurrence_Of (Standard_Duration, Loc))); M := Make_Temporary (Loc, 'M'); @@ -12273,7 +12292,7 @@ package body Exp_Ch9 is Append_To (Decls, Make_Object_Declaration (Loc, Defining_Identifier => M, - Object_Definition => New_Reference_To (Standard_Integer, Loc), + Object_Definition => New_Occurrence_Of (Standard_Integer, Loc), Expression => D_Disc)); -- Do the assignment at this stage only because the evaluation of the @@ -12281,7 +12300,7 @@ package body Exp_Ch9 is Append_To (Stmts, Make_Assignment_Statement (Loc, - Name => New_Reference_To (D, Loc), + Name => New_Occurrence_Of (D, Loc), Expression => D_Conv)); -- Parameter block processing @@ -12325,20 +12344,20 @@ package body Exp_Ch9 is Params := New_List; Append_To (Params, New_Copy_Tree (Obj)); - Append_To (Params, New_Reference_To (S, Loc)); + Append_To (Params, New_Occurrence_Of (S, Loc)); Append_To (Params, Make_Attribute_Reference (Loc, - Prefix => New_Reference_To (P, Loc), + Prefix => New_Occurrence_Of (P, Loc), Attribute_Name => Name_Address)); - Append_To (Params, New_Reference_To (D, Loc)); - Append_To (Params, New_Reference_To (M, Loc)); - Append_To (Params, New_Reference_To (C, Loc)); - Append_To (Params, New_Reference_To (B, Loc)); + Append_To (Params, New_Occurrence_Of (D, Loc)); + Append_To (Params, New_Occurrence_Of (M, Loc)); + Append_To (Params, New_Occurrence_Of (C, Loc)); + Append_To (Params, New_Occurrence_Of (B, Loc)); Append_To (Conc_Typ_Stmts, Make_Procedure_Call_Statement (Loc, Name => - New_Reference_To + New_Occurrence_Of (Find_Prim_Op (Etype (Etype (Obj)), Name_uDisp_Timed_Select), Loc), Parameter_Associations => Params)); @@ -12365,16 +12384,16 @@ package body Exp_Ch9 is Make_Or_Else (Loc, Left_Opnd => Make_Op_Eq (Loc, - Left_Opnd => New_Reference_To (C, Loc), + Left_Opnd => New_Occurrence_Of (C, Loc), Right_Opnd => - New_Reference_To + New_Occurrence_Of (RTE (RE_POK_Protected_Entry), Loc)), Right_Opnd => Make_Op_Eq (Loc, - Left_Opnd => New_Reference_To (C, Loc), + Left_Opnd => New_Occurrence_Of (C, Loc), Right_Opnd => - New_Reference_To (RTE (RE_POK_Task_Entry), Loc))), + New_Occurrence_Of (RTE (RE_POK_Task_Entry), Loc))), Then_Statements => Unpack)); end if; @@ -12396,30 +12415,30 @@ package body Exp_Ch9 is Make_Or_Else (Loc, Left_Opnd => Make_Op_Eq (Loc, - Left_Opnd => New_Reference_To (C, Loc), + Left_Opnd => New_Occurrence_Of (C, Loc), Right_Opnd => - New_Reference_To (RTE (RE_POK_Procedure), Loc)), + New_Occurrence_Of (RTE (RE_POK_Procedure), Loc)), Right_Opnd => Make_Or_Else (Loc, Left_Opnd => Make_Op_Eq (Loc, - Left_Opnd => New_Reference_To (C, Loc), + Left_Opnd => New_Occurrence_Of (C, Loc), Right_Opnd => - New_Reference_To (RTE ( + New_Occurrence_Of (RTE ( RE_POK_Protected_Procedure), Loc)), Right_Opnd => Make_Op_Eq (Loc, - Left_Opnd => New_Reference_To (C, Loc), + Left_Opnd => New_Occurrence_Of (C, Loc), Right_Opnd => - New_Reference_To + New_Occurrence_Of (RTE (RE_POK_Task_Procedure), Loc)))), Then_Statements => New_List (E_Call))); Append_To (Conc_Typ_Stmts, Make_Implicit_If_Statement (N, - Condition => New_Reference_To (B, Loc), + Condition => New_Occurrence_Of (B, Loc), Then_Statements => N_Stats)); -- Generate: @@ -12478,7 +12497,7 @@ package body Exp_Ch9 is Insert_Before (Stmt, Make_Assignment_Statement (Loc, - Name => New_Reference_To (D, Loc), + Name => New_Occurrence_Of (D, Loc), Expression => D_Conv)); Call := Stmt; @@ -12508,20 +12527,20 @@ package body Exp_Ch9 is -- finally add Duration and a Delay_Mode parameter pragma Assert (Present (Param)); - Rewrite (Param, New_Reference_To (D, Loc)); + Rewrite (Param, New_Occurrence_Of (D, Loc)); - Rewrite (Dummy, New_Reference_To (M, Loc)); + Rewrite (Dummy, New_Occurrence_Of (M, Loc)); -- Add a Boolean flag for successful entry call - Append_To (Params, New_Reference_To (B, Loc)); + Append_To (Params, New_Occurrence_Of (B, Loc)); case Corresponding_Runtime_Package (Etype (Concval)) is when System_Tasking_Protected_Objects_Entries => Rewrite (Call, Make_Procedure_Call_Statement (Loc, Name => - New_Reference_To + New_Occurrence_Of (RTE (RE_Timed_Protected_Entry_Call), Loc), Parameter_Associations => Params)); @@ -12534,20 +12553,20 @@ package body Exp_Ch9 is else -- Create a new call statement - Append_To (Params, New_Reference_To (D, Loc)); - Append_To (Params, New_Reference_To (M, Loc)); - Append_To (Params, New_Reference_To (B, Loc)); + Append_To (Params, New_Occurrence_Of (D, Loc)); + Append_To (Params, New_Occurrence_Of (M, Loc)); + Append_To (Params, New_Occurrence_Of (B, Loc)); Rewrite (Call, Make_Procedure_Call_Statement (Loc, Name => - New_Reference_To (RTE (RE_Timed_Task_Entry_Call), Loc), + New_Occurrence_Of (RTE (RE_Timed_Task_Entry_Call), Loc), Parameter_Associations => Params)); end if; Append_To (Stmts, Make_Implicit_If_Statement (N, - Condition => New_Reference_To (B, Loc), + Condition => New_Occurrence_Of (B, Loc), Then_Statements => E_Stats, Else_Statements => D_Stats)); end if; @@ -12751,10 +12770,10 @@ package body Exp_Ch9 is Next_Discriminant (D); end loop; - B := New_Reference_To (Discriminal (D), Loc); + B := New_Occurrence_Of (Discriminal (D), Loc); else - B := New_Reference_To (Discriminal (Entity (Bound)), Loc); + B := New_Occurrence_Of (Discriminal (Entity (Bound)), Loc); end if; elsif Nkind (Bound) = N_Attribute_Reference then @@ -12786,7 +12805,7 @@ package body Exp_Ch9 is Real_Hi := Make_Attribute_Reference (Loc, - Prefix => New_Reference_To (Ityp, Loc), + Prefix => New_Occurrence_Of (Ityp, Loc), Attribute_Name => Name_Min, Expressions => New_List ( Real_Hi, @@ -12794,7 +12813,7 @@ package body Exp_Ch9 is Real_Lo := Make_Attribute_Reference (Loc, - Prefix => New_Reference_To (Ityp, Loc), + Prefix => New_Occurrence_Of (Ityp, Loc), Attribute_Name => Name_Max, Expressions => New_List ( Real_Lo, @@ -12826,7 +12845,7 @@ package body Exp_Ch9 is return Make_Attribute_Reference (Loc, - Prefix => New_Reference_To (Ityp, Loc), + Prefix => New_Occurrence_Of (Ityp, Loc), Attribute_Name => Name_Max, Expressions => New_List ( Make_Op_Add (Loc, @@ -13073,7 +13092,7 @@ package body Exp_Ch9 is Type_Definition => Make_Access_To_Object_Definition (Loc, Subtype_Indication => - New_Reference_To (Conc_Rec, Loc))); + New_Occurrence_Of (Conc_Rec, Loc))); Add (Decl); -- Generate: @@ -13083,10 +13102,10 @@ package body Exp_Ch9 is Make_Object_Declaration (Loc, Defining_Identifier => Make_Defining_Identifier (Loc, Name_uObject), - Object_Definition => New_Reference_To (Typ_Id, Loc), + Object_Definition => New_Occurrence_Of (Typ_Id, Loc), Expression => Unchecked_Convert_To (Typ_Id, - New_Reference_To (Obj_Ent, Loc))); + New_Occurrence_Of (Obj_Ent, Loc))); Add (Decl); -- Set the reference to the concurrent object @@ -13142,10 +13161,10 @@ package body Exp_Ch9 is Make_Object_Renaming_Declaration (Loc, Defining_Identifier => Prot_Ent, Subtype_Mark => - New_Reference_To (RTE (Prot_Typ), Loc), + New_Occurrence_Of (RTE (Prot_Typ), Loc), Name => Make_Selected_Component (Loc, - Prefix => New_Reference_To (Obj_Ent, Loc), + Prefix => New_Occurrence_Of (Obj_Ent, Loc), Selector_Name => Make_Identifier (Loc, Name_uObject))); Add (Decl); end; @@ -13173,10 +13192,10 @@ package body Exp_Ch9 is Decl := Make_Object_Renaming_Declaration (Loc, Defining_Identifier => Discriminal (D), - Subtype_Mark => New_Reference_To (Etype (D), Loc), + Subtype_Mark => New_Occurrence_Of (Etype (D), Loc), Name => Make_Selected_Component (Loc, - Prefix => New_Reference_To (Obj_Ent, Loc), + Prefix => New_Occurrence_Of (Obj_Ent, Loc), Selector_Name => Make_Identifier (Loc, Chars (D)))); Add (Decl); @@ -13223,11 +13242,11 @@ package body Exp_Ch9 is Make_Object_Renaming_Declaration (Loc, Defining_Identifier => Decl_Id, Subtype_Mark => - New_Reference_To (Etype (Comp_Id), Loc), + New_Occurrence_Of (Etype (Comp_Id), Loc), Name => Make_Selected_Component (Loc, Prefix => - New_Reference_To (Obj_Ent, Loc), + New_Occurrence_Of (Obj_Ent, Loc), Selector_Name => Make_Identifier (Loc, Chars (Comp_Id)))); Add (Decl); @@ -13294,7 +13313,7 @@ package body Exp_Ch9 is Subtype_Indication => Make_Subtype_Indication (Loc, Subtype_Mark => - New_Reference_To (Base_Type (Etype (Index)), Loc), + New_Occurrence_Of (Base_Type (Etype (Index)), Loc), Constraint => Make_Range_Constraint (Loc, Range_Expression => @@ -13317,12 +13336,12 @@ package body Exp_Ch9 is Defining_Identifier => Index_Con, Constant_Present => True, Object_Definition => - New_Reference_To (Index_Typ, Loc), + New_Occurrence_Of (Index_Typ, Loc), Expression => Make_Attribute_Reference (Loc, Prefix => - New_Reference_To (Index_Typ, Loc), + New_Occurrence_Of (Index_Typ, Loc), Attribute_Name => Name_Val, Expressions => New_List ( @@ -13331,7 +13350,7 @@ package body Exp_Ch9 is Left_Opnd => Make_Op_Subtract (Loc, Left_Opnd => - New_Reference_To (E, Loc), + New_Occurrence_Of (E, Loc), Right_Opnd => Entry_Index_Expression (Loc, Defining_Identifier (Body_Nod), @@ -13340,12 +13359,12 @@ package body Exp_Ch9 is Right_Opnd => Make_Attribute_Reference (Loc, Prefix => - New_Reference_To (Index_Typ, Loc), + New_Occurrence_Of (Index_Typ, Loc), Attribute_Name => Name_Pos, Expressions => New_List ( Make_Attribute_Reference (Loc, Prefix => - New_Reference_To (Index_Typ, Loc), + New_Occurrence_Of (Index_Typ, Loc), Attribute_Name => Name_First))))))); Add (Decl); end; @@ -13638,13 +13657,13 @@ package body Exp_Ch9 is or else Has_Interrupt_Handler (Ptyp) then Append_To (Args, - New_Reference_To (RTE (RE_Default_Interrupt_Priority), Loc)); + New_Occurrence_Of (RTE (RE_Default_Interrupt_Priority), Loc)); -- Normal case, no priority or xx_Handler specified, default priority else Append_To (Args, - New_Reference_To (RTE (RE_Unspecified_Priority), Loc)); + New_Occurrence_Of (RTE (RE_Unspecified_Priority), Loc)); end if; -- Test for Compiler_Info parameter. This parameter allows entry body @@ -13712,7 +13731,7 @@ package body Exp_Ch9 is Append_To (Args, Make_Attribute_Reference (Loc, - Prefix => New_Reference_To (P_Arr, Loc), + Prefix => New_Occurrence_Of (P_Arr, Loc), Attribute_Name => Name_Unrestricted_Access)); if Pkg_Id = System_Tasking_Protected_Objects_Entries then @@ -13725,7 +13744,7 @@ package body Exp_Ch9 is Append_To (Args, Make_Attribute_Reference (Loc, - Prefix => New_Reference_To (P_Arr, Loc), + Prefix => New_Occurrence_Of (P_Arr, Loc), Attribute_Name => Name_Unrestricted_Access)); end if; @@ -13756,7 +13775,7 @@ package body Exp_Ch9 is Append_To (L, Make_Procedure_Call_Statement (Loc, - Name => New_Reference_To (RTE (Called_Subp), Loc), + Name => New_Occurrence_Of (RTE (Called_Subp), Loc), Parameter_Associations => Args)); end; end if; @@ -13793,7 +13812,7 @@ package body Exp_Ch9 is else Append_To (Args, - New_Reference_To + New_Occurrence_Of (RTE (RE_Default_Interrupt_Priority), Loc)); end if; end if; @@ -13843,7 +13862,7 @@ package body Exp_Ch9 is Append_To (L, Make_Procedure_Call_Statement (Loc, Name => - New_Reference_To + New_Occurrence_Of (RTE (RE_Install_Restricted_Handlers), Loc), Parameter_Associations => Args)); @@ -13865,7 +13884,7 @@ package body Exp_Ch9 is Append_To (L, Make_Procedure_Call_Statement (Loc, - Name => New_Reference_To (RTE (RE_Install_Handlers), Loc), + Name => New_Occurrence_Of (RTE (RE_Install_Handlers), Loc), Parameter_Associations => Args)); end if; end; @@ -13928,7 +13947,7 @@ package body Exp_Ch9 is Selector_Name => Make_Identifier (Loc, Name_uPriority))); else Append_To (Args, - New_Reference_To (RTE (RE_Unspecified_Priority), Loc)); + New_Occurrence_Of (RTE (RE_Unspecified_Priority), Loc)); end if; -- Optional Stack parameter @@ -13949,7 +13968,7 @@ package body Exp_Ch9 is else Append_To (Args, - New_Reference_To (RTE (RE_Null_Address), Loc)); + New_Occurrence_Of (RTE (RE_Null_Address), Loc)); end if; end if; @@ -13970,7 +13989,7 @@ package body Exp_Ch9 is else Append_To (Args, - New_Reference_To (Storage_Size_Variable (Ttyp), Loc)); + New_Occurrence_Of (Storage_Size_Variable (Ttyp), Loc)); end if; -- Task_Info parameter. Set to Unspecified_Task_Info unless there is a @@ -13984,7 +14003,7 @@ package body Exp_Ch9 is else Append_To (Args, - New_Reference_To (RTE (RE_Unspecified_Task_Info), Loc)); + New_Occurrence_Of (RTE (RE_Unspecified_Task_Info), Loc)); end if; -- CPU parameter. Set to Unspecified_CPU unless there is a CPU rep item, @@ -14000,7 +14019,7 @@ package body Exp_Ch9 is Selector_Name => Make_Identifier (Loc, Name_uCPU)))); else Append_To (Args, - New_Reference_To (RTE (RE_Unspecified_CPU), Loc)); + New_Occurrence_Of (RTE (RE_Unspecified_CPU), Loc)); end if; if not Restricted_Profile then @@ -14028,7 +14047,7 @@ package body Exp_Ch9 is else Append_To (Args, - New_Reference_To (RTE (RE_Time_Span_Zero), Loc)); + New_Occurrence_Of (RTE (RE_Time_Span_Zero), Loc)); end if; -- Dispatching_Domain parameter. If no Dispatching_Domain rep item is @@ -14118,7 +14137,7 @@ package body Exp_Ch9 is Append_To (Args, Unchecked_Convert_To (RTE (RE_Task_Procedure_Access), Make_Qualified_Expression (Loc, - Subtype_Mark => New_Reference_To (Subp_Ptr_Typ, Loc), + Subtype_Mark => New_Occurrence_Of (Subp_Ptr_Typ, Loc), Expression => Make_Attribute_Reference (Loc, Prefix => @@ -14201,7 +14220,7 @@ package body Exp_Ch9 is Create_RE := RE_Create_Task; end if; - Name := New_Reference_To (RTE (Create_RE), Loc); + Name := New_Occurrence_Of (RTE (Create_RE), Loc); end; return @@ -14292,7 +14311,7 @@ package body Exp_Ch9 is Defining_Identifier => Temp_Nam, Object_Definition => - New_Reference_To (Etype (Formal), Loc))); + New_Occurrence_Of (Etype (Formal), Loc))); if Ekind (Formal) /= E_Out_Parameter then @@ -14300,7 +14319,7 @@ package body Exp_Ch9 is -- Jnn := <actual> Temp_Asn := - New_Reference_To (Temp_Nam, Loc); + New_Occurrence_Of (Temp_Nam, Loc); Set_Assignment_OK (Temp_Asn); @@ -14320,7 +14339,7 @@ package body Exp_Ch9 is Attribute_Name => Name_Unchecked_Access, Prefix => - New_Reference_To (Temp_Nam, Loc))); + New_Occurrence_Of (Temp_Nam, Loc))); Has_Param := True; @@ -14356,7 +14375,7 @@ package body Exp_Ch9 is Defining_Identifier => P, Object_Definition => - New_Reference_To (Blk_Typ, Loc), + New_Occurrence_Of (Blk_Typ, Loc), Expression => Expr)); @@ -14397,7 +14416,7 @@ package body Exp_Ch9 is Make_Explicit_Dereference (Loc, Make_Selected_Component (Loc, Prefix => - New_Reference_To (P, Loc), + New_Occurrence_Of (P, Loc), Selector_Name => Make_Identifier (Loc, Chars (Formal))))); |