From: Piotr Trojanek <troja...@adacore.com> Parameter Scopes_In_EWA_OK of New_Copy_Tree was introduced in 2018 to deal with expressions-with-actions (EWA) in the build-in-place machinery. However, after changes made in 2022 it is no longer used by any caller.
Cleanup related to handling of expression functions in GNATprove; semantics is unaffected. gcc/ada/ * sem_util.ads (New_Copy_Tree): Remove Scopes_In_EWA_OK from spec; adapt comment. * sem_util.adb (New_Copy_Tree): Remove Scopes_In_EWA_OK from body; adapt code. Tested on x86_64-pc-linux-gnu, committed on master. --- gcc/ada/sem_util.adb | 16 ++++++---------- gcc/ada/sem_util.ads | 13 ++++--------- 2 files changed, 10 insertions(+), 19 deletions(-) diff --git a/gcc/ada/sem_util.adb b/gcc/ada/sem_util.adb index 8b536ec4e42..b83c75939c7 100644 --- a/gcc/ada/sem_util.adb +++ b/gcc/ada/sem_util.adb @@ -23067,11 +23067,10 @@ package body Sem_Util is ------------------- function New_Copy_Tree - (Source : Node_Id; - Map : Elist_Id := No_Elist; - New_Sloc : Source_Ptr := No_Location; - New_Scope : Entity_Id := Empty; - Scopes_In_EWA_OK : Boolean := False) return Node_Id + (Source : Node_Id; + Map : Elist_Id := No_Elist; + New_Sloc : Source_Ptr := No_Location; + New_Scope : Entity_Id := Empty) return Node_Id is -- This routine performs low-level tree manipulations and needs access -- to the internals of the tree. @@ -24030,12 +24029,9 @@ package body Sem_Util is return; -- Nothing to do when the entity is defined in a scoping construct - -- within an N_Expression_With_Actions node, unless the caller has - -- requested their replication. + -- within an N_Expression_With_Actions node. - -- ??? should this restriction be eliminated? - - elsif EWA_Inner_Scope_Level > 0 and then not Scopes_In_EWA_OK then + elsif EWA_Inner_Scope_Level > 0 then return; -- Nothing to do when the entity does not denote a construct that diff --git a/gcc/ada/sem_util.ads b/gcc/ada/sem_util.ads index 4962c62fa7d..185cf2ceabd 100644 --- a/gcc/ada/sem_util.ads +++ b/gcc/ada/sem_util.ads @@ -2630,11 +2630,10 @@ package Sem_Util is -- names to facilitate debugging the tree copy. function New_Copy_Tree - (Source : Node_Id; - Map : Elist_Id := No_Elist; - New_Sloc : Source_Ptr := No_Location; - New_Scope : Entity_Id := Empty; - Scopes_In_EWA_OK : Boolean := False) return Node_Id; + (Source : Node_Id; + Map : Elist_Id := No_Elist; + New_Sloc : Source_Ptr := No_Location; + New_Scope : Entity_Id := Empty) return Node_Id; -- Perform a deep copy of the subtree rooted at Source. Entities, itypes, -- and nodes are handled separately as follows: -- @@ -2704,10 +2703,6 @@ package Sem_Util is -- -- Parameter New_Scope may be used to specify a new scope for all copied -- entities and itypes. - -- - -- Parameter Scopes_In_EWA_OK may be used to force the replication of both - -- scoping entities and non-scoping entities found within expression with - -- actions nodes. function New_External_Entity (Kind : Entity_Kind; -- 2.40.0