From patchwork Thu May 25 08:06:01 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: =?utf-8?q?Marc_Poulhi=C3=A8s?= X-Patchwork-Id: 98872 Return-Path: Delivered-To: ouuuleilei@gmail.com Received: by 2002:a59:994d:0:b0:3d9:f83d:47d9 with SMTP id k13csp203907vqr; Thu, 25 May 2023 01:29:04 -0700 (PDT) X-Google-Smtp-Source: ACHHUZ6+TR3ZU3YW7nxCPYUFoxLM3siISoglCkMvH3VhRBCuzmSxqIwOsSMerQuP4Wfy2rU/un72 X-Received: by 2002:a17:907:3185:b0:970:925:6563 with SMTP id xe5-20020a170907318500b0097009256563mr762809ejb.8.1685003344678; Thu, 25 May 2023 01:29:04 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1685003344; cv=none; d=google.com; s=arc-20160816; b=OhsB2YxapE0Zyz7w7lBYH3i9YhePGyH4C64vcjrEYUDGFrJuyav+T7AqyR80d4NqdZ u/th2ak6l5IiruHLKFBH1a3X9Ujh5D9rKmKn/DBZcSyGrvzde/U0GWSaglG1fJ1gXmrX FFwjLoQ70KGYpCAta4+mn/s7Zk9IUyzFHPoKih/GfbfB5pY7fWfo+voKgmWvW4kLgwPe 2QtjrtbuWXRZ8rxbc1xBGIOqwWmCJw34v1gG/N9QR7/fkCUxTDOa54n/WI75QEafk+/A OVPvlwvGk/4eyg2nx20bgzgfwjIRn+14UvUdKo9f26vgHZDFTgbAyiB2giKGyeXC5gHT 5yvg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=sender:errors-to:reply-to:from:list-subscribe:list-help:list-post :list-archive:list-unsubscribe:list-id:precedence :content-transfer-encoding:mime-version:message-id:date:subject:cc :to:dmarc-filter:delivered-to:dkim-signature:dkim-filter; bh=z+PssrRDRf53UsMfY+/g36soiN6ojfquB3VLeULH6l8=; b=xbd3jUFJ/ecbTYS3B9wQqIIJAvKt8DOoXFQBXZzRdyu0MYKT1b4dQM+8+BqPDzHyov zKG3aRvWo35TUNxSYEhlwGmIiGithRXJaZlwYFmDr7BI7yrbav//XajR9qVfcmCezxDl +sV7WN0KJrEu+weaya79WBkmIX0TqmmKndD9SiPlscT2MQtLykQMIUqgxDYpmHFvUyFu mrmvH7RO49qOutivxUD0Ara8tJJ3K1mKfeufJ8eIfQD5Wh34GbOGJwxNPimRlqZZKihc oIbXajOBH7B453szhJ+EOBJwUQYLfb5IGjgmFzp7Zj/eoaW9lQRLS97AXzYCVi04Xugw oGPw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@gcc.gnu.org header.s=default header.b="Y5/dP9O9"; spf=pass (google.com: domain of gcc-patches-bounces+ouuuleilei=gmail.com@gcc.gnu.org designates 2620:52:3:1:0:246e:9693:128c as permitted sender) smtp.mailfrom="gcc-patches-bounces+ouuuleilei=gmail.com@gcc.gnu.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=gnu.org Received: from sourceware.org (server2.sourceware.org. [2620:52:3:1:0:246e:9693:128c]) by mx.google.com with ESMTPS id um4-20020a170906cf8400b00969f6672981si655418ejb.979.2023.05.25.01.29.04 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 25 May 2023 01:29:04 -0700 (PDT) Received-SPF: pass (google.com: domain of gcc-patches-bounces+ouuuleilei=gmail.com@gcc.gnu.org designates 2620:52:3:1:0:246e:9693:128c as permitted sender) client-ip=2620:52:3:1:0:246e:9693:128c; Authentication-Results: mx.google.com; dkim=pass header.i=@gcc.gnu.org header.s=default header.b="Y5/dP9O9"; spf=pass (google.com: domain of gcc-patches-bounces+ouuuleilei=gmail.com@gcc.gnu.org designates 2620:52:3:1:0:246e:9693:128c as permitted sender) smtp.mailfrom="gcc-patches-bounces+ouuuleilei=gmail.com@gcc.gnu.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=gnu.org Received: from server2.sourceware.org (localhost [IPv6:::1]) by sourceware.org (Postfix) with ESMTP id E28A93883011 for ; Thu, 25 May 2023 08:18:54 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org E28A93883011 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gcc.gnu.org; s=default; t=1685002734; bh=z+PssrRDRf53UsMfY+/g36soiN6ojfquB3VLeULH6l8=; h=To:Cc:Subject:Date:List-Id:List-Unsubscribe:List-Archive: List-Post:List-Help:List-Subscribe:From:Reply-To:From; b=Y5/dP9O9Ez3nQdNfZl1rcwQSJY+DcSVqrE7Cs0D9CJG0HHiCENdvUw87gMKCjEuWK KMWFZK2LfNC8ezfYG4gCaBf6GNZ59LWSjoMlnXiiccdiIJslIIrcAep8FmcPy9NhgU qOn+plEuAc12c33TcAhA3Uy6Q3+Pj29tA9TyHIq4= X-Original-To: gcc-patches@gcc.gnu.org Delivered-To: gcc-patches@gcc.gnu.org Received: from mail-wr1-x42a.google.com (mail-wr1-x42a.google.com [IPv6:2a00:1450:4864:20::42a]) by sourceware.org (Postfix) with ESMTPS id C0845384645D for ; Thu, 25 May 2023 08:06:03 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.4.2 sourceware.org C0845384645D Received: by mail-wr1-x42a.google.com with SMTP id ffacd0b85a97d-3093d10442aso1176183f8f.1 for ; Thu, 25 May 2023 01:06:03 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20221208; t=1685001962; x=1687593962; h=content-transfer-encoding:mime-version:message-id:date:subject:cc :to:from:x-gm-message-state:from:to:cc:subject:date:message-id :reply-to; bh=z+PssrRDRf53UsMfY+/g36soiN6ojfquB3VLeULH6l8=; b=G1843y8LancvD+Zs56B3MUgGMXnDKuJdelqtclzi6JZybLFlYp1U9CwaIhPxuLoh4/ h8otU0TYWOraLdUF1Tqnm1SzWVrDSUGORH2U/G0t4hcf5fQaAKo4tQzSVnaxDkQ3jYV+ imPoirDcOkRBCfPBmdgy4fCr1QQRLI4lBRrbNTEQsU8DvB1+sp64pqyF+V/RiiMIGXmD wb/KcJit7Fk3HXNkhmgS5SzwyCTU9WwNRXuw+Iih+TKSA4+NQYnzX+Shn4bCw01rUcMZ NbtDt3HEhATfZa3qEOeNVvg408GRS3s2jFGAvjsIlRJeOuY2Xpl32+TA5HOtYP2J94j9 Ijyw== X-Gm-Message-State: AC+VfDwijuEn/R2ttUHbTFb+0ERlzcdwLkM4SRbmyzwDt7PiKuHZYoQb GlQ1rOgd5dMVTKra4W+8YdIkr8qnzsLoqFWcMocd8w== X-Received: by 2002:adf:eace:0:b0:306:28f4:963c with SMTP id o14-20020adfeace000000b0030628f4963cmr1744404wrn.23.1685001962656; Thu, 25 May 2023 01:06:02 -0700 (PDT) Received: from poulhies-Precision-5550.telnowedge.local (lmontsouris-659-1-24-67.w81-250.abo.wanadoo.fr. [81.250.175.67]) by smtp.gmail.com with ESMTPSA id i11-20020adfdecb000000b0030629536e64sm911598wrn.30.2023.05.25.01.06.01 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 25 May 2023 01:06:02 -0700 (PDT) To: gcc-patches@gcc.gnu.org Cc: Piotr Trojanek Subject: [COMMITTED] ada: Simplify copying of node lists Date: Thu, 25 May 2023 10:06:01 +0200 Message-Id: <20230525080601.1956918-1-poulhies@adacore.com> X-Mailer: git-send-email 2.40.0 MIME-Version: 1.0 X-Spam-Status: No, score=-13.6 required=5.0 tests=BAYES_00, DKIM_SIGNED, DKIM_VALID, DKIM_VALID_AU, DKIM_VALID_EF, GIT_PATCH_0, RCVD_IN_DNSWL_NONE, SPF_HELO_NONE, SPF_PASS, TXREP, T_SCC_BODY_TEXT_LINE autolearn=ham autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on server2.sourceware.org X-BeenThere: gcc-patches@gcc.gnu.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: Gcc-patches mailing list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-Patchwork-Original-From: =?utf-8?q?Marc_Poulhi=C3=A8s_via_Gcc-patches?= From: =?utf-8?q?Marc_Poulhi=C3=A8s?= Reply-To: =?utf-8?q?Marc_Poulhi=C3=A8s?= Errors-To: gcc-patches-bounces+ouuuleilei=gmail.com@gcc.gnu.org Sender: "Gcc-patches" X-getmail-retrieved-from-mailbox: =?utf-8?q?INBOX?= X-GMAIL-THRID: =?utf-8?q?1766854067264505078?= X-GMAIL-MSGID: =?utf-8?q?1766854067264505078?= From: Piotr Trojanek 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. Tested on x86_64-pc-linux-gnu, committed on master. --- 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;