From patchwork Thu May 25 08:06:24 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: 98869 Return-Path: Delivered-To: ouuuleilei@gmail.com Received: by 2002:a59:994d:0:b0:3d9:f83d:47d9 with SMTP id k13csp203080vqr; Thu, 25 May 2023 01:27:08 -0700 (PDT) X-Google-Smtp-Source: ACHHUZ62mqyvQR/vWTqS14qDhffJOOmiEeIqhi5Mq/Mh894ONTkHNXvUX+br5bI/S5WtmGvwC6qA X-Received: by 2002:a17:907:9347:b0:94a:7b2c:205e with SMTP id bv7-20020a170907934700b0094a7b2c205emr568311ejc.72.1685003228447; Thu, 25 May 2023 01:27:08 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1685003228; cv=none; d=google.com; s=arc-20160816; b=LonHAT09fFjCtmw+VkMFswzYUPGoDPHcTJC9sSbYd/wWCFKuzUzLhkp1cJEP1X8ceU 4Em5bBBykcBVmaHzZJ1/CiyHzzWd30cyTu3DYbM3jKJUpT8aqTWbgeUfO2hGs5b+Kwxf MURjskRoSp2Rc01gpmqqJzfOUUKgqDiCDpqP6yHHgFs8fq9BNsKhGvcfNq+W7DOVtPAx WIfr1qzaxDTtWeLMaSvVUhPM3ToyNIE87Jg7SeNeF1TElIrN6WyKqyLc/D33h6/JuFRO 7wgUw0wC54pl2BEaAIY0nGJvfXqYW6QIZPc52xtf49fpyj0DE4yeLKOF5yPYkT/BbhW+ HkfA== 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=gdJYC3U+3tqBnY6Z18Sl6MPWlqqh8Nt5KYRdy9p0XGI=; b=fpSdIVc4Qm+7YEAoeGZZunrKhGZqCj2FwfStiWjMVsWC15NaUhaMq3oDHd4eTFQ8yT VF/PDaGn0TrCHRX9LXktV3/dnNrE3KDj8m987oYIRxaOL9o1aXPDE4Z1+hHQ+lFYPcuR +49wqTLWM8FqxP/MCdTxiHwmstPKx3uKYF/g5eE6tg21J86+/yi/k6SoG9X/jS+qrNG+ ZsVDAr28uujLEjqS4jRG3+x0y1fKWLH98sq9rIRI450jeATrPV+hfOEpOVn7bLwRpvdi P/OHk39E4BXy76WK9AQyRPlUVB0Hzdw/aAlYEAHmP2me6ZPBy3nOhFxxF+Kgyj5/bnAa KcGg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@gcc.gnu.org header.s=default header.b="msmcA/kK"; spf=pass (google.com: domain of gcc-patches-bounces+ouuuleilei=gmail.com@gcc.gnu.org designates 8.43.85.97 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 (ip-8-43-85-97.sourceware.org. [8.43.85.97]) by mx.google.com with ESMTPS id eq4-20020a170907290400b00965ab48278asi647628ejc.573.2023.05.25.01.27.08 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 25 May 2023 01:27:08 -0700 (PDT) Received-SPF: pass (google.com: domain of gcc-patches-bounces+ouuuleilei=gmail.com@gcc.gnu.org designates 8.43.85.97 as permitted sender) client-ip=8.43.85.97; Authentication-Results: mx.google.com; dkim=pass header.i=@gcc.gnu.org header.s=default header.b="msmcA/kK"; spf=pass (google.com: domain of gcc-patches-bounces+ouuuleilei=gmail.com@gcc.gnu.org designates 8.43.85.97 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 890F439960E7 for ; Thu, 25 May 2023 08:17:41 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org 890F439960E7 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gcc.gnu.org; s=default; t=1685002661; bh=gdJYC3U+3tqBnY6Z18Sl6MPWlqqh8Nt5KYRdy9p0XGI=; h=To:Cc:Subject:Date:List-Id:List-Unsubscribe:List-Archive: List-Post:List-Help:List-Subscribe:From:Reply-To:From; b=msmcA/kKvcOFbK3A66BME8c5nsa8XL604yt3hDG/OhNLqr0nvvDeqrUTlC/Opqqa8 RP83tKBblTeJvref0eIzw/gT8ohQ9DkVgAmrFghTXkLY2PwGMZkG9o8cm+F3tEcwy6 xnFZ7c/DZpuPCnAjtSjccFTtwMN6/t3PmYYxSCM4= X-Original-To: gcc-patches@gcc.gnu.org Delivered-To: gcc-patches@gcc.gnu.org Received: from mail-wr1-x432.google.com (mail-wr1-x432.google.com [IPv6:2a00:1450:4864:20::432]) by sourceware.org (Postfix) with ESMTPS id 057E3384D197 for ; Thu, 25 May 2023 08:06:26 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.4.2 sourceware.org 057E3384D197 Received: by mail-wr1-x432.google.com with SMTP id ffacd0b85a97d-3078d1c8828so1723087f8f.3 for ; Thu, 25 May 2023 01:06:26 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20221208; t=1685001985; x=1687593985; 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=gdJYC3U+3tqBnY6Z18Sl6MPWlqqh8Nt5KYRdy9p0XGI=; b=SGBL2Li9kj3NFgaaSW6U/cVZlS2MrZaMQ7p0ivXwPxl7F4kvTlMNIZ+yd2RnSNIYAv Z3t4HDnUe7PJyfxJ7V/sLgQEOm7087fIxLV1JC0AsNWcYdUxCOnWFr8/duiWiyqSzeNH Kc7AP9mgZcikbweZSBWd79Fy3iGmyp0Qb4b1SQ+E99dQxPQhLQitzPrZXj3Qc0OGX13R AjFQGE+s80HL7UJRJ2sXsEXa9MPrYvxASFRBV6zJehAMxJ3kd6dJ91XWdq3Au6B3uUAR mxb8hCuL/r5GrcKHVvKoPT8NBAob9r5HMPfX0Pb9dlgmA1Pb6hvZlA+eRBf0AUlwHKK0 mZJQ== X-Gm-Message-State: AC+VfDwjjfZXW7TjgSPceGF3ZM7c/G4vEslY8HvOf8SpnlACHv9pPh/Z NWdlqxjxoyNGIh3ydfD86NWMsKpoOkGnNBd+0K8xfw== X-Received: by 2002:a5d:690d:0:b0:309:4ba8:f76e with SMTP id t13-20020a5d690d000000b003094ba8f76emr1512059wru.26.1685001985393; Thu, 25 May 2023 01:06:25 -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 o2-20020a5d4082000000b002feea065cc9sm844633wrp.111.2023.05.25.01.06.24 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 25 May 2023 01:06:24 -0700 (PDT) To: gcc-patches@gcc.gnu.org Cc: Piotr Trojanek Subject: [COMMITTED] ada: Use procedural variant of Next_Index where possible Date: Thu, 25 May 2023 10:06:24 +0200 Message-Id: <20230525080624.1957802-1-poulhies@adacore.com> X-Mailer: git-send-email 2.40.0 MIME-Version: 1.0 X-Spam-Status: No, score=-13.7 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?1766853945359068842?= X-GMAIL-MSGID: =?utf-8?q?1766853945359068842?= From: Piotr Trojanek Code cleanup; semantics is unaffected. gcc/ada/ * einfo-utils.adb (Write_Entity_Info): Use procedural Next_Index. * sem_aggr.adb (Collect_Aggr_Bounds): Reuse local constant. (Resolve_Null_Array_Aggregate): Use procedural Next_Index. Tested on x86_64-pc-linux-gnu, committed on master. --- gcc/ada/einfo-utils.adb | 2 +- gcc/ada/sem_aggr.adb | 6 +++--- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/gcc/ada/einfo-utils.adb b/gcc/ada/einfo-utils.adb index fa28a9e0100..d1db66ff697 100644 --- a/gcc/ada/einfo-utils.adb +++ b/gcc/ada/einfo-utils.adb @@ -3171,7 +3171,7 @@ package body Einfo.Utils is Index := First_Index (Id); while Present (Index) loop Write_Attribute (" ", Etype (Index)); - Index := Next_Index (Index); + Next_Index (Index); end loop; Write_Eol; diff --git a/gcc/ada/sem_aggr.adb b/gcc/ada/sem_aggr.adb index 33c44c42a24..d9520ca8f4b 100644 --- a/gcc/ada/sem_aggr.adb +++ b/gcc/ada/sem_aggr.adb @@ -464,8 +464,8 @@ package body Sem_Aggr is This_Range : constant Node_Id := Aggregate_Bounds (N); -- The aggregate range node of this specific sub-aggregate - This_Low : constant Node_Id := Low_Bound (Aggregate_Bounds (N)); - This_High : constant Node_Id := High_Bound (Aggregate_Bounds (N)); + This_Low : constant Node_Id := Low_Bound (This_Range); + This_High : constant Node_Id := High_Bound (This_Range); -- The aggregate bounds of this specific sub-aggregate Assoc : Node_Id; @@ -4175,7 +4175,7 @@ package body Sem_Aggr is Append (Make_Range (Loc, New_Copy_Tree (Lo), Hi), Constr); Analyze_And_Resolve (Last (Constr), Etype (Index)); - Index := Next_Index (Index); + Next_Index (Index); end loop; Set_Compile_Time_Known_Aggregate (N);