diff options
author | Eric Botcazou <ebotcazou@adacore.com> | 2018-11-14 11:42:26 +0000 |
---|---|---|
committer | Pierre-Marie de Rodat <pmderodat@gcc.gnu.org> | 2018-11-14 11:42:26 +0000 |
commit | 64a87aa5dbb2a62a042a2449e30c0fdddd8009e8 (patch) | |
tree | a8585897b86b7c000a8bc4d68a08fb2c5b7fa2a0 /gcc | |
parent | a2c54c951479b2eb5315f859a7035f48a3256c50 (diff) | |
download | gcc-64a87aa5dbb2a62a042a2449e30c0fdddd8009e8.zip gcc-64a87aa5dbb2a62a042a2449e30c0fdddd8009e8.tar.gz gcc-64a87aa5dbb2a62a042a2449e30c0fdddd8009e8.tar.bz2 |
[Ada] Remove couple of recently added dead tests
N_Quantified_Expression and N_Iterated_Component_Association are
unrelated nodes that cannot appear in the same context: the former can
appear wherever an expression node is acceptable whereas the latter can
appear only as an element of a component association list. So a test
combining both most likely contains a dead arm and this change removes a
couple of them.
No functional changes.
2018-11-14 Eric Botcazou <ebotcazou@adacore.com>
gcc/ada/
* exp_aggr.adb (Check_Static_Components): Remove dead test.
(Flatten): Likewise. Move comment around.
From-SVN: r266133
Diffstat (limited to 'gcc')
-rw-r--r-- | gcc/ada/ChangeLog | 5 | ||||
-rw-r--r-- | gcc/ada/exp_aggr.adb | 14 |
2 files changed, 11 insertions, 8 deletions
diff --git a/gcc/ada/ChangeLog b/gcc/ada/ChangeLog index ba6055d..742379b 100644 --- a/gcc/ada/ChangeLog +++ b/gcc/ada/ChangeLog @@ -1,3 +1,8 @@ +2018-11-14 Eric Botcazou <ebotcazou@adacore.com> + + * exp_aggr.adb (Check_Static_Components): Remove dead test. + (Flatten): Likewise. Move comment around. + 2018-11-14 Hristian Kirtchev <kirtchev@adacore.com> * sem_ch6.adb (Analyze_Null_Procedure): Capture Ghost and diff --git a/gcc/ada/exp_aggr.adb b/gcc/ada/exp_aggr.adb index 1928cb9..7fc7a87 100644 --- a/gcc/ada/exp_aggr.adb +++ b/gcc/ada/exp_aggr.adb @@ -4367,8 +4367,7 @@ package body Exp_Aggr is elsif Nkind (Expression (Expr)) /= N_Aggregate or else not Compile_Time_Known_Aggregate (Expression (Expr)) or else Expansion_Delayed (Expression (Expr)) - or else Nkind_In (Expr, N_Iterated_Component_Association, - N_Quantified_Expression) + or else Nkind (Expr) = N_Iterated_Component_Association then Static_Components := False; exit; @@ -4521,16 +4520,15 @@ package body Exp_Aggr is -- If we have an others choice, fill in the missing elements -- subject to the limit established by Max_Others_Replicate. - -- If the expression involves a construct that generates - -- a loop, we must generate individual assignments and - -- no flattening is possible. if Nkind (Choice) = N_Others_Choice then Rep_Count := 0; - if Nkind_In (Expression (Elmt), - N_Iterated_Component_Association, - N_Quantified_Expression) + -- If the expression involves a construct that generates + -- a loop, we must generate individual assignments and + -- no flattening is possible. + + if Nkind (Expression (Elmt)) = N_Quantified_Expression then return False; end if; |