From patchwork Tue May 30 07:20:31 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: 100578 Return-Path: Delivered-To: ouuuleilei@gmail.com Received: by 2002:a59:994d:0:b0:3d9:f83d:47d9 with SMTP id k13csp1994789vqr; Tue, 30 May 2023 00:22:09 -0700 (PDT) X-Google-Smtp-Source: ACHHUZ6pDEpkR1bG30mDlBsAAy1qVkJyDKJS4ZDTx1Cj+93r98ueoX86+QTQldtml5WXkgKzTK4W X-Received: by 2002:aa7:d88d:0:b0:514:8eb3:8bf6 with SMTP id u13-20020aa7d88d000000b005148eb38bf6mr954554edq.35.1685431329398; Tue, 30 May 2023 00:22:09 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1685431329; cv=none; d=google.com; s=arc-20160816; b=fZN/1wccka9U49Lw/pptR10bQ8J1KC+kyGsLJkyiG635xZlyk+3w55rVl0wYQtEGLy 4IfUYWLXQ0bzBa0Gm6WJJS2wT2XeFo6Cos3lAoApWHvqRQZWL8NmjWCsAMKCHIK2TAZ+ CqDDbWEIyyGuerM/o6U5kkj8iJFN+8XKW7h5z2ffKx7BrTAI9UEexLvIvI80oaSSfn/a XG4Edsc06+D11P7hGr5uyOLmUHsG+3Ki+TFfi6z5lBfB9SmGdk/P06/Ma/a3Rh4y/zT2 rtaHANEXDctvOnjA/hhVvb3UfQZoxqVNSFLjMGvX7fNHYNmwYKtCaNbOyLjficKhR/WK BMjA== 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=JUe0KikVOXOixbPHeDQ8ztf3AhorPk6JnLrdnQ9Z+54=; b=xhex8kPCqjN7sjI9jiXiqfVyghYd4I6Pkto1QSwKnwsntS1VZwOYnthbR7vgikB7EM vCumGzKuHVCPyPVtrvNuJavJsx2Gu7fnN4UY+AcRM0E0/s+0S99LJ6+qrb6MY0WQUznG Aq0wtkVBGKhw/D5Dx3JXwLVRykrgRSzWyutolq/+zjQV9VQ5jNno+XfUNd6aD0sURs39 uOqyKk7bqXbZNj1xmcb/sT1uaYDK7UUdnkqwp6JVHin6g5zDmegPlRiP9MxI99zOrXTr 4AyCO5eSpJUt4ZB7rmxz8bxkW503KDKV6bGHLRA9aRVrjxaHuTXjy7nIRehNt4sU8BAQ XSBQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@gcc.gnu.org header.s=default header.b=cO8PB+Tv; 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 m13-20020aa7c48d000000b00514926e51bcsi930328edq.595.2023.05.30.00.22.09 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 30 May 2023 00:22:09 -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=cO8PB+Tv; 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 99CC3384FDF2 for ; Tue, 30 May 2023 07:21:23 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org 99CC3384FDF2 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gcc.gnu.org; s=default; t=1685431283; bh=JUe0KikVOXOixbPHeDQ8ztf3AhorPk6JnLrdnQ9Z+54=; h=To:Cc:Subject:Date:List-Id:List-Unsubscribe:List-Archive: List-Post:List-Help:List-Subscribe:From:Reply-To:From; b=cO8PB+Tvf9uuvNV11NJXQqsbYPCux6mZxcILBn58AChXe0Mt5ay0E7H17cIhgS5MG YLZ0U9aijQI7Ez3bupR2GnNr7OsreoEKm+Rctii401GcmGvAuJafifo6ZKwWC7ZRKl +gSQN3wWcEM/69EnnE/krf7Bjz0VNmHSb2vrZ1VI= X-Original-To: gcc-patches@gcc.gnu.org Delivered-To: gcc-patches@gcc.gnu.org Received: from mail-wm1-x333.google.com (mail-wm1-x333.google.com [IPv6:2a00:1450:4864:20::333]) by sourceware.org (Postfix) with ESMTPS id E3FA7385662F for ; Tue, 30 May 2023 07:20:34 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.4.2 sourceware.org E3FA7385662F Received: by mail-wm1-x333.google.com with SMTP id 5b1f17b1804b1-3f60804faf4so26556275e9.3 for ; Tue, 30 May 2023 00:20:34 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20221208; t=1685431233; x=1688023233; 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=JUe0KikVOXOixbPHeDQ8ztf3AhorPk6JnLrdnQ9Z+54=; b=gTOSW0ELAFiAJr7f1zfxJ1XwlVl2YFwR6tnTvZqCwk1kkmacf5d34reakOuY/IF0tU QVIb93mCTpu8wZrm6lMOI5P2EMdWJCO6jn9kh0Jb3p812+PwUbyMnfVA5UrKXlAyWPhv bGzSW2yDrh5W1v17FPE54aLh4GINBDl0fZfcZ87Ez8h6LfCVwCLxvVMp0+yPxK8KFKYz URC6Kp6PjHqnwJ1mcw2iCyySHGxoNIIrZA0r+S/TnpO5EOMLimAh5w2lKRngDri6QS2p WXkRbKJOWhBe/3TeCt0ssZP0mhlZMd8/U4E87nmEbr/S+poi24aB6RWDJh6KxALH1jfT AzAw== X-Gm-Message-State: AC+VfDw3yW7B74/TaqjbRgPwlUHr/6vOMdxrEwWbxtKvSB7c0XdtrSYB ar7jCowMNO1Um/zqEJlT9MnvvLbSA6XXHAbWEZ4Gcw== X-Received: by 2002:a7b:c4d7:0:b0:3f5:ffe7:bf11 with SMTP id g23-20020a7bc4d7000000b003f5ffe7bf11mr915001wmk.36.1685431233745; Tue, 30 May 2023 00:20:33 -0700 (PDT) Received: from localhost.localdomain ([2001:861:3382:1a90:7733:a608:a415:6b2a]) by smtp.gmail.com with ESMTPSA id y6-20020a05600c364600b003f6042d6da0sm16382804wmq.16.2023.05.30.00.20.32 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 30 May 2023 00:20:33 -0700 (PDT) To: gcc-patches@gcc.gnu.org Cc: Eric Botcazou Subject: [COMMITTED] ada: Use generalized loop iteration in Put_Image routines Date: Tue, 30 May 2023 09:20:31 +0200 Message-Id: <20230530072031.2499585-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?1767302842028766514?= X-GMAIL-MSGID: =?utf-8?q?1767302842028766514?= From: Eric Botcazou gcc/ada/ * libgnat/a-cidlli.adb (Put_Image): Simplify. * libgnat/a-coinve.adb (Put_Image): Likewise. Tested on x86_64-pc-linux-gnu, committed on master. --- gcc/ada/libgnat/a-cidlli.adb | 13 +++++-------- gcc/ada/libgnat/a-coinve.adb | 13 +++++-------- 2 files changed, 10 insertions(+), 16 deletions(-) diff --git a/gcc/ada/libgnat/a-cidlli.adb b/gcc/ada/libgnat/a-cidlli.adb index 65582d152f0..9e6ad70a103 100644 --- a/gcc/ada/libgnat/a-cidlli.adb +++ b/gcc/ada/libgnat/a-cidlli.adb @@ -1283,22 +1283,19 @@ is is First_Time : Boolean := True; use System.Put_Images; + begin + Array_Before (S); - procedure Put_Elem (Position : Cursor); - procedure Put_Elem (Position : Cursor) is - begin + for X of V loop if First_Time then First_Time := False; else Simple_Array_Between (S); end if; - Element_Type'Put_Image (S, Element (Position)); - end Put_Elem; + Element_Type'Put_Image (S, X); + end loop; - begin - Array_Before (S); - Iterate (V, Put_Elem'Access); Array_After (S); end Put_Image; diff --git a/gcc/ada/libgnat/a-coinve.adb b/gcc/ada/libgnat/a-coinve.adb index 846f819a732..dd0e8cdee40 100644 --- a/gcc/ada/libgnat/a-coinve.adb +++ b/gcc/ada/libgnat/a-coinve.adb @@ -2679,22 +2679,19 @@ is is First_Time : Boolean := True; use System.Put_Images; + begin + Array_Before (S); - procedure Put_Elem (Position : Cursor); - procedure Put_Elem (Position : Cursor) is - begin + for X of V loop if First_Time then First_Time := False; else Simple_Array_Between (S); end if; - Element_Type'Put_Image (S, Element (Position)); - end Put_Elem; + Element_Type'Put_Image (S, X); + end loop; - begin - Array_Before (S); - Iterate (V, Put_Elem'Access); Array_After (S); end Put_Image;