[Ada] Incremental patch for restriction No_Dynamic_Accessibility_Checks
authorJustin Squirek <squirek@adacore.com>
Thu, 3 Jun 2021 21:15:51 +0000 (17:15 -0400)
committerPierre-Marie de Rodat <derodat@adacore.com>
Fri, 9 Jul 2021 12:35:26 +0000 (12:35 +0000)
commit9b1647a50dda833a0640e66bb0bedb6c477b7561
tree5ee5e2dae6d8d1b662e8b47d63606f47a66a78bb
parentd80c73318785edec642b04dfe00db2e61503bf20
[Ada] Incremental patch for restriction No_Dynamic_Accessibility_Checks

gcc/ada/

* sem_util.ads (Type_Access_Level): Add new optional parameter
Assoc_Ent.
* sem_util.adb (Accessibility_Level): Treat access discriminants
the same as components when the restriction
No_Dynamic_Accessibility_Checks is enabled.
(Deepest_Type_Access_Level): Remove exception for
Debug_Flag_Underscore_B when returning the result of
Type_Access_Level in the case where
No_Dynamic_Accessibility_Checks is active.
(Function_Call_Or_Allocator_Level): Correctly calculate the
level of Expr based on its containing subprogram instead of
using Current_Subprogram.
* sem_res.adb (Valid_Conversion): Add actual for new parameter
Assoc_Ent in call to Type_Access_Level, and add test of
No_Dynamic_Accessibility_Checks_Enabled to ensure that static
accessibility checks are performed for all anonymous access type
conversions.
gcc/ada/sem_res.adb
gcc/ada/sem_util.adb
gcc/ada/sem_util.ads