aboutsummaryrefslogtreecommitdiff
path: root/gcc/varasm.c
diff options
context:
space:
mode:
authorJan Hubicka <hubicka@ucw.cz>2014-06-12 06:03:49 +0200
committerJan Hubicka <hubicka@gcc.gnu.org>2014-06-12 04:03:49 +0000
commitf961457f887a965ecca2f35b81e33c077759c347 (patch)
tree40360d8b10e6d2d13c2b1ae77545f00bc6f2121b /gcc/varasm.c
parente35889871c9e5e6f8ea0d8c10f3d6d9fe2d9c854 (diff)
downloadgcc-f961457f887a965ecca2f35b81e33c077759c347.zip
gcc-f961457f887a965ecca2f35b81e33c077759c347.tar.gz
gcc-f961457f887a965ecca2f35b81e33c077759c347.tar.bz2
symtab.c (section_hash): New hash.
* symtab.c (section_hash): New hash. (symtab_unregister_node): Clear section before freeing. (hash_section_hash_entry): New haser. (eq_sections): New function. (symtab_node::set_section_for_node): New method. (set_section_1): Update. (symtab_node::set_section): Take string instead of tree as parameter. (symtab_resolve_alias): Update. * cgraph.h (section_hash_entry_d): New structure. (section_hash_entry): New typedef. (cgraph_node): Change comdat_group_ to x_comdat_group, change section_ to x_section and turn into section_hash_entry; update accestors; put set_section_for_node offline. * tree.c (decl_section_name): Turn into string. (set_decl_section_name): Change parameter to be string. * tree.h (decl_section_name, set_decl_section_name): Update prototypes. * sdbout.c (sdbout_one_type): Update. * tree-vect-data-refs.c (vect_can_force_dr_alignment_p): Update. * varasm.c (IN_NAMED_SECTION, get_named_section, resolve_unique_section, hot_function_section, get_named_text_section, USE_SELECT_SECTION_FOR_FUNCTIONS, default_function_rodata_section, make_decl_rtl, default_unique_section): Update. * config/c6x/c6x.c (c6x_in_small_data_p): Update. (c6x_elf_unique_section): Update. * config/nios2/nios2.c (nios2_in_small_data_p): Update. * config/pa/pa.c (pa_function_section): Update. * config/pa/pa.h (IN_NAMED_SECTION_P): Update. * config/ia64/ia64.c (ia64_in_small_data_p): Update. * config/arc/arc.c (arc_in_small_data_p): Update. * config/arm/unknown-elf.h (IN_NAMED_SECTION_P): Update. * config/mcore/mcore.c (mcore_unique_section): Update. * config/mips/mips.c (mips16_build_function_stub): Update. (mips16_build_call_stub): Update. (mips_function_rodata_section): Update. (mips_in_small_data_p): Update. * config/score/score.c (score_in_small_data_p): Update. * config/rx/rx.c (rx_in_small_data): Update. * config/rs6000/rs6000.c (rs6000_elf_in_small_data_p): Update. (rs6000_xcoff_asm_named_section): Update. (rs6000_xcoff_unique_section): Update. * config/frv/frv.c (frv_string_begins_with): Update. (frv_in_small_data_p): Update. * config/v850/v850.c (v850_encode_data_area): Update. * config/bfin/bfin.c (DECL_SECTION_NAME): Update. (bfin_handle_l1_data_attribute): Update. (bfin_handle_l2_attribute): Update. * config/mep/mep.c (mep_unique_section): Update. * config/microblaze/microblaze.c (microblaze_elf_in_small_data_p): Update. * config/h8300/h8300.c (h8300_handle_eightbit_data_attribute): Update. (h8300_handle_tiny_data_attribute): Update. * config/m32r/m32r.c (m32r_in_small_data_p): Update. (m32r_in_small_data_p): Update. * config/alpha/alpha.c (alpha_in_small_data_p): Update. * config/i386/i386.c (ix86_in_large_data_p): Update. * config/i386/winnt.c (i386_pe_unique_section): Update. * config/darwin.c (darwin_function_section): Update. * config/lm32/lm32.c (lm32_in_small_data_p): Update. * tree-emutls.c (get_emutls_init_templ_addr): Update. (new_emutls_decl): Update. * lto-cgraph.c (lto_output_node, input_node, input_varpool_node, input_varpool_node): Update. (ead_string_cst): Turn to ... (read_string): ... this one. * dwarf2out.c (secname_for_decl): Update. * asan.c (asan_protect_global): Update. * c-family/c-common.c (handle_section_attribute): Update handling for section names that are no longer trees. * java/class.c (build_utf8_ref): Update handling for section names that are no longer trees. (emit_register_classes_in_jcr_section): Update. * vtable-class-hierarchy.c: Update handling for section names that are no longer trees. * decl.c (duplicate_decls): Likewise. * gcc-interface/utils.c: Update handling for section names that are no longer trees. From-SVN: r211489
Diffstat (limited to 'gcc/varasm.c')
-rw-r--r--gcc/varasm.c24
1 files changed, 12 insertions, 12 deletions
diff --git a/gcc/varasm.c b/gcc/varasm.c
index d56e67a..7be56f1 100644
--- a/gcc/varasm.c
+++ b/gcc/varasm.c
@@ -173,7 +173,7 @@ static GTY(()) section *unnamed_sections;
/* Return a nonzero value if DECL has a section attribute. */
#define IN_NAMED_SECTION(DECL) \
((TREE_CODE (DECL) == FUNCTION_DECL || TREE_CODE (DECL) == VAR_DECL) \
- && DECL_SECTION_NAME (DECL) != NULL_TREE)
+ && DECL_SECTION_NAME (DECL) != NULL)
/* Hash table of named sections. */
static GTY((param_is (section))) htab_t section_htab;
@@ -411,7 +411,7 @@ get_named_section (tree decl, const char *name, int reloc)
if (name == NULL)
{
gcc_assert (decl && DECL_P (decl) && DECL_SECTION_NAME (decl));
- name = TREE_STRING_POINTER (DECL_SECTION_NAME (decl));
+ name = DECL_SECTION_NAME (decl);
}
flags = targetm.section_type_flags (decl, name, reloc);
@@ -433,7 +433,7 @@ void
resolve_unique_section (tree decl, int reloc ATTRIBUTE_UNUSED,
int flag_function_or_data_sections)
{
- if (DECL_SECTION_NAME (decl) == NULL_TREE
+ if (DECL_SECTION_NAME (decl) == NULL
&& targetm_common.have_named_sections
&& (flag_function_or_data_sections
|| DECL_COMDAT_GROUP (decl)))
@@ -483,7 +483,7 @@ static section *
hot_function_section (tree decl)
{
if (decl != NULL_TREE
- && DECL_SECTION_NAME (decl) != NULL_TREE
+ && DECL_SECTION_NAME (decl) != NULL
&& targetm_common.have_named_sections)
return get_named_section (decl, NULL, 0);
else
@@ -508,13 +508,13 @@ get_named_text_section (tree decl,
{
if (named_section_suffix)
{
- tree dsn = DECL_SECTION_NAME (decl);
+ const char *dsn = DECL_SECTION_NAME (decl);
const char *stripped_name;
char *name, *buffer;
- name = (char *) alloca (TREE_STRING_LENGTH (dsn) + 1);
- memcpy (name, TREE_STRING_POINTER (dsn),
- TREE_STRING_LENGTH (dsn) + 1);
+ name = (char *) alloca (strlen (dsn) + 1);
+ memcpy (name, dsn,
+ strlen (dsn) + 1);
stripped_name = targetm.strip_name_encoding (name);
@@ -620,7 +620,7 @@ function_section_1 (tree decl, bool force_cold)
#ifdef USE_SELECT_SECTION_FOR_FUNCTIONS
if (decl != NULL_TREE
- && DECL_SECTION_NAME (decl) != NULL_TREE)
+ && DECL_SECTION_NAME (decl) != NULL)
{
if (targetm.asm_out.function_section)
section = targetm.asm_out.function_section (decl, freq,
@@ -694,7 +694,7 @@ default_function_rodata_section (tree decl)
{
if (decl != NULL_TREE && DECL_SECTION_NAME (decl))
{
- const char *name = TREE_STRING_POINTER (DECL_SECTION_NAME (decl));
+ const char *name = DECL_SECTION_NAME (decl);
if (DECL_COMDAT_GROUP (decl) && HAVE_COMDAT_GROUP)
{
@@ -1380,7 +1380,7 @@ make_decl_rtl (tree decl)
we take care of recomputing the DECL_RTL after visibility is changed. */
if (TREE_CODE (decl) == VAR_DECL
&& (TREE_STATIC (decl) || DECL_EXTERNAL (decl))
- && DECL_SECTION_NAME (decl) != NULL_TREE
+ && DECL_SECTION_NAME (decl) != NULL
&& DECL_INITIAL (decl) == NULL_TREE
&& DECL_COMMON (decl))
DECL_COMMON (decl) = 0;
@@ -6471,7 +6471,7 @@ default_unique_section (tree decl, int reloc)
string = ACONCAT ((linkonce, prefix, ".", name, NULL));
- set_decl_section_name (decl, build_string (strlen (string), string));
+ set_decl_section_name (decl, string);
}
/* Like compute_reloc_for_constant, except for an RTX. The return value