From patchwork Tue Dec 10 17:42:44 2013 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: "H.J. Lu" X-Patchwork-Id: 299618 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)) (Client did not present a certificate) by ozlabs.org (Postfix) with ESMTPS id 2CD3F2C0300 for ; Wed, 11 Dec 2013 10:14:16 +1100 (EST) DomainKey-Signature: a=rsa-sha1; c=nofws; d=gcc.gnu.org; h=list-id :list-unsubscribe:list-archive:list-post:list-help:sender :mime-version:in-reply-to:references:date:message-id:subject :from:to:cc:content-type:content-transfer-encoding; q=dns; s= default; b=He0mMc3I/N1WNkbQBAJQQds5xyDmGlqsU9I2KJzpYQt2AriE1z962 J0HgIekEjoKpBQerx/5vycubGD/BxwWCJ7GzFuI7H3CIHiA7DqwggKRWqIariCwm lB2ypcFGBuXAt8jy7yp3uPs9wTlDYCbN3Tcvws77Jq5y3aH/r/5W+o= 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 :mime-version:in-reply-to:references:date:message-id:subject :from:to:cc:content-type:content-transfer-encoding; s=default; bh=tQ1uHz8JYAb7XXJWmL8XZVzMVrc=; b=KKaTtAdOMUXXR3GPyBvVGzEObwYz uxUJsh6EXqgMUH1wPz1TX/fLnl/+4FC7/WMeUZyx73FhpB9KdL44UjJoDJXVAJWa 1HIQDBiO2gdRvy7p0ibd8B2CWreAK4JTI7nFcKmeCNAb23pxq5CFebjj8xCfjUus k+JEYqOUmbKixYE= Received: (qmail 2585 invoked by alias); 10 Dec 2013 17:42:54 -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 2573 invoked by uid 89); 10 Dec 2013 17:42:54 -0000 Authentication-Results: sourceware.org; auth=none X-Virus-Found: No X-Spam-SWARE-Status: No, score=1.4 required=5.0 tests=AWL, BAYES_99, FREEMAIL_FROM, RCVD_IN_DNSWL_LOW, SPF_PASS autolearn=no version=3.3.2 X-HELO: mail-oa0-f41.google.com Received: from Unknown (HELO mail-oa0-f41.google.com) (209.85.219.41) by sourceware.org (qpsmtpd/0.93/v0.84-503-g423c35a) with (AES128-SHA encrypted) ESMTPS; Tue, 10 Dec 2013 17:42:53 +0000 Received: by mail-oa0-f41.google.com with SMTP id j17so5962671oag.28 for ; Tue, 10 Dec 2013 09:42:45 -0800 (PST) MIME-Version: 1.0 X-Received: by 10.60.67.105 with SMTP id m9mr2380894oet.58.1386697364874; Tue, 10 Dec 2013 09:42:44 -0800 (PST) Received: by 10.76.105.174 with HTTP; Tue, 10 Dec 2013 09:42:44 -0800 (PST) In-Reply-To: References: <1386233288.14008.9.camel@yam-132-YW-E178-FTW> <3B985852-FCA6-44C3-9FEC-D18E3CEFAB68@gmail.com> <1386238371.14008.30.camel@yam-132-YW-E178-FTW> <1386243714.14008.38.camel@yam-132-YW-E178-FTW> <1386254099.14008.43.camel@yam-132-YW-E178-FTW> <1386618599.14008.193.camel@yam-132-YW-E178-FTW> Date: Tue, 10 Dec 2013 09:42:44 -0800 Message-ID: Subject: Re: Remove some typedefs (was: Silence class vs. struct warnings (opt_pass, ipa_opt_pass_d)) From: "H.J. Lu" To: Oleg Endo Cc: Richard Biener , gcc-patches X-IsSubscribed: yes On Tue, Dec 10, 2013 at 9:33 AM, H.J. Lu wrote: > On Mon, Dec 9, 2013 at 11:49 AM, Oleg Endo wrote: >> On Thu, 2013-12-05 at 15:34 +0100, Oleg Endo wrote: >>> On Thu, 2013-12-05 at 14:56 +0100, Richard Biener wrote: >>> > >>> > grep for 'typedef struct.*{' in headers. The typedef name is usually >>> > the desired one and is used without 'struct'. So it's an orthogonal >>> > issue. >>> >>> Ah, do you mean converting this stuff ... >>> >>> typedef struct >>> { >>> cgraph_node_set set; >>> unsigned index; >>> } cgraph_node_set_iterator; >>> >>> ... to ... >>> >>> struct cgraph_node_set_iterator >>> { >>> .... >>> >>> right? >>> Sure, no problem. But I'd rather do it step by step in separate >>> patches. >> >> So here it is. >> Tested with make all-gcc. >> Is this OK? >> >> Cheers, >> Oleg >> >> gcc/ChangeLog: >> * gcc/cgraph.h (cgraph_node_set_iterator, >> varpool_node_set_iterator): Remove typedef. >> (cgraph_inline_failed_enum, cgraph_inline_failed_t): Remove >> typedef and rename to cgraph_inline_failed_t. >> * gcc/tree-ssa-alias.h (ao_ref_s, ao_ref): Remove typedef and >> rename to ao_ref. >> * gcc/reload.h (reg_equivs_s, reg_equivs_t): Remove typedef and >> rename to reg_equivs_t. >> * gcc/conditions.h (CC_STATUS): Remove typedef. >> * gcc/bitmap.h (bitmap_obstack): Remove typedef. >> (bitmap_element_def, bitmap_element): Remove typedef and rename >> to bitmap_element. >> (bitmap_head_def, bitmap_head): Remove typedef and rename to >> bitmap_head. >> (bitmap_iterator): Remove typedef. >> * gcc/target.h (cumulative_args_t, print_switch_type, >> secondary_reload_info): Remove typedef. >> * gcc/dwarf2out.h (dw_cfi_oprnd_struct, dw_cfi_oprnd): Remove >> dw_cfi_oprnd_struct alias. >> (dw_cfi_struct, dw_cfi_node): Remove typedef and rename to >> dw_cfi_node. >> (dw_fde_struct, dw_fde_node): Remove typedef and rename to >> dw_fde_node. >> (cfa_loc, dw_cfa_location): Remove typedef and rename to >> dw_cfa_location. >> (dw_vec_struct, dw_vec_const): Remove typedef and rename to >> dw_vec_const. >> (dw_val_struct, dw_val_node): Remove typedef and rename to >> dw_val_node. >> (dw_loc_descr_struct, dw_loc_descr_node): Remove typedef and >> rename to dw_loc_descr_node. >> * gcc/params.h (param_info, compiler_param): Remove typedef. >> * gcc/opts.h (cl_deferred_param): Remove typedef. >> * gcc/sreal.h (sreal): Remove typedef. >> * gcc/ddg.h (dep_type, dep_data_type): Remove typedef. >> * gcc/graphite-clast-to-gimple.h (cloog_prog_clast, bb_pbb_def): >> Remove typedef. >> * gcc/lto-streamer.h (lto_decl_stream_e_t, lto_encoder_entry, >> lto_symtab_encoder_iterator, res_pair): Remove typedef. >> * gcc/tree-affine.h (affine_tree_combination, aff_tree): Remove >> typedef and rename to aff_tree. >> * gcc/sched-int.h (region): Remove typedef. >> * gcc/diagnostic.h (diagnostic_info, >> diagnostic_classification_change_t): Remove typedef. >> * gcc/tree-ssa-loop.h (affine_iv_d): Remove typedef and rename >> to affine_iv. >> * gcc/sbitmap.h (sbitmap_iterator): Remove typedef. >> * gcc/ssa-iterators.h (immediate_use_iterator_d, >> imm_use_iterator): Remove typedef and rename to >> imm_use_iterator. >> (ssa_operand_iterator_d, ssa_op_iter): Remove typedef and rename >> to ssa_op_iter. >> * gcc/ggc-internal.h (ggc_statistics): Remove typedef. >> * gcc/cselib.h (cselib_val_struct, cselib_val): Remove typedef >> and rename to cselib_val. >> * gcc/tree-core.h (alias_pair): Remove typedef. >> (constructor_elt_d, constructor_elt): Remove typedef and rename >> to constructor_elt. >> (ssa_use_operand_d, ssa_use_operand_t): Remove typedef and >> rename to ssa_use_operand_t. >> * gcc/graphite-sese-to-poly.h (base_alias_pair): Remove typedef. >> * gcc/tree-data-ref.h (conflict_function): Remove typedef. >> * gcc/tree-inline.h (copy_body_data): Remove typedef. >> * gcc/ipa-inline.h (condition, size_time_entry, >> inline_param_summary_t, edge_growth_cache_entry): Remove >> typedef. >> * gcc/regrename.h (operand_rr_info, insn_rr_info): Remove >> typedef. >> * gcc/gimple-iterator.h (gimple_stmt_iterator_d, >> gimple_stmt_iterator): Remove typedef and rename to >> gimple_stmt_iterator. >> * gcc/basic-block.h (ce_if_block, ce_if_block_t): Remove typedef >> and rename to ce_if_block. >> (edge_iterator): Remove typedef. >> * gcc/ipa-prop.h (ipa_agg_jf_item, ipa_agg_jf_item_t): Remove >> typedef and rename to ipa_agg_jf_item. >> (ipa_agg_jump_function_t, ipa_param_descriptor_t, >> ipa_node_params_t, ipa_parm_adjustment_t): Remove typedef. >> (ipa_jump_func, ipa_jump_func_t): Remove typedef and rename to >> ipa_jump_func. >> (ipa_edge_args, ipa_edge_args_t): Remove typedef and rename to >> ipa_edge_args. >> * gcc/gcov-io.h (gcov_bucket_type): Remove typedef. >> (gcov_working_set_info, gcov_working_set_t): Remove typedef and >> rename to gcov_working_set_t. >> * gcc/ira-int.h (minmax_set_iterator, ira_allocno_iterator, >> ira_object_iterator, ira_allocno_object_iterator, >> ira_pref_iterator, ira_copy_iterator, >> ira_object_conflict_iterator): Remove typedef. >> * gcc/tree-iterator.h (tree_stmt_iterator): Remove typedef. >> * gcc/rtl.h (addr_diff_vec_flags, mem_attrs, reg_attrs, >> replace_label_data): Remove typedef. >> (rtunion_def, rtunion): Remove typedef and rename to rtunion. >> * gcc/hard-reg-set.h (hard_reg_set_iterator): Remove typedef. >> * gcc/sel-sched-ir.h (_list_iterator, sel_global_bb_info_def, >> sel_region_bb_info_def, succ_iterator): Remove typedef. >> (deps_where_def, deps_where_t): Remove typedef and rename to >> deps_where_t. >> >> * gcc/coretypes.h: Adapt forward declarations. >> * gcc/tree-scalar-evolution.h: Likewise. >> * gcc/tree-ssa-address.h: Likewise. >> * gcc/tree-ssa-operands.h: Likewise. >> * gcc/function.h: Likewise. >> * gcc/config/frv/frv-protos.h: Likewise. >> * gcc/targhooks.h: Likewise. >> * gcc/basic_block.h: Likewise. >> >> * gcc/rtl.def: Adapt documentation. >> * gcc/doc/tm.texi: Likewise. >> >> * gcc/ipa-cp.c: Adapt uses. >> * gcc/bitmap.c: Likewise. >> * gcc/dwarf2out.c: Likewise. >> * gcc/target.def: Likewise. >> * gcc/ipa-inline-analysis.c: Likewise. >> * gcc/dwarf2cfi.c: Likewise. >> * gcc/tree-ssa-loop-ivopts.c: Likewise. >> * gcc/lto-cgraph.c: Likewise. >> * gcc/config/frv/frv.c: Likewise. >> * gcc/ifcvt.c: Likewise. >> * gcc/ipa-prop.c: Likewise. >> > > This break gcc bootstrap: > > In file included from /export/gnu/import/git/gcc/libgcc/libgcov-merge.c:38:0: > /export/gnu/import/git/gcc/libgcc/../gcc/gcov-io.h:434:3: error: > unknown type name ‘gcov_bucket_type’ > gcov_bucket_type histogram[GCOV_HISTOGRAM_SIZE]; /* histogram of > ^ > make[6]: *** [_gcov_merge_add.o] Error 1 > > gcc/gcov-io.h is shared between gcc and libgcc directories. > libgcc is compiled with the C compiler. > I am checking in this as an obvious fix. diff --git a/gcc/basic-block.h b/gcc/basic-block.h index bcd1a6e..3fa319b 100644 --- a/gcc/basic-block.h +++ b/gcc/basic-block.h @@ -939,7 +939,7 @@ extern void rtl_profile_for_edge (edge); extern void default_rtl_profile (void); /* In profile.c. */ -struct gcov_working_set_t; +typedef struct gcov_working_set_info gcov_working_set_t; extern gcov_working_set_t *find_working_set (unsigned pct_times_10); /* Check tha probability is sane. */ diff --git a/gcc/gcov-io.h b/gcc/gcov-io.h index 93b2d4d..fb3857d 100644 --- a/gcc/gcov-io.h +++ b/gcc/gcov-io.h @@ -401,7 +401,7 @@ typedef unsigned HOST_WIDEST_INT gcov_type_unsigned; /* Structured records. */ /* Structure used for each bucket of the log2 histogram of counter values. */ -struct gcov_bucket_type +typedef struct { /* Number of counters whose profile count falls within the bucket. */ gcov_unsigned_t num_counters; @@ -409,7 +409,7 @@ struct gcov_bucket_type gcov_type min_value; /* Cumulative value of the profile counts in this bucket. */ gcov_type cum_value; -}; +} gcov_bucket_type; /* For a log2 scale histogram with each range split into 4 linear sub-ranges, there will be at most 64 (max gcov_type bit