diff options
author | Ed Schonberg <schonberg@adacore.com> | 2020-11-28 10:19:47 -0500 |
---|---|---|
committer | Pierre-Marie de Rodat <derodat@adacore.com> | 2020-12-16 08:01:04 -0500 |
commit | d1d0c4c80058923fbf681d1d80ff90eeb7883949 (patch) | |
tree | b20bdde60c5b2872074a0cdf5e1d0b1ff2433cfb | |
parent | aa44eaca60245cda7913543e3a7848800b79b955 (diff) | |
download | gcc-d1d0c4c80058923fbf681d1d80ff90eeb7883949.zip gcc-d1d0c4c80058923fbf681d1d80ff90eeb7883949.tar.gz gcc-d1d0c4c80058923fbf681d1d80ff90eeb7883949.tar.bz2 |
[Ada] Handle iterator filters on loop specifications over containers
gcc/ada/
* sem_ch5.adb (Analyze_Iterator_Specification): If iterator
filter is present, preanalyze filter without expansion.
(Analyze_Loop_Parameter_Specification): When
loop_Parameter_Specification is rewritten as
Iterator_Specification, transfer Iterator_Filter if present.
-rw-r--r-- | gcc/ada/sem_ch5.adb | 8 |
1 files changed, 7 insertions, 1 deletions
diff --git a/gcc/ada/sem_ch5.adb b/gcc/ada/sem_ch5.adb index b136356..653e315 100644 --- a/gcc/ada/sem_ch5.adb +++ b/gcc/ada/sem_ch5.adb @@ -2620,7 +2620,10 @@ package body Sem_Ch5 is end if; if Present (Iterator_Filter (N)) then - Analyze_And_Resolve (Iterator_Filter (N), Standard_Boolean); + -- Preanalyze the filter. Expansion will take place when enclosing + -- loop is expanded. + + Preanalyze_And_Resolve (Iterator_Filter (N), Standard_Boolean); end if; end Analyze_Iterator_Specification; @@ -3017,6 +3020,9 @@ package body Sem_Ch5 is begin Set_Iterator_Specification (Scheme, I_Spec); Set_Loop_Parameter_Specification (Scheme, Empty); + Set_Iterator_Filter (I_Spec, + Relocate_Node (Iterator_Filter (N))); + Analyze_Iterator_Specification (I_Spec); -- In a generic context, analyze the original domain of |