From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: by sourceware.org (Postfix, from userid 1914) id 4CF373969824; Wed, 7 Jul 2021 16:26:26 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org 4CF373969824 MIME-Version: 1.0 Content-Transfer-Encoding: 7bit Content-Type: text/plain; charset="utf-8" From: Pierre-Marie de Rodat To: gcc-cvs@gcc.gnu.org Subject: [gcc r12-2124] [Ada] Simplify code by reusing Remove on list of primitive operations X-Act-Checkin: gcc X-Git-Author: Piotr Trojanek X-Git-Refname: refs/heads/master X-Git-Oldrev: 9e76a063f11197aee9667b59ed8aa071e83237aa X-Git-Newrev: e1eb4441733ca9b80faf4f51a29418d720014ae1 Message-Id: <20210707162626.4CF373969824@sourceware.org> Date: Wed, 7 Jul 2021 16:26:26 +0000 (GMT) X-BeenThere: gcc-cvs@gcc.gnu.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: Gcc-cvs mailing list List-Unsubscribe: , List-Archive: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 07 Jul 2021 16:26:26 -0000 https://gcc.gnu.org/g:e1eb4441733ca9b80faf4f51a29418d720014ae1 commit r12-2124-ge1eb4441733ca9b80faf4f51a29418d720014ae1 Author: Piotr Trojanek Date: Wed May 19 14:05:01 2021 +0200 [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: --- gcc/ada/sem_prag.adb | 8 +------- 1 file changed, 1 insertion(+), 7 deletions(-) diff --git a/gcc/ada/sem_prag.adb b/gcc/ada/sem_prag.adb index 41e887d8f39..5705aa7bbf4 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;