diff options
author | charlet <charlet@138bc75d-0d04-0410-961f-82ee72b054a4> | 2011-08-29 13:42:00 +0000 |
---|---|---|
committer | charlet <charlet@138bc75d-0d04-0410-961f-82ee72b054a4> | 2011-08-29 13:42:00 +0000 |
commit | defcde112eae094b776169d9e2d62c17d052ae92 (patch) | |
tree | f20f4df300d64f5600c1039d02d785c133bb1250 /gcc | |
parent | 852b4cc2d9d0889a68adf7672a040e4451b1be1d (diff) | |
download | gcc-defcde112eae094b776169d9e2d62c17d052ae92.tar.gz |
2011-08-29 Robert Dewar <dewar@adacore.com>
* a-cdlili.adb, a-cdlili.ads, a-coinve.adb, a-coinve.ads,
sem_util.adb, sem_util.ads, a-cohama.adb, a-cohama.ads, a-coorse.adb,
a-coorse.ads, aspects.ads, sem_ch8.adb: Minor reformatting.
git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@178232 138bc75d-0d04-0410-961f-82ee72b054a4
Diffstat (limited to 'gcc')
-rw-r--r-- | gcc/ada/ChangeLog | 6 | ||||
-rw-r--r-- | gcc/ada/a-cdlili.adb | 30 | ||||
-rw-r--r-- | gcc/ada/a-cdlili.ads | 3 | ||||
-rw-r--r-- | gcc/ada/a-cohama.adb | 22 | ||||
-rw-r--r-- | gcc/ada/a-cohama.ads | 3 | ||||
-rw-r--r-- | gcc/ada/a-coinve.adb | 23 | ||||
-rw-r--r-- | gcc/ada/a-coinve.ads | 11 | ||||
-rw-r--r-- | gcc/ada/a-coorse.adb | 30 | ||||
-rw-r--r-- | gcc/ada/a-coorse.ads | 10 | ||||
-rwxr-xr-x | gcc/ada/aspects.ads | 2 | ||||
-rw-r--r-- | gcc/ada/sem_ch8.adb | 2 | ||||
-rw-r--r-- | gcc/ada/sem_util.adb | 93 | ||||
-rw-r--r-- | gcc/ada/sem_util.ads | 12 |
13 files changed, 137 insertions, 110 deletions
diff --git a/gcc/ada/ChangeLog b/gcc/ada/ChangeLog index f4e7ca36ca0..1a078d5f2f4 100644 --- a/gcc/ada/ChangeLog +++ b/gcc/ada/ChangeLog @@ -1,3 +1,9 @@ +2011-08-29 Robert Dewar <dewar@adacore.com> + + * a-cdlili.adb, a-cdlili.ads, a-coinve.adb, a-coinve.ads, + sem_util.adb, sem_util.ads, a-cohama.adb, a-cohama.ads, a-coorse.adb, + a-coorse.ads, aspects.ads, sem_ch8.adb: Minor reformatting. + 2011-08-29 Thomas Quinot <quinot@adacore.com> * system-freebsd-x86_64.ads (Backend_Overflow_Checks): Set true True. diff --git a/gcc/ada/a-cdlili.adb b/gcc/ada/a-cdlili.adb index 8a3b98358dd..4682ffbea50 100644 --- a/gcc/ada/a-cdlili.adb +++ b/gcc/ada/a-cdlili.adb @@ -38,12 +38,16 @@ package body Ada.Containers.Doubly_Linked_Lists is Node : Node_Access; end record; - overriding function First (Object : Iterator) return Cursor; - overriding function Last (Object : Iterator) return Cursor; - overriding function Next (Object : Iterator; Position : Cursor) - return Cursor; - overriding function Previous (Object : Iterator; Position : Cursor) - return Cursor; + overriding function First (Object : Iterator) return Cursor; + overriding function Last (Object : Iterator) return Cursor; + + overriding function Next + (Object : Iterator; + Position : Cursor) return Cursor; + + overriding function Previous + (Object : Iterator; + Position : Cursor) return Cursor; ----------------------- -- Local Subprograms -- @@ -918,6 +922,7 @@ package body Ada.Containers.Doubly_Linked_Lists is declare Next_Node : constant Node_Access := Position.Node.Next; + begin if Next_Node = null then return No_Element; @@ -927,11 +932,13 @@ package body Ada.Containers.Doubly_Linked_Lists is end; end Next; - function Next (Object : Iterator; Position : Cursor) return Cursor is + function Next + (Object : Iterator; + Position : Cursor) return Cursor + is begin if Position.Node = Object.Container.Last then return No_Element; - else return (Object.Container, Position.Node.Next); end if; @@ -969,6 +976,7 @@ package body Ada.Containers.Doubly_Linked_Lists is declare Prev_Node : constant Node_Access := Position.Node.Prev; + begin if Prev_Node = null then return No_Element; @@ -978,11 +986,13 @@ package body Ada.Containers.Doubly_Linked_Lists is end; end Previous; - function Previous (Object : Iterator; Position : Cursor) return Cursor is + function Previous + (Object : Iterator; + Position : Cursor) return Cursor + is begin if Position.Node = Position.Container.First then return No_Element; - else return (Object.Container, Position.Node.Prev); end if; diff --git a/gcc/ada/a-cdlili.ads b/gcc/ada/a-cdlili.ads index 8b3a16abbf6..f7accff0a27 100644 --- a/gcc/ada/a-cdlili.ads +++ b/gcc/ada/a-cdlili.ads @@ -32,7 +32,8 @@ ------------------------------------------------------------------------------ private with Ada.Finalization; -with Ada.Streams; use Ada.Streams; + +with Ada.Streams; use Ada.Streams; with Ada.Iterator_Interfaces; generic diff --git a/gcc/ada/a-cohama.adb b/gcc/ada/a-cohama.adb index fdf9696fd61..c06ba9e35e4 100644 --- a/gcc/ada/a-cohama.adb +++ b/gcc/ada/a-cohama.adb @@ -39,13 +39,15 @@ package body Ada.Containers.Hashed_Maps is type Iterator is new Map_Iterator_Interfaces.Forward_Iterator with record - Container : Map_Access; - Node : Node_Access; - end record; + Container : Map_Access; + Node : Node_Access; + end record; overriding function First (Object : Iterator) return Cursor; - overriding function Next (Object : Iterator; Position : Cursor) - return Cursor; + + overriding function Next + (Object : Iterator; + Position : Cursor) return Cursor; ----------------------- -- Local Subprograms -- @@ -599,8 +601,8 @@ package body Ada.Containers.Hashed_Maps is B := B - 1; end Iterate; - function Iterate (Container : Map) - return Map_Iterator_Interfaces.Forward_Iterator'class + function Iterate + (Container : Map) return Map_Iterator_Interfaces.Forward_Iterator'class is Node : constant Node_Access := HT_Ops.First (Container.HT); It : constant Iterator := (Container'Unrestricted_Access, Node); @@ -680,11 +682,13 @@ package body Ada.Containers.Hashed_Maps is Position := Next (Position); end Next; - function Next (Object : Iterator; Position : Cursor) return Cursor is + function Next + (Object : Iterator; + Position : Cursor) return Cursor + is begin if Position.Node = null then return No_Element; - else return (Object.Container, Next (Position).Node); end if; diff --git a/gcc/ada/a-cohama.ads b/gcc/ada/a-cohama.ads index 2ade56e1952..d0bd3fdbbf2 100644 --- a/gcc/ada/a-cohama.ads +++ b/gcc/ada/a-cohama.ads @@ -32,8 +32,9 @@ ------------------------------------------------------------------------------ private with Ada.Containers.Hash_Tables; -with Ada.Streams; use Ada.Streams; private with Ada.Finalization; + +with Ada.Streams; use Ada.Streams; with Ada.Iterator_Interfaces; generic diff --git a/gcc/ada/a-coinve.adb b/gcc/ada/a-coinve.adb index fa90aaf31f5..d66b9ec563b 100644 --- a/gcc/ada/a-coinve.adb +++ b/gcc/ada/a-coinve.adb @@ -46,11 +46,16 @@ package body Ada.Containers.Indefinite_Vectors is end record; overriding function First (Object : Iterator) return Cursor; - overriding function Last (Object : Iterator) return Cursor; - overriding function Next (Object : Iterator; Position : Cursor) - return Cursor; - overriding function Previous (Object : Iterator; Position : Cursor) - return Cursor; + + overriding function Last (Object : Iterator) return Cursor; + + overriding function Next + (Object : Iterator; + Position : Cursor) return Cursor; + + overriding function Previous + (Object : Iterator; + Position : Cursor) return Cursor; --------- -- "&" -- @@ -2433,7 +2438,9 @@ package body Ada.Containers.Indefinite_Vectors is return It; end Iterate; - function Iterate (Container : Vector; Start : Cursor) + function Iterate + (Container : Vector; + Start : Cursor) return Vector_Iterator_Interfaces.Reversible_Iterator'class is It : constant Iterator := @@ -2584,10 +2591,6 @@ package body Ada.Containers.Indefinite_Vectors is end if; end Next; - ---------- - -- Next -- - ---------- - procedure Next (Position : in out Cursor) is begin if Position.Container = null then diff --git a/gcc/ada/a-coinve.ads b/gcc/ada/a-coinve.ads index 866beb9c55f..2380b425309 100644 --- a/gcc/ada/a-coinve.ads +++ b/gcc/ada/a-coinve.ads @@ -32,7 +32,8 @@ ------------------------------------------------------------------------------ private with Ada.Finalization; -with Ada.Streams; use Ada.Streams; + +with Ada.Streams; use Ada.Streams; with Ada.Iterator_Interfaces; generic @@ -344,7 +345,9 @@ package Ada.Containers.Indefinite_Vectors is function Iterate (Container : Vector) return Vector_Iterator_Interfaces.Reversible_Iterator'class; - function Iterate (Container : Vector; Start : Cursor) + function Iterate + (Container : Vector; + Start : Cursor) return Vector_Iterator_Interfaces.Reversible_Iterator'class; procedure Reverse_Iterate @@ -398,10 +401,10 @@ private end record; type Constant_Reference_Type - (Element : not null access constant Element_Type) is null record; + (Element : not null access constant Element_Type) is null record; type Reference_Type - (Element : not null access Element_Type) is null record; + (Element : not null access Element_Type) is null record; overriding procedure Adjust (Container : in out Vector); diff --git a/gcc/ada/a-coorse.adb b/gcc/ada/a-coorse.adb index 2224fdf317e..b7d9d45dc03 100644 --- a/gcc/ada/a-coorse.adb +++ b/gcc/ada/a-coorse.adb @@ -42,16 +42,21 @@ package body Ada.Containers.Ordered_Sets is type Iterator is new Ordered_Set_Iterator_Interfaces.Reversible_Iterator with record - Container : access constant Set; - Node : Node_Access; - end record; + Container : access constant Set; + Node : Node_Access; + end record; overriding function First (Object : Iterator) return Cursor; - overriding function Last (Object : Iterator) return Cursor; - overriding function Next (Object : Iterator; Position : Cursor) - return Cursor; - overriding function Previous (Object : Iterator; Position : Cursor) - return Cursor; + + overriding function Last (Object : Iterator) return Cursor; + + overriding function Next + (Object : Iterator; + Position : Cursor) return Cursor; + + overriding function Previous + (Object : Iterator; + Position : Cursor) return Cursor; ------------------------------ -- Access to Fields of Node -- @@ -1248,9 +1253,7 @@ package body Ada.Containers.Ordered_Sets is Position := Next (Position); end Next; - function Next (Object : Iterator; Position : Cursor) - return Cursor - is + function Next (Object : Iterator; Position : Cursor) return Cursor is pragma Unreferenced (Object); begin return Next (Position); @@ -1305,13 +1308,12 @@ package body Ada.Containers.Ordered_Sets is Position := Previous (Position); end Previous; - overriding function Previous (Object : Iterator; Position : Cursor) - return Cursor - is + function Previous (Object : Iterator; Position : Cursor) return Cursor is pragma Unreferenced (Object); begin return Previous (Position); end Previous; + ------------------- -- Query_Element -- ------------------- diff --git a/gcc/ada/a-coorse.ads b/gcc/ada/a-coorse.ads index cf52da66a1c..8dc0eda123d 100644 --- a/gcc/ada/a-coorse.ads +++ b/gcc/ada/a-coorse.ads @@ -33,7 +33,8 @@ private with Ada.Containers.Red_Black_Trees; private with Ada.Finalization; -with Ada.Streams; use Ada.Streams; + +with Ada.Streams; use Ada.Streams; with Ada.Iterator_Interfaces; generic @@ -254,10 +255,13 @@ package Ada.Containers.Ordered_Sets is (Container : Set; Process : not null access procedure (Position : Cursor)); - function Iterate (Container : Set) + function Iterate + (Container : Set) return Ordered_Set_Iterator_Interfaces.Reversible_Iterator'class; - function Iterate (Container : Set; Start : Cursor) + function Iterate + (Container : Set; + Start : Cursor) return Ordered_Set_Iterator_Interfaces.Reversible_Iterator'class; generic diff --git a/gcc/ada/aspects.ads b/gcc/ada/aspects.ads index b355cadc17d..ecf74ba4d20 100755 --- a/gcc/ada/aspects.ads +++ b/gcc/ada/aspects.ads @@ -360,7 +360,7 @@ package Aspects is -- empty list or No_List. function Find_Aspect (Ent : Entity_Id; A : Aspect_Id) return Node_Id; - -- Find value of a given aspect from aspect list of entity. + -- Find value of a given aspect from aspect list of entity procedure Move_Aspects (From : Node_Id; To : Node_Id); -- Moves aspects from 'From' node to 'To' node. Has_Aspects (To) must be diff --git a/gcc/ada/sem_ch8.adb b/gcc/ada/sem_ch8.adb index 87d5717f41a..47632f304c9 100644 --- a/gcc/ada/sem_ch8.adb +++ b/gcc/ada/sem_ch8.adb @@ -5141,7 +5141,7 @@ package body Sem_Ch8 is Next_Entity (Id); end loop; - -- If not found, standard error message + -- If not found, standard error message Error_Msg_NE ("& not declared in&", N, Selector); diff --git a/gcc/ada/sem_util.adb b/gcc/ada/sem_util.adb index f6088afc9d6..adbe0ce820a 100644 --- a/gcc/ada/sem_util.adb +++ b/gcc/ada/sem_util.adb @@ -990,17 +990,14 @@ package body Sem_Util is Disc : Entity_Id) is Loc : constant Source_Ptr := Sloc (Expr); - begin Set_Is_Overloaded (Expr, False); Rewrite (Expr, Make_Explicit_Dereference (Loc, Prefix => Make_Selected_Component (Loc, - Prefix => Relocate_Node (Expr), - Selector_Name => - New_Occurrence_Of (Disc, Loc)))); - + Prefix => Relocate_Node (Expr), + Selector_Name => New_Occurrence_Of (Disc, Loc)))); Set_Etype (Prefix (Expr), Etype (Disc)); Set_Etype (Expr, Designated_Type (Etype (Disc))); end Build_Explicit_Dereference; @@ -7178,9 +7175,7 @@ package body Sem_Util is Iface : Entity_Id; begin - if not Is_Tagged_Type (Typ) - or else not Is_Derived_Type (Typ) - then + if not Is_Tagged_Type (Typ) or else not Is_Derived_Type (Typ) then return False; else @@ -7202,45 +7197,7 @@ package body Sem_Util is return False; end if; - end Is_Iterator; - - ---------------------------- - -- Is_Reversible_Iterator -- - ---------------------------- - - function Is_Reversible_Iterator (Typ : Entity_Id) return Boolean is - Ifaces_List : Elist_Id; - Iface_Elmt : Elmt_Id; - Iface : Entity_Id; - - begin - if not Is_Tagged_Type (Typ) - or else not Is_Derived_Type (Typ) - then - return False; - else - - Collect_Interfaces (Typ, Ifaces_List); - - Iface_Elmt := First_Elmt (Ifaces_List); - while Present (Iface_Elmt) loop - Iface := Node (Iface_Elmt); - if Chars (Iface) = Name_Reversible_Iterator - and then - Is_Predefined_File_Name - (Unit_File_Name (Get_Source_Unit (Iface))) - then - return True; - end if; - - Next_Elmt (Iface_Elmt); - end loop; - - end if; - return False; - end Is_Reversible_Iterator; - ------------ -- Is_LHS -- ------------ @@ -7466,15 +7423,15 @@ package body Sem_Util is -- original node is a conversion, then Is_Variable will not be true -- but we still want to allow the conversion if it converts a variable). - -- In Ada2012, the explicit dereference may be a rewritten call - -- to a Reference function. - elsif Original_Node (AV) /= AV then + + -- In Ada2012, the explicit dereference may be a rewritten call to a + -- Reference function. + if Ada_Version >= Ada_2012 and then Nkind (Original_Node (AV)) = N_Function_Call and then - Has_Implicit_Dereference - (Etype (Name (Original_Node (AV)))) + Has_Implicit_Dereference (Etype (Name (Original_Node (AV)))) then return True; @@ -7884,6 +7841,40 @@ package body Sem_Util is return False; end Is_Renamed_Entry; + ---------------------------- + -- Is_Reversible_Iterator -- + ---------------------------- + + function Is_Reversible_Iterator (Typ : Entity_Id) return Boolean is + Ifaces_List : Elist_Id; + Iface_Elmt : Elmt_Id; + Iface : Entity_Id; + + begin + if not Is_Tagged_Type (Typ) or else not Is_Derived_Type (Typ) then + return False; + + else + Collect_Interfaces (Typ, Ifaces_List); + + Iface_Elmt := First_Elmt (Ifaces_List); + while Present (Iface_Elmt) loop + Iface := Node (Iface_Elmt); + if Chars (Iface) = Name_Reversible_Iterator + and then + Is_Predefined_File_Name + (Unit_File_Name (Get_Source_Unit (Iface))) + then + return True; + end if; + + Next_Elmt (Iface_Elmt); + end loop; + end if; + + return False; + end Is_Reversible_Iterator; + ---------------------- -- Is_Selector_Name -- ---------------------- diff --git a/gcc/ada/sem_util.ads b/gcc/ada/sem_util.ads index 89ae19819ae..e9b4f4392c8 100644 --- a/gcc/ada/sem_util.ads +++ b/gcc/ada/sem_util.ads @@ -804,17 +804,15 @@ package Sem_Util is -- by a derived type declaration. function Is_Inherited_Operation_For_Type - (E : Entity_Id; Typ : Entity_Id) return Boolean; + (E : Entity_Id; + Typ : Entity_Id) return Boolean; -- E is a subprogram. Return True is E is an implicit operation inherited -- by the derived type declaration for type Typ. function Is_Iterator (Typ : Entity_Id) return Boolean; - -- AI05-0139-2 : check whether Typ is derived from the predefined interface + -- AI05-0139-2: Check whether Typ is derived from the predefined interface -- Ada.Iterator_Interfaces.Forward_Iterator. - function Is_Reversible_Iterator (Typ : Entity_Id) return Boolean; - -- Ditto for Ada.Iterator_Interfaces.Reversible_Iterator. - function Is_LHS (N : Node_Id) return Boolean; -- Returns True iff N is used as Name in an assignment statement @@ -882,6 +880,10 @@ package Sem_Util is function Is_Renamed_Entry (Proc_Nam : Entity_Id) return Boolean; -- Return True if Proc_Nam is a procedure renaming of an entry + function Is_Reversible_Iterator (Typ : Entity_Id) return Boolean; + -- AI05-0139-2: Check whether Typ is derived from the predefined interface + -- Ada.Iterator_Interfaces.Reversible_Iterator. + function Is_Selector_Name (N : Node_Id) return Boolean; -- Given an N_Identifier node N, determines if it is a Selector_Name. -- As described in Sinfo, Selector_Names are special because they |