public inbox for gcc-cvs@sourceware.org
help / color / mirror / Atom feed
* [gcc r15-424] ada: Move Init_Proc_Level_Formal from Exp_Ch3 to Exp_Util
@ 2024-05-13  8:38 Marc Poulhi?s
  0 siblings, 0 replies; only message in thread
From: Marc Poulhi?s @ 2024-05-13  8:38 UTC (permalink / raw)
  To: gcc-cvs

https://gcc.gnu.org/g:5de075393402281c0fd9d0081a9d753c8793891e

commit r15-424-g5de075393402281c0fd9d0081a9d753c8793891e
Author: Eric Botcazou <ebotcazou@adacore.com>
Date:   Mon Feb 5 16:26:04 2024 +0100

    ada: Move Init_Proc_Level_Formal from Exp_Ch3 to Exp_Util
    
    This makes it possible to remove clauses from the Accessibility package.
    
    gcc/ada/
    
            * accessibility.adb: Remove clauses for Exp_Ch3.
            * exp_ch3.ads (Init_Proc_Level_Formal): Move declaration to...
            * exp_ch3.adb (Init_Proc_Level_Formal): Move body to...
            * exp_util.ads (Init_Proc_Level_Formal): ...here.
            (Inside_Init_Proc): Alphabetize.
            * exp_util.adb (Init_Proc_Level_Formal): ...here.

Diff:
---
 gcc/ada/accessibility.adb |  1 -
 gcc/ada/exp_ch3.adb       | 25 -------------------------
 gcc/ada/exp_ch3.ads       |  5 -----
 gcc/ada/exp_util.adb      | 26 ++++++++++++++++++++++++++
 gcc/ada/exp_util.ads      | 10 +++++++---
 5 files changed, 33 insertions(+), 34 deletions(-)

diff --git a/gcc/ada/accessibility.adb b/gcc/ada/accessibility.adb
index 75ab96674363..bb81ae49f411 100644
--- a/gcc/ada/accessibility.adb
+++ b/gcc/ada/accessibility.adb
@@ -32,7 +32,6 @@ with Elists;         use Elists;
 with Errout;         use Errout;
 with Einfo.Utils;    use Einfo.Utils;
 with Exp_Atag;       use Exp_Atag;
-with Exp_Ch3;        use Exp_Ch3;
 with Exp_Ch7;        use Exp_Ch7;
 with Exp_Tss;        use Exp_Tss;
 with Exp_Util;       use Exp_Util;
diff --git a/gcc/ada/exp_ch3.adb b/gcc/ada/exp_ch3.adb
index f9989373a620..2477a221c96d 100644
--- a/gcc/ada/exp_ch3.adb
+++ b/gcc/ada/exp_ch3.adb
@@ -1462,31 +1462,6 @@ package body Exp_Ch3 is
       return Agg;
    end Build_Equivalent_Record_Aggregate;
 
-   ----------------------------
-   -- Init_Proc_Level_Formal --
-   ----------------------------
-
-   function Init_Proc_Level_Formal (Proc : Entity_Id) return Entity_Id is
-      Form : Entity_Id;
-   begin
-      --  Move through the formals of the initialization procedure Proc to find
-      --  the extra accessibility level parameter associated with the object
-      --  being initialized.
-
-      Form := First_Formal (Proc);
-      while Present (Form) loop
-         if Chars (Form) = Name_uInit_Level then
-            return Form;
-         end if;
-
-         Next_Formal (Form);
-      end loop;
-
-      --  No formal was found, return Empty
-
-      return Empty;
-   end Init_Proc_Level_Formal;
-
    -------------------------------
    -- Build_Initialization_Call --
    -------------------------------
diff --git a/gcc/ada/exp_ch3.ads b/gcc/ada/exp_ch3.ads
index 5a4b1133916d..1e0f76ae18f7 100644
--- a/gcc/ada/exp_ch3.ads
+++ b/gcc/ada/exp_ch3.ads
@@ -146,11 +146,6 @@ package Exp_Ch3 is
    --  type is valid only when Normalize_Scalars or Initialize_Scalars is
    --  active, or if N is the node for a 'Invalid_Value attribute node.
 
-   function Init_Proc_Level_Formal (Proc : Entity_Id) return Entity_Id;
-   --  Fetch the extra formal from an initalization procedure "proc"
-   --  corresponding to the level of the object being initialized. When none
-   --  is present Empty is returned.
-
    procedure Init_Secondary_Tags
      (Typ            : Entity_Id;
       Target         : Node_Id;
diff --git a/gcc/ada/exp_util.adb b/gcc/ada/exp_util.adb
index efc9ef0ed38a..1dcfb61b333d 100644
--- a/gcc/ada/exp_util.adb
+++ b/gcc/ada/exp_util.adb
@@ -7267,6 +7267,32 @@ package body Exp_Util is
       return False;
    end In_Unconditional_Context;
 
+   ----------------------------
+   -- Init_Proc_Level_Formal --
+   ----------------------------
+
+   function Init_Proc_Level_Formal (Proc : Entity_Id) return Entity_Id is
+      Form : Entity_Id;
+
+   begin
+      --  Go through the formals of the initialization procedure Proc to find
+      --  the extra accessibility level parameter associated with the object
+      --  being initialized.
+
+      Form := First_Formal (Proc);
+      while Present (Form) loop
+         if Chars (Form) = Name_uInit_Level then
+            return Form;
+         end if;
+
+         Next_Formal (Form);
+      end loop;
+
+      --  No formal was found, return Empty
+
+      return Empty;
+   end Init_Proc_Level_Formal;
+
    -------------------
    -- Insert_Action --
    -------------------
diff --git a/gcc/ada/exp_util.ads b/gcc/ada/exp_util.ads
index b968f448bbae..3fd3a151ddbe 100644
--- a/gcc/ada/exp_util.ads
+++ b/gcc/ada/exp_util.ads
@@ -724,9 +724,6 @@ package Exp_Util is
    --  chain, counting only entries in the current scope. If an entity is not
    --  overloaded, the returned number will be one.
 
-   function Inside_Init_Proc return Boolean;
-   --  Returns True if current scope is within an init proc
-
    function In_Library_Level_Package_Body (Id : Entity_Id) return Boolean;
    --  Given an arbitrary entity, determine whether it appears at the library
    --  level of a package body.
@@ -737,6 +734,13 @@ package Exp_Util is
    --  unconditionally executed, i.e. it is not within a loop or a conditional
    --  or a case statement etc.
 
+   function Init_Proc_Level_Formal (Proc : Entity_Id) return Entity_Id;
+   --  Return the extra formal of an initialization procedure corresponding to
+   --  the level of the object being initialized, or Empty if none is present.
+
+   function Inside_Init_Proc return Boolean;
+   --  Return True if current scope is within an init proc
+
    function Integer_Type_For (S : Uint; Uns : Boolean) return Entity_Id;
    --  Return a suitable standard integer type containing at least S bits and
    --  of the signedness given by Uns. See also Small_Integer_Type_For.

^ permalink raw reply	[flat|nested] only message in thread

only message in thread, other threads:[~2024-05-13  8:38 UTC | newest]

Thread overview: (only message) (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2024-05-13  8:38 [gcc r15-424] ada: Move Init_Proc_Level_Formal from Exp_Ch3 to Exp_Util Marc Poulhi?s

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).