From d6dffa6695731c28a5a1e6d64c897680f761496c Mon Sep 17 00:00:00 2001 From: Hristian Kirtchev Date: Thu, 12 Nov 2015 11:12:23 +0000 Subject: [PATCH] exp_attr.adb, [...]: Minor reformatting. 2015-11-12 Hristian Kirtchev * exp_attr.adb, freeze.adb, sem_util.adb, sem_ch13.adb: Minor reformatting. From-SVN: r230235 --- gcc/ada/ChangeLog | 5 +++++ gcc/ada/exp_attr.adb | 19 ++++++++----------- gcc/ada/freeze.adb | 13 +++++++------ gcc/ada/sem_ch13.adb | 8 +++++--- gcc/ada/sem_util.adb | 1 + 5 files changed, 26 insertions(+), 20 deletions(-) diff --git a/gcc/ada/ChangeLog b/gcc/ada/ChangeLog index 9a799de64ec..bb2fad19f5d 100644 --- a/gcc/ada/ChangeLog +++ b/gcc/ada/ChangeLog @@ -1,3 +1,8 @@ +2015-11-12 Hristian Kirtchev + + * exp_attr.adb, freeze.adb, sem_util.adb, sem_ch13.adb: Minor + reformatting. + 2015-11-12 Ed Schonberg * exp_attr.adb (Compile_Stream_Body_In_Scope): When compiling diff --git a/gcc/ada/exp_attr.adb b/gcc/ada/exp_attr.adb index aaa3c728751..8c0224705bc 100644 --- a/gcc/ada/exp_attr.adb +++ b/gcc/ada/exp_attr.adb @@ -634,11 +634,10 @@ package body Exp_Attr is Arr : Entity_Id; Check : Boolean) is - C_Type : constant Entity_Id := Base_Type (Component_Type (Arr)); - Curr : constant Entity_Id := Current_Scope; - - Install : Boolean := False; - Scop : Entity_Id := Scope (Arr); + C_Type : constant Entity_Id := Base_Type (Component_Type (Arr)); + Curr : constant Entity_Id := Current_Scope; + Install : Boolean := False; + Scop : Entity_Id := Scope (Arr); begin if Is_Hidden (Arr) @@ -646,10 +645,10 @@ package body Exp_Attr is and then Ekind (Scop) = E_Package then Install := True; - else - -- The component type may be private, in which case we install - -- its full view to compile the subprogram. + else + -- The component type may be private, in which case we install its + -- full view to compile the subprogram. Scop := Scope (C_Type); @@ -665,9 +664,7 @@ package body Exp_Attr is -- If we are within an instance body, then all visibility has been -- established already and there is no need to install the package. - if Install - and then not In_Instance_Body - then + if Install and then not In_Instance_Body then Push_Scope (Scop); Install_Visible_Declarations (Scop); Install_Private_Declarations (Scop); diff --git a/gcc/ada/freeze.adb b/gcc/ada/freeze.adb index 88e785cda39..7c56b1fb9a8 100644 --- a/gcc/ada/freeze.adb +++ b/gcc/ada/freeze.adb @@ -672,24 +672,25 @@ package body Freeze is -- later for the variable if it is assigned. if (Ekind (E) = E_Variable - or else (Ekind (E) = E_Constant - and then not Is_Imported (E))) + or else (Ekind (E) = E_Constant + and then not Is_Imported (E))) and then Overlays_Constant (E) and then Present (Init) then declare O_Ent : Entity_Id; Off : Boolean; + begin Find_Overlaid_Entity (Addr, O_Ent, Off); if Ekind (O_Ent) = E_Constant and then Etype (O_Ent) = Typ and then Present (Constant_Value (O_Ent)) - and then Compile_Time_Compare ( - Init, - Constant_Value (O_Ent), - Assume_Valid => True) = EQ + and then Compile_Time_Compare + (Init, + Constant_Value (O_Ent), + Assume_Valid => True) = EQ then Set_No_Initialization (Decl); return; diff --git a/gcc/ada/sem_ch13.adb b/gcc/ada/sem_ch13.adb index 3d33e639e34..5c87364d42b 100644 --- a/gcc/ada/sem_ch13.adb +++ b/gcc/ada/sem_ch13.adb @@ -4725,11 +4725,13 @@ package body Sem_Ch13 is Find_Overlaid_Entity (N, O_Ent, Off); if Present (O_Ent) then + -- If the object overlays a constant object, mark it so if Is_Constant_Object (O_Ent) then Set_Overlays_Constant (U_Ent); end if; + else -- If this is not an overlay, mark a variable as being -- volatile to prevent unwanted optimizations. It's a @@ -4744,9 +4746,9 @@ package body Sem_Ch13 is end if; end if; - -- Overlaying controlled objects is erroneous. - -- Emit warning but continue analysis because program is - -- itself legal, and back-end must see address clause. + -- Overlaying controlled objects is erroneous. Emit warning + -- but continue analysis because program is itself legal, + -- and back-end must see address clause. if Present (O_Ent) and then (Has_Controlled_Component (Etype (O_Ent)) diff --git a/gcc/ada/sem_util.adb b/gcc/ada/sem_util.adb index 2422bb3ec47..25ffa96e5d2 100644 --- a/gcc/ada/sem_util.adb +++ b/gcc/ada/sem_util.adb @@ -16267,6 +16267,7 @@ package body Sem_Util is Addr : constant Node_Id := Address_Clause (Ent); O_Ent : Entity_Id; Off : Boolean; + begin Find_Overlaid_Entity (Addr, O_Ent, Off); -- 2.30.2