ada: Only build access-to-subprogram wrappers when expander is active
commit3fd3d3d0fa094c5d79c2e4e3c44cdd22b42d6ca4
authorPiotr Trojanek <trojanek@adacore.com>
Tue, 11 Apr 2023 22:19:23 +0000 (12 00:19 +0200)
committerMarc Poulhiès <poulhies@adacore.com>
Tue, 30 May 2023 07:12:16 +0000 (30 09:12 +0200)
tree9af65cfc0b36b77e31131bf9c7bcab5b0e9f0ade
parent35875281d9f3f783864f96baf71a279fc657238d
ada: Only build access-to-subprogram wrappers when expander is active

For access-to-subprogram types with Pre/Post aspects we create a wrapper
routine that evaluates these aspects. Spec of this wrapper was created
always, while its body was only created when expansion was enabled.

Now we only create these wrappers when expansion is enabled. In
particular, we don't create them in GNATprove mode; instead, GNATprove
picks the Pre/Post expressions directly from the aspects.

gcc/ada/

* exp_ch3.adb
(Build_Access_Subprogram_Wrapper_Body): Build wrapper body if requested
by routine that builds wrapper spec.
* sem_ch3.adb
(Analyze_Full_Type_Declaration): Only build wrapper when expander is
active.
(Build_Access_Subprogram_Wrapper):
Remove special-case for GNATprove.
gcc/ada/exp_ch3.adb
gcc/ada/sem_ch3.adb