From patchwork Fri Oct 22 09:40:22 2010 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Arnaud Charlet X-Patchwork-Id: 68819 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]) by ozlabs.org (Postfix) with SMTP id 1D628B6F10 for ; Fri, 22 Oct 2010 20:40:42 +1100 (EST) Received: (qmail 24087 invoked by alias); 22 Oct 2010 09:40:34 -0000 Received: (qmail 24052 invoked by uid 22791); 22 Oct 2010 09:40:31 -0000 X-SWARE-Spam-Status: No, hits=-1.5 required=5.0 tests=AWL, BAYES_00, T_RP_MATCHES_RCVD X-Spam-Check-By: sourceware.org Received: from mel.act-europe.fr (HELO mel.act-europe.fr) (194.98.77.210) by sourceware.org (qpsmtpd/0.43rc1) with ESMTP; Fri, 22 Oct 2010 09:40:25 +0000 Received: from localhost (localhost [127.0.0.1]) by filtered-smtp.eu.adacore.com (Postfix) with ESMTP id 06B50CB0290; Fri, 22 Oct 2010 11:40:23 +0200 (CEST) Received: from mel.act-europe.fr ([127.0.0.1]) by localhost (smtp.eu.adacore.com [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id eaYtPBK-+1Ga; Fri, 22 Oct 2010 11:40:22 +0200 (CEST) Received: from saumur.act-europe.fr (saumur.act-europe.fr [10.10.0.183]) by mel.act-europe.fr (Postfix) with ESMTP id DFAABCB0223; Fri, 22 Oct 2010 11:40:22 +0200 (CEST) Received: by saumur.act-europe.fr (Postfix, from userid 525) id C2CB5D9BB4; Fri, 22 Oct 2010 11:40:22 +0200 (CEST) Date: Fri, 22 Oct 2010 11:40:22 +0200 From: Arnaud Charlet To: gcc-patches@gcc.gnu.org Cc: Robert Dewar Subject: [Ada] Minor code reorganization, move Is_Generic_Formal Message-ID: <20101022094022.GA20507@adacore.com> Mime-Version: 1.0 Content-Disposition: inline User-Agent: Mutt/1.5.9i X-IsSubscribed: yes 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 Minor code reorganization, move Is_Generic_Formal from Sem_Util to Sem_Aux. No test needed, no functional effect. Tested on x86_64-pc-linux-gnu, committed on trunk 2010-10-22 Robert Dewar * sem_util.ads, sem_util.adb, sem_aux.ads, sem_aux.adb (Is_Generic_Formal): Moved from Sem_Util to Sem_Aux. Index: sem_aux.adb =================================================================== --- sem_aux.adb (revision 165807) +++ sem_aux.adb (working copy) @@ -537,6 +537,25 @@ package body Sem_Aux is end if; end Is_Derived_Type; + ----------------------- + -- Is_Generic_Formal -- + ----------------------- + + function Is_Generic_Formal (E : Entity_Id) return Boolean is + Kind : Node_Kind; + begin + if No (E) then + return False; + else + Kind := Nkind (Parent (E)); + return + Nkind_In (Kind, N_Formal_Object_Declaration, + N_Formal_Package_Declaration, + N_Formal_Type_Declaration) + or else Is_Formal_Subprogram (E); + end if; + end Is_Generic_Formal; + --------------------------- -- Is_Indefinite_Subtype -- --------------------------- Index: sem_aux.ads =================================================================== --- sem_aux.ads (revision 165807) +++ sem_aux.ads (working copy) @@ -159,6 +159,11 @@ package Sem_Aux is -- Determines if the given entity Ent is a derived type. Result is always -- false if argument is not a type. + function Is_Generic_Formal (E : Entity_Id) return Boolean; + -- Determine whether E is a generic formal parameter. In particular this is + -- used to set the visibility of generic formals of a generic package + -- declared with a box or with partial parametrization. + function Is_Indefinite_Subtype (Ent : Entity_Id) return Boolean; -- Ent is any entity. Determines if given entity is an unconstrained array -- type or subtype, a discriminated record type or subtype with no initial Index: sem_util.adb =================================================================== --- sem_util.adb (revision 165810) +++ sem_util.adb (working copy) @@ -6559,25 +6559,6 @@ package body Sem_Util is end if; end Is_Fully_Initialized_Variant; - ----------------------- - -- Is_Generic_Formal -- - ----------------------- - - function Is_Generic_Formal (E : Entity_Id) return Boolean is - Kind : Node_Kind; - begin - if No (E) then - return False; - else - Kind := Nkind (Parent (E)); - return - Nkind_In (Kind, N_Formal_Object_Declaration, - N_Formal_Package_Declaration, - N_Formal_Type_Declaration) - or else Is_Formal_Subprogram (E); - end if; - end Is_Generic_Formal; - ------------ -- Is_LHS -- ------------ Index: sem_util.ads =================================================================== --- sem_util.ads (revision 165810) +++ sem_util.ads (working copy) @@ -733,11 +733,6 @@ package Sem_Util is -- means that the result returned is not crucial, but should err on the -- side of thinking things are fully initialized if it does not know. - function Is_Generic_Formal (E : Entity_Id) return Boolean; - -- Determine whether E is a generic formal parameter. In particular this is - -- used to set the visibility of generic formals of a generic package - -- declared with a box or with partial parametrization. - function Is_Inherited_Operation (E : Entity_Id) return Boolean; -- E is a subprogram. Return True is E is an implicit operation inherited -- by a derived type declarations.