From patchwork Wed Jul 30 14:32:30 2014 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Arnaud Charlet X-Patchwork-Id: 374926 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 9B6801400E7 for ; Thu, 31 Jul 2014 00:32:41 +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=ANnnfd0gWC55Px+vvoYugqeFodFl3r+sYV5vCMSKGJ1z5bPQrA JFerDwFnAz7vR0sFsfHgygBQu/rwegdnEcXqJ1bkW98nrV3KAKPcCTvSO2YTCkg9 Y8PCR2AWsxiEQlC9XZ4IJd8CLmFUnKhWNTuws+uJOiaS73XBKPPW2DQc4= 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=W2HcbKQyj39PRcpcvAp42fJA/Tw=; b=cBgMSZn7cMz51g3hyhmb Esi0tQ5+zDJSTIbb1UpvV8mDBmu+uJMP/woPl2p4tY9GiB4iH/+9JP9Cy+x5hZrY HCGhRKD2J4GKVyH85Mkv98D5MjBdnK5rjVOg2P0z6RU84wd1ZV546tTnrq09KARS 5zIZ7HTKxRjlNMd73ex86hY= Received: (qmail 29264 invoked by alias); 30 Jul 2014 14:32:35 -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 29252 invoked by uid 89); 30 Jul 2014 14:32:34 -0000 Authentication-Results: sourceware.org; auth=none X-Virus-Found: No X-Spam-SWARE-Status: No, score=-1.7 required=5.0 tests=AWL, 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; Wed, 30 Jul 2014 14:32:31 +0000 Received: from localhost (localhost.localdomain [127.0.0.1]) by filtered-rock.gnat.com (Postfix) with ESMTP id 219AE11632F; Wed, 30 Jul 2014 10:32:30 -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 5R9-6EvAY18Y; Wed, 30 Jul 2014 10:32:30 -0400 (EDT) Received: from kwai.gnat.com (kwai.gnat.com [205.232.38.4]) by rock.gnat.com (Postfix) with ESMTP id 0ED641162F0; Wed, 30 Jul 2014 10:32:30 -0400 (EDT) Received: by kwai.gnat.com (Postfix, from userid 4192) id 0BC2D91976; Wed, 30 Jul 2014 10:32:30 -0400 (EDT) Date: Wed, 30 Jul 2014 10:32:30 -0400 From: Arnaud Charlet To: gcc-patches@gcc.gnu.org Cc: Robert Dewar Subject: [Ada] Internal cleanups in Cstand Message-ID: <20140730143230.GA8358@adacore.com> MIME-Version: 1.0 Content-Disposition: inline User-Agent: Mutt/1.5.21 (2010-09-15) The name of raise type was "any type", it is now "raise type" We now the name before setting other fields of standard entities, which avoids debugger blowups printing the entity when setting one of these fields. These are minor internal imrpovements for front-end debugging, no external effect, no test required. Tested on x86_64-pc-linux-gnu, committed on trunk 2014-07-30 Robert Dewar * cstand.adb (New_Standard_Entity): New version takes name string to call Make_Name. (Create_Standard): Use this routine to set name before setting other fields. Index: cstand.adb =================================================================== --- cstand.adb (revision 213263) +++ cstand.adb (working copy) @@ -151,6 +151,10 @@ (New_Node_Kind : Node_Kind := N_Defining_Identifier) return Entity_Id; -- Builds a new entity for Standard + function New_Standard_Entity (S : String) return Entity_Id; + -- Builds a new entity for Standard with Nkind = N_Defining_Identifier, + -- and Chars of this defining identifier set to the given string S. + procedure Print_Standard; -- Print representation of package Standard if switch set @@ -1204,30 +1208,27 @@ -- filled out to minimize problems with cascaded errors (for example, -- Any_Integer is given reasonable and consistent type and size values) - Any_Type := New_Standard_Entity; + Any_Type := New_Standard_Entity ("any type"); Decl := New_Node (N_Full_Type_Declaration, Stloc); Set_Defining_Identifier (Decl, Any_Type); Set_Scope (Any_Type, Standard_Standard); Build_Signed_Integer_Type (Any_Type, Standard_Integer_Size); - Make_Name (Any_Type, "any type"); - Any_Id := New_Standard_Entity; + Any_Id := New_Standard_Entity ("any id"); Set_Ekind (Any_Id, E_Variable); Set_Scope (Any_Id, Standard_Standard); Set_Etype (Any_Id, Any_Type); Init_Esize (Any_Id); Init_Alignment (Any_Id); - Make_Name (Any_Id, "any id"); - Any_Access := New_Standard_Entity; + Any_Access := New_Standard_Entity ("an access type"); Set_Ekind (Any_Access, E_Access_Type); Set_Scope (Any_Access, Standard_Standard); Set_Etype (Any_Access, Any_Access); Init_Size (Any_Access, System_Address_Size); Set_Elem_Alignment (Any_Access); - Make_Name (Any_Access, "an access type"); - Any_Character := New_Standard_Entity; + Any_Character := New_Standard_Entity ("a character type"); Set_Ekind (Any_Character, E_Enumeration_Type); Set_Scope (Any_Character, Standard_Standard); Set_Etype (Any_Character, Any_Character); @@ -1237,18 +1238,16 @@ Init_RM_Size (Any_Character, 8); Set_Elem_Alignment (Any_Character); Set_Scalar_Range (Any_Character, Scalar_Range (Standard_Character)); - Make_Name (Any_Character, "a character type"); - Any_Array := New_Standard_Entity; + Any_Array := New_Standard_Entity ("an array type"); Set_Ekind (Any_Array, E_Array_Type); Set_Scope (Any_Array, Standard_Standard); Set_Etype (Any_Array, Any_Array); Set_Component_Type (Any_Array, Any_Character); Init_Size_Align (Any_Array); - Make_Name (Any_Array, "an array type"); Make_Dummy_Index (Any_Array); - Any_Boolean := New_Standard_Entity; + Any_Boolean := New_Standard_Entity ("a boolean type"); Set_Ekind (Any_Boolean, E_Enumeration_Type); Set_Scope (Any_Boolean, Standard_Standard); Set_Etype (Any_Boolean, Standard_Boolean); @@ -1257,34 +1256,30 @@ Set_Elem_Alignment (Any_Boolean); Set_Is_Unsigned_Type (Any_Boolean); Set_Scalar_Range (Any_Boolean, Scalar_Range (Standard_Boolean)); - Make_Name (Any_Boolean, "a boolean type"); - Any_Composite := New_Standard_Entity; + Any_Composite := New_Standard_Entity ("a composite type"); Set_Ekind (Any_Composite, E_Array_Type); Set_Scope (Any_Composite, Standard_Standard); Set_Etype (Any_Composite, Any_Composite); Set_Component_Size (Any_Composite, Uint_0); Set_Component_Type (Any_Composite, Standard_Integer); Init_Size_Align (Any_Composite); - Make_Name (Any_Composite, "a composite type"); - Any_Discrete := New_Standard_Entity; + Any_Discrete := New_Standard_Entity ("a discrete type"); Set_Ekind (Any_Discrete, E_Signed_Integer_Type); Set_Scope (Any_Discrete, Standard_Standard); Set_Etype (Any_Discrete, Any_Discrete); Init_Size (Any_Discrete, Standard_Integer_Size); Set_Elem_Alignment (Any_Discrete); - Make_Name (Any_Discrete, "a discrete type"); - Any_Fixed := New_Standard_Entity; + Any_Fixed := New_Standard_Entity ("a fixed-point type"); Set_Ekind (Any_Fixed, E_Ordinary_Fixed_Point_Type); Set_Scope (Any_Fixed, Standard_Standard); Set_Etype (Any_Fixed, Any_Fixed); Init_Size (Any_Fixed, Standard_Integer_Size); Set_Elem_Alignment (Any_Fixed); - Make_Name (Any_Fixed, "a fixed-point type"); - Any_Integer := New_Standard_Entity; + Any_Integer := New_Standard_Entity ("an integer type"); Set_Ekind (Any_Integer, E_Signed_Integer_Type); Set_Scope (Any_Integer, Standard_Standard); Set_Etype (Any_Integer, Standard_Long_Long_Integer); @@ -1296,83 +1291,72 @@ Typ => Base_Type (Standard_Integer), Lb => Uint_0, Hb => Intval (High_Bound (Scalar_Range (Standard_Integer)))); - Make_Name (Any_Integer, "an integer type"); - Any_Modular := New_Standard_Entity; + Any_Modular := New_Standard_Entity ("a modular type"); Set_Ekind (Any_Modular, E_Modular_Integer_Type); Set_Scope (Any_Modular, Standard_Standard); Set_Etype (Any_Modular, Standard_Long_Long_Integer); Init_Size (Any_Modular, Standard_Long_Long_Integer_Size); Set_Elem_Alignment (Any_Modular); Set_Is_Unsigned_Type (Any_Modular); - Make_Name (Any_Modular, "a modular type"); - Any_Numeric := New_Standard_Entity; + Any_Numeric := New_Standard_Entity ("a numeric type"); Set_Ekind (Any_Numeric, E_Signed_Integer_Type); Set_Scope (Any_Numeric, Standard_Standard); Set_Etype (Any_Numeric, Standard_Long_Long_Integer); Init_Size (Any_Numeric, Standard_Long_Long_Integer_Size); Set_Elem_Alignment (Any_Numeric); - Make_Name (Any_Numeric, "a numeric type"); - Any_Real := New_Standard_Entity; + Any_Real := New_Standard_Entity ("a real type"); Set_Ekind (Any_Real, E_Floating_Point_Type); Set_Scope (Any_Real, Standard_Standard); Set_Etype (Any_Real, Standard_Long_Long_Float); Init_Size (Any_Real, UI_To_Int (Esize (Standard_Long_Long_Float))); Set_Elem_Alignment (Any_Real); - Make_Name (Any_Real, "a real type"); - Any_Scalar := New_Standard_Entity; + Any_Scalar := New_Standard_Entity ("a scalar type"); Set_Ekind (Any_Scalar, E_Signed_Integer_Type); Set_Scope (Any_Scalar, Standard_Standard); Set_Etype (Any_Scalar, Any_Scalar); Init_Size (Any_Scalar, Standard_Integer_Size); Set_Elem_Alignment (Any_Scalar); - Make_Name (Any_Scalar, "a scalar type"); - Any_String := New_Standard_Entity; + Any_String := New_Standard_Entity ("a string type"); Set_Ekind (Any_String, E_Array_Type); Set_Scope (Any_String, Standard_Standard); Set_Etype (Any_String, Any_String); Set_Component_Type (Any_String, Any_Character); Init_Size_Align (Any_String); - Make_Name (Any_String, "a string type"); Make_Dummy_Index (Any_String); - Raise_Type := New_Standard_Entity; + Raise_Type := New_Standard_Entity ("raise type"); Decl := New_Node (N_Full_Type_Declaration, Stloc); Set_Defining_Identifier (Decl, Raise_Type); Set_Scope (Raise_Type, Standard_Standard); Build_Signed_Integer_Type (Raise_Type, Standard_Integer_Size); - Make_Name (Raise_Type, "any type"); - Standard_Integer_8 := New_Standard_Entity; + Standard_Integer_8 := New_Standard_Entity ("integer_8"); Decl := New_Node (N_Full_Type_Declaration, Stloc); Set_Defining_Identifier (Decl, Standard_Integer_8); - Make_Name (Standard_Integer_8, "integer_8"); Set_Scope (Standard_Integer_8, Standard_Standard); Build_Signed_Integer_Type (Standard_Integer_8, 8); - Standard_Integer_16 := New_Standard_Entity; + Standard_Integer_16 := New_Standard_Entity ("integer_16"); Decl := New_Node (N_Full_Type_Declaration, Stloc); Set_Defining_Identifier (Decl, Standard_Integer_16); - Make_Name (Standard_Integer_16, "integer_16"); Set_Scope (Standard_Integer_16, Standard_Standard); Build_Signed_Integer_Type (Standard_Integer_16, 16); - Standard_Integer_32 := New_Standard_Entity; + Standard_Integer_32 := New_Standard_Entity ("integer_32"); Decl := New_Node (N_Full_Type_Declaration, Stloc); Set_Defining_Identifier (Decl, Standard_Integer_32); - Make_Name (Standard_Integer_32, "integer_32"); Set_Scope (Standard_Integer_32, Standard_Standard); Build_Signed_Integer_Type (Standard_Integer_32, 32); - Standard_Integer_64 := New_Standard_Entity; + Standard_Integer_64 := New_Standard_Entity ("integer_64"); Decl := New_Node (N_Full_Type_Declaration, Stloc); Set_Defining_Identifier (Decl, Standard_Integer_64); - Make_Name (Standard_Integer_64, "integer_64"); Set_Scope (Standard_Integer_64, Standard_Standard); Build_Signed_Integer_Type (Standard_Integer_64, 64); @@ -1879,6 +1863,13 @@ return E; end New_Standard_Entity; + function New_Standard_Entity (S : String) return Entity_Id is + Ent : constant Entity_Id := New_Standard_Entity; + begin + Make_Name (Ent, S); + return Ent; + end New_Standard_Entity; + -------------------- -- Print_Standard -- --------------------