attribs.c (handle_alias_attribute): Don't call assemble_alias.
* attribs.c (handle_alias_attribute): Don't call assemble_alias. (handle_visibility_attribute): Don't call assemble_visibility. * toplev.c (rest_of_decl_compilation): Invoke make_decl_rtl even without asmspec. Invoke assemble_alias when needed. * varasm.c (maybe_assemble_visibility): New. (assemble_start_function, assemble_variable, assemble_alias): Use it. From-SVN: r50237
This commit is contained in:
parent
b20032503b
commit
b14707c32c
@ -1,3 +1,12 @@
|
|||||||
|
2002-03-02 Richard Henderson <rth@redhat.com>
|
||||||
|
|
||||||
|
* attribs.c (handle_alias_attribute): Don't call assemble_alias.
|
||||||
|
(handle_visibility_attribute): Don't call assemble_visibility.
|
||||||
|
* toplev.c (rest_of_decl_compilation): Invoke make_decl_rtl even
|
||||||
|
without asmspec. Invoke assemble_alias when needed.
|
||||||
|
* varasm.c (maybe_assemble_visibility): New.
|
||||||
|
(assemble_start_function, assemble_variable, assemble_alias): Use it.
|
||||||
|
|
||||||
2002-03-02 Richard Henderson <rth@redhat.com>
|
2002-03-02 Richard Henderson <rth@redhat.com>
|
||||||
|
|
||||||
* varasm.c (make_decl_rtl): Remove call to REDO_SECTION_INFO_P;
|
* varasm.c (make_decl_rtl): Remove call to REDO_SECTION_INFO_P;
|
||||||
|
@ -1054,7 +1054,6 @@ handle_alias_attribute (node, name, args, flags, no_add_attrs)
|
|||||||
DECL_INITIAL (decl) = error_mark_node;
|
DECL_INITIAL (decl) = error_mark_node;
|
||||||
else
|
else
|
||||||
DECL_EXTERNAL (decl) = 0;
|
DECL_EXTERNAL (decl) = 0;
|
||||||
assemble_alias (decl, id);
|
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
@ -1102,8 +1101,6 @@ handle_visibility_attribute (node, name, args, flags, no_add_attrs)
|
|||||||
*no_add_attrs = true;
|
*no_add_attrs = true;
|
||||||
return NULL_TREE;
|
return NULL_TREE;
|
||||||
}
|
}
|
||||||
|
|
||||||
assemble_visibility (decl, TREE_STRING_POINTER (id));
|
|
||||||
}
|
}
|
||||||
|
|
||||||
return NULL_TREE;
|
return NULL_TREE;
|
||||||
|
27
gcc/toplev.c
27
gcc/toplev.c
@ -2254,17 +2254,33 @@ rest_of_decl_compilation (decl, asmspec, top_level, at_end)
|
|||||||
#define ASM_FINISH_DECLARE_OBJECT(FILE, DECL, TOP, END)
|
#define ASM_FINISH_DECLARE_OBJECT(FILE, DECL, TOP, END)
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
|
/* We deferred calling assemble_alias so that we could collect
|
||||||
|
other attributes such as visibility. Emit the alias now. */
|
||||||
|
{
|
||||||
|
tree alias;
|
||||||
|
alias = lookup_attribute ("alias", DECL_ATTRIBUTES (decl));
|
||||||
|
if (alias)
|
||||||
|
{
|
||||||
|
alias = TREE_VALUE (TREE_VALUE (alias));
|
||||||
|
alias = get_identifier (TREE_STRING_POINTER (alias));
|
||||||
|
assemble_alias (decl, alias);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
/* Forward declarations for nested functions are not "external",
|
/* Forward declarations for nested functions are not "external",
|
||||||
but we need to treat them as if they were. */
|
but we need to treat them as if they were. */
|
||||||
if (TREE_STATIC (decl) || DECL_EXTERNAL (decl)
|
if (TREE_STATIC (decl) || DECL_EXTERNAL (decl)
|
||||||
|| TREE_CODE (decl) == FUNCTION_DECL)
|
|| TREE_CODE (decl) == FUNCTION_DECL)
|
||||||
{
|
{
|
||||||
timevar_push (TV_VARCONST);
|
timevar_push (TV_VARCONST);
|
||||||
if (asmspec)
|
|
||||||
make_decl_rtl (decl, asmspec);
|
/* If asmspec non-zero, we may be creating a global register variable.
|
||||||
/* Don't output anything
|
If asmspec zero, we may be making sure that ENCODE_SECTION_INFO is
|
||||||
when a tentative file-scope definition is seen.
|
up-to-date. */
|
||||||
But at end of compilation, do output code for them. */
|
make_decl_rtl (decl, asmspec);
|
||||||
|
|
||||||
|
/* Don't output anything when a tentative file-scope definition
|
||||||
|
is seen. But at end of compilation, do output code for them. */
|
||||||
if (at_end || !DECL_DEFER_OUTPUT (decl))
|
if (at_end || !DECL_DEFER_OUTPUT (decl))
|
||||||
assemble_variable (decl, top_level, at_end, 0);
|
assemble_variable (decl, top_level, at_end, 0);
|
||||||
if (decl == last_assemble_variable_decl)
|
if (decl == last_assemble_variable_decl)
|
||||||
@ -2272,6 +2288,7 @@ rest_of_decl_compilation (decl, asmspec, top_level, at_end)
|
|||||||
ASM_FINISH_DECLARE_OBJECT (asm_out_file, decl,
|
ASM_FINISH_DECLARE_OBJECT (asm_out_file, decl,
|
||||||
top_level, at_end);
|
top_level, at_end);
|
||||||
}
|
}
|
||||||
|
|
||||||
timevar_pop (TV_VARCONST);
|
timevar_pop (TV_VARCONST);
|
||||||
}
|
}
|
||||||
else if (DECL_REGISTER (decl) && asmspec != 0)
|
else if (DECL_REGISTER (decl) && asmspec != 0)
|
||||||
|
23
gcc/varasm.c
23
gcc/varasm.c
@ -171,6 +171,7 @@ static void mark_weak_decls PARAMS ((void *));
|
|||||||
#if defined (ASM_WEAKEN_LABEL) || defined (ASM_WEAKEN_DECL)
|
#if defined (ASM_WEAKEN_LABEL) || defined (ASM_WEAKEN_DECL)
|
||||||
static void remove_from_pending_weak_list PARAMS ((const char *));
|
static void remove_from_pending_weak_list PARAMS ((const char *));
|
||||||
#endif
|
#endif
|
||||||
|
static void maybe_assemble_visibility PARAMS ((tree));
|
||||||
static int in_named_entry_eq PARAMS ((const PTR, const PTR));
|
static int in_named_entry_eq PARAMS ((const PTR, const PTR));
|
||||||
static hashval_t in_named_entry_hash PARAMS ((const PTR));
|
static hashval_t in_named_entry_hash PARAMS ((const PTR));
|
||||||
#ifdef ASM_OUTPUT_BSS
|
#ifdef ASM_OUTPUT_BSS
|
||||||
@ -1252,6 +1253,8 @@ assemble_start_function (decl, fnname)
|
|||||||
else
|
else
|
||||||
#endif
|
#endif
|
||||||
ASM_GLOBALIZE_LABEL (asm_out_file, fnname);
|
ASM_GLOBALIZE_LABEL (asm_out_file, fnname);
|
||||||
|
|
||||||
|
maybe_assemble_visibility (decl);
|
||||||
}
|
}
|
||||||
|
|
||||||
/* Do any machine/system dependent processing of the function name */
|
/* Do any machine/system dependent processing of the function name */
|
||||||
@ -1603,6 +1606,9 @@ assemble_variable (decl, top_level, at_end, dont_output_data)
|
|||||||
DECL_ALIGN (decl) = align;
|
DECL_ALIGN (decl) = align;
|
||||||
set_mem_align (decl_rtl, align);
|
set_mem_align (decl_rtl, align);
|
||||||
|
|
||||||
|
if (TREE_PUBLIC (decl))
|
||||||
|
maybe_assemble_visibility (decl);
|
||||||
|
|
||||||
/* Handle uninitialized definitions. */
|
/* Handle uninitialized definitions. */
|
||||||
|
|
||||||
if ((DECL_INITIAL (decl) == 0 || DECL_INITIAL (decl) == error_mark_node
|
if ((DECL_INITIAL (decl) == 0 || DECL_INITIAL (decl) == error_mark_node
|
||||||
@ -5181,6 +5187,8 @@ assemble_alias (decl, target)
|
|||||||
else
|
else
|
||||||
#endif
|
#endif
|
||||||
ASM_GLOBALIZE_LABEL (asm_out_file, name);
|
ASM_GLOBALIZE_LABEL (asm_out_file, name);
|
||||||
|
|
||||||
|
maybe_assemble_visibility (decl);
|
||||||
}
|
}
|
||||||
|
|
||||||
#ifdef ASM_OUTPUT_DEF_FROM_DECLS
|
#ifdef ASM_OUTPUT_DEF_FROM_DECLS
|
||||||
@ -5225,6 +5233,21 @@ assemble_visibility (decl, visibility_type)
|
|||||||
#endif
|
#endif
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/* A helper function to call assemble_visibility when needed for a decl. */
|
||||||
|
|
||||||
|
static void
|
||||||
|
maybe_assemble_visibility (decl)
|
||||||
|
tree decl;
|
||||||
|
{
|
||||||
|
tree visibility = lookup_attribute ("visibility", DECL_ATTRIBUTES (decl));
|
||||||
|
if (visibility)
|
||||||
|
{
|
||||||
|
const char *type
|
||||||
|
= TREE_STRING_POINTER (TREE_VALUE (TREE_VALUE (visibility)));
|
||||||
|
assemble_visibility (decl, type);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
/* Returns 1 if the target configuration supports defining public symbols
|
/* Returns 1 if the target configuration supports defining public symbols
|
||||||
so that one of them will be chosen at link time instead of generating a
|
so that one of them will be chosen at link time instead of generating a
|
||||||
multiply-defined symbol error, whether through the use of weak symbols or
|
multiply-defined symbol error, whether through the use of weak symbols or
|
||||||
|
Loading…
Reference in New Issue
Block a user