diff options
author | Arnaud Charlet <charlet@gcc.gnu.org> | 2011-09-19 11:03:03 +0200 |
---|---|---|
committer | Arnaud Charlet <charlet@gcc.gnu.org> | 2011-09-19 11:03:03 +0200 |
commit | a3068ca6e7d3cb9e7bf5db0279ad6ca814bd6e28 (patch) | |
tree | b33e70843b45fbf14c84216c61cb9b7028bbef0a /gcc/ada/a-cimutr.ads | |
parent | e7fceebce65739f184ad8e090d0fac712336df34 (diff) | |
download | gcc-a3068ca6e7d3cb9e7bf5db0279ad6ca814bd6e28.zip gcc-a3068ca6e7d3cb9e7bf5db0279ad6ca814bd6e28.tar.gz gcc-a3068ca6e7d3cb9e7bf5db0279ad6ca814bd6e28.tar.bz2 |
[multiple changes]
2011-09-19 Steve Baird <baird@adacore.com>
* snames.ads-tmpl: Move declaration of Name_Annotate into range of
configuration pragma names so that Is_Configuration_Pragma_Name
will return True for Name_Annotate. Make corresponding change in
Pragma_Id enumeration type. This is needed to allow an Annotate
pragma to occur in a configuration pragma file (typically,
a gnat.adc file).
* gnat_ugn.texi: Add Annotate to the list of configuration pragmas.
* gnat_rm.texi: Note that pragma Annotate may be used as a
configuration pragma.
2011-09-19 Ed Schonberg <schonberg@adacore.com>
* a-cbmutr.adb, a-cbmutr.ads, a-cimutr.adb, a-cimutr.ads,
a-comutr.adb, a-comutr.ads: Add iterator machinery for multiway trees.
2011-09-19 Yannick Moy <moy@adacore.com>
* exp_alfa.adb, exp_alfa.ads (Expand_Alfa_N_In): New function
for expansion of set membership.
(Expand_Alfa): Call expansion for N_In and N_Not_In nodes.
* exp_ch4.adb, exp_ch4.ads (Expand_Set_Membership): Make procedure
visible for use in Alfa expansion.
* sem_ch5.adb (Analyze_Iterator_Specification): Introduce loop
variable in Alfa mode.
2011-09-19 Thomas Quinot <quinot@adacore.com>
* s-osinte-darwin.ads: Change SIGADAABRT on Darwin to SIGABRT.
2011-09-19 Thomas Quinot <quinot@adacore.com>
* exp_ch9.adb: Minor reformatting.
2011-09-19 Hristian Kirtchev <kirtchev@adacore.com>
* freeze.adb (Build_Renamed_Body): Generic subprograms
instantiations cannot be poperly inlined by the compiler, do
not set the Body_To_Inline attribute in such cases.
* sem_ch12.adb (Analyze_Subprogram_Instantiation): Inherit all
inlining-related flags from the generic subprogram declaration.
2011-09-19 Thomas Quinot <quinot@adacore.com>
* exp_dist.adb, rtsfind.ads, sem_util.adb, sem_util.ads
(Build_Stub_Type): Remove, instead copy components from
System.Partition_Interface.RACW_Stub_Type.
(RPC_Receiver_Decl): Remainder of code from old Build_Stub_Type routine.
(Copy_Component_List): New subprogram.
2011-09-19 Yannick Moy <moy@adacore.com>
* lib-xref.adb (Generate_Reference): Ignore references to
constants in Standard.
From-SVN: r178962
Diffstat (limited to 'gcc/ada/a-cimutr.ads')
-rw-r--r-- | gcc/ada/a-cimutr.ads | 68 |
1 files changed, 65 insertions, 3 deletions
diff --git a/gcc/ada/a-cimutr.ads b/gcc/ada/a-cimutr.ads index 9f3b5d7..c47f986 100644 --- a/gcc/ada/a-cimutr.ads +++ b/gcc/ada/a-cimutr.ads @@ -31,6 +31,7 @@ -- This unit was originally developed by Matthew J Heaney. -- ------------------------------------------------------------------------------ +with Ada.Iterator_Interfaces; private with Ada.Finalization; private with Ada.Streams; @@ -43,7 +44,12 @@ package Ada.Containers.Indefinite_Multiway_Trees is pragma Preelaborate; pragma Remote_Types; - type Tree is tagged private; + type Tree is tagged private + with Constant_Indexing => Constant_Reference, + Variable_Indexing => Reference, + Default_Iterator => Iterate, + Iterator_Element => Element_Type; + pragma Preelaborable_Initialization (Tree); type Cursor is private; @@ -52,6 +58,10 @@ package Ada.Containers.Indefinite_Multiway_Trees is Empty_Tree : constant Tree; No_Element : constant Cursor; + function Has_Element (Position : Cursor) return Boolean; + + package Tree_Iterator_Interfaces is new + Ada.Iterator_Interfaces (Cursor, Has_Element); function Equal_Subtree (Left_Position : Cursor; @@ -91,6 +101,14 @@ package Ada.Containers.Indefinite_Multiway_Trees is Position : Cursor; Process : not null access procedure (Element : in out Element_Type)); + type Constant_Reference_Type + (Element : not null access constant Element_Type) is private + with Implicit_Dereference => Element; + + type Reference_Type + (Element : not null access Element_Type) is private + with Implicit_Dereference => Element; + procedure Assign (Target : in out Tree; Source : Tree); function Copy (Source : Tree) return Tree; @@ -149,8 +167,6 @@ package Ada.Containers.Indefinite_Multiway_Trees is (Container : Tree; Item : Element_Type) return Boolean; - function Has_Element (Position : Cursor) return Boolean; - procedure Iterate (Container : Tree; Process : not null access procedure (Position : Cursor)); @@ -159,6 +175,12 @@ package Ada.Containers.Indefinite_Multiway_Trees is (Position : Cursor; Process : not null access procedure (Position : Cursor)); + function Iterate (Container : Tree) + return Tree_Iterator_Interfaces.Forward_Iterator'Class; + + function Iterate_Subtree (Position : Cursor) + return Tree_Iterator_Interfaces.Forward_Iterator'Class; + function Child_Count (Parent : Cursor) return Count_Type; function Child_Depth (Parent, Child : Cursor) return Count_Type; @@ -343,6 +365,46 @@ private for Cursor'Read use Read; + type Constant_Reference_Type + (Element : not null access constant Element_Type) is null record; + + procedure Read + (Stream : not null access Root_Stream_Type'Class; + Item : out Constant_Reference_Type); + + for Constant_Reference_Type'Read use Read; + + procedure Write + (Stream : not null access Root_Stream_Type'Class; + Item : Constant_Reference_Type); + + for Constant_Reference_Type'Write use Write; + + type Reference_Type + (Element : not null access Element_Type) is null record; + + procedure Read + (Stream : not null access Root_Stream_Type'Class; + Item : out Reference_Type); + + for Reference_Type'Read use Read; + + procedure Write + (Stream : not null access Root_Stream_Type'Class; + Item : Reference_Type); + + for Reference_Type'Write use Write; + + function Constant_Reference + (Container : aliased Tree; + Position : Cursor) + return Constant_Reference_Type; + + function Reference + (Container : aliased Tree; + Position : Cursor) + return Reference_Type; + Empty_Tree : constant Tree := (Controlled with others => <>); No_Element : constant Cursor := (others => <>); |