diff options
author | charlet <charlet@138bc75d-0d04-0410-961f-82ee72b054a4> | 2011-08-29 14:40:11 +0000 |
---|---|---|
committer | charlet <charlet@138bc75d-0d04-0410-961f-82ee72b054a4> | 2011-08-29 14:40:11 +0000 |
commit | 625b8e97f6f97078299969fab004d540a021716a (patch) | |
tree | e32b257f259965d95e0d8e66ce84cc867c98918a /gcc/ada/a-coorse.adb | |
parent | c0e6b3d6a2bdf050cb8489c14551bf9c5ec89f41 (diff) | |
download | gcc-625b8e97f6f97078299969fab004d540a021716a.tar.gz |
2011-08-29 Robert Dewar <dewar@adacore.com>
* sem_ch10.adb, a-coorse.adb, exp_dist.adb, exp_ch3.adb: Minor
reformatting.
* gcc-interface/Make-lang.in: Update dependencies.
2011-08-29 Yannick Moy <moy@adacore.com>
* alfa.ads (Name_Of_Heap_Variable): New constant name.
* lib-xref-alfa.adb, lib-xref.adb, lib-xref.ads (Drefs): New global
table to hold dereferences.
(Add_ALFA_Xrefs): Take into account dereferences as special
reads/writes to the variable "HEAP".
(Enclosing_Subprogram_Or_Package): Move subprogram here.
(Generate_Dereference): New procedure to store a read/write dereferencew
in the table Drefs.
* put_alfa.adb (Put_ALFA): Use different default than (0,0) used for
the special "HEAP" var.
* sem_ch4.adb (Analyze_Explicit_Dereference): Store read dereference
in ALFA mode.
* sem_util.adb (Note_Possible_Modification): Store write dereference
in ALFA mode.
git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@178252 138bc75d-0d04-0410-961f-82ee72b054a4
Diffstat (limited to 'gcc/ada/a-coorse.adb')
-rw-r--r-- | gcc/ada/a-coorse.adb | 27 |
1 files changed, 14 insertions, 13 deletions
diff --git a/gcc/ada/a-coorse.adb b/gcc/ada/a-coorse.adb index 668bd739e84..7465f930b1f 100644 --- a/gcc/ada/a-coorse.adb +++ b/gcc/ada/a-coorse.adb @@ -535,9 +535,10 @@ package body Ada.Containers.Ordered_Sets is if Object.Container = null then return No_Element; else - return Cursor'( - Object.Container.all'Unrestricted_Access, - Object.Container.Tree.First); + return + Cursor'( + Object.Container.all'Unrestricted_Access, + Object.Container.Tree.First); end if; end First; @@ -1171,19 +1172,20 @@ package body Ada.Containers.Ordered_Sets is begin if Container.Tree.Last = null then return No_Element; + else + return Cursor'(Container'Unrestricted_Access, Container.Tree.Last); end if; - - return Cursor'(Container'Unrestricted_Access, Container.Tree.Last); end Last; function Last (Object : Iterator) return Cursor is begin if Object.Container = null then return No_Element; + else + return Cursor'( + Object.Container.all'Unrestricted_Access, + Object.Container.Tree.Last); end if; - - return Cursor'( - Object.Container.all'Unrestricted_Access, Object.Container.Tree.Last); end Last; ------------------ @@ -1194,9 +1196,9 @@ package body Ada.Containers.Ordered_Sets is begin if Container.Tree.Last = null then raise Constraint_Error with "set is empty"; + else + return Container.Tree.Last.Element; end if; - - return Container.Tree.Last.Element; end Last_Element; ---------- @@ -1300,13 +1302,12 @@ package body Ada.Containers.Ordered_Sets is declare Node : constant Node_Access := Tree_Operations.Previous (Position.Node); - begin if Node = null then return No_Element; + else + return Cursor'(Position.Container, Node); end if; - - return Cursor'(Position.Container, Node); end; end Previous; |