aboutsummaryrefslogtreecommitdiff
path: root/gcc/ada/a-coorse.adb
diff options
context:
space:
mode:
Diffstat (limited to 'gcc/ada/a-coorse.adb')
-rw-r--r--gcc/ada/a-coorse.adb62
1 files changed, 59 insertions, 3 deletions
diff --git a/gcc/ada/a-coorse.adb b/gcc/ada/a-coorse.adb
index 41ebb5c..600403b 100644
--- a/gcc/ada/a-coorse.adb
+++ b/gcc/ada/a-coorse.adb
@@ -6,7 +6,7 @@
-- --
-- B o d y --
-- --
--- Copyright (C) 2004-2011, Free Software Foundation, Inc. --
+-- Copyright (C) 2004-2012, 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- --
@@ -285,6 +285,20 @@ package body Ada.Containers.Ordered_Sets is
Adjust (Container.Tree);
end Adjust;
+ procedure Adjust (Control : in out Reference_Control_Type) is
+ begin
+ if Control.Container /= null then
+ declare
+ Tree : Tree_Type renames Control.Container.all.Tree;
+ B : Natural renames Tree.Busy;
+ L : Natural renames Tree.Lock;
+ begin
+ B := B + 1;
+ L := L + 1;
+ end;
+ end if;
+ end Adjust;
+
------------
-- Assign --
------------
@@ -353,7 +367,20 @@ package body Ada.Containers.Ordered_Sets is
(Vet (Container.Tree, Position.Node),
"bad cursor in Constant_Reference");
- return (Element => Position.Node.Element'Access);
+ declare
+ Tree : Tree_Type renames Position.Container.all.Tree;
+ B : Natural renames Tree.Busy;
+ L : Natural renames Tree.Lock;
+ begin
+ return R : constant Constant_Reference_Type :=
+ (Element => Position.Node.Element'Access,
+ Control =>
+ (Controlled with Container'Unrestricted_Access))
+ do
+ B := B + 1;
+ L := L + 1;
+ end return;
+ end;
end Constant_Reference;
--------------
@@ -554,6 +581,22 @@ package body Ada.Containers.Ordered_Sets is
end if;
end Finalize;
+ procedure Finalize (Control : in out Reference_Control_Type) is
+ begin
+ if Control.Container /= null then
+ declare
+ Tree : Tree_Type renames Control.Container.all.Tree;
+ B : Natural renames Tree.Busy;
+ L : Natural renames Tree.Lock;
+ begin
+ B := B - 1;
+ L := L - 1;
+ end;
+
+ Control.Container := null;
+ end if;
+ end Finalize;
+
----------
-- Find --
----------
@@ -699,7 +742,20 @@ package body Ada.Containers.Ordered_Sets is
raise Constraint_Error with "key not in set";
end if;
- return (Element => Node.Element'Access);
+ declare
+ Tree : Tree_Type renames Container'Unrestricted_Access.all.Tree;
+ B : Natural renames Tree.Busy;
+ L : Natural renames Tree.Lock;
+ begin
+ return R : constant Constant_Reference_Type :=
+ (Element => Node.Element'Access,
+ Control =>
+ (Controlled with Container'Unrestricted_Access))
+ do
+ B := B + 1;
+ L := L + 1;
+ end return;
+ end;
end Constant_Reference;
--------------