diff options
author | Eric Botcazou <ebotcazou@adacore.com> | 2020-05-29 16:30:54 +0200 |
---|---|---|
committer | Giuliano Belinassi <giuliano.belinassi@usp.br> | 2020-08-17 13:17:13 -0300 |
commit | e6ab530389319cd1d9345ad53cc32fd81cc20cab (patch) | |
tree | b902b181b915dbd25f0677c2ad76767a2532f559 /gcc/fortran | |
parent | ead6a829aea071b6c03840255a08d35369de4003 (diff) | |
download | gcc-e6ab530389319cd1d9345ad53cc32fd81cc20cab.zip gcc-e6ab530389319cd1d9345ad53cc32fd81cc20cab.tar.gz gcc-e6ab530389319cd1d9345ad53cc32fd81cc20cab.tar.bz2 |
[Ada] Further improve the expansion of array aggregates
gcc/ada/
* exp_aggr.adb
(Convert_To_Positional): Add Dims local variable
and pass it in calls to Is_Flat and Flatten.
(Check_Static_Components): Pass Dims in call to
Is_Static_Element.
(Nonflattenable_Next_Aggr): New predicate.
(Flatten): Add Dims parameter and Expr local variable. Call
Nonflattenable_Next_Aggr in a couple of places. In the case
when an Others choice is present, check that the element is
either static or a nested aggregate that can be flattened,
before disregarding the replication limit for elaboration
purposes. Check that a nested array is flattenable in the case
of a multidimensional array in any position. Remove redundant
check in the Others case and pass Dims in call to
Is_Static_Element. Use Expr variable.
(Is_Flat): Change type of Dims parameter from Int to Nat.
(Is_Static_Element): Add Dims parameter. Replace tests on
literals with call to Compile_Time_Known_Value. If everything
else failed and the dimension is 1, preanalyze the expression
before calling again Compile_Time_Known_Value on it. Return
true for null.
(Late_Expansion): Do not expand further if the assignment to the
target can be done directly by the back end.
Diffstat (limited to 'gcc/fortran')
0 files changed, 0 insertions, 0 deletions