public inbox for gcc-patches@gcc.gnu.org
 help / color / mirror / Atom feed
* [Ada] Remove dependency on tampering checks and controlled types for formal
@ 2022-05-13  8:07 Pierre-Marie de Rodat
  0 siblings, 0 replies; only message in thread
From: Pierre-Marie de Rodat @ 2022-05-13  8:07 UTC (permalink / raw)
  To: gcc-patches; +Cc: Yannick Moy

[-- Attachment #1: Type: text/plain, Size: 1700 bytes --]

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.

[-- Attachment #2: patch.diff.gz --]
[-- Type: application/gzip, Size: 8600 bytes --]

^ permalink raw reply	[flat|nested] only message in thread

only message in thread, other threads:[~2022-05-13  8:07 UTC | newest]

Thread overview: (only message) (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2022-05-13  8:07 [Ada] Remove dependency on tampering checks and controlled types for formal Pierre-Marie de Rodat

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).