Formal hashed sets and maps are now using a different type of hash table that does not require controlled types. This is possible because formal containers do not rely on tampering checks, as cursors do not hold a pointer to a single matching container, but are logical indexes that can be used with multiple containers.
For simplicity of the package organisation, and symmetry with other versions of containers, add a formal version of hashed types in the shared Ada.Containers.Hash_Tables unit. This unit should be specialized to only include the formal version of hash tables for runtimes that do not support controlled types (so that the dependency on Ada.Containers.Helpers can be removed). The new versions of units for generic keys and operations are modified versions of the units for bounded containers, with all tampering checks removed (they were no-op in formal containers). A declaration of constant Checks is added at the start of the body, as these units cannot use the version in Ada.Containers.Helpers. Tested on x86_64-pc-linux-gnu, committed on trunk gcc/ada/ * Makefile.rtl: Add new files. * libgnat/a-cfhama.adb: Use formal version of hash tables. * libgnat/a-cfhama.ads: Same. * libgnat/a-cfhase.adb: Same. * libgnat/a-cfhase.ads: Same. * libgnat/a-chtgfk.adb: New unit for formal containers, modified version of Generic_Bounded_Keys. * libgnat/a-chtgfk.ads: Same. * libgnat/a-chtgfo.adb: New unit for formal containers, modified version of Generic_Bounded_Operations. * libgnat/a-chtgfo.ads: Same. * libgnat/a-cohata.ads (Generic_Formal_Hash_Table_Types): Third version of the type for hash tables, equivalent to the bounded version without tampering checks.
patch.diff.gz
Description: application/gzip