diff options
Diffstat (limited to 'gcc/ada/a-coorma.adb')
| -rw-r--r-- | gcc/ada/a-coorma.adb | 90 |
1 files changed, 85 insertions, 5 deletions
diff --git a/gcc/ada/a-coorma.adb b/gcc/ada/a-coorma.adb index c7153c5..0e72d69 100644 --- a/gcc/ada/a-coorma.adb +++ b/gcc/ada/a-coorma.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- -- @@ -252,6 +252,20 @@ package body Ada.Containers.Ordered_Maps is Adjust (Container.Tree); end Adjust; + procedure Adjust (Control : in out Reference_Control_Type) is + begin + if Control.Container /= null then + declare + T : Tree_Type renames Control.Container.all.Tree; + B : Natural renames T.Busy; + L : Natural renames T.Lock; + begin + B := B + 1; + L := L + 1; + end; + end if; + end Adjust; + ------------ -- Assign -- ------------ @@ -340,7 +354,19 @@ package body Ada.Containers.Ordered_Maps is pragma Assert (Vet (Container.Tree, Position.Node), "Position cursor in Constant_Reference is bad"); - return (Element => Position.Node.Element'Access); + declare + T : Tree_Type renames Position.Container.all.Tree; + B : Natural renames T.Busy; + L : Natural renames T.Lock; + begin + return R : constant Constant_Reference_Type := + (Element => Position.Node.Element'Access, + Control => (Controlled with Position.Container)) + do + B := B + 1; + L := L + 1; + end return; + end; end Constant_Reference; function Constant_Reference @@ -354,7 +380,20 @@ package body Ada.Containers.Ordered_Maps is raise Constraint_Error with "key not in map"; end if; - return (Element => Node.Element'Access); + declare + T : Tree_Type renames Container'Unrestricted_Access.all.Tree; + B : Natural renames T.Busy; + L : Natural renames T.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; -------------- @@ -532,6 +571,22 @@ package body Ada.Containers.Ordered_Maps is end if; end Finalize; + procedure Finalize (Control : in out Reference_Control_Type) is + begin + if Control.Container /= null then + declare + T : Tree_Type renames Control.Container.all.Tree; + B : Natural renames T.Busy; + L : Natural renames T.Lock; + begin + B := B - 1; + L := L - 1; + end; + + Control.Container := null; + end if; + end Finalize; + ---------- -- Find -- ---------- @@ -1294,7 +1349,19 @@ package body Ada.Containers.Ordered_Maps is pragma Assert (Vet (Container.Tree, Position.Node), "Position cursor in function Reference is bad"); - return (Element => Position.Node.Element'Access); + declare + T : Tree_Type renames Position.Container.all.Tree; + B : Natural renames T.Busy; + L : Natural renames T.Lock; + begin + return R : constant Reference_Type := + (Element => Position.Node.Element'Access, + Control => (Controlled with Position.Container)) + do + B := B + 1; + L := L + 1; + end return; + end; end Reference; function Reference @@ -1308,7 +1375,20 @@ package body Ada.Containers.Ordered_Maps is raise Constraint_Error with "key not in map"; end if; - return (Element => Node.Element'Access); + declare + T : Tree_Type renames Container'Unrestricted_Access.all.Tree; + B : Natural renames T.Busy; + L : Natural renames T.Lock; + begin + return R : constant Reference_Type := + (Element => Node.Element'Access, + Control => + (Controlled with Container'Unrestricted_Access)) + do + B := B + 1; + L := L + 1; + end return; + end; end Reference; ------------- |
