From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 30407 invoked by alias); 17 Sep 2019 08:06:42 -0000 Mailing-List: contact gcc-patches-help@gcc.gnu.org; run by ezmlm Precedence: bulk List-Id: List-Archive: List-Post: List-Help: Sender: gcc-patches-owner@gcc.gnu.org Received: (qmail 30334 invoked by uid 89); 17 Sep 2019 08:06:41 -0000 Authentication-Results: sourceware.org; auth=none X-Spam-SWARE-Status: No, score=-11.1 required=5.0 tests=BAYES_00,GIT_PATCH_2,GIT_PATCH_3,KAM_ASCII_DIVIDERS,RCVD_IN_DNSWL_NONE,SPF_PASS autolearn=ham version=3.3.1 spammy=sem_util X-HELO: rock.gnat.com Received: from rock.gnat.com (HELO rock.gnat.com) (205.232.38.15) by sourceware.org (qpsmtpd/0.93/v0.84-503-g423c35a) with ESMTP; Tue, 17 Sep 2019 08:06:40 +0000 Received: from localhost (localhost.localdomain [127.0.0.1]) by filtered-rock.gnat.com (Postfix) with ESMTP id 05E20117C4A; Tue, 17 Sep 2019 04:06:36 -0400 (EDT) Received: from rock.gnat.com ([127.0.0.1]) by localhost (rock.gnat.com [127.0.0.1]) (amavisd-new, port 10024) with LMTP id 4DiND7zdS3xV; Tue, 17 Sep 2019 04:06:35 -0400 (EDT) Received: from tron.gnat.com (tron.gnat.com [IPv6:2620:20:4000:0:46a8:42ff:fe0e:e294]) by rock.gnat.com (Postfix) with ESMTP id 85E5B117BE1; Tue, 17 Sep 2019 04:06:33 -0400 (EDT) Received: by tron.gnat.com (Postfix, from userid 4862) id 84AEE6AD; Tue, 17 Sep 2019 04:06:33 -0400 (EDT) Date: Tue, 17 Sep 2019 08:06:00 -0000 From: Pierre-Marie de Rodat To: gcc-patches@gcc.gnu.org Cc: Piotr Trojanek Subject: [Ada] A new utility routine for detecting attribute 'Old Message-ID: <20190917080633.GA37488@adacore.com> MIME-Version: 1.0 Content-Type: multipart/mixed; boundary="YZ5djTAD1cGYuMQK" Content-Disposition: inline User-Agent: Mutt/1.5.23 (2014-03-12) X-IsSubscribed: yes X-SW-Source: 2019-09/txt/msg00964.txt.bz2 --YZ5djTAD1cGYuMQK Content-Type: text/plain; charset=us-ascii Content-Disposition: inline Content-length: 293 Add a utility routine for detecting attribute 'Old. It will be immediately reused in the GNATprove backend. Tested on x86_64-pc-linux-gnu, committed on trunk 2019-09-17 Piotr Trojanek gcc/ada/ * sem_util.ads, sem_util.adb (Is_Attribute_Old): New utility routine. --YZ5djTAD1cGYuMQK Content-Type: text/x-diff; charset=us-ascii Content-Disposition: attachment; filename="patch.diff" Content-length: 1053 --- gcc/ada/sem_util.adb +++ gcc/ada/sem_util.adb @@ -13559,6 +13559,16 @@ package body Sem_Util is Is_Volatile_Full_Access (Etype (Entity (N))))); end Is_Atomic_Or_VFA_Object; + ---------------------- + -- Is_Attribute_Old -- + ---------------------- + + function Is_Attribute_Old (N : Node_Id) return Boolean is + begin + return Nkind (N) = N_Attribute_Reference + and then Attribute_Name (N) = Name_Old; + end Is_Attribute_Old; + ------------------------- -- Is_Attribute_Result -- ------------------------- --- gcc/ada/sem_util.ads +++ gcc/ada/sem_util.ads @@ -1549,6 +1549,9 @@ package Sem_Util is -- Determine whether arbitrary node N denotes a reference to an object -- which is either atomic or Volatile_Full_Access. + function Is_Attribute_Old (N : Node_Id) return Boolean; + -- Determine whether node N denotes attribute 'Old + function Is_Attribute_Result (N : Node_Id) return Boolean; -- Determine whether node N denotes attribute 'Result --YZ5djTAD1cGYuMQK--