diff options
author | Eric Botcazou <ebotcazou@adacore.com> | 2020-06-05 11:35:25 +0200 |
---|---|---|
committer | Pierre-Marie de Rodat <derodat@adacore.com> | 2020-07-15 09:43:01 -0400 |
commit | c2ba82add6af32344b056b272ca1c31b60b8f903 (patch) | |
tree | f01f2a3547555802b736653e9c97505f9258a3b2 /gcc | |
parent | 8092c19930b6cdf3087825f9063cb830cd2de479 (diff) | |
download | gcc-c2ba82add6af32344b056b272ca1c31b60b8f903.zip gcc-c2ba82add6af32344b056b272ca1c31b60b8f903.tar.gz gcc-c2ba82add6af32344b056b272ca1c31b60b8f903.tar.bz2 |
[Ada] Cleanup in Convert_To_Positional after previous work
gcc/ada/
* exp_aggr.adb (Flatten): Adjust description.
(Convert_To_Positional): Remove obsolete ??? comment and use
Compile_Time_Known_Value in the final test.
Diffstat (limited to 'gcc')
-rw-r--r-- | gcc/ada/exp_aggr.adb | 18 |
1 files changed, 3 insertions, 15 deletions
diff --git a/gcc/ada/exp_aggr.adb b/gcc/ada/exp_aggr.adb index 6d89191..29d3f14 100644 --- a/gcc/ada/exp_aggr.adb +++ b/gcc/ada/exp_aggr.adb @@ -4969,9 +4969,8 @@ package body Exp_Aggr is Dims : Nat; Ix : Node_Id; Ixb : Node_Id) return Boolean; - -- Convert the aggregate into a purely positional form if possible. On - -- entry the bounds of all dimensions are known to be static, and the - -- total number of components is safe enough to expand. + -- Convert the aggregate into a purely positional form if possible after + -- checking that the bounds of all dimensions are known to be static. function Is_Flat (N : Node_Id; Dims : Nat) return Boolean; -- Return True if the aggregate N is flat (which is not trivial in the @@ -5476,10 +5475,6 @@ package body Exp_Aggr is -- compatible with the upper bound of the type, and therefore it is -- worth flattening such aggregates as well. - -- For now the back-end expands these aggregates into individual - -- assignments to the target anyway, but it is conceivable that - -- it will eventually be able to treat such aggregates statically??? - if Aggr_Size_OK (N, Typ) and then Flatten (N, Dims, First_Index (Typ), First_Index (Base_Type (Typ))) @@ -5506,14 +5501,7 @@ package body Exp_Aggr is if Nkind (N) = N_Aggregate and then Present (Expressions (N)) then Expr := First (Expressions (N)); while Present (Expr) loop - if Nkind_In (Expr, N_Integer_Literal, N_Real_Literal) - or else - (Is_Entity_Name (Expr) - and then Ekind (Entity (Expr)) = E_Enumeration_Literal) - then - null; - - else + if not Compile_Time_Known_Value (Expr) then Error_Msg_N ("non-static object requires elaboration code??", N); exit; |