From f8bc3bcb5fee9140c876d89ae2bf298914c01077 Mon Sep 17 00:00:00 2001 From: Hristian Kirtchev Date: Wed, 26 Sep 2018 09:18:02 +0000 Subject: [Ada] New unit GNAT.Sets This patch implements unit GNAT.Sets which currently offers a general purpose membership set. The patch also streamlines GNAT.Dynamic_HTables and GNAT.Lists to use parts of the same API, types, and exceptions as those used by GNAT.Sets. 2018-09-26 Hristian Kirtchev gcc/ada/ * gcc-interface/Make-lang.in: Add unit GNAT.Sets to the list of front end sources. * impunit.adb: Add unit GNAT.Sets to the list of predefined units. * Makefile.rtl: Add unit GNAT.Sets to the list of non-tasking units. * libgnat/g-sets.adb: New unit. * libgnat/g-sets.ads: New unit. * libgnat/g-dynhta.adb (Minimum_Size): Decrease to 8 in order to allow for small sets. Update all occurrences of Table_Locked to Iterated. (Ensure_Unlocked): Query the number of iterators. (Find_Node): Use the supplied equality. (Is_Empty): New routine. (Lock): Update the number of iterators. (Prepend_Or_Replace): Use the supplied equality. (Size): Update the return type. (Unlock): Update the number of iterators. * libgnat/g-dynhta.ads: Update all occurrences of Table_Locked to Iterated. Rename formal subprogram Equivalent_Keys to "=". (Bucket_Range_Type, Pair_Count_Type): Remove types. (Not_Created, Table_Locked, Iterator_Exhausted): Remove exceptions. (Hash_Table): Update to store the number of iterators rather than locks. (Is_Empty): New routine. (Size): Update the return type. * libgnat/g-lists.adb: Update all occurrences of List_Locked to Iterated. (Ensure_Unlocked): Query the number of iterators. (Length): Remove. (Lock): Update the number of iterators. (Size): New routine. (Unlock): Update the number of iterators. * libgnat/g-lists.ads: Update all occurrences of List_Locked to Iterated. (Element_Count_Type): Remove type. (Not_Created, Table_Locked, Iterator_Exhausted): Remove exceptions. (Linked_List): Update type to store the number of iterators rather than locks. (Length): Remove. (Size): New routine. * libgnat/gnat.ads (Bucket_Range_Type): New type. (Iterated, Iterator_Exhausted, and Not_Created): New exceptions. gcc/testsuite/ * gnat.dg/sets1.adb: New testcase. * gnat.dg/dynhash.adb, gnat.dg/linkedlist.adb: Update testcases to new API. From-SVN: r264620 --- gcc/ada/gcc-interface/Make-lang.in | 1 + 1 file changed, 1 insertion(+) (limited to 'gcc/ada/gcc-interface/Make-lang.in') diff --git a/gcc/ada/gcc-interface/Make-lang.in b/gcc/ada/gcc-interface/Make-lang.in index d8dac73..4866c2a 100644 --- a/gcc/ada/gcc-interface/Make-lang.in +++ b/gcc/ada/gcc-interface/Make-lang.in @@ -320,6 +320,7 @@ GNAT_ADA_OBJS = \ ada/libgnat/g-hesora.o \ ada/libgnat/g-htable.o \ ada/libgnat/g-lists.o \ + ada/libgnat/g-sets.o \ ada/libgnat/g-spchge.o \ ada/libgnat/g-speche.o \ ada/libgnat/g-u3spch.o \ -- cgit v1.1