From 07aa5e6fa1e8bbee4a3ba080d449deb24f0d647e Mon Sep 17 00:00:00 2001 From: Robert Dewar Date: Tue, 26 May 2015 08:06:51 +0000 Subject: [PATCH] sem_util.adb: Minor code reorganization. 2015-05-26 Robert Dewar * sem_util.adb: Minor code reorganization. * sem_ch6.adb: Minor reformatting. From-SVN: r223662 --- gcc/ada/ChangeLog | 5 +++++ gcc/ada/sem_ch6.adb | 2 +- gcc/ada/sem_util.adb | 14 ++++++++------ 3 files changed, 14 insertions(+), 7 deletions(-) diff --git a/gcc/ada/ChangeLog b/gcc/ada/ChangeLog index f75ecf0a37a..92decca3440 100644 --- a/gcc/ada/ChangeLog +++ b/gcc/ada/ChangeLog @@ -1,3 +1,8 @@ +2015-05-26 Robert Dewar + + * sem_util.adb: Minor code reorganization. + * sem_ch6.adb: Minor reformatting. + 2015-05-25 Eric Botcazou * gcc-interface/utils.c (maybe_pad_type): Do not apply adjustment to diff --git a/gcc/ada/sem_ch6.adb b/gcc/ada/sem_ch6.adb index 5e3be75ae98..2c7552eafa8 100644 --- a/gcc/ada/sem_ch6.adb +++ b/gcc/ada/sem_ch6.adb @@ -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 diff --git a/gcc/ada/sem_util.adb b/gcc/ada/sem_util.adb index 5f6f464c1ff..b823d8006d1 100644 --- a/gcc/ada/sem_util.adb +++ b/gcc/ada/sem_util.adb @@ -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; -- 2.30.2