diff options
author | Robert Dewar <dewar@adacore.com> | 2014-06-13 10:26:34 +0000 |
---|---|---|
committer | Arnaud Charlet <charlet@gcc.gnu.org> | 2014-06-13 12:26:34 +0200 |
commit | 129bbe4330667aca34b1f15cb6db9e7615143acb (patch) | |
tree | ac067b42d0006129301b9981c84465c42a834989 /gcc | |
parent | aca670a0a949d7b79bd7d70997df0e0fbbd71b5d (diff) | |
download | gcc-129bbe4330667aca34b1f15cb6db9e7615143acb.zip gcc-129bbe4330667aca34b1f15cb6db9e7615143acb.tar.gz gcc-129bbe4330667aca34b1f15cb6db9e7615143acb.tar.bz2 |
sem_ch3.adb, [...]: Minor reformatting.
2014-06-13 Robert Dewar <dewar@adacore.com>
* sem_ch3.adb, sem_ch9.adb, a-coinho.adb, a-coinho.ads: Minor
reformatting.
From-SVN: r211628
Diffstat (limited to 'gcc')
-rw-r--r-- | gcc/ada/ChangeLog | 5 | ||||
-rw-r--r-- | gcc/ada/a-coinho.adb | 28 | ||||
-rw-r--r-- | gcc/ada/a-coinho.ads | 10 | ||||
-rw-r--r-- | gcc/ada/sem_ch3.adb | 19 | ||||
-rw-r--r-- | gcc/ada/sem_ch9.adb | 2 |
5 files changed, 39 insertions, 25 deletions
diff --git a/gcc/ada/ChangeLog b/gcc/ada/ChangeLog index 7dc730c0f..22557b2 100644 --- a/gcc/ada/ChangeLog +++ b/gcc/ada/ChangeLog @@ -1,3 +1,8 @@ +2014-06-13 Robert Dewar <dewar@adacore.com> + + * sem_ch3.adb, sem_ch9.adb, a-coinho.adb, a-coinho.ads: Minor + reformatting. + 2014-06-13 Hristian Kirtchev <kirtchev@adacore.com> * sem_prag.adb (Analyze_Pragma): Add local diff --git a/gcc/ada/a-coinho.adb b/gcc/ada/a-coinho.adb index 7fb7bec..4cb7179 100644 --- a/gcc/ada/a-coinho.adb +++ b/gcc/ada/a-coinho.adb @@ -6,7 +6,7 @@ -- -- -- B o d y -- -- -- --- Copyright (C) 2014, Free Software Foundation, Inc. -- +-- Copyright (C) 2012-2014, Free Software Foundation, Inc. -- -- -- -- GNAT is free software; you can redistribute it and/or modify it under -- -- terms of the GNU General Public License as published by the Free Soft- -- @@ -65,7 +65,11 @@ package body Ada.Containers.Indefinite_Holders is overriding procedure Adjust (Control : in out Reference_Control_Type) is begin if Control.Container /= null then - Control.Container.Busy := Control.Container.Busy + 1; + declare + B : Natural renames Control.Container.Busy; + begin + B := B + 1; + end; end if; end Adjust; @@ -109,9 +113,11 @@ package body Ada.Containers.Indefinite_Holders is (Container : aliased Holder) return Constant_Reference_Type is Ref : constant Constant_Reference_Type := - (Element => Container.Element, + (Element => Container.Element.all'Access, Control => (Controlled with Container'Unrestricted_Access)); + B : Natural renames Ref.Control.Container.Busy; begin + B := B + 1; return Ref; end Constant_Reference; @@ -154,13 +160,16 @@ package body Ada.Containers.Indefinite_Holders is Free (Container.Element); end Finalize; - overriding procedure Finalize (Control : in out Reference_Control_Type) - is + overriding procedure Finalize (Control : in out Reference_Control_Type) is begin if Control.Container /= null then - Control.Container.Busy := Control.Container.Busy - 1; - + declare + B : Natural renames Control.Container.Busy; + begin + B := B - 1; + end; end if; + Control.Container := null; end Finalize; @@ -262,9 +271,10 @@ package body Ada.Containers.Indefinite_Holders is (Container : aliased in out Holder) return Reference_Type is Ref : constant Reference_Type := - (Element => Container.Element, + (Element => Container.Element.all'Access, Control => (Controlled with Container'Unrestricted_Access)); begin + Container.Busy := Container.Busy + 1; return Ref; end Reference; @@ -301,6 +311,7 @@ package body Ada.Containers.Indefinite_Holders is --------------- function To_Holder (New_Item : Element_Type) return Holder is + -- The element allocator may need an accessibility check in the case the -- actual type is class-wide or has access discriminants (RM 4.8(10.1) -- and AI12-0035). @@ -354,6 +365,7 @@ package body Ada.Containers.Indefinite_Holders is Element_Type'Output (Stream, Container.Element.all); end if; end Write; + procedure Write (Stream : not null access Root_Stream_Type'Class; Item : Reference_Type) diff --git a/gcc/ada/a-coinho.ads b/gcc/ada/a-coinho.ads index 5edfc64..c5f45f5 100644 --- a/gcc/ada/a-coinho.ads +++ b/gcc/ada/a-coinho.ads @@ -6,7 +6,7 @@ -- -- -- S p e c -- -- -- --- Copyright (C) 2014, Free Software Foundation, Inc. -- +-- Copyright (C) 2011-2014, Free Software Foundation, Inc. -- -- -- -- This specification is derived from the Ada Reference Manual for use with -- -- GNAT. The copyright notice above, and the license provisions that follow -- @@ -131,8 +131,8 @@ private pragma Inline (Finalize); type Constant_Reference_Type - (Element : not null access constant Element_Type) - is record + (Element : not null access constant Element_Type) is + record Control : Reference_Control_Type; end record; @@ -148,9 +148,7 @@ private for Constant_Reference_Type'Read use Read; - type Reference_Type - (Element : not null access Element_Type) - is record + type Reference_Type (Element : not null access Element_Type) is record Control : Reference_Control_Type; end record; diff --git a/gcc/ada/sem_ch3.adb b/gcc/ada/sem_ch3.adb index b899e01..9dc8d12 100644 --- a/gcc/ada/sem_ch3.adb +++ b/gcc/ada/sem_ch3.adb @@ -15598,11 +15598,10 @@ package body Sem_Ch3 is end if; elsif Nkind (N) = N_Full_Type_Declaration - and then - (Nkind (Type_Definition (N)) = N_Record_Definition - or else Nkind (Type_Definition (N)) - = N_Derived_Type_Definition) - and then Interface_Present (Type_Definition (N)) + and then Nkind_In + (Type_Definition (N), N_Record_Definition, + N_Derived_Type_Definition) + and then Interface_Present (Type_Definition (N)) then Error_Msg_N ("completion of private type cannot be an interface", N); @@ -18309,16 +18308,16 @@ package body Sem_Ch3 is if Present (Iface) then Error_Msg_NE - ("interface in partial view& not implemented by full type " & - "(RM-2005 7.3 (7.3/2))", Full_T, Iface); + ("interface in partial view& not implemented by full type " + & "(RM-2005 7.3 (7.3/2))", Full_T, Iface); end if; Iface := Find_Hidden_Interface (Full_T_Ifaces, Priv_T_Ifaces); if Present (Iface) then Error_Msg_NE - ("interface & not implemented by partial view " & - "(RM-2005 7.3 (7.3/2))", Full_T, Iface); + ("interface & not implemented by partial view " + & "(RM-2005 7.3 (7.3/2))", Full_T, Iface); end if; end; end if; @@ -18349,7 +18348,7 @@ package body Sem_Ch3 is if Priv_Parent = Any_Type or else Full_Parent = Any_Type then return; - -- Ada 2005 (AI-251): Interfaces in the full-typ can be given in + -- Ada 2005 (AI-251): Interfaces in the full type can be given in -- any order. Therefore we don't have to check that its parent must -- be a descendant of the parent of the private type declaration. diff --git a/gcc/ada/sem_ch9.adb b/gcc/ada/sem_ch9.adb index be46427..9dcd7de 100644 --- a/gcc/ada/sem_ch9.adb +++ b/gcc/ada/sem_ch9.adb @@ -3328,7 +3328,7 @@ package body Sem_Ch9 is if Present (Iface) then Error_Msg_NE ("interface in partial view& not implemented by full " - & "type (RM-2005 7.3 (7.3/2))", T, Iface); + & "type (RM-2005 7.3 (7.3/2))", T, Iface); end if; Iface := Find_Hidden_Interface (Full_T_Ifaces, Priv_T_Ifaces); |