From patchwork Mon May 15 09:44:08 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: 94061 Return-Path: Delivered-To: ouuuleilei@gmail.com Received: by 2002:a59:b0ea:0:b0:3b6:4342:cba0 with SMTP id b10csp6795496vqo; Mon, 15 May 2023 02:57:11 -0700 (PDT) X-Google-Smtp-Source: ACHHUZ4Mi951qOdtoPJEaqXQGh8j1JpZGt6aa9/odc5hsCLOyET5Q5x0A3+d+4An1rGpDE6cvw7P X-Received: by 2002:a05:6402:b13:b0:50c:a8ca:3240 with SMTP id bm19-20020a0564020b1300b0050ca8ca3240mr26288394edb.24.1684144631547; Mon, 15 May 2023 02:57:11 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1684144631; cv=none; d=google.com; s=arc-20160816; b=Zcq149MZKogeagQQh9mvjOU4nQZNARvwG4nWP6J0RD/jV5645nP+1G0weyoM46nKys aYoFkMJn2freneEXxWqsjPYy4zJowd1VA1PcrYRGxI6AKW0SAW1kjtu6cp3FgFjvyBHn R4fEnEcAN3QykBAOuAK7WcPZ0zA1jN5IjQ/OMCMiucAVUcj21o6M78uzegqwoWMm9jP/ 4hIjzorSvipE+54AoVNjeY0JSvLYFVNPg2aq+zEPC/ZPlmf8neUD3fM30qKYJsCRf39y Gew+m1+jbPuU16yVkS6kQZxsPPEgSjgXHQw2T/PYhUbx/+gu1skAJ4x5jd9xTIl8WlPQ 3/2w== 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=hKftZ/6wgCLuiEflVoP4xy7QdVNXRrHa+LnIdt4UpQA=; b=DeEbXIAJ8BuCh/7i4QWGr2vw+E3Hd9fJE4ZmyaDcqOLX0xxrEavolLsyMU6jz+itQG q4PdC2GUI+3Ig7+FJZyo3Oq+TLH0UVoXu2NOexZPIRcEHhXTkBTI+YDljLZx8RoJPBDX UC3a7wcLrfp0qcb/kd5xuINcyfWijnhltrCpNDhHZRztAgY6nFPpgOnmRZW2qPOP7aAN C90NBLhF9Lex1mUYJ3ECMUWNP91A8ww7y4/y1Tj4L8qrtenysA0cP0uXcnAbyk2H5U7M YPP/D/M8HMC+kAlpPget0r8XunK3PTGwgtBpp19JHMbSODhgTNAZuI8GB/3JalpSQhTR GouQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@gcc.gnu.org header.s=default header.b=uCJGZm3s; 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 k15-20020aa7d8cf000000b0050bca05d561si11125560eds.203.2023.05.15.02.57.11 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 15 May 2023 02:57:11 -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=uCJGZm3s; 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 5FE113834690 for ; Mon, 15 May 2023 09:50:51 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org 5FE113834690 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gcc.gnu.org; s=default; t=1684144251; bh=hKftZ/6wgCLuiEflVoP4xy7QdVNXRrHa+LnIdt4UpQA=; h=To:Cc:Subject:Date:List-Id:List-Unsubscribe:List-Archive: List-Post:List-Help:List-Subscribe:From:Reply-To:From; b=uCJGZm3ssw6VcIsaFFC0xhKCJr8b6Oftj+geV95zdKILi3Nb4CPu941My3SXzOpHO b+RY2uxxMzvXFmflUVHiy1aR1GnaXtIBPhu6YaYWrkAK5VxS4qrriqhHFGlIL0/FmH N/2Tl3g3eTBVZx6StKLZ94X5wZ363ZFAD0+psV38= X-Original-To: gcc-patches@gcc.gnu.org Delivered-To: gcc-patches@gcc.gnu.org Received: from mail-wm1-x32f.google.com (mail-wm1-x32f.google.com [IPv6:2a00:1450:4864:20::32f]) by sourceware.org (Postfix) with ESMTPS id 9F22B3852919 for ; Mon, 15 May 2023 09:44:12 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.4.2 sourceware.org 9F22B3852919 Received: by mail-wm1-x32f.google.com with SMTP id 5b1f17b1804b1-3f435658d23so62429085e9.3 for ; Mon, 15 May 2023 02:44:12 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20221208; t=1684143851; x=1686735851; 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=hKftZ/6wgCLuiEflVoP4xy7QdVNXRrHa+LnIdt4UpQA=; b=WFMJ6sf75gZo5930FBI7OdVPjzRzyqzQaCI0gAhUgVXsVdobfoYj5HrBtO2Q//AM6c jawCqIXAgopja6OayOgNAki9OSe1R85La9VEuWpZ1yr2u1fdVi5RJ0eHyF9jCdEucggt 34YaH7Mznk8QDOL5hVA0RFqXEbI4HRCn56FZgBblIGTsXecfif0dMezNHcnCZ6fZvyFI 6xDCJQHIgq+iglZEyaeKu1B2SKpt9ZGxX4Sm+n7I6m4LANLRx6eBwfR6zgLoTXPps2+a a/DUYby4KUBTHBQkkkFDJT0uNSs8nVOmdy/1WS8hHIQVIqi4plmBOf1INw1A57bh2y8/ awKg== X-Gm-Message-State: AC+VfDzfXrdAoWKD9myNu1YRmkpk03oQ0F/Juxd/p7f0o00YTAaeiXLp /mCjeKGGOI5ePhOYqlh1W9cYHx+GO2nrL4ztEqv6Kg== X-Received: by 2002:a7b:c7da:0:b0:3f4:2df7:e332 with SMTP id z26-20020a7bc7da000000b003f42df7e332mr14979122wmk.13.1684143850723; Mon, 15 May 2023 02:44:10 -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 12-20020a05600c020c00b003f50e29bce3sm1272038wmi.48.2023.05.15.02.44.09 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 15 May 2023 02:44:10 -0700 (PDT) To: gcc-patches@gcc.gnu.org Cc: Bob Duff Subject: [COMMITTED] ada: Remove duplicated code in Proc_Next_Component_Or_Discriminant Date: Mon, 15 May 2023 11:44:08 +0200 Message-Id: <20230515094408.1408681-1-poulhies@adacore.com> X-Mailer: git-send-email 2.40.0 MIME-Version: 1.0 X-Spam-Status: No, score=-13.4 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?1765953641114804208?= X-GMAIL-MSGID: =?utf-8?q?1765953641114804208?= From: Bob Duff Proc_Next_Component_Or_Discriminant was duplicating the code in Next_Component_Or_Discriminant. gcc/ada/ * einfo-utils.adb: (Proc_Next_Component_Or_Discriminant): Call Next_Component_Or_Discriminant. Tested on x86_64-pc-linux-gnu, committed on master. --- gcc/ada/einfo-utils.adb | 6 +----- 1 file changed, 1 insertion(+), 5 deletions(-) diff --git a/gcc/ada/einfo-utils.adb b/gcc/ada/einfo-utils.adb index dc379cbc852..a8220e2d133 100644 --- a/gcc/ada/einfo-utils.adb +++ b/gcc/ada/einfo-utils.adb @@ -3219,11 +3219,7 @@ package body Einfo.Utils is procedure Proc_Next_Component_Or_Discriminant (N : in out Node_Id) is begin - N := Next_Entity (N); - while Present (N) loop - exit when Ekind (N) in E_Component | E_Discriminant; - N := Next_Entity (N); - end loop; + N := Next_Component_Or_Discriminant (N); end Proc_Next_Component_Or_Discriminant; procedure Proc_Next_Discriminant (N : in out Node_Id) is