From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: by sourceware.org (Postfix, from userid 7871) id CFD9B3856962; Thu, 25 May 2023 08:06:22 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org CFD9B3856962 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gcc.gnu.org; s=default; t=1685001982; bh=6aTH4+8dCHu1zqsPKKYVUHfPAIf2YcUSQuQmOtnqjo8=; h=From:To:Subject:Date:From; b=X4jTkkGmFZ9Nj3xWaCXc50hJujg06lqFxNUvaBoLH6caq2a2vdKRhCWgck1UDqoRB VbutqlT0sLSR8y/6dubIJ/q251DFFCNe9mTz+qdIb0o47hCskNrzLAVxJNMYvD9ub6 nNnRkg+9W/8rskc4dmIZrmELG1xjI5jjpBDlUOAU= MIME-Version: 1.0 Content-Transfer-Encoding: 7bit Content-Type: text/plain; charset="utf-8" From: Marc Poulhi?s To: gcc-cvs@gcc.gnu.org Subject: [gcc r14-1218] ada: Simplify copying of node lists X-Act-Checkin: gcc X-Git-Author: Piotr Trojanek X-Git-Refname: refs/heads/master X-Git-Oldrev: 82a205ebf656aa349f46c541a2a22303ca5b92fc X-Git-Newrev: c4399ee62946eafbded4334478678d6f3d68787e Message-Id: <20230525080622.CFD9B3856962@sourceware.org> Date: Thu, 25 May 2023 08:06:22 +0000 (GMT) List-Id: https://gcc.gnu.org/g:c4399ee62946eafbded4334478678d6f3d68787e commit r14-1218-gc4399ee62946eafbded4334478678d6f3d68787e Author: Piotr Trojanek Date: Tue Mar 7 19:52:40 2023 +0100 ada: Simplify copying of node lists When creating a copy of a node list we called Copy_Entity for entities and Copy_Separate_Tree for other nodes. This was unnecessary, because the Copy_Separate_Tree when called on entities will just do Copy_Entity. Code cleanup; semantics is unaffected. gcc/ada/ * atree.adb (Copy_List): Call Copy_Separate_Tree for both entities and other nodes. Diff: --- gcc/ada/atree.adb | 7 +------ 1 file changed, 1 insertion(+), 6 deletions(-) diff --git a/gcc/ada/atree.adb b/gcc/ada/atree.adb index 1c5b93727cd..ef19a80b6e7 100644 --- a/gcc/ada/atree.adb +++ b/gcc/ada/atree.adb @@ -1396,12 +1396,7 @@ package body Atree is E := First (List); while Present (E) loop - if Is_Entity (E) then - Append (Copy_Entity (E), NL); - else - Append (Copy_Separate_Tree (E), NL); - end if; - + Append (Copy_Separate_Tree (E), NL); Next (E); end loop;