From patchwork Tue Apr 23 09:40:46 2013 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Arnaud Charlet X-Patchwork-Id: 238839 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Received: from sourceware.org (server1.sourceware.org [209.132.180.131]) (using TLSv1 with cipher DHE-RSA-AES256-SHA (256/256 bits)) (Client CN "localhost", Issuer "www.qmailtoaster.com" (not verified)) by ozlabs.org (Postfix) with ESMTPS id B53272C007E for ; Tue, 23 Apr 2013 19:40:55 +1000 (EST) DomainKey-Signature: a=rsa-sha1; c=nofws; d=gcc.gnu.org; h=list-id :list-unsubscribe:list-archive:list-post:list-help:sender:date :from:to:cc:subject:message-id:mime-version:content-type; q=dns; s=default; b=CBgo7y1I1XRtEnmX3qj3wF7OGNmj8SW5TSRWlqFOTSFqJxgB9M QSaGg629GoA8Pdjj1gRaSFKi6P0znN+HlE/FhKis3l+W01xFap3g9L+7KvC6iPw1 EaClVdMBpKLOaTQP8FANbH1+4TAc+mLXkFIu91JfS2m73G5mnb3KTTZnw= DKIM-Signature: v=1; a=rsa-sha1; c=relaxed; d=gcc.gnu.org; h=list-id :list-unsubscribe:list-archive:list-post:list-help:sender:date :from:to:cc:subject:message-id:mime-version:content-type; s= default; bh=NwB5JTdpfZzDZRHYVOYbhwggigY=; b=yD5TkzjVOcmonN+a/E7D xGF4QkKesQlDDWtXHZvSgPVt2RJ1MB5xcvJ3FtzAvkaLSH9EQXsPirI+expjFgK8 zZk4cu5WRJAVuEDWqoUHcviCJ4Jpn+b6i2Gm2na+1OpgVheE9oorIIorz5IPtsbf 5t3t61oeOCXTMyplzlZs4aE= Received: (qmail 8915 invoked by alias); 23 Apr 2013 09:40:48 -0000 Mailing-List: contact gcc-patches-help@gcc.gnu.org; run by ezmlm Precedence: bulk List-Id: List-Unsubscribe: List-Archive: List-Post: List-Help: Sender: gcc-patches-owner@gcc.gnu.org Delivered-To: mailing list gcc-patches@gcc.gnu.org Received: (qmail 8903 invoked by uid 89); 23 Apr 2013 09:40:48 -0000 X-Spam-SWARE-Status: No, score=-1.8 required=5.0 tests=AWL, BAYES_00, RCVD_IN_HOSTKARMA_NO autolearn=ham version=3.3.1 Received: from rock.gnat.com (HELO rock.gnat.com) (205.232.38.15) by sourceware.org (qpsmtpd/0.84/v0.84-167-ge50287c) with ESMTP; Tue, 23 Apr 2013 09:40:47 +0000 Received: from localhost (localhost.localdomain [127.0.0.1]) by filtered-rock.gnat.com (Postfix) with ESMTP id 2B8BA2E95B; Tue, 23 Apr 2013 05:40:46 -0400 (EDT) Received: from rock.gnat.com ([127.0.0.1]) by localhost (rock.gnat.com [127.0.0.1]) (amavisd-new, port 10024) with LMTP id 1pXd3fVf4jab; Tue, 23 Apr 2013 05:40:46 -0400 (EDT) Received: from kwai.gnat.com (kwai.gnat.com [205.232.38.4]) by rock.gnat.com (Postfix) with ESMTP id 0FC982E949; Tue, 23 Apr 2013 05:40:46 -0400 (EDT) Received: by kwai.gnat.com (Postfix, from userid 4192) id 0F5F13FF09; Tue, 23 Apr 2013 05:40:46 -0400 (EDT) Date: Tue, 23 Apr 2013 05:40:46 -0400 From: Arnaud Charlet To: gcc-patches@gcc.gnu.org Cc: Yannick Moy Subject: [Ada] Cleanup code for the generation of the _Postconditions procedure Message-ID: <20130423094046.GA28721@adacore.com> MIME-Version: 1.0 Content-Disposition: inline User-Agent: Mutt/1.5.20 (2009-06-14) X-Virus-Found: No A _Postconditions procedure is created during expansion to check postconditions and invariants of parameters. A special case was made for Postcondition pragmas from the subprogram body: it was checked whether they were enabled before adding them to the list of pragmas to consider in _Postconditions. The only benefit was potentially the absence of generation of an empty _Postconditions procedure if all such postconditions were not enabled. We remove this special case, as it has no valid motivation, and it complexifies the code. Tested on x86_64-pc-linux-gnu, committed on trunk 2013-04-23 Yannick Moy * sem_ch6.adb (Process_PPCs): Do not filter postconditions based on applicable policy. Index: sem_ch6.adb =================================================================== --- sem_ch6.adb (revision 198175) +++ sem_ch6.adb (working copy) @@ -12174,13 +12174,10 @@ Prag := First (Declarations (N)); while Present (Prag) loop if Nkind (Prag) = N_Pragma then - Check_Applicable_Policy (Prag); - -- If pragma, capture if postconditions enabled, else ignore + -- Capture postcondition pragmas - if Pragma_Name (Prag) = Name_Postcondition - and then not Is_Ignored (Prag) - then + if Pragma_Name (Prag) = Name_Postcondition then if Plist = No_List then Plist := Empty_List; end if;