aboutsummaryrefslogtreecommitdiff
path: root/gcc/ada/exp_ch5.adb
diff options
context:
space:
mode:
authorJustin Squirek <squirek@adacore.com>2021-03-29 08:46:02 -0400
committerPierre-Marie de Rodat <derodat@adacore.com>2021-07-05 13:09:13 +0000
commitbcb8c3bba756feb252340757e0944956684b7cfb (patch)
treef01d8dbd3bee7d2e95ad86c9dc787cfca8cd5e4a /gcc/ada/exp_ch5.adb
parent35d721c09a5c8e4fb48d0a7a07da9220915bf0c1 (diff)
downloadgcc-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/exp_ch5.adb')
-rw-r--r--gcc/ada/exp_ch5.adb4
1 files changed, 3 insertions, 1 deletions
diff --git a/gcc/ada/exp_ch5.adb b/gcc/ada/exp_ch5.adb
index 4eba6fb..2cc8b64 100644
--- a/gcc/ada/exp_ch5.adb
+++ b/gcc/ada/exp_ch5.adb
@@ -2771,7 +2771,9 @@ package body Exp_Ch5 is
(Entity (Lhs)), Loc),
Expression =>
Accessibility_Level
- (Rhs, Dynamic_Level));
+ (Expr => Rhs,
+ Level => Dynamic_Level,
+ Allow_Alt_Model => False));
begin
if not Accessibility_Checks_Suppressed (Entity (Lhs)) then