]> git.ipfire.org Git - thirdparty/gcc.git/commitdiff
ada: Move Save_Global_References_In_Aspects into sole caller
authorEric Botcazou <ebotcazou@adacore.com>
Wed, 24 Dec 2025 19:35:39 +0000 (20:35 +0100)
committerMarc Poulhiès <dkm@gcc.gnu.org>
Fri, 9 Jan 2026 10:57:22 +0000 (11:57 +0100)
No functional changes.

gcc/ada/ChangeLog:

* sem_ch12.ads (Save_Global_References_In_Aspects): Move to...
* sem_ch12.adb (Save_Global_References_In_Aspects): Move to...
* contracts.adb (Save_Global_References_In_Contract): ...here.

gcc/ada/contracts.adb
gcc/ada/sem_ch12.adb
gcc/ada/sem_ch12.ads

index 8aaf41128723003d672f15be9df0d5ea6e69af3e..deea67ed3669a9f8ebc976aea1ebb2974ffce508 100644 (file)
@@ -4877,10 +4877,35 @@ package body Contracts is
      (Templ  : Node_Id;
       Gen_Id : Entity_Id)
    is
+      procedure Save_Global_References_In_Aspects (N : Node_Id);
+      --  Save all global references found in the expressions of all aspects
+      --  that appear on node N.
+
       procedure Save_Global_References_In_List (First_Prag : Node_Id);
       --  Save all global references in contract-related source pragmas found
       --  in the list, starting with pragma First_Prag.
 
+      ---------------------------------------
+      -- Save_Global_References_In_Aspects --
+      ---------------------------------------
+
+      procedure Save_Global_References_In_Aspects (N : Node_Id) is
+         Asp  : Node_Id;
+         Expr : Node_Id;
+
+      begin
+         Asp := First (Aspect_Specifications (N));
+         while Present (Asp) loop
+            Expr := Expression (Asp);
+
+            if Present (Expr) then
+               Save_Global_References (Expr);
+            end if;
+
+            Next (Asp);
+         end loop;
+      end Save_Global_References_In_Aspects;
+
       ------------------------------------
       -- Save_Global_References_In_List --
       ------------------------------------
index e112a42e81876dda7c906101f5bedb5d65a0ed28..cbe453a7af16bffbfc06ca16eb97415925ff10bd 100644 (file)
@@ -18665,27 +18665,6 @@ package body Sem_Ch12 is
       Save_References (Templ);
    end Save_Global_References;
 
-   ---------------------------------------
-   -- Save_Global_References_In_Aspects --
-   ---------------------------------------
-
-   procedure Save_Global_References_In_Aspects (N : Node_Id) is
-      Asp  : Node_Id;
-      Expr : Node_Id;
-
-   begin
-      Asp := First (Aspect_Specifications (N));
-      while Present (Asp) loop
-         Expr := Expression (Asp);
-
-         if Present (Expr) then
-            Save_Global_References (Expr);
-         end if;
-
-         Next (Asp);
-      end loop;
-   end Save_Global_References_In_Aspects;
-
    ------------------------------------------
    -- Set_Copied_Sloc_For_Inherited_Pragma --
    ------------------------------------------
index 83c3114667b86a1a94d92259772ce28de24b8694..f8f2f024bec94a43c0d0a8a66e2f815a968cc494 100644 (file)
@@ -150,10 +150,6 @@ package Sem_Ch12 is
    --  restored in stack-like fashion. Front-end inlining also uses these
    --  structures for the management of private/full views.
 
-   procedure Save_Global_References_In_Aspects (N : Node_Id);
-   --  Save all global references found within the expressions of all aspects
-   --  that appear on node N.
-
    procedure Set_Copied_Sloc_For_Inlined_Body (N : Node_Id; E : Entity_Id);
    --  This procedure is used when a subprogram body is inlined. This process
    --  shares the same circuitry as the creation of an instantiated copy of