aboutsummaryrefslogtreecommitdiff
path: root/gcc/ada/gcc-interface
diff options
context:
space:
mode:
authorEric Botcazou <ebotcazou@adacore.com>2018-09-26 09:17:36 +0000
committerPierre-Marie de Rodat <pmderodat@gcc.gnu.org>2018-09-26 09:17:36 +0000
commit56c3e620aa79524033973d09f44cf587c2038198 (patch)
tree06ad6a863eb3475eb4ecf7f60ebe80b5ad62cdf9 /gcc/ada/gcc-interface
parentd58008d23d073916471ca95587b5fcd090675243 (diff)
downloadgcc-56c3e620aa79524033973d09f44cf587c2038198.zip
gcc-56c3e620aa79524033973d09f44cf587c2038198.tar.gz
gcc-56c3e620aa79524033973d09f44cf587c2038198.tar.bz2
[Ada] Inlining of renamed subprogram instances in package body
This fixes a small discrepancy in the handling of renamed subprograms declared in a package body, between those originally a regular subprogram and those an instance of a generic subprogram, the latter being slightly hindered. The difference comes from the setting of the Is_Public flag, which was more conservative in the latter case because instantiations of generic subprograms are done in compiler-generated local packages. It is eliminated by allowing Has_Referencer to recurse into nested packages, but only if they are themselves not instances of generic packages. The compiler must now fully inline Doit_I into Doit at -O2 in: package P is generic procedure Doit_G; procedure Doit; end P; package body P is N : Natural := 0; procedure Doit_G is begin N := 1; end Doit_G; procedure Doit_I is new Doit_G; procedure Doit renames Doit_I; end P; 2018-09-26 Eric Botcazou <ebotcazou@adacore.com> gcc/ada/ * sem_ch7.adb (Has_Referencer): Remove Top_Level parameter and add In_Nested_Instance and Has_Outer_Referencer_Of_Non_Subprograms parameters. Rename Has_Non_Subprograms_Referencer variable into Has_Referencer_Of_Non_Subprograms and initialize it with the new third parameter. Adjust recursive calls and to the renaming. Replace test on Top_Level with test on In_Nested_Instance to decide whether to clear the Is_Public flag on entities. (Hide_Public_Entities): Adjust call to Has_Referencer. From-SVN: r264615
Diffstat (limited to 'gcc/ada/gcc-interface')
0 files changed, 0 insertions, 0 deletions