Message ID | 20231107091919.3905379-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:aa0b:0:b0:403:3b70:6f57 with SMTP id k11csp111316vqo; Tue, 7 Nov 2023 01:20:15 -0800 (PST) X-Google-Smtp-Source: AGHT+IH6hNN1fe3eMc2YWYJ4P3sVzgIjaXUUcjURUu8fQVZ41Qb+9QzKqdpMECHp9PqH1IQrUx55 X-Received: by 2002:a05:620a:280a:b0:77a:1d5b:2ccb with SMTP id f10-20020a05620a280a00b0077a1d5b2ccbmr29178824qkp.6.1699348814968; Tue, 07 Nov 2023 01:20:14 -0800 (PST) ARC-Seal: i=2; a=rsa-sha256; t=1699348814; cv=pass; d=google.com; s=arc-20160816; b=i8E+MwN+lUSI4x033JW9iSuGuW2bxt3WK0wZ8gzVcG56zf7m29kDlQA6TxbYV83JJh 8Hl+Rq8vMKjGoQvd61O/6UHNAHYTPn4at2oM+MkHyrBp/f9zbI61ggZLxMMASNlGxwxE k5iZGNagH6MQFgOHdmMDAAbX4S/uATMLbNu/jgmPcsa2h3JVKFo3A5eaIUYr9R/iwKDW 1doXOP0+FiSIAGTpJ4bsqiE8bDlxqKa3PSQN/Ds5Nqe3cjJhb3whXyPkjbyO3aVxQHh1 hNzhBEeZt0jiflZmMIM9KWswHlIdjMlNTQHaMFQVmaJP4temIuHvA7Aqdlm7FhPrUVSO Em3A== ARC-Message-Signature: i=2; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=errors-to:list-subscribe:list-help:list-post:list-archive :list-unsubscribe:list-id:precedence:content-transfer-encoding :mime-version:message-id:date:subject:cc:to:from:dkim-signature :arc-filter:dmarc-filter:delivered-to; bh=D8dqc7ma781SszX0xlEl3QzM/nMWB+Z7wDMZ5qinCJk=; fh=QRb7QY4BZ0mIIAPiH2G4K0PcYKRtRn2i5A6VLUA8cN4=; b=iVzcxpEcXL4n01OV3pxjZVzrd0aiFWWOxpkyyQrzaRspvcpAH935/dqYNjBTDoGHLR 4LX6xNvXTukFZ8gKvBysfzu+AJm73xzs8EOo9VS8DcVzwzvUvlNlaoorANFlNUwE91Gs Onx3x5nXwLJb2RBeNGXKMUVakMVNIlSnm0dwIoDbMaypslB7QlwPfK8SvzO2AmdCLpjV vgbAl9aBDAAF6RbnCiBNZBPMctww1k2XxFdIhB9nk8gzXaVxsemy+lfbEP5V1WRc3Eng lqhSeu2xCa1nospwmCMhN8oFNED/OLuJTtAmQg7yCLyZDQPJNCXixhsXZO0M2oyDR79o 24kA== ARC-Authentication-Results: i=2; mx.google.com; dkim=pass header.i=@adacore.com header.s=google header.b=Kdob72Du; arc=pass (i=1); 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=adacore.com Received: from server2.sourceware.org (server2.sourceware.org. [2620:52:3:1:0:246e:9693:128c]) by mx.google.com with ESMTPS id q13-20020a05620a0d8d00b0077b935fdc22si3059722qkl.632.2023.11.07.01.20.14 for <ouuuleilei@gmail.com> (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 07 Nov 2023 01:20:14 -0800 (PST) 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=@adacore.com header.s=google header.b=Kdob72Du; arc=pass (i=1); 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=adacore.com Received: from server2.sourceware.org (localhost [IPv6:::1]) by sourceware.org (Postfix) with ESMTP id 15AF53857020 for <ouuuleilei@gmail.com>; Tue, 7 Nov 2023 09:20:06 +0000 (GMT) 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 A48543857009 for <gcc-patches@gcc.gnu.org>; Tue, 7 Nov 2023 09:19:30 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.4.2 sourceware.org A48543857009 Authentication-Results: sourceware.org; dmarc=pass (p=none dis=none) header.from=adacore.com Authentication-Results: sourceware.org; spf=pass smtp.mailfrom=adacore.com ARC-Filter: OpenARC Filter v1.0.0 sourceware.org A48543857009 Authentication-Results: server2.sourceware.org; arc=none smtp.remote-ip=2a00:1450:4864:20::432 ARC-Seal: i=1; a=rsa-sha256; d=sourceware.org; s=key; t=1699348772; cv=none; b=DlGr/nVWIs4GVVHEPImfJQBOuasKAluRbXHW3Bc9wCSjUCj8ixO2U2JdSqAW/PHx4yuouCFDAXmDThUqpuJZSIa8L3ACl6/p50ccz/UhF8UuutVSElxFrrwdh3hpKy77G9JOaa4etqLWzswy/MmhOPvF0RZvEV4pGU8yJX46+Lg= ARC-Message-Signature: i=1; a=rsa-sha256; d=sourceware.org; s=key; t=1699348772; c=relaxed/simple; bh=t98VggtkDjoUkX9gDMkjekqWpCSsNWQoQzIl8F770Sg=; h=DKIM-Signature:From:To:Subject:Date:Message-ID:MIME-Version; b=yGUTU6D6lBEtgrDbwdjqpsno7cMJAsMPo7t9R5xKTkPJZQ1upblyUDvWsC7V8vEBrPJNYg5MY5KMn0wI0J3C22+sby5hH1XXe+D5RNsb7TiiDjE55WXxFw/s+ujT9ZbOqhjw6/Ow0iCRbhSRO/+Mk8l30J56dLkVst9l78XFX60= ARC-Authentication-Results: i=1; server2.sourceware.org Received: by mail-wr1-x432.google.com with SMTP id ffacd0b85a97d-32fbf271346so2163164f8f.1 for <gcc-patches@gcc.gnu.org>; Tue, 07 Nov 2023 01:19:30 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=adacore.com; s=google; t=1699348769; x=1699953569; darn=gcc.gnu.org; h=content-transfer-encoding:mime-version:message-id:date:subject:cc :to:from:from:to:cc:subject:date:message-id:reply-to; bh=D8dqc7ma781SszX0xlEl3QzM/nMWB+Z7wDMZ5qinCJk=; b=Kdob72DuYchGaL0vKos9ImQPF0689vzCAzQINnToQGRuHX0AzvmjLgvn+z3072wzMb 96hAPXxb+0lC/fFGDAckJesrJMZmhhwzGMV0wKx4ssECVpVoFHJVZo/JMJQDRWzNJtgv cdcXzyDU1rBqc7XD0y3sWPW2SLzPtcVtGATzfQITkxFYRU17da3izaGEkQOfkUCndToY PEd5PMeoYKomkS3a7q6r8sbkJGTwUz2ewZiGv/hoNQZZbbsS3PynX0jCEimz3Dt6ECsD os03KVegH5gNTB343L0KLekFposCx5ff+139ZErrJ4op3jNup9h1xqXiluCsIYeeaEsr sT+g== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1699348769; x=1699953569; 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=D8dqc7ma781SszX0xlEl3QzM/nMWB+Z7wDMZ5qinCJk=; b=hoDGlZmzBRX2mKjtDcfTTXvUVyQfTmeHHTx5biTbvIS5jEsGNKT+A+ieGVvV74iZFU aiY7VfDSuJ/fbgB7xsnjESowflHWUoM6hXasBlEn/Cuj7rLbsKSCVU4MacudRgH7VxAG pPvkSkZRSFBCVKGbZQTC/llVQaMa8hXGwMXmNwuYifs6nstoqhn5YDZmOwBjCwBtrLjB 35BR3rOkjHtgXh4vtE9geIjmgONlcog2BPvbNlPIvrAPxxqKcW7MfOv3uZTTLLyU5ZSg rSrhkDhvrxkrv0kwyweNhehu4ZY0s2rzQDBBVWcmsGyuTu7hr+WhDttNHF/mXrlKutb+ P7Sw== X-Gm-Message-State: AOJu0YwaTcn392jzROrqj0b8St4GdbsYbTAdU0E6mvI+qI+879vxWCwN SZcV1yJYqUEK9nFfCUgPDdzfIOISMr/EAyjaZocw6Q== X-Received: by 2002:a05:6000:1c0f:b0:32f:a48b:1e2b with SMTP id ba15-20020a0560001c0f00b0032fa48b1e2bmr11721314wrb.5.1699348769491; Tue, 07 Nov 2023 01:19:29 -0800 (PST) Received: from localhost.localdomain ([2001:861:3382:1a90:dbc1:a1d1:2e58:4040]) by smtp.gmail.com with ESMTPSA id n17-20020a5d6611000000b003142e438e8csm1794211wru.26.2023.11.07.01.19.28 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 07 Nov 2023 01:19:29 -0800 (PST) From: =?utf-8?q?Marc_Poulhi=C3=A8s?= <poulhies@adacore.com> To: gcc-patches@gcc.gnu.org Cc: Piotr Trojanek <trojanek@adacore.com> Subject: [COMMITTED] ada: Cleanup getting of actual subtypes Date: Tue, 7 Nov 2023 10:19:19 +0100 Message-ID: <20231107091919.3905379-1-poulhies@adacore.com> X-Mailer: git-send-email 2.42.0 MIME-Version: 1.0 Content-Transfer-Encoding: 8bit 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.30 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> Errors-To: gcc-patches-bounces+ouuuleilei=gmail.com@gcc.gnu.org X-getmail-retrieved-from-mailbox: INBOX X-GMAIL-THRID: 1781896383251774828 X-GMAIL-MSGID: 1781896383251774828 |
Series |
[COMMITTED] ada: Cleanup getting of actual subtypes
|
|
Checks
Context | Check | Description |
---|---|---|
snail/gcc-patch-check | success | Github commit url |
Commit Message
Marc Poulhiès
Nov. 7, 2023, 9:19 a.m. UTC
From: Piotr Trojanek <trojanek@adacore.com>
Avoid potentially unnecessary call to Etype.
gcc/ada/
* sem_util.adb (Get_Actual_Subtype_If_Available): Only call Etype
when necessary.
Tested on x86_64-pc-linux-gnu, committed on master.
---
gcc/ada/sem_util.adb | 4 +---
1 file changed, 1 insertion(+), 3 deletions(-)
diff --git a/gcc/ada/sem_util.adb b/gcc/ada/sem_util.adb index da531e53466..d5df05b88e1 100644 --- a/gcc/ada/sem_util.adb +++ b/gcc/ada/sem_util.adb @@ -10218,8 +10218,6 @@ package body Sem_Util is ------------------------------------- function Get_Actual_Subtype_If_Available (N : Node_Id) return Entity_Id is - Typ : constant Entity_Id := Etype (N); - begin -- If what we have is an identifier that references a subprogram -- formal, or a variable or constant object, then we get the actual @@ -10245,7 +10243,7 @@ package body Sem_Util is -- Otherwise the Etype of N is returned unchanged else - return Typ; + return Etype (N); end if; end Get_Actual_Subtype_If_Available;