From patchwork Mon Oct 18 09:55:55 2010 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Arnaud Charlet X-Patchwork-Id: 68156 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 8DDB1B70E6 for ; Mon, 18 Oct 2010 20:56:03 +1100 (EST) Received: (qmail 22648 invoked by alias); 18 Oct 2010 09:56:02 -0000 Received: (qmail 22638 invoked by uid 22791); 18 Oct 2010 09:56:01 -0000 X-SWARE-Spam-Status: No, hits=-1.8 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) (212.99.106.210) by sourceware.org (qpsmtpd/0.43rc1) with ESMTP; Mon, 18 Oct 2010 09:55:57 +0000 Received: from localhost (localhost [127.0.0.1]) by filtered-smtp.eu.adacore.com (Postfix) with ESMTP id 65D3CCB02A5; Mon, 18 Oct 2010 11:55:55 +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 Jv9NhExjCt87; Mon, 18 Oct 2010 11:55:55 +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 53257CB022E; Mon, 18 Oct 2010 11:55:55 +0200 (CEST) Received: by saumur.act-europe.fr (Postfix, from userid 525) id 3572AD9BB4; Mon, 18 Oct 2010 11:55:55 +0200 (CEST) Date: Mon, 18 Oct 2010 11:55:55 +0200 From: Arnaud Charlet To: gcc-patches@gcc.gnu.org Cc: Eric Botcazou Subject: [Ada] Use Freeze_Before in lieu of more verbose sequence Message-ID: <20101018095555.GA2598@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 This replaces a few sequences equivalent to Freeze_Before with explicit calls to the procedure. No functional changes. Tested on x86_64-pc-linux-gnu, committed on trunk 2010-10-18 Eric Botcazou * exp_ch6.adb (Expand_N_Subprogram_Declaration): Use Freeze_Before. (Expand_Protected_Object_Reference): Likewise. * sem_attr.adb (Resolve_Attribute): Likewise. * sem_ch3.adb (Analyze_Subtype_Declaration): Likewise. * sem_ch6.adb (Analyze_Subprogram_Body_Helper): Likewise. Index: sem_ch3.adb =================================================================== --- sem_ch3.adb (revision 165612) +++ sem_ch3.adb (working copy) @@ -4180,7 +4180,7 @@ package body Sem_Ch3 is end if; end if; - -- Make sure that generic actual types are properly frozen The subtype + -- Make sure that generic actual types are properly frozen. The subtype -- is marked as a generic actual type when the enclosing instance is -- analyzed, so here we identify the subtype from the tree structure. @@ -4191,7 +4191,7 @@ package body Sem_Ch3 is and then Nkind (Subtype_Indication (N)) /= N_Subtype_Indication and then Is_Frozen (T) then - Insert_Actions (N, Freeze_Entity (Id, N)); + Freeze_Before (N, Id); end if; Set_Optimize_Alignment_Flags (Id); Index: sem_attr.adb =================================================================== --- sem_attr.adb (revision 165610) +++ sem_attr.adb (working copy) @@ -7921,7 +7921,7 @@ package body Sem_Attr is -- Avoid insertion of freeze actions in spec expression mode if not In_Spec_Expression then - Insert_Actions (N, Freeze_Entity (Entity (P), N)); + Freeze_Before (N, Entity (P)); end if; elsif Is_Type (Entity (P)) then Index: exp_ch6.adb =================================================================== --- exp_ch6.adb (revision 165610) +++ exp_ch6.adb (working copy) @@ -5459,7 +5459,7 @@ package body Exp_Ch6 is Push_Scope (Scope (Scop)); Analyze (Prot_Decl); - Insert_Actions (N, Freeze_Entity (Prot_Id, N)); + Freeze_Before (N, Prot_Id); Set_Protected_Body_Subprogram (Subp, Prot_Id); -- Create protected operation as well. Even though the operation @@ -5699,7 +5699,7 @@ package body Exp_Ch6 is (Corresponding_Record_Type (Scop), Loc)))); Insert_Actions (N, Decls); - Insert_Actions (N, Freeze_Entity (Obj_Ptr, N)); + Freeze_Before (N, Obj_Ptr); Rec := Make_Explicit_Dereference (Loc, Index: sem_ch6.adb =================================================================== --- sem_ch6.adb (revision 165615) +++ sem_ch6.adb (working copy) @@ -2167,7 +2167,7 @@ package body Sem_Ch6 is -- why, to be investigated further??? Set_Has_Delayed_Freeze (Spec_Id); - Insert_Actions (N, Freeze_Entity (Spec_Id, N)); + Freeze_Before (N, Spec_Id); end if; end if;