From patchwork Thu May 25 08:05:49 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: 98847 Return-Path: Delivered-To: ouuuleilei@gmail.com Received: by 2002:a59:994d:0:b0:3d9:f83d:47d9 with SMTP id k13csp196232vqr; Thu, 25 May 2023 01:13:02 -0700 (PDT) X-Google-Smtp-Source: ACHHUZ5UKripYD3zK28OOcWDGvR8R7/HvP7o5yWT1fTh6szWLSE314CvAOcDQNgdCGH5jHv/dBBJ X-Received: by 2002:a17:907:9408:b0:94f:2852:1d2b with SMTP id dk8-20020a170907940800b0094f28521d2bmr640722ejc.72.1685002382369; Thu, 25 May 2023 01:13:02 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1685002382; cv=none; d=google.com; s=arc-20160816; b=OVrFNtfSmKUNj3cq+F8uGhYP4r/B39TszRwl9cMWOQX2/0++ZUeCpb0ThAvMPLuhzA g+GmptyuwFUEfLY+C/XyyGynVhQl2mnEc/FJLmmNYxnqDiC8NiGyDWnTeAaaKCSu3J9c gUqV/Bdh61CI7o05oLdMibbVAsiGCDn2H8hSQilavsbvJGuvNME/ExP7CGHZwu6cApTf NL7PODHQwm6twQKloefTARJd7YS6eEPKovq6hsT0e8KCJNYnmSUmCJQKBcxEXXbUEHPA ESJtO3b8U6myh8VZxGAPzb/Zs4bpy+7Y3UMQmFWHO77iMhV2yoxahP1v3PNxe9AJE0xV wYqw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=sender:errors-to:reply-to:from:list-subscribe:list-help:list-post :list-archive:list-unsubscribe:list-id:precedence :content-transfer-encoding:mime-version:message-id:date:subject:cc :to:dmarc-filter:delivered-to:dkim-signature:dkim-filter; bh=ET7IsMqj19yJZJ91/6IG/7nkGkymNFS6IrYl9Z99/yc=; b=YRnTc3+Upobzb8VHcGFpX4ggnljU4i1Oo4rT22cXLAE42B9sdNZEw+1ggJBcZ/A/aD IY59Vg6yGU0XHbx2wxezLQE6ukK3WN7mSX+grZ3U7Gmr657GhFWvFFCbYfCvJOoJCHZq L5Ok0p7ybEOu6xz8vYrwGu/ydmtmES8z7l9RqlKrZPyhoZc+I5j6QmBPBz2MBFzHqG1u bN29sv6oa41xn2Q+SNN+bsHzcHYdw9/wSs1w4v6eMfcV5WGDbkuwMO3GdHJciviE1mMe X3s2KfpXuGFEX2dHgpsFfkAnnsNKQmlhQu6rhwfzq97F5lIL1hDz0r3Bna0gxobqzQpb enlw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@gcc.gnu.org header.s=default header.b=u35eCFk4; spf=pass (google.com: domain of gcc-patches-bounces+ouuuleilei=gmail.com@gcc.gnu.org designates 8.43.85.97 as permitted sender) smtp.mailfrom="gcc-patches-bounces+ouuuleilei=gmail.com@gcc.gnu.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=gnu.org Received: from sourceware.org (ip-8-43-85-97.sourceware.org. [8.43.85.97]) by mx.google.com with ESMTPS id h22-20020a170906855600b0096f7d9b8b09si675968ejy.999.2023.05.25.01.13.02 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 25 May 2023 01:13:02 -0700 (PDT) Received-SPF: pass (google.com: domain of gcc-patches-bounces+ouuuleilei=gmail.com@gcc.gnu.org designates 8.43.85.97 as permitted sender) client-ip=8.43.85.97; Authentication-Results: mx.google.com; dkim=pass header.i=@gcc.gnu.org header.s=default header.b=u35eCFk4; spf=pass (google.com: domain of gcc-patches-bounces+ouuuleilei=gmail.com@gcc.gnu.org designates 8.43.85.97 as permitted sender) smtp.mailfrom="gcc-patches-bounces+ouuuleilei=gmail.com@gcc.gnu.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=gnu.org Received: from server2.sourceware.org (localhost [IPv6:::1]) by sourceware.org (Postfix) with ESMTP id 34985382E696 for ; Thu, 25 May 2023 08:09:18 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org 34985382E696 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gcc.gnu.org; s=default; t=1685002158; bh=ET7IsMqj19yJZJ91/6IG/7nkGkymNFS6IrYl9Z99/yc=; h=To:Cc:Subject:Date:List-Id:List-Unsubscribe:List-Archive: List-Post:List-Help:List-Subscribe:From:Reply-To:From; b=u35eCFk4/jD26RL45YFPt+QtDgo6DQ21GmLE/sS53s0sRv0TpWrxizb6G//JvCu61 K753B8EzH7m06obAwzXq9U/Z3g3/29oNM46lkxQcewgLGTPQk5qhWrockWcbiYWHlX rZzBOaGdAd94aLT1381CyzCdewUAtHE6EEgxpak8= X-Original-To: gcc-patches@gcc.gnu.org Delivered-To: gcc-patches@gcc.gnu.org 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 Received: by mail-wr1-x436.google.com with SMTP id ffacd0b85a97d-309438004a6so1156380f8f.2 for ; Thu, 25 May 2023 01:05:52 -0700 (PDT) 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-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) 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 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 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+ouuuleilei=gmail.com@gcc.gnu.org Sender: "Gcc-patches" X-getmail-retrieved-from-mailbox: =?utf-8?q?INBOX?= X-GMAIL-THRID: =?utf-8?q?1766853058148387200?= X-GMAIL-MSGID: =?utf-8?q?1766853058148387200?= 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 --