summaryrefslogtreecommitdiff
path: root/gcc/ada/a-coorma.ads
diff options
context:
space:
mode:
authorcharlet <charlet@138bc75d-0d04-0410-961f-82ee72b054a4>2015-10-20 10:23:46 +0000
committercharlet <charlet@138bc75d-0d04-0410-961f-82ee72b054a4>2015-10-20 10:23:46 +0000
commitaae9bc79154afb2fc82da451745affd9f0dd1166 (patch)
tree5d28f19aa90d6e4079a4f3107278c6be82f787be /gcc/ada/a-coorma.ads
parenta738763ee9394321fa868afd00cdf04a9a75840f (diff)
downloadgcc-aae9bc79154afb2fc82da451745affd9f0dd1166.tar.gz
2015-10-20 Bob Duff <duff@adacore.com>
* sem_ch13.adb (Analyze_One_Aspect): Avoid analyzing the expression in a 'Disable_Controlled attribute when Expander_Active is False, because otherwise, we get errors about nonstatic expressions in pragma-Preelaborate generic packages. * restrict.ads: minor whitespace cleanup in comment 2015-10-20 Bob Duff <duff@adacore.com> * a-conhel.adb: Remove "use SAC;", because otherwise the compiler complains about use clauses in run-time units. Use "use type" instead. * a-btgbso.adb, a-btgbso.ads, a-cbdlli.adb, a-cbdlli.ads, * a-cbhama.adb, a-cbhama.ads, a-cbhase.adb, a-cbhase.ads, * a-cbmutr.adb, a-cbmutr.ads, a-cborma.adb, a-cborma.ads, * a-cborse.adb, a-cborse.ads, a-cdlili.adb, a-cdlili.ads, * a-chtgbk.adb, a-chtgbk.ads, a-chtgbo.adb, a-chtgbo.ads, * a-chtgke.adb, a-chtgke.ads, a-chtgop.adb, a-chtgop.ads, * a-cidlli.adb, a-cidlli.ads, a-cihama.adb, a-cihama.ads, * a-cihase.adb, a-cihase.ads, a-cimutr.adb, a-cimutr.ads, * a-ciorma.adb, a-ciorma.ads, a-ciormu.adb, a-ciormu.ads, * a-ciorse.adb, a-ciorse.ads, a-cobove.adb, a-cobove.ads, * a-cohama.adb, a-cohama.ads, a-cohase.adb, a-cohase.ads, * a-cohata.ads, a-coinve.adb, a-comutr.adb, a-comutr.ads, * a-convec.adb, a-coorma.adb, a-coorma.ads, a-coormu.adb, * a-coormu.ads, a-coorse.adb, a-coorse.ads, a-crbltr.ads, * a-crbtgk.adb, a-crbtgk.ads, a-crbtgo.adb, a-crbtgo.ads, * a-rbtgbk.adb, a-rbtgbk.ads, a-rbtgbo.adb, a-rbtgbo.ads, * a-rbtgso.adb, a-rbtgso.ads: Change all the predefined containers to share the tampering machinery in Ada.Containers.Helpers. This reduces the amount of duplicated code, and takes advantage of efficiency improvements in Helpers. Protect all run-time checks and supporting machinery with "if Checks" or "if T_Check", so this code can be suppressed with pragma Suppress or -gnatp. Add Pseudo_Reference and Get_Element_Access to remaining containers, so that the compiler can optimize "for ... of" loops. git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@229041 138bc75d-0d04-0410-961f-82ee72b054a4
Diffstat (limited to 'gcc/ada/a-coorma.ads')
-rw-r--r--gcc/ada/a-coorma.ads28
1 files changed, 8 insertions, 20 deletions
diff --git a/gcc/ada/a-coorma.ads b/gcc/ada/a-coorma.ads
index 56a98fbc0e4..56877803187 100644
--- a/gcc/ada/a-coorma.ads
+++ b/gcc/ada/a-coorma.ads
@@ -261,7 +261,7 @@ private
overriding procedure Finalize (Container : in out Map) renames Clear;
use Red_Black_Trees;
- use Tree_Types;
+ use Tree_Types, Tree_Types.Implementation;
use Ada.Finalization;
use Ada.Streams;
@@ -297,16 +297,8 @@ private
for Cursor'Read use Read;
- type Reference_Control_Type is
- new Controlled with record
- Container : Map_Access;
- end record;
-
- overriding procedure Adjust (Control : in out Reference_Control_Type);
- pragma Inline (Adjust);
-
- overriding procedure Finalize (Control : in out Reference_Control_Type);
- pragma Inline (Finalize);
+ subtype Reference_Control_Type is Implementation.Reference_Control_Type;
+ -- It is necessary to rename this here, so that the compiler can find it
type Constant_Reference_Type
(Element : not null access constant Element_Type) is
@@ -364,19 +356,14 @@ private
-- container, and increments the Lock. Finalization of this object will
-- decrement the Lock.
- type Element_Access is access all Element_Type;
+ type Element_Access is access all Element_Type with
+ Storage_Size => 0;
function Get_Element_Access
(Position : Cursor) return not null Element_Access;
-- Returns a pointer to the element designated by Position.
- Empty_Map : constant Map :=
- (Controlled with Tree => (First => null,
- Last => null,
- Root => null,
- Length => 0,
- Busy => 0,
- Lock => 0));
+ Empty_Map : constant Map := (Controlled with others => <>);
No_Element : constant Cursor := Cursor'(null, null);
@@ -385,7 +372,8 @@ private
record
Container : Map_Access;
Node : Node_Access;
- end record;
+ end record
+ with Disable_Controlled => not T_Check;
overriding procedure Finalize (Object : in out Iterator);