[Ada] Improve unnesting of indexed references
authorRichard Kenner <kenner@vlsi1.ultra.nyu.edu>
Mon, 28 May 2018 08:54:27 +0000 (08:54 +0000)
committerPierre-Marie de Rodat <pmderodat@gcc.gnu.org>
Mon, 28 May 2018 08:54:27 +0000 (08:54 +0000)
commit577ad216dc16802d1eeed14a3948ed3bacac30e6
tree6d5a40cffe1e6ce5376eb610a9ca8b861e9f2ce8
parent1541ede1e18b72f77b84fdef0478e97684d14cf1
[Ada] Improve unnesting of indexed references

2018-05-28  Richard Kenner  <kenner@vlsi1.ultra.nyu.edu>

gcc/ada/

* exp_unst.adb (Check_Static_Type): Add argument to indicate node to be
replaced, if any; all callers changed.
(Note_Uplevel_Ref): Likewise.  Also replace reference to deferred
constant with private view so we take the address of that entity.
(Note_Uplevel_Bound): Add argument to indicate node to be replaced, if
any; all callers changed.  Handle N_Indexed_Component like
N_Attribute_Reference.  Add N_Type_Conversion case.
(Visit_Node): Indexed references can be uplevel if the type isn't
static.
(Unnest_Subprograms): Don't rewrite if no reference given.  If call has
been relocated, set first_named pointer in original node as well.

From-SVN: r260830
gcc/ada/ChangeLog
gcc/ada/exp_unst.adb