[Ada] Make minimum accessibility level a constant object
authorPiotr Trojanek <trojanek@adacore.com>
Thu, 30 Jul 2020 10:02:19 +0000 (12:02 +0200)
committerPierre-Marie de Rodat <derodat@adacore.com>
Wed, 21 Oct 2020 07:22:44 +0000 (03:22 -0400)
gcc/ada/

* exp_ch6.adb (Expand_Actuals): Whitespace cleanup.
* sem_ch6.adb (Analyze_Subprogram_Body_Helper): Make minimum
accessibility a constant object.

gcc/ada/exp_ch6.adb
gcc/ada/sem_ch6.adb

index 9b7efc2..57995a4 100644 (file)
@@ -1458,12 +1458,12 @@ package body Exp_Ch6 is
       Subp      : Entity_Id;
       Post_Call : out List_Id)
    is
-      Loc       : constant Source_Ptr := Sloc (N);
-      Actual    : Node_Id;
-      Formal    : Entity_Id;
-      N_Node    : Node_Id;
-      E_Actual  : Entity_Id;
-      E_Formal  : Entity_Id;
+      Loc      : constant Source_Ptr := Sloc (N);
+      Actual   : Node_Id;
+      Formal   : Entity_Id;
+      N_Node   : Node_Id;
+      E_Actual : Entity_Id;
+      E_Formal : Entity_Id;
 
       procedure Add_Call_By_Copy_Code;
       --  For cases where the parameter must be passed by copy, this routine
index 8bf5889..9c42075 100644 (file)
@@ -4699,7 +4699,7 @@ package body Sem_Ch6 is
                   then
                      --  Generate the minimum accessibility level object
 
-                     --    A60b : natural := natural'min(1, paramL);
+                     --    A60b : constant natural := natural'min(1, paramL);
 
                      declare
                         Loc      : constant Source_Ptr := Sloc (Body_Nod);
@@ -4708,6 +4708,7 @@ package body Sem_Ch6 is
                             Defining_Identifier =>
                               Make_Temporary
                                 (Loc, 'A', Extra_Accessibility (Form)),
+                            Constant_Present    => True,
                             Object_Definition   => New_Occurrence_Of
                                                      (Standard_Natural, Loc),
                             Expression          =>