aboutsummaryrefslogtreecommitdiff
path: root/gcc
diff options
context:
space:
mode:
authorEric Botcazou <ebotcazou@adacore.com>2023-05-15 00:07:01 +0200
committerMarc Poulhiès <poulhies@adacore.com>2023-06-15 09:59:36 +0200
commit3f3f37c3f72f4840ef2d304e00f5bc8c28374bce (patch)
tree384dfcb357eb97d7d3e3b1505de5f16cd51c1e77 /gcc
parent70345b97934d4d998bef26a7d38c9e6a4aa8e776 (diff)
downloadgcc-3f3f37c3f72f4840ef2d304e00f5bc8c28374bce.zip
gcc-3f3f37c3f72f4840ef2d304e00f5bc8c28374bce.tar.gz
gcc-3f3f37c3f72f4840ef2d304e00f5bc8c28374bce.tar.bz2
ada: Remove dead code in Expand_Iterator_Loop_Over_Container
The Condition_Actions field can only be populated for while loops. gcc/ada/ * exp_ch5.adb (Expand_Iterator_Loop_Over_Container): Do not insert an always empty list. Remove unused parameter Isc. (Expand_Iterator_Loop): Adjust call to above procedure.
Diffstat (limited to 'gcc')
-rw-r--r--gcc/ada/exp_ch5.adb17
1 files changed, 4 insertions, 13 deletions
diff --git a/gcc/ada/exp_ch5.adb b/gcc/ada/exp_ch5.adb
index d8214bd..a4c7db9 100644
--- a/gcc/ada/exp_ch5.adb
+++ b/gcc/ada/exp_ch5.adb
@@ -181,14 +181,13 @@ package body Exp_Ch5 is
procedure Expand_Iterator_Loop_Over_Container
(N : Node_Id;
- Isc : Node_Id;
I_Spec : Node_Id;
Container : Node_Id;
Container_Typ : Entity_Id);
-- Expand loop over containers that uses the form "for X of C" with an
- -- optional subtype mark, or "for Y in C". Isc is the iteration scheme.
- -- I_Spec is the iterator specification and Container is either the
- -- Container (for OF) or the iterator (for IN).
+ -- optional subtype mark, or "for Y in C". I_Spec is the iterator
+ -- specification and Container is either the Container (for OF) or the
+ -- iterator (for IN).
procedure Expand_Predicated_Loop (N : Node_Id);
-- Expand for loop over predicated subtype
@@ -4836,7 +4835,7 @@ package body Exp_Ch5 is
else
Expand_Iterator_Loop_Over_Container
- (N, Isc, I_Spec, Container, Container_Typ);
+ (N, I_Spec, Container, Container_Typ);
end if;
end Expand_Iterator_Loop;
@@ -5133,7 +5132,6 @@ package body Exp_Ch5 is
procedure Expand_Iterator_Loop_Over_Container
(N : Node_Id;
- Isc : Node_Id;
I_Spec : Node_Id;
Container : Node_Id;
Container_Typ : Entity_Id)
@@ -5606,13 +5604,6 @@ package body Exp_Ch5 is
Mutate_Ekind (Cursor, Id_Kind);
end;
- -- If the range of iteration is given by a function call that returns
- -- a container, the finalization actions have been saved in the
- -- Condition_Actions of the iterator. Insert them now at the head of
- -- the loop.
-
- Insert_List_Before (N, Condition_Actions (Isc));
-
Rewrite (N, New_Loop);
Analyze (N);
end Expand_Iterator_Loop_Over_Container;