[Ada] Ada_2020: contracts for formal subprograms
authorEd Schonberg <schonberg@adacore.com>
Fri, 24 Jan 2020 19:14:14 +0000 (14:14 -0500)
committerPierre-Marie de Rodat <derodat@adacore.com>
Thu, 4 Jun 2020 09:11:18 +0000 (05:11 -0400)
commit9531ffdaafe38f8cf07481430daba035e855bdf4
tree0ff699ce35670ed1cf4cda30af6def5effae4c22
parent25a76d621a4b6e324777677c8a5a81c09da2db9d
[Ada] Ada_2020: contracts for formal subprograms

2020-06-04  Ed Schonberg  <schonberg@adacore.com>

gcc/ada/

* sem_ch12.adb (Build_Suprogram_Body_Wrapper,
Build_Subprogram_Decl_Wrapper): New suprograms, to create the
wrappers needed to implement contracts on formsl subprograms at
the point of instantiation.
(Build_Subprogram_Wrappers): New subprogram within
Analyze_Associations, calls the above when the formal subprogram
has contracts, and expansion is enabled.
(Instantiate_Formal_Subprogram): If the actual is not an entity,
such as a function attribute, or a synchronized operation,
create a function with an internal name and call it within the
wrapper.
(Analyze_Generic_Formal_Part): Analyze contracts at the end of
the list of formal declarations.
* sem_prag.adb (Analyze_Pre_Post_Condtion): In Ada_2020 the
aspect and corresponding pragma can appear on a formal
subprogram declaration.
(Find_Related_Declaration_Or_Body): Ditto.
gcc/ada/sem_ch12.adb
gcc/ada/sem_prag.adb