aboutsummaryrefslogtreecommitdiff
path: root/gcc/varasm.c
diff options
context:
space:
mode:
authorSteve Ellcey <sje@gcc.gnu.org>2007-01-24 19:40:12 +0000
committerSteve Ellcey <sje@gcc.gnu.org>2007-01-24 19:40:12 +0000
commit812b587e9dd503c08805b69f0006beef8faa9ac2 (patch)
tree13559698c1afb4d85fe748d845c52d2e03712729 /gcc/varasm.c
parentfe32582aca9d7fa72265813406102b97119cd86d (diff)
downloadgcc-812b587e9dd503c08805b69f0006beef8faa9ac2.zip
gcc-812b587e9dd503c08805b69f0006beef8faa9ac2.tar.gz
gcc-812b587e9dd503c08805b69f0006beef8faa9ac2.tar.bz2
target.h (globalize_decl_name): New.
* target.h (globalize_decl_name): New. * target-def.h (TARGET_ASM_GLOBALIZE_DECL_NAME): New. * output.h (default_globalize_decl_name): New. * varasm.c (asm_output_bss): Use globalize_decl_name instead of globalize_label. (globalize_decl): Ditto. (default_globalize_decl_name): New. * config/ia64/ia64.c (ia64_globalize_decl_name): New. (ia64_handle_version_id_attribute): New. (TARGET_ASM_GLOBALIZE_DECL_NAME): New. (ia64_asm_output_external): Use globalize_decl_name instead of globalize_label. * doc/extend.texi (version_id): New pragma. * doc/tm.texi (ARGET_ASM_GLOBALIZE_DECL_NAME): New target hook. From-SVN: r121128
Diffstat (limited to 'gcc/varasm.c')
-rw-r--r--gcc/varasm.c15
1 files changed, 12 insertions, 3 deletions
diff --git a/gcc/varasm.c b/gcc/varasm.c
index 0cb8f86..48055cf 100644
--- a/gcc/varasm.c
+++ b/gcc/varasm.c
@@ -489,7 +489,8 @@ asm_output_bss (FILE *file, tree decl ATTRIBUTE_UNUSED,
unsigned HOST_WIDE_INT size ATTRIBUTE_UNUSED,
unsigned HOST_WIDE_INT rounded)
{
- targetm.asm_out.globalize_label (file, name);
+ gcc_assert (strcmp (XSTR (XEXP (DECL_RTL (decl), 0), 0), name) == 0);
+ targetm.asm_out.globalize_decl_name (file, decl);
switch_to_section (bss_section);
#ifdef ASM_DECLARE_OBJECT_NAME
last_assemble_variable_decl = decl;
@@ -4739,11 +4740,11 @@ weak_finish (void)
static void
globalize_decl (tree decl)
{
- const char *name = XSTR (XEXP (DECL_RTL (decl), 0), 0);
#if defined (ASM_WEAKEN_LABEL) || defined (ASM_WEAKEN_DECL)
if (DECL_WEAK (decl))
{
+ const char *name = XSTR (XEXP (DECL_RTL (decl), 0), 0);
tree *p, t;
#ifdef ASM_WEAKEN_DECL
@@ -4777,7 +4778,7 @@ globalize_decl (tree decl)
}
#endif
- targetm.asm_out.globalize_label (asm_out_file, name);
+ targetm.asm_out.globalize_decl_name (asm_out_file, decl);
}
/* We have to be able to tell cgraph about the needed-ness of the target
@@ -5913,6 +5914,14 @@ default_globalize_label (FILE * stream, const char *name)
}
#endif /* GLOBAL_ASM_OP */
+/* Default function to output code that will globalize a declaration. */
+void
+default_globalize_decl_name (FILE * stream, tree decl)
+{
+ const char *name = XSTR (XEXP (DECL_RTL (decl), 0), 0);
+ targetm.asm_out.globalize_label (stream, name);
+}
+
/* Default function to output a label for unwind information. The
default is to do nothing. A target that needs nonlocal labels for
unwind information must provide its own function to do this. */