https://gcc.gnu.org/g:fda65d6ed0a2cc7747af1c543be5ffc66629fc10

commit r17-794-gfda65d6ed0a2cc7747af1c543be5ffc66629fc10
Author: Viljar Indus <[email protected]>
Date:   Thu Feb 12 12:26:48 2026 +0200

    ada: Relocate Check_Valid_Ghost_Declaration
    
    Relocate it to an alphabetically correct location.
    
    gcc/ada/ChangeLog:
    
            * ghost.adb (Check_Valid_Ghost_Declaration): Relocate the procedure.

Diff:
---
 gcc/ada/ghost.adb | 102 +++++++++++++++++++++++++++---------------------------
 1 file changed, 51 insertions(+), 51 deletions(-)

diff --git a/gcc/ada/ghost.adb b/gcc/ada/ghost.adb
index dc5ea1efe8a2..ce9e80e09abf 100644
--- a/gcc/ada/ghost.adb
+++ b/gcc/ada/ghost.adb
@@ -1067,57 +1067,6 @@ package body Ghost is
       end if;
    end Check_Ghost_Context_In_Generic_Association;
 
-   -----------------------------------
-   -- Check_Valid_Ghost_Declaration --
-   -----------------------------------
-
-   procedure Check_Valid_Ghost_Declaration (N : Node_Id) is
-      procedure Check_Valid_Assertion_Level (Id : Entity_Id; Ref : Node_Id);
-      --  Check that the the assertion level of the declared entity is
-      --  compatible with assertion level of the ghost region.
-
-      ---------------------------------
-      -- Check_Valid_Assertion_Level --
-      ---------------------------------
-
-      procedure Check_Valid_Assertion_Level (Id : Entity_Id; Ref : Node_Id) is
-         Id_Level     : constant Entity_Id := Ghost_Assertion_Level (Id);
-         Region_Level : constant Entity_Id :=
-           Ghost_Config.Ghost_Mode_Assertion_Level;
-      begin
-         --  This check is not applied for generic isntantiations
-
-         if Is_Generic_Instance (Id) then
-            return;
-         end if;
-
-         if not Is_Assertion_Level_Dependent (Id_Level, Region_Level) then
-            Error_Msg_Sloc := Sloc (Ref);
-
-            Error_Msg_N (Assertion_Level_Error_Msg, Ref);
-            Error_Msg_Name_1 := Chars (Id_Level);
-            Error_Msg_NE ("\& has assertion level %", Ref, Id);
-            Error_Msg_Name_1 := Chars (Region_Level);
-            Error_Msg_NE ("\& is declared within a region with %", Ref, Id);
-            Error_Msg_Name_1 := Chars (Region_Level);
-            Error_Msg_NE ("\assertion level of & should depend on %", Ref, Id);
-         end if;
-      end Check_Valid_Assertion_Level;
-
-      --  Local variables
-
-      Id : constant Entity_Id := Defining_Entity (N);
-
-   --  Start of processing for Check_Valid_Ghost_Declaration
-   begin
-      if not Is_Ghost_Entity (Id) or else Ghost_Config.Ghost_Mode = None
-      then
-         return;
-      end if;
-
-      Check_Valid_Assertion_Level (Id, N);
-   end Check_Valid_Ghost_Declaration;
-
    -----------------------------
    -- Check_Ghost_Equality_Op --
    -----------------------------
@@ -1517,6 +1466,57 @@ package body Ghost is
       end if;
    end Check_Ghost_Type;
 
+   -----------------------------------
+   -- Check_Valid_Ghost_Declaration --
+   -----------------------------------
+
+   procedure Check_Valid_Ghost_Declaration (N : Node_Id) is
+      procedure Check_Valid_Assertion_Level (Id : Entity_Id; Ref : Node_Id);
+      --  Check that the the assertion level of the declared entity is
+      --  compatible with assertion level of the ghost region.
+
+      ---------------------------------
+      -- Check_Valid_Assertion_Level --
+      ---------------------------------
+
+      procedure Check_Valid_Assertion_Level (Id : Entity_Id; Ref : Node_Id) is
+         Id_Level     : constant Entity_Id := Ghost_Assertion_Level (Id);
+         Region_Level : constant Entity_Id :=
+           Ghost_Config.Ghost_Mode_Assertion_Level;
+      begin
+         --  This check is not applied for generic isntantiations
+
+         if Is_Generic_Instance (Id) then
+            return;
+         end if;
+
+         if not Is_Assertion_Level_Dependent (Id_Level, Region_Level) then
+            Error_Msg_Sloc := Sloc (Ref);
+
+            Error_Msg_N (Assertion_Level_Error_Msg, Ref);
+            Error_Msg_Name_1 := Chars (Id_Level);
+            Error_Msg_NE ("\& has assertion level %", Ref, Id);
+            Error_Msg_Name_1 := Chars (Region_Level);
+            Error_Msg_NE ("\& is declared within a region with %", Ref, Id);
+            Error_Msg_Name_1 := Chars (Region_Level);
+            Error_Msg_NE ("\assertion level of & should depend on %", Ref, Id);
+         end if;
+      end Check_Valid_Assertion_Level;
+
+      --  Local variables
+
+      Id : constant Entity_Id := Defining_Entity (N);
+
+   --  Start of processing for Check_Valid_Ghost_Declaration
+   begin
+      if not Is_Ghost_Entity (Id) or else Ghost_Config.Ghost_Mode = None
+      then
+         return;
+      end if;
+
+      Check_Valid_Assertion_Level (Id, N);
+   end Check_Valid_Ghost_Declaration;
+
    ----------------------
    -- Get_Ghost_Aspect --
    ----------------------

Reply via email to