[Ada] Fix handling of subprograms declared in a protected body
authorArnaud Charlet <charlet@adacore.com>
Tue, 24 Mar 2020 08:40:18 +0000 (04:40 -0400)
committerPierre-Marie de Rodat <derodat@adacore.com>
Fri, 12 Jun 2020 08:29:24 +0000 (04:29 -0400)
commit842d28d2acba14a4ebe53f80a35bf1096a1c223e
tree647a2c558f240596d4f385e57faec866e43468f2
parent3ca9a460f02fc538d314682f456bf3519f311f97
[Ada] Fix handling of subprograms declared in a protected body

2020-06-12  Arnaud Charlet  <charlet@adacore.com>

gcc/ada/

* exp_ch6.adb (Expand_N_Subprogram_Declaration): Do nothing for
a subprogram declared in a protected body.
* exp_ch9.ads, exp_ch9.adb
(Build_Private_Protected_Declaration): Moved to sem_ch6.adb.
(Expand_N_Protected_Body): Do nothing for a subprogram declared
in a protected body.
* sem_ch6.adb (Build_Internal_Protected_Declaration): Moved from
exp_ch9.adb and renamed and fixed to ensure in particular that
such subprograms have convention Intrinsic and have no protected
version.
(Analyze_Subprogram_Body_Helper): Call
Build_Internal_Protected_Declaration.
(Move_Pragmas): Moved up and merged with the more general
version from Build_Private_Protected_Declaration. We only want
to copy selected pragmas, most pragmas are not suitable for a
copy on the spec.
gcc/ada/exp_ch6.adb
gcc/ada/exp_ch9.adb
gcc/ada/exp_ch9.ads
gcc/ada/sem_ch6.adb