Message ID | 20230529082910.2409702-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 k13csp1361981vqr; Mon, 29 May 2023 01:34:08 -0700 (PDT) X-Google-Smtp-Source: ACHHUZ4qlLCQboBZLY2QmA0jMu8piDjdjcs6TNvLsBYdPFzSrRbrKhWMdv11DaoKfM2kka0qbylX X-Received: by 2002:a05:6402:b23:b0:514:9c77:50b7 with SMTP id bo3-20020a0564020b2300b005149c7750b7mr2430107edb.25.1685349248743; Mon, 29 May 2023 01:34:08 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1685349248; cv=none; d=google.com; s=arc-20160816; b=sYBUx42TkPSi9chxqTUEHwj3rF8R7tBxgM9gvWs6dULbfcBxegdJXoiNN9RKzONgWP /xXiROAZEkmJEUvZ1sARt8dphbZCogFbwqlHvuCYnvhtenV6Dqz0Tev++4k5uDVnceI/ VnKufSISlrzzPIL38FOp2kQ+ljqx3U9WGZAI+CB8C1Yj7jAxbLsPKIUSMa9SQwlOmk7J WUmnAsit0hC3X0P2E3qw7+QXXlFDqeh3T3plkGB7vaKrBExbHwzzoKRNO/T21nucz+NM RHyLeJmgjk5/8HnyrBC/8d4MdTdtfLcbA40aWvCGJYkr7DFSq7vytKMcHO7f9M6k//6N kxGg== 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=MVQNBoT+/MyAsNPOjSB+1yMNQ+WWoMc777APF5+qFgU=; b=vRlmyM3nsn9wsvexCZB81ts5ihRThlgsg0lcinXSJtzqYqNo9ImFxYfScii2Vdpapm LasLxLm//TBe7u45T0Wi59T5Lwf2dnCAQK4RaBcb6YNtH0o8dXvIdL3SpdSltInwi99v Ox9lrdLaauGE3joQ6R42ESflSeaJXGA/C73SiXwXJmSVTbbo0HIqs7aqffBCsgs4uJlY ICxhk73pOI8l5jMXS+mrfgvwDJeHi9rSDCwkhZa5Vvv5zq9/E5zSGVpI0MZgDHRw+Rsn vEL/62ZIOejxNn1QqlqYW8+mFznuPOgESyFpiK+MtZDNr1wjx65ipGenDn9Cu/98sz6/ DRKQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@gcc.gnu.org header.s=default header.b="GbPtdl4/"; 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 w18-20020a056402129200b0050e035d7980si4147398edv.122.2023.05.29.01.34.08 for <ouuuleilei@gmail.com> (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 29 May 2023 01:34:08 -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="GbPtdl4/"; 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 6918038498CE for <ouuuleilei@gmail.com>; Mon, 29 May 2023 08:31:53 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org 6918038498CE DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gcc.gnu.org; s=default; t=1685349113; bh=MVQNBoT+/MyAsNPOjSB+1yMNQ+WWoMc777APF5+qFgU=; h=To:Cc:Subject:Date:List-Id:List-Unsubscribe:List-Archive: List-Post:List-Help:List-Subscribe:From:Reply-To:From; b=GbPtdl4/dxVPaVGQmisQXhP5FCNgoQcpn8edCfJemVCw7l11GAz43Zp9pLcIWOPCw zlp97DTI7AvgpYM/6GlPMJXOJQmkdFFG7AE1t7mKpVIas0Ek4u103KsGt15QkGQ1nN G3uVNWq+CpblbVRZQ1BIJJUWjUeGBNL6jCklh8DI= 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 3470A385696F for <gcc-patches@gcc.gnu.org>; Mon, 29 May 2023 08:29:13 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.4.2 sourceware.org 3470A385696F Received: by mail-wr1-x432.google.com with SMTP id ffacd0b85a97d-30ae5f2ac94so1333804f8f.1 for <gcc-patches@gcc.gnu.org>; Mon, 29 May 2023 01:29:13 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20221208; t=1685348952; x=1687940952; 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=MVQNBoT+/MyAsNPOjSB+1yMNQ+WWoMc777APF5+qFgU=; b=A7KOt5fdv5jbhMwjFcAVLHeginisKwxJm1/pj1EhnKQsNomQR2eXwwtvwB60oNG1br MMpdRuZ+o/7FxuKZKNbIt4vBCnsbqhZ/FRpUMBQqm14GH4HGulXHxetva9BvyTS3bP1T pG60L32ArqS4xpYqrHYQzikrixDQKx3gJNX9TImwBzDbWsmAcY2bLCC3i9n+oE6ZiH8Y LPGcPTyuCzQ2TNmdmanHoDJ35B6p69mg/eY8n38bBvpTnA4c3uknPwMAXzxCQT8Z95rd O3n2DC5nuGXGtV6pFr8hXX7NlKOc9jCnFwYRZ0aVfyZczjCotAnSxEtijQ+I+zxYzMsU y3fw== X-Gm-Message-State: AC+VfDwoeVUVC2C7UKyk+WYtP7IkNZZhU/71W6VV6jOvYRvBS0GGbvXp zNp/X+MmlO6KPq52KYItTQQlvmmTrnS8HTdveI2BzQ== X-Received: by 2002:a5d:6647:0:b0:30a:dd26:63cd with SMTP id f7-20020a5d6647000000b0030add2663cdmr8055710wrw.5.1685348952030; Mon, 29 May 2023 01:29:12 -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 z16-20020adfe550000000b003063a92bbf5sm13144392wrm.70.2023.05.29.01.29.11 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 29 May 2023 01:29:11 -0700 (PDT) To: gcc-patches@gcc.gnu.org Cc: Piotr Trojanek <trojanek@adacore.com> Subject: [COMMITTED] ada: Fix retrieval of spec entity from entry body entity Date: Mon, 29 May 2023 10:29:10 +0200 Message-Id: <20230529082910.2409702-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.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 <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?1767216773866069380?= X-GMAIL-MSGID: =?utf-8?q?1767216773866069380?= |
Series |
[COMMITTED] ada: Fix retrieval of spec entity from entry body entity
|
|
Checks
Context | Check | Description |
---|---|---|
snail/gcc-patch-check | success | Github commit url |
Commit Message
Marc Poulhiès
May 29, 2023, 8:29 a.m. UTC
From: Piotr Trojanek <trojanek@adacore.com>
When retrieving entities of subprogram spec we only handled functions
and procedures, but not entries. This had no consequences, because we
then only applied checks to functions, but still is worth a cleanup, so
the code is easier to adapt for access-to-subprogram entities as well.
gcc/ada/
* sem_util.adb (Check_Result_And_Post_State): Properly handle entry
bodies.
Tested on x86_64-pc-linux-gnu, committed on master.
---
gcc/ada/sem_util.adb | 3 +++
1 file changed, 3 insertions(+)
diff --git a/gcc/ada/sem_util.adb b/gcc/ada/sem_util.adb index 1839214332d..d71329bbcb2 100644 --- a/gcc/ada/sem_util.adb +++ b/gcc/ada/sem_util.adb @@ -4582,6 +4582,9 @@ package body Sem_Util is then Spec_Id := Corresponding_Spec_Of_Stub (Subp_Decl); + elsif Nkind (Subp_Decl) = N_Entry_Body then + Spec_Id := Corresponding_Spec (Subp_Decl); + else Spec_Id := Subp_Id; end if;