diff options
author | Jan Hubicka <hubicka@ucw.cz> | 2014-06-09 04:30:30 +0200 |
---|---|---|
committer | Jan Hubicka <hubicka@gcc.gnu.org> | 2014-06-09 02:30:30 +0000 |
commit | 24d047a30a8007163d0eea43e8dd445e2b999160 (patch) | |
tree | 13c6fa7658c6ac240d9a498d43c0bed9ba277176 /gcc/tree.c | |
parent | b6def23167b87482c7425949b5f0d8ed7983f0ed (diff) | |
download | gcc-24d047a30a8007163d0eea43e8dd445e2b999160.zip gcc-24d047a30a8007163d0eea43e8dd445e2b999160.tar.gz gcc-24d047a30a8007163d0eea43e8dd445e2b999160.tar.bz2 |
symtab.c (dump_symtab_base): Update dumping.
* symtab.c (dump_symtab_base): Update dumping.
(symtab_make_decl_local): Clear only DECL_COMDAT.
* tree-vect-data-refs.c (Check that variable is static before
tampering with sections.
* cgraphclones.c (duplicate_thunk_for_node): Do not clear section name.
(cgraph_create_virtual_clone): Likewise.
* tree.c (decl_comdat_group, decl_comdat_group_id): Constify argument.
(decl_section_name, set_decl_section_name): New accessors.
(find_decls_types_r): Do not walk section name
* tree.h (DECL_SECTION_NAME): Implement using
decl_section_name.
(decl_comdat_group, decl_comdat_group_id): Constify.
(decl_section_name, set_decl_section_name): Update.
* varpool.c (varpool_finalize_named_section_flags): Use
get_section.
* cgraph.c (cgraph_add_thunk): Reset node instead of rebuilding.
(cgraph_make_node_local_1): Clear section and comdat group.
* cgraph.h (set_comdat_group): Sanity check.
(get_section, set_section): New.
* ipa-comdats.c (ipa_comdats): Use get_section.
* ipa.c (ipa_discover_readonly_nonaddressable_var): Likewise.
* lto-streamer-out.c: Do not follow section names.
* c-family/c-common.c (handle_section_attribute):
Update.
* lto-cgraph.c (lto_output_node): Output section.
(lto_output_varpool_node): Likewise.
(read_comdat_group): Rename to ...
(read_identifier): ... this one.
(read_string_cst): New function.
(input_node, input_varpool_node): Input section names.
* tree-emutls.c (get_emutls_init_templ_addr): Update.
(new_emutls_decl): Update.
(secname_for_decl): Check section names only of static
vars.
* config/mep/mep.c (mep_unique_section): Use set_decl_section_name.
* config/i386/winnt.c (i386_pe_unique_section): Likewise.
* config/i386/i386.c (x86_64_elf_unique_section): Likewise.
* config/c6x/c6x.c (c6x_elf_unique_section): Likewise.
* config/rs6000/rs6000.c (rs6000_xcoff_unique_section): Likewise.
* config/mcore/mcore.c (mcore_unique_section): Likewise.
* config/mips/mips.c (mips16_build_function_stub): Likewise.
* config/v850/v850.c (v850_insert_attributes): Likewise.
* config/h8300/h8300.c: (h8300_handle_eightbit_data_attribute):
Likewise.
(h8300_handle_tiny_data_attribute): Likewise.
* config/bfin/bfin.c (bfin_handle_l1_text_attribute): Likewise.
(bfin_handle_l2_attribute): Likewise.
* tree-streamer-in.c (lto_input_ts_decl_with_vis_tree_pointers): Do not read section name.
* lto.c (mentions_vars_p_decl_with_vis, compare_tree_sccs_1,
lto_fixup_prevailing_decls): Skip section names.
* go-gcc.cc (global_variable_set_init): Use
set_decl_section_name.
* gcc-interface/utils.c (process_attributes): Use it.
* c-decl.c (merge_decls): Use set_decl_section_name.
(duplicate_decls): Remove node if it exists.
* class.c (build_utf8_ref): Use set_decl_section_name.
(emit_register_classes_in_jcr_section): Likewise.
(emit_register_classes_in_jcr_section): Likewise.
* method.c (use_thunk): Use set_decl_section_name.
* optimize.c (maybe_clone_body): Use set_decl_section_name.
* decl.c (duplicate_decls): Likewise.
* vtable-class-hierarchy.c: Likewise.
From-SVN: r211363
Diffstat (limited to 'gcc/tree.c')
-rw-r--r-- | gcc/tree.c | 39 |
1 files changed, 33 insertions, 6 deletions
@@ -608,7 +608,7 @@ decl_assembler_name (tree decl) DECL is associated with. This can be either an IDENTIFIER_NODE or a decl, in which case its DECL_ASSEMBLER_NAME identifies the group. */ tree -decl_comdat_group (tree node) +decl_comdat_group (const_tree node) { struct symtab_node *snode = symtab_get_node (node); if (!snode) @@ -618,7 +618,7 @@ decl_comdat_group (tree node) /* Likewise, but make sure it's been reduced to an IDENTIFIER_NODE. */ tree -decl_comdat_group_id (tree node) +decl_comdat_group_id (const_tree node) { struct symtab_node *snode = symtab_get_node (node); if (!snode) @@ -626,6 +626,37 @@ decl_comdat_group_id (tree node) return snode->get_comdat_group_id (); } +/* When the target supports named section, return its name as IDENTIFIER_NODE + or NULL if it is in no section. */ +tree +decl_section_name (const_tree node) +{ + struct symtab_node *snode = symtab_get_node (node); + if (!snode) + return NULL; + return snode->get_section (); +} + +/* Set section section name of NODE to VALUE (that is expected to + be identifier node) */ +void +set_decl_section_name (tree node, tree value) +{ + struct symtab_node *snode; + + if (value == NULL) + { + snode = symtab_get_node (node); + if (!snode) + return; + } + else if (TREE_CODE (node) == VAR_DECL) + snode = varpool_node_for_decl (node); + else + snode = cgraph_get_create_node (node); + snode->set_section (value); +} + /* Compute the number of bytes occupied by a tree with code CODE. This function cannot be used for nodes that have variable sizes, including TREE_VEC, INTEGER_CST, STRING_CST, and CALL_EXPR. */ @@ -5264,10 +5295,6 @@ find_decls_types_r (tree *tp, int *ws, void *data) fld_worklist_push (DECL_FIELD_BIT_OFFSET (t), fld); fld_worklist_push (DECL_FCONTEXT (t), fld); } - else if (TREE_CODE (t) == VAR_DECL) - { - fld_worklist_push (DECL_SECTION_NAME (t), fld); - } if ((TREE_CODE (t) == VAR_DECL || TREE_CODE (t) == PARM_DECL) && DECL_HAS_VALUE_EXPR_P (t)) |