From patchwork Fri Jan 24 14:55:23 2014 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Arnaud Charlet X-Patchwork-Id: 313923 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.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by ozlabs.org (Postfix) with ESMTPS id E30352C0084 for ; Sat, 25 Jan 2014 01:55:33 +1100 (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=kqZqGjGpiIN+zjEc3XgRYYhwIUVg7POrmYGBPlMZF7F3pMF8El QTX+rZcmAqiKuWD3dNRE9hHYFpWeOf9S2uaza0y1lTZ8i10SZqnU5jyBJfdTOjqa wweYrblhVeyZjh+Cgzy6iOd6DsIjEuykMPcMtIdLaDutovy5aFf02YIyM= 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=bjpj3KUAG7NTaKqFPcl4k0glDP0=; b=igYadfFSqROhSz1eToVp vBEssNlTEsgc6c0LnBNhwzekYUXqJnHrdGZiTHv7R1OBdHaQrijMUexOHEKZyCbG UXPf/945asi0zK7LDtiRmE/fxxqqV62CfXOIkJtosSJS521cxJT6sVP2u2m4Occ8 UPrCRK+GWlDnD1GXfzNKfTI= Received: (qmail 14303 invoked by alias); 24 Jan 2014 14:55:26 -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 14290 invoked by uid 89); 24 Jan 2014 14:55:26 -0000 Authentication-Results: sourceware.org; auth=none X-Virus-Found: No X-Spam-SWARE-Status: No, score=-1.9 required=5.0 tests=BAYES_00 autolearn=ham version=3.3.2 X-HELO: rock.gnat.com Received: from rock.gnat.com (HELO rock.gnat.com) (205.232.38.15) by sourceware.org (qpsmtpd/0.93/v0.84-503-g423c35a) with (AES256-SHA encrypted) ESMTPS; Fri, 24 Jan 2014 14:55:25 +0000 Received: from localhost (localhost.localdomain [127.0.0.1]) by filtered-rock.gnat.com (Postfix) with ESMTP id 1E1FD1164BC; Fri, 24 Jan 2014 09:55:23 -0500 (EST) 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 hbYZ7tlaTg52; Fri, 24 Jan 2014 09:55:23 -0500 (EST) Received: from kwai.gnat.com (unknown [IPv6:2620:20:4000:0:a6ba:dbff:fe26:1f63]) by rock.gnat.com (Postfix) with ESMTP id 0C3631164B6; Fri, 24 Jan 2014 09:55:23 -0500 (EST) Received: by kwai.gnat.com (Postfix, from userid 4192) id 0A7863FB31; Fri, 24 Jan 2014 09:55:23 -0500 (EST) Date: Fri, 24 Jan 2014 09:55:23 -0500 From: Arnaud Charlet To: gcc-patches@gcc.gnu.org Cc: Yannick Moy Subject: [Ada] Document check flags use in semantic analysis and expander Message-ID: <20140124145523.GA24604@adacore.com> MIME-Version: 1.0 Content-Disposition: inline User-Agent: Mutt/1.5.20 (2009-06-14) Document which check flags are completely set by semantic analysis, including in ASIS mode and GNATprove mode, and which check flags are only partially set. Analysis tools based on a tree obtained by semantic analysis only should thus rely only on the first category of flags to be set in the tree. Tested on x86_64-pc-linux-gnu, committed on trunk 2014-01-24 Yannick Moy * sinfo.ads: Add documentation of check flag fields. Index: sinfo.ads =================================================================== --- sinfo.ads (revision 207026) +++ sinfo.ads (working copy) @@ -516,12 +516,12 @@ -- expansion is performed and the analysis must generate a tree in a -- form that meets additional requirements. - -- This light expansion does two transformations of the tree, that cannot - -- be postponed after the frontend semantic analysis: + -- This light expansion does two transformations of the tree that cannot + -- be postponed after semantic analysis: -- 1. Replace object renamings by renamed object. This requires the - -- introdtion of temporaries at the point of the renaming, which must - -- be properly analyzed. + -- introduction of temporaries at the point of the renaming, which + -- must be properly analyzed. -- 2. Fully qualify entity names. This is needed to generate suitable -- local effects and call-graphs in ALI files, with the completely @@ -549,6 +549,39 @@ -- not make sense from a user point-of-view, and that cross-references that -- do not lead to data dependences for subprograms can be safely ignored. + ----------------------- + -- Check Flag Fields -- + ----------------------- + + -- The following flag fields appear in expression nodes: + + -- Do_Division_Check + -- Do_Overflow_Check + -- Do_Range_Check + + -- These three flags are always set by the front end during semantic + -- analysis, on expression nodes that may trigger the corresponding + -- check. The front end then inserts or not the check during expansion. + -- In particular, these flags should also be correctly set in ASIS mode + -- and GNATprove mode. + + -- Note that this accounts for all nodes that trigger the corresponding + -- checks, except for range checks on subtype_indications, which may be + -- required to check that a range_constraint is compatible with the given + -- subtype (RM 3.2.2(11)). + + -- The following flag fields appear in various nodes: + + -- Do_Accessibility_Check + -- Do_Discriminant_Check + -- Do_Length_Check + -- Do_Storage_Check + -- Do_Tag_Check + + -- These flags are used in some specific cases by the front end, either + -- during semantic analysis or during expansion, and cannot be expected + -- to be set on all nodes that trigger the corresponding check. + ------------------------ -- Common Flag Fields -- ------------------------ @@ -7325,7 +7358,7 @@ -- N_Expression_With_Actions has type Standard_Void_Type. However some -- backends do not support such expression-with-actions occurring -- outside of a proper (non-void) expression, so this should just be - -- used as an intermediate representation within the front-end. Also + -- used as an intermediate representation within the front end. Also -- note that this is really an irregularity (expressions and statements -- are not interchangeable, and in particular an N_Null_Statement is -- not a proper expression), and in the long term all cases of this @@ -7746,7 +7779,7 @@ -- e.g. involving unconstrained array types. -- For the case of the standard gigi backend, this means that all - -- checks are done in the front-end. + -- checks are done in the front end. -- However, in the case of specialized back-ends, notably the JVM -- backend for JGNAT, additional requirements and restrictions apply