From patchwork Mon May 16 08:42:56 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Pierre-Marie de Rodat X-Patchwork-Id: 54000 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 AC0C73857C71 for ; Mon, 16 May 2022 08:44:30 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org AC0C73857C71 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gcc.gnu.org; s=default; t=1652690670; bh=VDzpFYu2aS2vvtEPqv7RIVzZyFwKP+JAyPFZox4VhVM=; h=Date:To:Subject:List-Id:List-Unsubscribe:List-Archive:List-Post: List-Help:List-Subscribe:From:Reply-To:Cc:From; b=ddJgeGT3kFc/1NzouRH7kNLQP1Um9egWAS0vvoMHl6foa5EkR09jqnWoSCMZCSECS iQY3qToDxf5M1I4KsPBJFDBurrUhuc6UKw+sqY4NWyyv6vkF3tL/Ie1h87y7QZfdYF oS42QsSG5sKhDhw1F8xajBIvjpkFSY5BuoV9/aP0= X-Original-To: gcc-patches@gcc.gnu.org Delivered-To: gcc-patches@gcc.gnu.org Received: from mail-wr1-x42c.google.com (mail-wr1-x42c.google.com [IPv6:2a00:1450:4864:20::42c]) by sourceware.org (Postfix) with ESMTPS id 7C2A23857C4E for ; Mon, 16 May 2022 08:42:58 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.4.1 sourceware.org 7C2A23857C4E Received: by mail-wr1-x42c.google.com with SMTP id t6so19492306wra.4 for ; Mon, 16 May 2022 01:42:58 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=x-gm-message-state:date:from:to:cc:subject:message-id:mime-version :content-disposition; bh=VDzpFYu2aS2vvtEPqv7RIVzZyFwKP+JAyPFZox4VhVM=; b=JFZq9LNMSu9o9Mdegc3CY9ssStREzC60AJVPOCxDNaG8o80h3917RDeIC9+sZz7oKf 8OGFzfzaizTQgHdnHdg6e+SUyB/l2xZ5poURC+psQYm1uUoEgzo3EK4Vml7hREw6rzMj UCs2V/cxxG9XYu50D6N1TKyyLas73VRT7vImMcJxAExTR5/yBZb121RtDMVEHfaWCFE9 AJpMRaIIwPZqeJiADcFTjEyyITLjcjVXUxCsOzVSxZTfGGHaWycnYY9BmPxBRJuRTl1U J8jTtKpLoIM9MQIc+8hEILN3XdkOIrLi4dYEx/OYzrf8Qv1ypQEDQjvUsa3oKWGikd9c utrw== X-Gm-Message-State: AOAM5316tBHzUDJoozqnqF6TDqCbt11cH8cJxef1M5pNN0UggE1kqQWN a8yb2izEGFvY3DQkySvvCtjffGMcih7TgA== X-Google-Smtp-Source: ABdhPJyPK6zC1zvbDrR9xJfY4qTRmyPwyx+mQRyHYsDtJL8VXuU/ZTltZnqca59E2/csBHoOgakPkg== X-Received: by 2002:adf:ed4e:0:b0:20a:c805:1d62 with SMTP id u14-20020adfed4e000000b0020ac8051d62mr13358616wro.134.1652690577236; Mon, 16 May 2022 01:42:57 -0700 (PDT) Received: from adacore.com ([45.147.211.82]) by smtp.gmail.com with ESMTPSA id ay19-20020a05600c1e1300b00396e99d9b50sm8302345wmb.31.2022.05.16.01.42.56 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 16 May 2022 01:42:56 -0700 (PDT) Date: Mon, 16 May 2022 08:42:56 +0000 To: gcc-patches@gcc.gnu.org Subject: [Ada] Clarify code for detecting volatile refinement properties Message-ID: <20220516084256.GA3843342@adacore.com> MIME-Version: 1.0 Content-Disposition: inline X-Spam-Status: No, score=-13.2 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: Pierre-Marie de Rodat via Gcc-patches From: Pierre-Marie de Rodat Reply-To: Pierre-Marie de Rodat Cc: Piotr Trojanek Errors-To: gcc-patches-bounces+patchwork=sourceware.org@gcc.gnu.org Sender: "Gcc-patches" 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. Tested on x86_64-pc-linux-gnu, committed on trunk gcc/ada/ * sem_util.adb (Type_Or_Variable_Has_Enabled_Property): Clarify. diff --git a/gcc/ada/sem_util.adb b/gcc/ada/sem_util.adb --- 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);