diff options
author | Justin Squirek <squirek@adacore.com> | 2021-03-29 08:46:02 -0400 |
---|---|---|
committer | Pierre-Marie de Rodat <derodat@adacore.com> | 2021-07-05 13:09:13 +0000 |
commit | bcb8c3bba756feb252340757e0944956684b7cfb (patch) | |
tree | f01d8dbd3bee7d2e95ad86c9dc787cfca8cd5e4a /gcc/ada/restrict.adb | |
parent | 35d721c09a5c8e4fb48d0a7a07da9220915bf0c1 (diff) | |
download | gcc-bcb8c3bba756feb252340757e0944956684b7cfb.zip gcc-bcb8c3bba756feb252340757e0944956684b7cfb.tar.gz gcc-bcb8c3bba756feb252340757e0944956684b7cfb.tar.bz2 |
[Ada] INOX: prototype alternative accessibility model
gcc/ada/
* checks.adb (Accessibility_Checks_Suppressed): Add check
against restriction No_Dynamic_Accessibility_Checks.
(Apply_Accessibility_Check): Add assertion to check restriction
No_Dynamic_Accessibility_Checks is not active.
* debug.adb: Add documentation for new debugging switch to
control which accessibility model gets employed under
restriction No_Dynamic_Accessibility_Checks.
* exp_attr.adb (Expand_N_Attribute_Reference): Disable dynamic
accessibility check generation when
No_Dynamic_Accessibility_Checks is active.
* exp_ch4.adb (Apply_Accessibility_Check): Skip check generation
when restriction No_Dynamic_Accessibility_Checks is active.
(Expand_N_Allocator): Disable dynamic accessibility checks when
No_Dynamic_Accessibility_Checks is active.
(Expand_N_In): Disable dynamic accessibility checks when
No_Dynamic_Accessibility_Checks is active.
(Expand_N_Type_Conversion): Disable dynamic accessibility checks
when No_Dynamic_Accessibility_Checks is active.
* exp_ch5.adb (Expand_N_Assignment_Statement): Disable
alternative accessibility model calculations when computing a
dynamic level for a SAOAAT.
* exp_ch6.adb (Add_Call_By_Copy_Code): Disable dynamic
accessibility check generation when
No_Dynamic_Accessibility_Checks is active.
(Expand_Branch): Disable alternative accessibility model
calculations.
(Expand_Call_Helper): Disable alternative accessibility model
calculations.
* restrict.adb, restrict.ads: Add new restriction
No_Dynamic_Accessibility_Checks.
(No_Dynamic_Accessibility_Checks_Enabled): Created to test when
experimental features (which are generally incompatible with
standard Ada) can be enabled.
* sem_attr.adb (Safe_Value_Conversions): Add handling of new
accessibility model under the restriction
No_Dynamic_Accessibility_Checks.
* sem_prag.adb (Process_Restrictions_Or_Restriction_Warnings):
Disallow new restriction No_Dynamic_Accessibility_Checks from
being exclusively specified within a body or subunit without
being present in a specification.
* sem_res.adb (Check_Fully_Declared_Prefix): Minor comment
fixup.
(Valid_Conversion): Omit implicit conversion checks on anonymous
access types and perform static checking instead when
No_Dynamic_Accessibility_Checks is active.
* sem_util.adb, sem_util.ads (Accessibility_Level): Add special
handling of anonymous access objects, formal parameters,
anonymous access components, and function return objects.
(Deepest_Type_Access_Level): When
No_Dynamic_Accessibility_Checks is active employ an alternative
model. Add paramter Allow_Alt_Model to override the new behavior
in certain cases.
(Type_Access_Level): When No_Dynamic_Accessibility_Checks is
active employ an alternative model. Add parameter
Allow_Alt_Model to override the new behavior in certain cases.
(Typ_Access_Level): Created within Accessibility_Level for
convenience.
* libgnat/s-rident.ads, snames.ads-tmpl: Add handing for
No_Dynamic_Accessibility_Checks.
Diffstat (limited to 'gcc/ada/restrict.adb')
-rw-r--r-- | gcc/ada/restrict.adb | 15 |
1 files changed, 15 insertions, 0 deletions
diff --git a/gcc/ada/restrict.adb b/gcc/ada/restrict.adb index 3592230..4f1dea4 100644 --- a/gcc/ada/restrict.adb +++ b/gcc/ada/restrict.adb @@ -924,6 +924,21 @@ package body Restrict is or else Targparm.Restrictions_On_Target.Set (No_Tasking); end Global_No_Tasking; + --------------------------------------------- + -- No_Dynamic_Accessibility_Checks_Enabled -- + --------------------------------------------- + + function No_Dynamic_Accessibility_Checks_Enabled + (N : Node_Id) return Boolean + is + pragma Unreferenced (N); + -- N is currently unreferenced but present for debugging purposes and + -- potential future use. + + begin + return Restrictions.Set (No_Dynamic_Accessibility_Checks); + end No_Dynamic_Accessibility_Checks_Enabled; + ------------------------------- -- No_Exception_Handlers_Set -- ------------------------------- |