]> git.ipfire.org Git - thirdparty/gcc.git/commit
ada: Small improvements to expansion of conditional expressions
authorEric Botcazou <ebotcazou@adacore.com>
Fri, 15 Nov 2024 20:29:18 +0000 (21:29 +0100)
committerMarc Poulhiès <dkm@gcc.gnu.org>
Thu, 12 Dec 2024 09:57:55 +0000 (10:57 +0100)
commit3e4b9c67861eef93a262aa1d87d903fbf3a2ae87
tree2e2c16676058db05561d83b60f665177a7fd50ba
parentca0145281f9573781686cba821eceab7a659f750
ada: Small improvements to expansion of conditional expressions

They comprise using a nonnull accesss type for the indirect expansion to
avoid useless checks, smplifying the expansion of if expressions whose
condition is known at compile time to avoid an N_Expression_With_Actions,
using the indirect expansion for them in the indefinite case too, which
makes the special case for an unconstrained array type obsolete.

No functional changes.

gcc/ada/ChangeLog:

* exp_ch4.adb (Expand_N_Case_Expression): Remove obsolete comment
about C code generation.  Do not create a useless target type if
the parent statement is rewritten instead of the expression.  Use
a nonnull accesss type for the expansion done for composite types.
(Expand_N_If_Expression): Simplify the expansion when the condition
is known at compile time.  Apply the expansion done for by-reference
types to indefinite types and remove the obsolete special case for
unconstrained array types  Use a nonnull access type in this case.
Rename New_If local variable to If_Stmt for the sake of consistency.
gcc/ada/exp_ch4.adb