]> gcc.gnu.org Git - gcc.git/commit - gcc/ada/gcc-interface/decl.cc
gigi.h (gnat_stabilize_reference): Adjust.
authorEric Botcazou <ebotcazou@adacore.com>
Thu, 28 May 2015 15:24:12 +0000 (15:24 +0000)
committerEric Botcazou <ebotcazou@gcc.gnu.org>
Thu, 28 May 2015 15:24:12 +0000 (15:24 +0000)
commitfc7a823e1507110aba804cf94415155a8783e698
treefb09192367caa4ff2977684a039b071404d51421
parent318a4e6de8f20670c9f9e9dde02dc639f161f68c
gigi.h (gnat_stabilize_reference): Adjust.

* gcc-interface/gigi.h (gnat_stabilize_reference): Adjust.
(rewrite_fn): Remove third parameter.
(type_is_padding_self_referential): New inline predicate.
(return_type_with_variable_size_p): Likewise.
* gcc-interface/decl.c (allocatable_size_p): More around.
(cannot_be_superflat_p): Rename into...
(cannot_be_superflat ): ...this.
(initial_value_needs_conversion): New predicate.
(gnat_to_gnu_entity): Invoke type_is_padding_self_referential,
initial_value_needs_conversion and adjust to above renaming.
For a renaming, force the materialization if the inner expression
is compound.  Adjust calls to elaborate_reference and build a
compound expression if needed.
(struct er_dat): Add N field.
(elaborate_reference_1): Remove N parameter and adjust.
(elaborate_reference): Add INIT parameter and pass it in the call to
gnat_rewrite_reference.  Adjust initial expression.
* gcc-interface/trans.c (Call_to_gnu): Treat renamings the same way as
regular object declarations when it comes to creating a temporary.
Adjust call to gnat_stabilize_reference and build a compound expression
  if needed.  Invoke return_type_with_variable_size_p.
(gnat_to_gnu): Invoke type_is_padding_self_referential.  In case #4,
return a call to a function unmodified if it returns with variable size
  and is also the initial expression in an object declaration.
* gcc-interface/utils2.c (build_binary_op) <INIT_EXPR>: Use the RHS'
type if it is a call to a function that returns with variable size.
(build_unary_op): Invoke type_is_padding_self_referential.
(gnat_stabilize_reference_1): Remove N parameter and adjust.
(gnat_stabilize_reference): Add INIT parameter and pass it in the call
to gnat_rewrite_reference.
(gnat_rewrite_reference):  Remove N, add INIT parameter and adjust.
<COMPOUND_EXPR>: New case.

From-SVN: r223834
19 files changed:
gcc/ada/ChangeLog
gcc/ada/gcc-interface/decl.c
gcc/ada/gcc-interface/gigi.h
gcc/ada/gcc-interface/trans.c
gcc/ada/gcc-interface/utils2.c
gcc/testsuite/ChangeLog
gcc/testsuite/gnat.dg/varsize1.adb [moved from gcc/testsuite/gnat.dg/varsize_temp.adb with 91% similarity]
gcc/testsuite/gnat.dg/varsize2.adb [moved from gcc/testsuite/gnat.dg/varsize_copy.adb with 89% similarity]
gcc/testsuite/gnat.dg/varsize2.ads [moved from gcc/testsuite/gnat.dg/varsize_copy.ads with 93% similarity]
gcc/testsuite/gnat.dg/varsize3_1.adb [new file with mode: 0644]
gcc/testsuite/gnat.dg/varsize3_1.ads [new file with mode: 0644]
gcc/testsuite/gnat.dg/varsize3_2.adb [new file with mode: 0644]
gcc/testsuite/gnat.dg/varsize3_3.adb [new file with mode: 0644]
gcc/testsuite/gnat.dg/varsize3_4.adb [new file with mode: 0644]
gcc/testsuite/gnat.dg/varsize3_5.adb [new file with mode: 0644]
gcc/testsuite/gnat.dg/varsize3_6.adb [new file with mode: 0644]
gcc/testsuite/gnat.dg/varsize3_pkg1.ads [new file with mode: 0644]
gcc/testsuite/gnat.dg/varsize3_pkg2.ads [new file with mode: 0644]
gcc/testsuite/gnat.dg/varsize3_pkg3.ads [new file with mode: 0644]
This page took 0.066569 seconds and 5 git commands to generate.