From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mail-wr1-x436.google.com (mail-wr1-x436.google.com [IPv6:2a00:1450:4864:20::436]) by sourceware.org (Postfix) with ESMTPS id 2AD6E3855581 for ; Thu, 25 May 2023 08:05:52 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.4.2 sourceware.org 2AD6E3855581 Authentication-Results: sourceware.org; dmarc=pass (p=none dis=none) header.from=adacore.com Authentication-Results: sourceware.org; spf=pass smtp.mailfrom=adacore.com Received: by mail-wr1-x436.google.com with SMTP id ffacd0b85a97d-309438004a6so1156380f8f.2 for ; Thu, 25 May 2023 01:05:52 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=adacore.com; s=google; t=1685001950; x=1687593950; h=content-transfer-encoding:mime-version:message-id:date:subject:cc :to:from:from:to:cc:subject:date:message-id:reply-to; bh=ET7IsMqj19yJZJ91/6IG/7nkGkymNFS6IrYl9Z99/yc=; b=k5FNWtQrQjEJeLpWxJ1gsGoLmOA8eyZjvenZRgn69g8tNG58DJ2iocOBRRDvRExoFA J7ObaHvpz6YoT4g1u+Xc+zruEj0c5DFny/XOfdtepUJ/D0BQAP9pRjlJSlbBgB4IUwuR UvBVH9u7taDXZc1O7PzJTUjXLlIPuIHXPFpW1ESyVQpCz2q28U0u1Fx6lJSW69Y6qF8z 4pKRLtKajO9JeNdnLqmftGBOlJKO+/aV6U5XGLu7CQYgK8vpI5ebu+ElVmkXqs06Pv5T jwCQ8SPeTcp/73JBefUbi1NRkWSYvbJil+Jyrk68uv7Jnup7olXu/QibXjI8BCl3EYY8 QpCA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20221208; t=1685001950; x=1687593950; 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=ET7IsMqj19yJZJ91/6IG/7nkGkymNFS6IrYl9Z99/yc=; b=XhWXSqCSwzEAvw2yaPdsGzgNje42RjuMUgkkM0lyboXtbcPm5Dt0MtBwCxj7LC2X/f 78Tq/ImEmc5QEkQLCoP59EqBVDSSQv3rVmyMEcGWRW98Cwmg18oAh8iGT0w/N9VcQUhL ZkV80Dh5vPpHQsGhzo8wR1Y/eIV+Jn9pz4TulIECaPu9KDzVCieVo42y2y7WnRDvU0FD ANnFKOj9msUDkx7WimJlGEpTKoXqxRVJq/ZW3l5BCc1iqaa89be2s2qi4ePfcvF2Pc8i seUna+RwJ4emFTUI3TnEF5VU74K0e4QoFv87TaHljtAhtbylg8yTRkGlSAt73Sb8cLls MdJQ== X-Gm-Message-State: AC+VfDyWLDCMnC3wTjFn7c+DtsGXu08lc+tJaj44/mQ7xJZsaF1ftMnZ PpN+6d8dgoxcCXdhypK6PnJro/LnJNSHTdmq3zSIBQ== X-Google-Smtp-Source: ACHHUZ5Yl86lN1u7USW9v2+3z1p+0Dh0NDOJN0zqLft/1zzltyoPj75uqwNI+1IcDfPZUUT2vMXZ8A== X-Received: by 2002:adf:eeca:0:b0:309:4ee8:35ce with SMTP id a10-20020adfeeca000000b003094ee835cemr1756270wrp.21.1685001950649; Thu, 25 May 2023 01:05:50 -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 f17-20020a5d5691000000b0030497b3224bsm864061wrv.64.2023.05.25.01.05.49 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 25 May 2023 01:05:50 -0700 (PDT) From: =?UTF-8?q?Marc=20Poulhi=C3=A8s?= To: gcc-patches@gcc.gnu.org Cc: Piotr Trojanek Subject: [COMMITTED] ada: Add missing supportive code for recently added SPARK aspects Date: Thu, 25 May 2023 10:05:49 +0200 Message-Id: <20230525080549.1956470-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.6 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 List-Id: From: Piotr Trojanek Fix minor inconsistencies with the recently added SPARK aspects Exceptional_Cases and Subprogram_Variant, whose implementation is based on Contract_Cases. gcc/ada/ * aspects.ads (Implementation_Defined_Aspect): Recently added aspects are implementation-defined, just like Contract_Cases. * sem_prag.ads (Aspect_Specifying_Pragma): Recently added aspects have corresponding pragmas, just like Contract_Cases. (Pragma_Significant_To_Subprograms): Recently added aspects are significant to subprograms, just like Contract_Cases. Tested on x86_64-pc-linux-gnu, committed on master. --- gcc/ada/aspects.ads | 2 ++ gcc/ada/sem_prag.ads | 46 ++++++++++++++++++++++++-------------------- 2 files changed, 27 insertions(+), 21 deletions(-) diff --git a/gcc/ada/aspects.ads b/gcc/ada/aspects.ads index 6670b64ca49..57719672222 100644 --- a/gcc/ada/aspects.ads +++ b/gcc/ada/aspects.ads @@ -270,6 +270,7 @@ package Aspects is Aspect_Dimension_System => True, Aspect_Effective_Reads => True, Aspect_Effective_Writes => True, + Aspect_Exceptional_Cases => True, Aspect_Extensions_Visible => True, Aspect_Favor_Top_Level => True, Aspect_Ghost => True, @@ -292,6 +293,7 @@ package Aspects is Aspect_Shared => True, Aspect_Simple_Storage_Pool => True, Aspect_Simple_Storage_Pool_Type => True, + Aspect_Subprogram_Variant => True, Aspect_Suppress_Debug_Info => True, Aspect_Suppress_Initialization => True, Aspect_Thread_Local_Storage => True, diff --git a/gcc/ada/sem_prag.ads b/gcc/ada/sem_prag.ads index 993ff7a986b..cbeb815ee0e 100644 --- a/gcc/ada/sem_prag.ads +++ b/gcc/ada/sem_prag.ads @@ -59,6 +59,7 @@ package Sem_Prag is Pragma_Effective_Reads => True, Pragma_Effective_Writes => True, Pragma_Elaborate_Body => True, + Pragma_Exceptional_Cases => True, Pragma_Export => True, Pragma_Extensions_Visible => True, Pragma_Favor_Top_Level => True, @@ -109,6 +110,7 @@ package Sem_Prag is Pragma_Simple_Storage_Pool_Type => True, Pragma_SPARK_Mode => True, Pragma_Storage_Size => True, + Pragma_Subprogram_Variant => True, Pragma_Suppress => True, Pragma_Suppress_Debug_Info => True, Pragma_Suppress_Initialization => True, @@ -208,27 +210,29 @@ package Sem_Prag is -- of subprogram bodies. Pragma_Significant_To_Subprograms : constant array (Pragma_Id) of Boolean := - (Pragma_Contract_Cases => True, - Pragma_Depends => True, - Pragma_Ghost => True, - Pragma_Global => True, - Pragma_Inline => True, - Pragma_Inline_Always => True, - Pragma_Post => True, - Pragma_Post_Class => True, - Pragma_Postcondition => True, - Pragma_Pre => True, - Pragma_Pre_Class => True, - Pragma_Precondition => True, - Pragma_Pure => True, - Pragma_Pure_Function => True, - Pragma_Refined_Depends => True, - Pragma_Refined_Global => True, - Pragma_Refined_Post => True, - Pragma_Refined_State => True, - Pragma_Volatile => True, - Pragma_Volatile_Function => True, - others => False); + (Pragma_Contract_Cases => True, + Pragma_Depends => True, + Pragma_Exceptional_Cases => True, + Pragma_Ghost => True, + Pragma_Global => True, + Pragma_Inline => True, + Pragma_Inline_Always => True, + Pragma_Post => True, + Pragma_Post_Class => True, + Pragma_Postcondition => True, + Pragma_Pre => True, + Pragma_Pre_Class => True, + Pragma_Precondition => True, + Pragma_Pure => True, + Pragma_Pure_Function => True, + Pragma_Refined_Depends => True, + Pragma_Refined_Global => True, + Pragma_Refined_Post => True, + Pragma_Refined_State => True, + Pragma_Subprogram_Variant => True, + Pragma_Volatile => True, + Pragma_Volatile_Function => True, + others => False); ----------------- -- Subprograms -- -- 2.40.0