Message ID | 20230525080535.1956040-1-poulhies@adacore.com |
---|---|
State | Accepted |
Headers |
Return-Path: <gcc-patches-bounces+ouuuleilei=gmail.com@gcc.gnu.org> Delivered-To: ouuuleilei@gmail.com Received: by 2002:a59:994d:0:b0:3d9:f83d:47d9 with SMTP id k13csp194294vqr; Thu, 25 May 2023 01:10:03 -0700 (PDT) X-Google-Smtp-Source: ACHHUZ6Gf9D7AAZ+1I32M1mFd+wzQ+t4Ai26I1D9QHu89sXeYPkY0xgALvSW9CH28op1k716NlXm X-Received: by 2002:aa7:d451:0:b0:50b:f9d8:ff72 with SMTP id q17-20020aa7d451000000b0050bf9d8ff72mr4623654edr.31.1685002203164; Thu, 25 May 2023 01:10:03 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1685002203; cv=none; d=google.com; s=arc-20160816; b=L36q0nhlD/o5uHv+4Jr1xFKShG4UAOk0cqPUe7GbxG8alGoOQoGY7QhHuxlWsyAQl9 +oef/zz9tWeTto5xTElxrakCV/aLynA4TrpxIVRdTQ1m14Qomj3oo3LQQDX0oEHSePW5 De28MvqtHI6NH3lcYSXG3bRMni/juIZs62+enSafX+wvC+wH+mBufVa0xW9HPXlmxvhp Zb5ZNpfMdbzL6YEaBlPeXOGBqZby1Y/3NiwVSUA9+fzvi7tiDZJAumzkpYjaLXauEID4 jUlC1zjcybudzIm3VGu8NDbQGOyeFvm4tawAl13hJMRchSSDtM7oJVlmtLq7WDlQtwLt Ey3Q== 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=FZnY3xhdPmYt4K9UZ93dU0cg109BKAzFj6lnV0oWmCg=; b=t1Hfn8/Q2zUYLlNqSbLlLhDxz2EliZZM6XQRVPDSviC/EFaarkYPpOsOn5XNwbiecV nFdvSDDv5yJyhyufjXUr9zLbEBFSsWVS2MC3RGzLqm5kC2hN+GDodQulypF4rLe1E1mo Dr8WZN2ajiRb9iCxligcsLrZ+BNDuiFQJTJbp7Z0g0op9+QxlqTjgHm/2fnMIroAuy7Q 5flACI5yk76J7NQD9FGJc7saTnGElR284pH0wb4cWpt5HVEygfOgHr6f+zq31gLPJOoU FHzuGYo82X0MbXjGXAC9t+WCgpGBdlEkgmce95auNg+RMPuOA5aCRKq3Y3j8X6t2hjQJ 4iWg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@gcc.gnu.org header.s=default header.b=eRc8suhH; 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 s4-20020a056402164400b005049ea38f75si548023edx.622.2023.05.25.01.10.02 for <ouuuleilei@gmail.com> (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 25 May 2023 01:10:03 -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=eRc8suhH; 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 68CF73839DE5 for <ouuuleilei@gmail.com>; Thu, 25 May 2023 08:07:51 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org 68CF73839DE5 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gcc.gnu.org; s=default; t=1685002071; bh=FZnY3xhdPmYt4K9UZ93dU0cg109BKAzFj6lnV0oWmCg=; h=To:Cc:Subject:Date:List-Id:List-Unsubscribe:List-Archive: List-Post:List-Help:List-Subscribe:From:Reply-To:From; b=eRc8suhH7Pp6HxjdS3mPL85wfaHYel0uT66+h/TQ02oG12sEcL5VlWudbUYfhSfFw msPiBAlUclJHF3VV5NxJAaTnxNneyayUMvcMwCtqLgmnNvuZxgduE/y21H3yG1aUZz toc5sW/f2e9MQ1qKLoZgfUPJm1WMV9q30U58ZXVI= X-Original-To: gcc-patches@gcc.gnu.org Delivered-To: gcc-patches@gcc.gnu.org Received: from mail-wm1-x330.google.com (mail-wm1-x330.google.com [IPv6:2a00:1450:4864:20::330]) by sourceware.org (Postfix) with ESMTPS id 08F623857722 for <gcc-patches@gcc.gnu.org>; Thu, 25 May 2023 08:05:38 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.4.2 sourceware.org 08F623857722 Received: by mail-wm1-x330.google.com with SMTP id 5b1f17b1804b1-3f60b3f32b4so2010685e9.1 for <gcc-patches@gcc.gnu.org>; Thu, 25 May 2023 01:05:37 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20221208; t=1685001937; x=1687593937; 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=FZnY3xhdPmYt4K9UZ93dU0cg109BKAzFj6lnV0oWmCg=; b=lCKj/ImSV4yq5ytaRCjI2M/gR0kAqKLuGUW0kwAqdz27pqLGhvzq8QFdaFRHrIJZ16 wyK/A+zb41OaSZSmNxVVYWc82RXzsxKhfERwxuOsf6YjHtsav0qv/ncgzu13R8ljVTb0 Df2RTDEW3GLjtSp4UGjQczJJDuqckDvByix12+f+bRHvst2sUAB0RH1Bayr/PY/arevt I/QGu0kPiZbbv8BkbHhthiBqgDu+8aTrUO5jhJ6h9b96iDCeqb2DNCb08n5j3fUI/FbO rPq3wNnTxisecYMav2E9SlltLXQJBde39umyWWHmQ1kzqFREE7QS9xO1dV9kuQgBCrya 4T1A== X-Gm-Message-State: AC+VfDyKMRUlI4zkhct7Zppgh+dCFSQT4mJoJZZTKVjabb8llsVNGHU1 Dzry6LexOidy0X1jOE0kwa8d1LPkIZv5nKdSXq/r1g== X-Received: by 2002:a05:600c:2109:b0:3f5:1a4:a08d with SMTP id u9-20020a05600c210900b003f501a4a08dmr1793535wml.7.1685001936857; Thu, 25 May 2023 01:05:36 -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 k15-20020a05600c0b4f00b003f611b2aedesm1167999wmr.38.2023.05.25.01.05.36 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 25 May 2023 01:05:36 -0700 (PDT) To: gcc-patches@gcc.gnu.org Cc: Ronan Desplanques <desplanques@adacore.com> Subject: [COMMITTED] ada: Reduce span of variable Date: Thu, 25 May 2023 10:05:35 +0200 Message-Id: <20230525080535.1956040-1-poulhies@adacore.com> X-Mailer: git-send-email 2.40.0 MIME-Version: 1.0 Content-Transfer-Encoding: 8bit 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 <gcc-patches.gcc.gnu.org> List-Unsubscribe: <https://gcc.gnu.org/mailman/options/gcc-patches>, <mailto:gcc-patches-request@gcc.gnu.org?subject=unsubscribe> List-Archive: <https://gcc.gnu.org/pipermail/gcc-patches/> List-Post: <mailto:gcc-patches@gcc.gnu.org> List-Help: <mailto:gcc-patches-request@gcc.gnu.org?subject=help> List-Subscribe: <https://gcc.gnu.org/mailman/listinfo/gcc-patches>, <mailto:gcc-patches-request@gcc.gnu.org?subject=subscribe> From: =?utf-8?q?Marc_Poulhi=C3=A8s_via_Gcc-patches?= <gcc-patches@gcc.gnu.org> Reply-To: =?utf-8?q?Marc_Poulhi=C3=A8s?= <poulhies@adacore.com> Errors-To: gcc-patches-bounces+ouuuleilei=gmail.com@gcc.gnu.org Sender: "Gcc-patches" <gcc-patches-bounces+ouuuleilei=gmail.com@gcc.gnu.org> X-getmail-retrieved-from-mailbox: =?utf-8?q?INBOX?= X-GMAIL-THRID: =?utf-8?q?1766852870222185249?= X-GMAIL-MSGID: =?utf-8?q?1766852870222185249?= |
Series |
[COMMITTED] ada: Reduce span of variable
|
|
Checks
Context | Check | Description |
---|---|---|
snail/gcc-patch-check | success | Github commit url |
Commit Message
Marc Poulhiès
May 25, 2023, 8:05 a.m. UTC
From: Ronan Desplanques <desplanques@adacore.com>
This patch does not change the behavior of the compiler, but is
intended to improve readability. It seizes an opportunity to move
a variable declaration to a smaller scope, so that it's clearer
that the variable is not used outside of that scope.
gcc/ada/
* sem_ch3.adb (Replace_Type): Reduce span of variable.
Tested on x86_64-pc-linux-gnu, committed on master.
---
gcc/ada/sem_ch3.adb | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/gcc/ada/sem_ch3.adb b/gcc/ada/sem_ch3.adb index a0783195b8b..c8af679b404 100644 --- a/gcc/ada/sem_ch3.adb +++ b/gcc/ada/sem_ch3.adb @@ -15901,7 +15901,6 @@ package body Sem_Ch3 is procedure Replace_Type (Id, New_Id : Entity_Id) is Id_Type : constant Entity_Id := Etype (Id); - Acc_Type : Entity_Id; Par : constant Node_Id := Parent (Derived_Type); begin @@ -15913,6 +15912,7 @@ package body Sem_Ch3 is if Ekind (Id_Type) = E_Anonymous_Access_Type then declare + Acc_Type : Entity_Id; Desig_Typ : Entity_Id := Designated_Type (Id_Type); begin