From patchwork Tue Jul 5 11:20:14 2011 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Richard Biener X-Patchwork-Id: 103253 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 A3DC9B6F67 for ; Tue, 5 Jul 2011 21:20:35 +1000 (EST) Received: (qmail 30853 invoked by alias); 5 Jul 2011 11:20:33 -0000 Received: (qmail 30844 invoked by uid 22791); 5 Jul 2011 11:20:31 -0000 X-SWARE-Spam-Status: No, hits=-3.3 required=5.0 tests=AWL, BAYES_00, TW_DB, T_RP_MATCHES_RCVD X-Spam-Check-By: sourceware.org Received: from cantor2.suse.de (HELO mx2.suse.de) (195.135.220.15) by sourceware.org (qpsmtpd/0.43rc1) with ESMTP; Tue, 05 Jul 2011 11:20:16 +0000 Received: from relay1.suse.de (charybdis-ext.suse.de [195.135.221.2]) (using TLSv1 with cipher DHE-RSA-AES256-SHA (256/256 bits)) (No client certificate requested) by mx2.suse.de (Postfix) with ESMTP id 1496E8891E; Tue, 5 Jul 2011 13:20:14 +0200 (CEST) Date: Tue, 5 Jul 2011 13:20:14 +0200 (CEST) From: Richard Guenther To: gcc-patches@gcc.gnu.org Cc: "Joseph S. Myers" , jason@redhat.com Subject: [PATCH][C][C++] Move common tree node building to c_common_nodes_and_builtins Message-ID: User-Agent: Alpine 2.00 (LNX 1167 2008-08-23) MIME-Version: 1.0 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 consolidates build_common_tree_nodes and build_common_tree_nodes_2 at a single place in c_common_nodes_and_builtins for C family languages. It is a preparation for merging those two functions and moving them to be called from toplev.c as they are middle-end inits. Bootstrapped and tested on x86_64-unknown-linux-gnu for all C family languages and Java. Ok for trunk? Thanks, Richard. 2011-07-05 Richard Guenther c-family/ * c-common.c (c_common_nodes_and_builtins): Build all common tree nodes first. * c-decl.c (c_init_decl_processing): Defer building common tree nodes to c_common_nodes_and_builtins. cp/ * decl.c (cxx_init_decl_processing): Defer building common tree nodes to c_common_nodes_and_builtins. Index: gcc/c-family/c-common.c =================================================================== --- gcc/c-family/c-common.c (revision 175840) +++ gcc/c-family/c-common.c (working copy) @@ -4576,6 +4576,9 @@ c_common_nodes_and_builtins (void) tree va_list_ref_type_node; tree va_list_arg_type_node; + build_common_tree_nodes (flag_signed_char); + build_common_tree_nodes_2 (flag_short_double); + /* Define `int' and `char' first so that dbx will output them first. */ record_builtin_type (RID_INT, NULL, integer_type_node); record_builtin_type (RID_CHAR, "char", char_type_node); @@ -4675,8 +4678,6 @@ c_common_nodes_and_builtins (void) pid_type_node = TREE_TYPE (identifier_global_value (get_identifier (PID_TYPE))); - build_common_tree_nodes_2 (flag_short_double); - record_builtin_type (RID_FLOAT, NULL, float_type_node); record_builtin_type (RID_DOUBLE, NULL, double_type_node); record_builtin_type (RID_MAX, "long double", long_double_type_node); Index: gcc/c-decl.c =================================================================== --- gcc/c-decl.c (revision 175840) +++ gcc/c-decl.c (working copy) @@ -3478,8 +3478,6 @@ c_init_decl_processing (void) using preprocessed headers. */ input_location = BUILTINS_LOCATION; - build_common_tree_nodes (flag_signed_char); - c_common_nodes_and_builtins (); /* In C, comparisons and TRUTH_* expressions have type int. */ Index: gcc/cp/decl.c =================================================================== --- gcc/cp/decl.c (revision 175840) +++ gcc/cp/decl.c (working copy) @@ -3518,8 +3518,6 @@ cxx_init_decl_processing (void) tree void_ftype; tree void_ftype_ptr; - build_common_tree_nodes (flag_signed_char); - /* Create all the identifiers we need. */ initialize_predefined_identifiers (); @@ -3536,8 +3534,6 @@ cxx_init_decl_processing (void) TREE_PUBLIC (global_namespace) = 1; begin_scope (sk_namespace, global_namespace); - current_lang_name = NULL_TREE; - if (flag_visibility_ms_compat) default_visibility = VISIBILITY_HIDDEN;