]> git.ipfire.org Git - thirdparty/gcc.git/commit
ada: Rewrite generic formal/actual matching
authorBob Duff <duff@adacore.com>
Tue, 28 May 2024 16:19:51 +0000 (12:19 -0400)
committerMarc Poulhiès <poulhies@adacore.com>
Thu, 20 Jun 2024 08:50:57 +0000 (10:50 +0200)
commita688a0281946b1cc11333ca548db031a9aa0e9fd
tree7ecfcacc8b3f13223d48088dd7b4bd26589eebf7
parent36bd57330f9b8f06206c909af53cd8b3ca6f6bed
ada: Rewrite generic formal/actual matching

...in preparation for implementing type inference for generic
parameters.

The main change is to do the "matching" computation early, and produce a
*constant* data structure (Gen_Assocs_Rec) to represent the matching
between each triple of unanalyzed formal, analyzed formal, and
corresponding actual. This will allow us to look at that data structure
more than once, which will be necessary for type inference.
Matching_Actual is removed; Match_Assocs is added.

Other changes include removal of global variables, splitting out
processing into subprograms, adding assertions, comment corrections,
and other general cleanups.

gcc/ada/

* expander.ads: Minor comment fixes.
* nlists.ads: Misc comment improvements.
* sem_aux.ads (First_Discriminant): Improve comment.
* sem_ch12.adb: Misc cleanups.
(Associations): New package containing type Gen_Assocs_Rec
to represent matchings, and function Match_Assocs to create the
Gen_Assocs_Rec constant.
(Analyze_Associations): Call Match_Assocs, and other major
changes related to that.
* sem_ch12.ads: Minor comment fixes.
* sem_ch3.adb: Minor comment fixes.
gcc/ada/expander.ads
gcc/ada/nlists.ads
gcc/ada/sem_aux.ads
gcc/ada/sem_ch12.adb
gcc/ada/sem_ch12.ads
gcc/ada/sem_ch3.adb