aboutsummaryrefslogtreecommitdiff
path: root/gcc/ada
diff options
context:
space:
mode:
authorPiotr Trojanek <trojanek@adacore.com>2024-01-04 17:10:47 +0100
committerMarc Poulhiès <poulhies@adacore.com>2024-05-06 11:11:32 +0200
commitd917954922f38652eb314f096e130ecaa53e8441 (patch)
treeb262ba9dc7662d8e76645a82147e1acfa351c3ad /gcc/ada
parent0f3324fd8ba91b16905e4b03eaf1e35a728f1027 (diff)
downloadgcc-d917954922f38652eb314f096e130ecaa53e8441.zip
gcc-d917954922f38652eb314f096e130ecaa53e8441.tar.gz
gcc-d917954922f38652eb314f096e130ecaa53e8441.tar.bz2
ada: Cleanup collecting of implicit outputs
Move handling of IN parameters to where both IN and IN OUT parameters are handled. This makes the code marginally more efficient and symmetrical to handling of implicit inputs. gcc/ada/ * sem_prag.adb (Collect_Global_Item): Move code.
Diffstat (limited to 'gcc/ada')
-rw-r--r--gcc/ada/sem_prag.adb22
1 files changed, 11 insertions, 11 deletions
diff --git a/gcc/ada/sem_prag.adb b/gcc/ada/sem_prag.adb
index ab60a8a..25a98cb 100644
--- a/gcc/ada/sem_prag.adb
+++ b/gcc/ada/sem_prag.adb
@@ -31651,6 +31651,17 @@ package body Sem_Prag is
while Present (Formal) loop
if Ekind (Formal) in E_In_Out_Parameter | E_In_Parameter then
Append_New_Elmt (Formal, Subp_Inputs);
+
+ -- IN parameters of procedures and protected entries can act as
+ -- outputs when the related type is access-to-variable.
+
+ if Ekind (Formal) = E_In_Parameter
+ and then Ekind (Spec_Id) not in E_Function
+ | E_Generic_Function
+ and then Is_Access_Variable (Etype (Formal))
+ then
+ Append_New_Elmt (Formal, Subp_Outputs);
+ end if;
end if;
if Ekind (Formal) in E_In_Out_Parameter | E_Out_Parameter then
@@ -31667,17 +31678,6 @@ package body Sem_Prag is
end if;
end if;
- -- IN parameters of procedures and protected entries can act as
- -- outputs when the related type is access-to-variable.
-
- if Ekind (Formal) = E_In_Parameter
- and then Ekind (Spec_Id) not in E_Function
- | E_Generic_Function
- and then Is_Access_Variable (Etype (Formal))
- then
- Append_New_Elmt (Formal, Subp_Outputs);
- end if;
-
Next_Formal (Formal);
end loop;