From patchwork Mon Nov 14 13:52:02 2022 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: 19818 Return-Path: Delivered-To: ouuuleilei@gmail.com Received: by 2002:a5d:6687:0:0:0:0:0 with SMTP id l7csp2156290wru; Mon, 14 Nov 2022 05:55:55 -0800 (PST) X-Google-Smtp-Source: AA0mqf6JOY3E/tCQrJ3aOEYYaATo2CLogWekoG4GeJgS7hW4pRjrR2eT16RQ6TUZ7x0SvnpeFKZ7 X-Received: by 2002:a17:907:2993:b0:7ae:37aa:711 with SMTP id eu19-20020a170907299300b007ae37aa0711mr10248501ejc.329.1668434155247; Mon, 14 Nov 2022 05:55:55 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1668434155; cv=none; d=google.com; s=arc-20160816; b=p7GEQHnrmOIBXlH9hKvr/A94zbsao4+heKdlB7VfyGT87fY3iQ8Kxws+Rb+yW6gvrx 4JupDdIxEnAnjfBv7HcMxu3XWbO6sTmE75rhUp0E516kZ3XPSqpTy8qoVDfQp9rRX3Vc 2UnTcXP5CplR9o9Q+EC11qNMC5qBHML/gl6s605TvEnGZQdpb957uNnLzDzRydSfpwz1 qzI0AbdCzADDy8uf89wElZERjtelf7vIzG1NnAICuUvSOsKQ+cYOi1bGF6HhfVl0S9hq 3FRJTlPRz4W3leGBZFbs9I+CWtwEKBD3QnUfBVJosIzdOm+z3DQQ7uxNYejQvTeVp7da BfgA== 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=IKOKuETYxQIh4s0e8Tte6bF/cH3qDt5nSTyugh/pBYU=; b=UTGXZgWt0003adYxflNbCFFvOG9piHaXZCvMlYm8oMBLZUdJMTNLAWQ9JoaVid7KZM EP5iQum7dGWAI0oTJ7W670o113GjsxMM20jtLfyjedZobGX5aijCxiUkd6PYOPyIsA1o YLhMh3ZpXUAMu09YWUNBc6pRO0dJre536Kgp5XxKVDn+GtqtFzcQotn2z9+f7MLzvGkC w5y9mNsvXZHFY1xxZsjRsRWzHIf1GnubwaHAFBj55pHQP/Js176moctqVRftWMuqfGZf 31GyockM/NcoZWOGGIVfkH4rCC0UxtJKcRKj6Jy/P2TVbxeukb+pkjopcFIFKLt6sk2g OJ5g== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@gcc.gnu.org header.s=default header.b=Y8k63iwT; spf=pass (google.com: domain of gcc-patches-bounces+ouuuleilei=gmail.com@gcc.gnu.org designates 2620:52:3:1:0:246e:9693:128c 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 (server2.sourceware.org. [2620:52:3:1:0:246e:9693:128c]) by mx.google.com with ESMTPS id x17-20020a05640226d100b00457ebe79577si9594277edd.623.2022.11.14.05.55.55 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 14 Nov 2022 05:55:55 -0800 (PST) Received-SPF: pass (google.com: domain of gcc-patches-bounces+ouuuleilei=gmail.com@gcc.gnu.org designates 2620:52:3:1:0:246e:9693:128c as permitted sender) client-ip=2620:52:3:1:0:246e:9693:128c; Authentication-Results: mx.google.com; dkim=pass header.i=@gcc.gnu.org header.s=default header.b=Y8k63iwT; spf=pass (google.com: domain of gcc-patches-bounces+ouuuleilei=gmail.com@gcc.gnu.org designates 2620:52:3:1:0:246e:9693:128c 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 9538C383EC43 for ; Mon, 14 Nov 2022 13:53:59 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org 9538C383EC43 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gcc.gnu.org; s=default; t=1668434039; bh=IKOKuETYxQIh4s0e8Tte6bF/cH3qDt5nSTyugh/pBYU=; h=To:Cc:Subject:Date:List-Id:List-Unsubscribe:List-Archive: List-Post:List-Help:List-Subscribe:From:Reply-To:From; b=Y8k63iwTPrlZf/0plwejL6bDNPXjaMoRi/pzSPklck8JdeI/YeZiBebKvRCgc0GDt XDmparR8erwvzHnni12z2ytzKa9w2lc+5eJ3egWiQK/5BSvvoRB9+nfZQ5FtUpu5k/ fwUr82E09fB4MxltSeJoNbQmWACczRnG/IJ0QohA= X-Original-To: gcc-patches@gcc.gnu.org Delivered-To: gcc-patches@gcc.gnu.org Received: from mail-wr1-x433.google.com (mail-wr1-x433.google.com [IPv6:2a00:1450:4864:20::433]) by sourceware.org (Postfix) with ESMTPS id 0B8CE385841A for ; Mon, 14 Nov 2022 13:52:07 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.4.1 sourceware.org 0B8CE385841A Received: by mail-wr1-x433.google.com with SMTP id k8so18399872wrh.1 for ; Mon, 14 Nov 2022 05:52:06 -0800 (PST) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; 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=IKOKuETYxQIh4s0e8Tte6bF/cH3qDt5nSTyugh/pBYU=; b=W7l7VG8jfnEju/TlfqRsqAstl2LokCsPJXtRbjYThtONUOVJOTKOJwKJV4VR/f5A+/ iepBpbO60sgxAUjHBBHWKT3n8T+3PMNh0WhZBt2YLpelm3+cVaK/vhm1u29kF3gLIawS KRy23za+OkUYCXXhwJEM8iLbc4ZJXK7CPB0kuEEjzK7LhMlKBHwPfkgw9mm0ajikO8xP neokmdT+s4R1ImyMnXaJfTqIhuR6k9/OeNXYOhKfttRpf3IXfcCEjlcsgZRQfH80tj3X bFlt/BVilGSbSsYH5qBRdiEwdQB5JHv/w/kM6nI46KDTYGA0RRwjRHiLTugnrHaMU+by abgw== X-Gm-Message-State: ANoB5pl90Tq53hbFyqcbKl9Gq+TluNJObq9JAgkUCDXIiCa5mVJu2D0z J0CA8AlUWsdfIy9effdr//6bwJQHFTifrw== X-Received: by 2002:a5d:4b0c:0:b0:236:6101:7b7d with SMTP id v12-20020a5d4b0c000000b0023661017b7dmr7404861wrq.484.1668433924779; Mon, 14 Nov 2022 05:52:04 -0800 (PST) Received: from localhost.localdomain (static-176-191-105-132.ftth.abo.bbox.fr. [176.191.105.132]) by smtp.gmail.com with ESMTPSA id bt17-20020a056000081100b0023677e1157fsm9772014wrb.56.2022.11.14.05.52.03 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 14 Nov 2022 05:52:04 -0800 (PST) To: gcc-patches@gcc.gnu.org Cc: Piotr Trojanek Subject: [COMMITTED] ada: Expand generic formal subprograms with contracts for GNATprove Date: Mon, 14 Nov 2022 14:52:02 +0100 Message-Id: <20221114135202.52712-1-poulhies@adacore.com> X-Mailer: git-send-email 2.34.1 MIME-Version: 1.0 X-Spam-Status: No, score=-13.4 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 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?1749480012818787925?= X-GMAIL-MSGID: =?utf-8?q?1749480012818787925?= From: Piotr Trojanek In GNATprove mode generic formal subprograms with Pre/Post contracts are now expanded into wrappers, just like in ordinary compilation. gcc/ada/ * sem_ch12.adb (Analyze_Associations): Expand wrappers for GNATprove. Tested on x86_64-pc-linux-gnu, committed on master. --- gcc/ada/sem_ch12.adb | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/gcc/ada/sem_ch12.adb b/gcc/ada/sem_ch12.adb index 276656085be..7af365e49c9 100644 --- a/gcc/ada/sem_ch12.adb +++ b/gcc/ada/sem_ch12.adb @@ -1937,7 +1937,7 @@ package body Sem_Ch12 is -- take place e.g. within an enclosing generic unit. if Has_Contracts (Analyzed_Formal) - and then Expander_Active + and then (Expander_Active or GNATprove_Mode) then Build_Subprogram_Wrappers; end if;