From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: by sourceware.org (Postfix, from userid 1914) id 0F3953857C71; Mon, 16 May 2022 08:42:51 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org 0F3953857C71 MIME-Version: 1.0 Content-Transfer-Encoding: 7bit Content-Type: text/plain; charset="utf-8" From: Pierre-Marie de Rodat To: gcc-cvs@gcc.gnu.org Subject: [gcc r13-474] [Ada] Clarify code for detecting volatile refinement properties X-Act-Checkin: gcc X-Git-Author: Piotr Trojanek X-Git-Refname: refs/heads/master X-Git-Oldrev: 07ee67a44d90380c3ab13587dd7d3f4714379d1f X-Git-Newrev: 457fb3369aec1e9d681853bcd33d77bb8da2f8ea Message-Id: <20220516084251.0F3953857C71@sourceware.org> Date: Mon, 16 May 2022 08:42:51 +0000 (GMT) X-BeenThere: gcc-cvs@gcc.gnu.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: Gcc-cvs mailing list List-Unsubscribe: , List-Archive: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 16 May 2022 08:42:51 -0000 https://gcc.gnu.org/g:457fb3369aec1e9d681853bcd33d77bb8da2f8ea commit r13-474-g457fb3369aec1e9d681853bcd33d77bb8da2f8ea Author: Piotr Trojanek Date: Mon Mar 7 14:07:15 2022 +0100 [Ada] Clarify code for detecting volatile refinement properties Routine Type_Or_Variable_Has_Enabled_Property handles either types or objects; replace negation with an explicit positive condition. Cleanup related to handling of volatile refinement aspects in SPARK; behaviour is unaffected. gcc/ada/ * sem_util.adb (Type_Or_Variable_Has_Enabled_Property): Clarify. Diff: --- gcc/ada/sem_util.adb | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/gcc/ada/sem_util.adb b/gcc/ada/sem_util.adb index d53c4356976..6cf3c70c8d9 100644 --- a/gcc/ada/sem_util.adb +++ b/gcc/ada/sem_util.adb @@ -12696,10 +12696,10 @@ package body Sem_Util is return Type_Or_Variable_Has_Enabled_Property (First_Subtype (Etype (Base_Type (Item_Id)))); - -- If not specified explicitly for an object and the type + -- If not specified explicitly for an object and its type -- is effectively volatile, then take result from the type. - elsif not Is_Type (Item_Id) + elsif Is_Object (Item_Id) and then Is_Effectively_Volatile (Etype (Item_Id)) then return Has_Enabled_Property (Etype (Item_Id), Property);