]> git.ipfire.org Git - thirdparty/gcc.git/commitdiff
ada: Deconstruct a no longer used parameter of New_Copy_Tree
authorPiotr Trojanek <trojanek@adacore.com>
Wed, 8 Mar 2023 10:41:42 +0000 (11:41 +0100)
committerMarc Poulhiès <poulhies@adacore.com>
Thu, 25 May 2023 07:44:18 +0000 (09:44 +0200)
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.

gcc/ada/sem_util.adb
gcc/ada/sem_util.ads

index 8b536ec4e4281be0eca3f41796b4817e50ad1178..b83c75939c734b19af7fab8c01193f97c9c61c7e 100644 (file)
@@ -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
index 4962c62fa7d722b2a91ee1b7f36d63b2b299abc2..185cf2ceabd5942e85a080cf16b35a849e321f5f 100644 (file)
@@ -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;