diff options
author | Piotr Trojanek <trojanek@adacore.com> | 2022-08-12 11:55:35 +0200 |
---|---|---|
committer | Marc Poulhiès <poulhies@adacore.com> | 2022-11-07 09:36:31 +0100 |
commit | 4e92ad48dcfdb726f72f35039c5c102a99bf7759 (patch) | |
tree | 8988bccf4aed926b6ea986d7117fd11ed6850279 /gcc | |
parent | 76b35e7227f34e2ce18e50ca637c86d7a1c3ef49 (diff) | |
download | gcc-4e92ad48dcfdb726f72f35039c5c102a99bf7759.zip gcc-4e92ad48dcfdb726f72f35039c5c102a99bf7759.tar.gz gcc-4e92ad48dcfdb726f72f35039c5c102a99bf7759.tar.bz2 |
ada: Clean up code for visibility of generic actuals
Code cleanup related to fixing visibility of actual parameters in
inlining-for-proof in GNATprove mode; semantics is unaffected.
gcc/ada/
* sem_ch12.adb (Check_Generic_Actuals): Remove redundant parens;
refactor an excessive if-statement; remove repeated call to Node.
Diffstat (limited to 'gcc')
-rw-r--r-- | gcc/ada/sem_ch12.adb | 14 |
1 files changed, 6 insertions, 8 deletions
diff --git a/gcc/ada/sem_ch12.adb b/gcc/ada/sem_ch12.adb index 0b7b7c9..2b7833d 100644 --- a/gcc/ada/sem_ch12.adb +++ b/gcc/ada/sem_ch12.adb @@ -7023,7 +7023,7 @@ package body Sem_Ch12 is Astype := First_Subtype (E); end if; - Set_Size_Info (E, (Astype)); + Set_Size_Info (E, Astype); Copy_RM_Size (To => E, From => Astype); Set_First_Rep_Item (E, First_Rep_Item (Astype)); @@ -7054,12 +7054,10 @@ package body Sem_Ch12 is elsif Present (Associated_Formal_Package (E)) and then not Is_Generic_Formal (E) then - if Box_Present (Parent (Associated_Formal_Package (E))) then - Check_Generic_Actuals (Renamed_Entity (E), True); - - else - Check_Generic_Actuals (Renamed_Entity (E), False); - end if; + Check_Generic_Actuals + (Renamed_Entity (E), + Is_Formal_Box => + Box_Present (Parent (Associated_Formal_Package (E)))); Set_Is_Hidden (E, False); end if; @@ -15457,7 +15455,7 @@ package body Sem_Ch12 is end loop; end if; - Exchange_Declarations (Node (M)); + Exchange_Declarations (Typ); Next_Elmt (M); end loop; |