From: Piotr Trojanek Date: Wed, 19 May 2021 12:05:01 +0000 (+0200) Subject: [Ada] Simplify code by reusing Remove on list of primitive operations X-Git-Tag: basepoints/gcc-13~6189 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=e1eb4441733ca9b80faf4f51a29418d720014ae1;p=thirdparty%2Fgcc.git [Ada] Simplify code by reusing Remove on list of primitive operations gcc/ada/ * sem_prag.adb (Analyze_Pragma): Simplify processing of pragma CPP_Constructor. --- diff --git a/gcc/ada/sem_prag.adb b/gcc/ada/sem_prag.adb index 41e887d8f39f..5705aa7bbf42 100644 --- a/gcc/ada/sem_prag.adb +++ b/gcc/ada/sem_prag.adb @@ -14738,7 +14738,6 @@ package body Sem_Prag is -- [, [Link_Name =>] static_string_EXPRESSION ]); when Pragma_CPP_Constructor => CPP_Constructor : declare - Elmt : Elmt_Id; Id : Entity_Id; Def_Id : Entity_Id; Tag_Typ : Entity_Id; @@ -14805,12 +14804,7 @@ package body Sem_Prag is then Tag_Typ := Etype (Def_Id); - Elmt := First_Elmt (Primitive_Operations (Tag_Typ)); - while Present (Elmt) and then Node (Elmt) /= Def_Id loop - Next_Elmt (Elmt); - end loop; - - Remove_Elmt (Primitive_Operations (Tag_Typ), Elmt); + Remove (Primitive_Operations (Tag_Typ), Def_Id); Set_Is_Dispatching_Operation (Def_Id, False); end if;