[Ada] Further cleanup in inlining machinery
authorEric Botcazou <ebotcazou@adacore.com>
Mon, 19 Aug 2019 08:35:31 +0000 (08:35 +0000)
committerPierre-Marie de Rodat <pmderodat@gcc.gnu.org>
Mon, 19 Aug 2019 08:35:31 +0000 (08:35 +0000)
commita4bbe10deb69d4885baffde7fa42c0ba137e7dc8
tree9676dddec5b7540cc78fa28fecea9e361005fde2
parent04d933fd48d7e7cbedb761d660229cac9f36fab2
[Ada] Further cleanup in inlining machinery

This gets rid of a small issue in the inlining machinery: under very
peculiar circumstances, it would add a pending instantiation for the
body of a generic package at the point of call to an inlined subprogram
of the instance.  That's theoritically problematic because the saved
context is that of the call and not that of the instance in this case,
although the strict conditions ensure that this doesn't make a real
difference in practice.

Now that the machinery can perform the pending instantiations on demand,
we can optimistically add more of them when the instantiations are
analyzed and thus remove the problematic handling at the point of call.

No functional changes.

2019-08-19  Eric Botcazou  <ebotcazou@adacore.com>

gcc/ada/

* inline.adb (Add_Inlined_Body): Do not add pending
instantiations.
* sem_ch12.adb (Needs_Body_Instantiated): New predicate.
(Analyze_Package_Instantiation): Use it to decide whether to add
a pending instantiation for the body of the package.

From-SVN: r274639
gcc/ada/ChangeLog
gcc/ada/inline.adb
gcc/ada/sem_ch12.adb