From patchwork Fri May 26 07:35:45 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: 70118 Return-Path: X-Original-To: patchwork@sourceware.org Delivered-To: patchwork@sourceware.org Received: from server2.sourceware.org (localhost [IPv6:::1]) by sourceware.org (Postfix) with ESMTP id 855EF3883005 for ; Fri, 26 May 2023 07:37:18 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org 855EF3883005 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gcc.gnu.org; s=default; t=1685086638; bh=0W7Eqqx6xEkasCLTuCEoQxiQwNLXgAc50CRnUzW/aSU=; h=To:Cc:Subject:Date:List-Id:List-Unsubscribe:List-Archive: List-Post:List-Help:List-Subscribe:From:Reply-To:From; b=GL0C9oNO2Zy6xeVBJU8LLFh3fk9lFVLG8/duSd2RWaXAQn0n26hLzohcYX9D+cVRZ acBcK3LgdbnbCVhJxAqmWJNALVhVktpmwg65rAPWyecLcX7v2lqdVBk+Xjw7co2g8N 2aY+9ou59GaqITbjinFZyyyhZW6Q5ICnNc3F/apM= X-Original-To: gcc-patches@gcc.gnu.org Delivered-To: gcc-patches@gcc.gnu.org Received: from mail-wm1-x32c.google.com (mail-wm1-x32c.google.com [IPv6:2a00:1450:4864:20::32c]) by sourceware.org (Postfix) with ESMTPS id E6D993857728 for ; Fri, 26 May 2023 07:35:47 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.4.2 sourceware.org E6D993857728 Received: by mail-wm1-x32c.google.com with SMTP id 5b1f17b1804b1-3f6dfc4dffaso2861575e9.0 for ; Fri, 26 May 2023 00:35:47 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20221208; t=1685086546; x=1687678546; 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=0W7Eqqx6xEkasCLTuCEoQxiQwNLXgAc50CRnUzW/aSU=; b=VvIPyTA9E5I2M4tEGtq3/vV1ctkOmcyVPZgs9ivV4ZvhD7P4PV+a9nZK7mbH90cdXk RWyrCv9TF+J/JlZnDm22Pcb968OZb8EqINoASy+4KZSLUUKXk7QgQZLFajVcGCqY5Cny gRxsHwoOfOqZYS3E62rL3gsAH8KOI1hJR5rhHEwaDPdt8IG/ThQIqNjKCPWWdbXllrvz gzdYxrz6s81qtLJdikud8/0qJBSnzEQ2qcPtm7/B+ev1XDidUa8iww4NGs8rCcBuxXGH 0MaW39zln78nON50yh8Ekw4nDFraOxhDIVxbnIwKZmbrPNtVUzcJ5+zt0DvqE4ynE0QT YeJA== X-Gm-Message-State: AC+VfDzlaRqA7Sru6OvsK7Oli6tke/dn2mRUKQEdRfE+X91V5U4h8/8c JpZ+B/hFEEjCF2DEuCJ5NifPXQM/oKccsr6MG2a5Gw== X-Google-Smtp-Source: ACHHUZ6Ic5ZvXX9G13S0P0C7hSjUSIY+CZPEH6Rsm2ZVYZqRc7klDCmWAR9uut3hq5zalO6+9ReUsg== X-Received: by 2002:a7b:c8c1:0:b0:3f6:2d8:4823 with SMTP id f1-20020a7bc8c1000000b003f602d84823mr706717wml.3.1685086546720; Fri, 26 May 2023 00:35:46 -0700 (PDT) Received: from localhost.localdomain ([2001:861:3382:1a90:777b:eef4:6f79:f26f]) by smtp.gmail.com with ESMTPSA id v24-20020a1cf718000000b003f606c4ad33sm7999044wmh.32.2023.05.26.00.35.45 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 26 May 2023 00:35:46 -0700 (PDT) To: gcc-patches@gcc.gnu.org Cc: Piotr Trojanek Subject: [COMMITTED] ada: Refine types for an accessibility-checking routine Date: Fri, 26 May 2023 09:35:45 +0200 Message-Id: <20230526073545.2067846-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+patchwork=sourceware.org@gcc.gnu.org Sender: "Gcc-patches" From: Piotr Trojanek Code cleanup related to work on expression functions for GNATprove (which require accessibility checks even when they are not expanded and thus have no explicit return statements). gcc/ada/ * accessibility.adb (Is_Formal_Of_Current_Function): This routine expects an entity reference and not the entity itself, so its parameter is a Node_Id and not an Entity_Id. Tested on x86_64-pc-linux-gnu, committed on master. --- gcc/ada/accessibility.adb | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/gcc/ada/accessibility.adb b/gcc/ada/accessibility.adb index c65c26d8875..bc897d1ef18 100644 --- a/gcc/ada/accessibility.adb +++ b/gcc/ada/accessibility.adb @@ -1153,7 +1153,7 @@ package body Accessibility is -- Obtain the first selector or choice from a given association function Is_Formal_Of_Current_Function - (Assoc_Expr : Entity_Id) return Boolean; + (Assoc_Expr : Node_Id) return Boolean; -- Predicate to test if a given expression associated with a -- discriminant is a formal parameter to the function in which the -- return construct we checking applies to. @@ -1180,7 +1180,7 @@ package body Accessibility is ----------------------------------- function Is_Formal_Of_Current_Function - (Assoc_Expr : Entity_Id) return Boolean is + (Assoc_Expr : Node_Id) return Boolean is begin return Is_Entity_Name (Assoc_Expr) and then Enclosing_Subprogram