]> git.ipfire.org Git - thirdparty/gcc.git/commit
ada: List subprogram body entities in scopes
authorYannick Moy <moy@adacore.com>
Fri, 26 Apr 2024 15:08:08 +0000 (17:08 +0200)
committerMarc Poulhiès <poulhies@adacore.com>
Thu, 13 Jun 2024 13:30:32 +0000 (15:30 +0200)
commit047135cfed8c4c3950bda207dc87d33ca4c154ea
treed430cc7171d8bb1b82e27e82c95f2c0953e75cde
parent5c45881bf57fa1ae593b5cab8f4db67506470ff9
ada: List subprogram body entities in scopes

Add entities of kind E_Subprogram_Body to the list of entities associated
to a given scope. This ensures that representation information is
correctly output for object and type declarations inside these subprogram
bodies. This is useful for outputing that information fron the compiler
with the switch -gnatR, as well as for getting precise representation
information inside GNATprove.

Remove ad-hoc code inside repinfo.adb that retrieved this information
in only some cases.

gcc/ada/

* exp_ch5.adb (Expand_Iterator_Loop_Over_Container): Skip entities
of kind E_Subprogram_Body.
* repinfo.adb (List_Entities): Remove special case for subprogram
bodies.
* sem_ch6.adb (Analyze_Subprogram_Body_Helper): List subprogram
body entities in the enclosing scope.
gcc/ada/exp_ch5.adb
gcc/ada/repinfo.adb
gcc/ada/sem_ch6.adb