From patchwork Fri May 8 00:32:23 2015 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Aldy Hernandez X-Patchwork-Id: 469820 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 20EB31402A0 for ; Fri, 8 May 2015 10:32:34 +1000 (AEST) Authentication-Results: ozlabs.org; dkim=pass (1024-bit key; unprotected) header.d=gcc.gnu.org header.i=@gcc.gnu.org header.b=GXbZnEyC; dkim-atps=neutral DomainKey-Signature: a=rsa-sha1; c=nofws; d=gcc.gnu.org; h=list-id :list-unsubscribe:list-archive:list-post:list-help:sender :message-id:date:from:mime-version:to:subject:content-type; q= dns; s=default; b=eqhEYPP3U0fllFDxN+2pJBcyIwjAMJyngatbUiYXvojEPG Z02z/J+EcXj5D04t2O/GxKGaqgKvxFgkjnvBPqCvW3KKrWhI1uwWDijKkQZxZlDt qWBZ3sYmidafr03CV+a00HTS/1edKmIx4mMNbf2UUbZVhyAE+rcYisWbg5NK8= 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 :message-id:date:from:mime-version:to:subject:content-type; s= default; bh=t5viSR6eZU8J9Sn1BnjrZNMIFyU=; b=GXbZnEyCoijE3Wk9NCY6 kP8ZGObiGwhALYd9U/KdZr0dhvJ+RYHjONrcWICn/VTQdo3a0Ysl7mFL3gu0NxmD rLJIzBoqfzVudh+6Ayi6d5+tiEWqmh2w9bNzxY78uJ6k038e0t/IcI7oybTGCnzI J7Oy8OeIIU0LTxN87SREmyo= Received: (qmail 10385 invoked by alias); 8 May 2015 00:32:27 -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 10375 invoked by uid 89); 8 May 2015 00:32:27 -0000 Authentication-Results: sourceware.org; auth=none X-Virus-Found: No X-Spam-SWARE-Status: No, score=-1.0 required=5.0 tests=AWL, BAYES_05, SPF_HELO_PASS, SPF_PASS, T_RP_MATCHES_RCVD autolearn=ham version=3.3.2 X-HELO: mx1.redhat.com Received: from mx1.redhat.com (HELO mx1.redhat.com) (209.132.183.28) by sourceware.org (qpsmtpd/0.93/v0.84-503-g423c35a) with (AES256-GCM-SHA384 encrypted) ESMTPS; Fri, 08 May 2015 00:32:26 +0000 Received: from int-mx14.intmail.prod.int.phx2.redhat.com (int-mx14.intmail.prod.int.phx2.redhat.com [10.5.11.27]) by mx1.redhat.com (Postfix) with ESMTPS id DC34EB6A32 for ; Fri, 8 May 2015 00:32:24 +0000 (UTC) Received: from reynosa.quesejoda.com (vpn-59-27.rdu2.redhat.com [10.10.59.27]) by int-mx14.intmail.prod.int.phx2.redhat.com (8.14.4/8.14.4) with ESMTP id t480WNeZ020535 for ; Thu, 7 May 2015 20:32:24 -0400 Message-ID: <554C0417.8020300@redhat.com> Date: Thu, 07 May 2015 17:32:23 -0700 From: Aldy Hernandez User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:31.0) Gecko/20100101 Thunderbird/31.6.0 MIME-Version: 1.0 To: gcc-patches Subject: [patch 1/10] debug-early merge: Ada front-end gcc/ada/ * gcc-interface/gigi.h (note_types_used_by_globals): New prototype. * gcc-interface/misc.c (gnat_parse_file): Call note_types_used_by_globals. * gcc-interface/utils.c: Remove global_decls. (gnat_pushdecl): Remove use of global_decls. (gnat_write_global_declarations): Rename to note_types_used_by_globals. Remove call to finalize_compilation_unit. Remove explicit call to debug_hooks. diff --git a/gcc/ada/gcc-interface/gigi.h b/gcc/ada/gcc-interface/gigi.h index 6d65fc5..fead2be 100644 --- a/gcc/ada/gcc-interface/gigi.h +++ b/gcc/ada/gcc-interface/gigi.h @@ -535,8 +535,7 @@ extern tree gnat_type_for_size (unsigned precision, int unsignedp); an unsigned type; otherwise a signed type is returned. */ extern tree gnat_type_for_mode (machine_mode mode, int unsignedp); -/* Emit debug info for all global variable declarations. */ -extern void gnat_write_global_declarations (void); +extern void note_types_used_by_globals (void); /* Return the unsigned version of a TYPE_NODE, a scalar type. */ extern tree gnat_unsigned_type (tree type_node); diff --git a/gcc/ada/gcc-interface/misc.c b/gcc/ada/gcc-interface/misc.c index edaab97..2056a61 100644 --- a/gcc/ada/gcc-interface/misc.c +++ b/gcc/ada/gcc-interface/misc.c @@ -122,6 +122,8 @@ gnat_parse_file (void) /* Call the front end. */ _ada_gnat1drv (); + + note_types_used_by_globals (); } /* Return language mask for option processing. */ @@ -972,8 +974,6 @@ gnat_init_ts (void) #define LANG_HOOKS_GETDECLS lhd_return_null_tree_v #undef LANG_HOOKS_PUSHDECL #define LANG_HOOKS_PUSHDECL gnat_return_tree -#undef LANG_HOOKS_WRITE_GLOBALS -#define LANG_HOOKS_WRITE_GLOBALS gnat_write_global_declarations #undef LANG_HOOKS_GET_ALIAS_SET #define LANG_HOOKS_GET_ALIAS_SET gnat_get_alias_set #undef LANG_HOOKS_PRINT_DECL diff --git a/gcc/ada/gcc-interface/utils.c b/gcc/ada/gcc-interface/utils.c index 170aa4a..647b427 100644 --- a/gcc/ada/gcc-interface/utils.c +++ b/gcc/ada/gcc-interface/utils.c @@ -227,9 +227,6 @@ static GTY((deletable)) struct gnat_binding_level *free_binding_level; /* The context to be used for global declarations. */ static GTY(()) tree global_context; -/* An array of global declarations. */ -static GTY(()) vec *global_decls; - /* An array of builtin function declarations. */ static GTY(()) vec *builtin_decls; @@ -764,9 +761,7 @@ gnat_pushdecl (tree decl, Node_Id gnat_node) if (TREE_CODE (decl) == FUNCTION_DECL && DECL_BUILT_IN (decl)) vec_safe_push (builtin_decls, decl); } - else if (global_bindings_p ()) - vec_safe_push (global_decls, decl); - else + else if (!global_bindings_p ()) { DECL_CHAIN (decl) = BLOCK_VARS (current_binding_level->block); BLOCK_VARS (current_binding_level->block) = decl; @@ -5176,7 +5171,7 @@ smaller_form_type_p (tree type, tree orig_type) static GTY (()) tree dummy_global; void -gnat_write_global_declarations (void) +note_types_used_by_globals (void) { unsigned int i; tree iter; @@ -5204,28 +5199,6 @@ gnat_write_global_declarations (void) types_used_by_var_decl_insert (t, dummy_global); } } - - /* Output debug information for all global type declarations first. This - ensures that global types whose compilation hasn't been finalized yet, - for example pointers to Taft amendment types, have their compilation - finalized in the right context. */ - FOR_EACH_VEC_SAFE_ELT (global_decls, i, iter) - if (TREE_CODE (iter) == TYPE_DECL && !DECL_IGNORED_P (iter)) - debug_hooks->global_decl (iter); - - /* Proceed to optimize and emit assembly. */ - symtab->finalize_compilation_unit (); - - /* After cgraph has had a chance to emit everything that's going to - be emitted, output debug information for the rest of globals. */ - if (!seen_error ()) - { - timevar_push (TV_SYMOUT); - FOR_EACH_VEC_SAFE_ELT (global_decls, i, iter) - if (TREE_CODE (iter) != TYPE_DECL && !DECL_IGNORED_P (iter)) - debug_hooks->global_decl (iter); - timevar_pop (TV_SYMOUT); - } } /* ************************************************************************