diff options
author | Eric Botcazou <ebotcazou@adacore.com> | 2024-10-15 15:18:05 +0200 |
---|---|---|
committer | Marc Poulhiès <dkm@gcc.gnu.org> | 2024-11-04 16:57:58 +0100 |
commit | 4fbfd9e686eeb02466581a87f151dfe20f140f13 (patch) | |
tree | 29a3d4c9ad45be7551164b67fc5dae92ceac0eee /gcc | |
parent | 420b9b99d67bb99efd1e23dabe1ed5e23737989d (diff) | |
download | gcc-4fbfd9e686eeb02466581a87f151dfe20f140f13.zip gcc-4fbfd9e686eeb02466581a87f151dfe20f140f13.tar.gz gcc-4fbfd9e686eeb02466581a87f151dfe20f140f13.tar.bz2 |
ada: Remove dead code in Resolve_Iterated_Component_Association
It dates back to when analysis was performed on a copy of the expression.
gcc/ada/ChangeLog:
* sem_aggr.adb (Resolve_Iterated_Component_Association): Move up
declaration of Expr and remove dead code from older processing.
Diffstat (limited to 'gcc')
-rw-r--r-- | gcc/ada/sem_aggr.adb | 16 |
1 files changed, 3 insertions, 13 deletions
diff --git a/gcc/ada/sem_aggr.adb b/gcc/ada/sem_aggr.adb index 63e17f4..9439d64 100644 --- a/gcc/ada/sem_aggr.adb +++ b/gcc/ada/sem_aggr.adb @@ -2114,8 +2114,9 @@ package body Sem_Aggr is (N : Node_Id; Index_Typ : Entity_Id) is - Loc : constant Source_Ptr := Sloc (N); - Id : constant Entity_Id := Defining_Identifier (N); + Loc : constant Source_Ptr := Sloc (N); + Id : constant Entity_Id := Defining_Identifier (N); + Expr : constant Node_Id := Expression (N); ----------------------- -- Remove_References -- @@ -2145,7 +2146,6 @@ package body Sem_Aggr is Choice : Node_Id; Resolution_OK : Boolean; Scop : Entity_Id; - Expr : constant Node_Id := Expression (N); -- Start of processing for Resolve_Iterated_Component_Association @@ -2234,16 +2234,6 @@ package body Sem_Aggr is end; end if; - -- An iterated_component_association may appear in a nested - -- aggregate for a multidimensional structure: preserve the bounds - -- computed for the expression, as well as the anonymous array - -- type generated for it; both are needed during array expansion. - - if Nkind (Expr) = N_Aggregate then - Set_Aggregate_Bounds (Expression (N), Aggregate_Bounds (Expr)); - Set_Etype (Expression (N), Etype (Expr)); - end if; - End_Scope; end Resolve_Iterated_Component_Association; |