sem_util.adb: Minor code reorganization.
authorRobert Dewar <dewar@adacore.com>
Tue, 26 May 2015 08:06:51 +0000 (08:06 +0000)
committerArnaud Charlet <charlet@gcc.gnu.org>
Tue, 26 May 2015 08:06:51 +0000 (10:06 +0200)
2015-05-26  Robert Dewar  <dewar@adacore.com>

* sem_util.adb: Minor code reorganization.
* sem_ch6.adb: Minor reformatting.

From-SVN: r223662

gcc/ada/ChangeLog
gcc/ada/sem_ch6.adb
gcc/ada/sem_util.adb

index f75ecf0a37aaf5e76d8c153ad30e090f8805a896..92decca3440a72f781df786ca73e14a6a3135c98 100644 (file)
@@ -1,3 +1,8 @@
+2015-05-26  Robert Dewar  <dewar@adacore.com>
+
+       * sem_util.adb: Minor code reorganization.
+       * sem_ch6.adb: Minor reformatting.
+
 2015-05-25  Eric Botcazou  <ebotcazou@adacore.com>
 
        * gcc-interface/utils.c (maybe_pad_type): Do not apply adjustment to
index 5e3be75ae989a87047957a3ffbdd6ae77e4f6320..2c7552eafa8e351c03fe1254a60b1cf7253dc16c 100644 (file)
@@ -10538,7 +10538,7 @@ package body Sem_Ch6 is
    ---------------------
 
    procedure Set_Formal_Mode (Formal_Id : Entity_Id) is
-      Spec : constant Node_Id := Parent (Formal_Id);
+      Spec : constant Node_Id   := Parent (Formal_Id);
       Id   : constant Entity_Id := Scope (Formal_Id);
 
    begin
index 5f6f464c1ff830cdef0f0bc9da65e1917a419a7c..b823d8006d17ce1ca6466da6e349b2ed5f37f50d 100644 (file)
@@ -2128,18 +2128,19 @@ package body Sem_Util is
 
                elsif Nkind (Parent (N)) = N_Component_Association
                   and then Nkind_In (Parent (Parent (N)),
-                             N_Aggregate,
-                             N_Extension_Aggregate)
+                                     N_Aggregate,
+                                     N_Extension_Aggregate)
                then
                   declare
                      Choice : constant Node_Id := First (Choices (Parent (N)));
+
                   begin
                      if Ekind (Entity (N)) = E_Discriminant then
                         return Skip;
 
                      elsif Expression (Parent (N)) = N
-                        and then Nkind (Choice) = N_Identifier
-                        and then Ekind (Entity (Choice)) = E_Discriminant
+                       and then Nkind (Choice) = N_Identifier
+                       and then Ekind (Entity (Choice)) = E_Discriminant
                      then
                         return Skip;
                      end if;
@@ -2194,9 +2195,10 @@ package body Sem_Util is
                      --  last (see comment in the body of traverse_func).
 
                      declare
-                        Elmt : Elmt_Id := First_Elmt (Writable_Actuals_List);
+                        Elmt : Elmt_Id;
 
                      begin
+                        Elmt := First_Elmt (Writable_Actuals_List);
                         while Present (Elmt)
                            and then Entity (Node (Elmt)) /= Entity (N)
                         loop
@@ -2210,7 +2212,7 @@ package body Sem_Util is
                         end if;
 
                         Error_Msg_NE
-                          ("value may be affected by call to& "
+                          ("value may be affected by call to & "
                            & "because order of evaluation is arbitrary",
                            Error_Node, Id);
                         return Abandon;