summaryrefslogtreecommitdiffstats
path: root/gcc/ada/a-cihama.adb
diff options
context:
space:
mode:
authorcharlet <charlet@138bc75d-0d04-0410-961f-82ee72b054a4>2011-11-23 11:24:48 +0000
committercharlet <charlet@138bc75d-0d04-0410-961f-82ee72b054a4>2011-11-23 11:24:48 +0000
commit96af89e481ae79d5137f7ce9bd714cc196459fa3 (patch)
tree3801b3b0ce11d58d1c4a23076336e38db3baa05d /gcc/ada/a-cihama.adb
parent0148118ba5fa019083e00017d0de0d1ec230450b (diff)
downloadppe42-gcc-96af89e481ae79d5137f7ce9bd714cc196459fa3.tar.gz
ppe42-gcc-96af89e481ae79d5137f7ce9bd714cc196459fa3.zip
2011-11-23 Robert Dewar <dewar@adacore.com>
* sem_ch9.adb (Analyze_Entry_Declaration): Check for entry family bounds out of range. 2011-11-23 Matthew Heaney <heaney@adacore.com> * a-cohama.adb, a-cihama.adb, a-cbhama.adb (Iterator): Declare type as limited, and remove node component. (First, Next): Forward call to corresponding cursor-based operation. (Iterate): Representation of iterator no longer has node component. 2011-11-23 Yannick Moy <moy@adacore.com> * exp_util.adb: Revert previous change to remove side-effects in Alfa mode, which is not the correct thing to do for renamings. 2011-11-23 Thomas Quinot <quinot@adacore.com> * s-osinte-hpux.ads, s-taprop-vxworks.adb, s-taprop-tru64.adb, s-osinte-vxworks.ads, s-osinte-aix.ads, s-osinte-lynxos.ads, s-osinte-solaris-posix.ads, s-taprop-solaris.adb, a-exetim-posix.adb, s-osinte-irix.ads, s-osinte-solaris.ads, s-oscons-tmplt.c, s-taprop-irix.adb, s-osinte-hpux-dce.ads, Makefile.rtl, s-osinte-tru64.ads, s-osinte-darwin.ads, s-taprop.ads, s-osinte-freebsd.ads, s-osinte-lynxos-3.ads, s-taprop-hpux-dce.adb, s-taprop-posix.adb: Remove hard-coded clock ids; instead, generate them in System.OS_Constants. (System.OS_Constants.CLOCK_RT_Ada): New constant denoting the id of the clock providing Ada.Real_Time.Monotonic_Clock. * thread.c: New file. (__gnat_pthread_condattr_setup): New function. For platforms where CLOCK_RT_Ada is not CLOCK_REALTIME, set appropriate condition variable attribute. 2011-11-23 Yannick Moy <moy@adacore.com> * sem_ch3.adb: Restore the use of Expander_Active instead of Full_Expander_Active, so that the evaluation is forced in Alfa mode too. Otherwise, we end up with an unexpected insertion in a place where it is not supposed to happen, on default parameters of a call. 2011-11-23 Thomas Quinot <quinot@adacore.com> * prj-pp.adb, prj-pp.ads: Minor new addition: wrapper procedure "wpr" for Pretty_Print, for use from within gdb. git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@181660 138bc75d-0d04-0410-961f-82ee72b054a4
Diffstat (limited to 'gcc/ada/a-cihama.adb')
-rw-r--r--gcc/ada/a-cihama.adb30
1 files changed, 13 insertions, 17 deletions
diff --git a/gcc/ada/a-cihama.adb b/gcc/ada/a-cihama.adb
index b90c5426481..84bbdfdf327 100644
--- a/gcc/ada/a-cihama.adb
+++ b/gcc/ada/a-cihama.adb
@@ -45,10 +45,9 @@ package body Ada.Containers.Indefinite_Hashed_Maps is
procedure Free_Element is
new Ada.Unchecked_Deallocation (Element_Type, Element_Access);
- type Iterator is new
+ type Iterator is limited new
Map_Iterator_Interfaces.Forward_Iterator with record
Container : Map_Access;
- Node : Node_Access;
end record;
overriding function First (Object : Iterator) return Cursor;
@@ -476,14 +475,8 @@ package body Ada.Containers.Indefinite_Hashed_Maps is
end First;
function First (Object : Iterator) return Cursor is
- M : constant Map_Access := Object.Container;
- N : constant Node_Access := HT_Ops.First (M.HT);
begin
- if N = null then
- return No_Element;
- else
- return Cursor'(Object.Container.all'Unchecked_Access, N);
- end if;
+ return Object.Container.First;
end First;
----------
@@ -715,13 +708,11 @@ package body Ada.Containers.Indefinite_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);
begin
- return It;
+ return Iterator'(Container => Container'Unrestricted_Access);
end Iterate;
---------
@@ -809,11 +800,16 @@ package body Ada.Containers.Indefinite_Hashed_Maps is
function Next (Object : Iterator; Position : Cursor) return Cursor is
begin
- if Position.Node = null then
+ if Position.Container = null then
return No_Element;
- else
- return (Object.Container, Next (Position).Node);
end if;
+
+ if Position.Container /= Object.Container then
+ raise Program_Error with
+ "Position cursor of Next designates wrong map";
+ end if;
+
+ return Next (Position);
end Next;
-------------------
OpenPOWER on IntegriCloud