varasm.c (assemble_start_function): Add weak_global_object_name.

* varasm.c (assemble_start_function): Add weak_global_object_name.
        * tree.c (get_file_function_name): Use it.

From-SVN: r20612
This commit is contained in:
Jason Merrill 1998-06-19 22:09:24 +00:00 committed by Jeff Law
parent 0d091530be
commit ee8303096a
3 changed files with 18 additions and 4 deletions

View File

@ -1,3 +1,8 @@
Fri Jun 19 23:06:33 1998 Jason Merrill <jason@yorick.cygnus.com>
* varasm.c (assemble_start_function): Add weak_global_object_name.
* tree.c (get_file_function_name): Use it.
Fri Jun 19 22:55:14 1998 Jeffrey A Law (law@cygnus.com)
* c-lang.c (GNU_xref_begin, GNU_xref_end): Deleted.

View File

@ -4793,6 +4793,7 @@ dump_tree_statistics ()
#endif /* NO_DOLLAR_IN_LABEL */
extern char * first_global_object_name;
extern char * weak_global_object_name;
/* If KIND=='I', return a suitable global initializer (constructor) name.
If KIND=='D', return a suitable global clean-up (destructor) name. */
@ -4806,6 +4807,8 @@ get_file_function_name (kind)
if (first_global_object_name)
p = first_global_object_name;
else if (weak_global_object_name)
p = weak_global_object_name;
else if (main_input_filename)
p = main_input_filename;
else

View File

@ -85,6 +85,7 @@ extern FILE *asm_out_file;
/* The (assembler) name of the first globally-visible object output. */
char *first_global_object_name;
char *weak_global_object_name;
extern struct obstack *current_obstack;
extern struct obstack *saveable_obstack;
@ -1003,14 +1004,19 @@ assemble_start_function (decl, fnname)
if (TREE_PUBLIC (decl))
{
if (!first_global_object_name && ! DECL_WEAK (decl)
&& ! DECL_ONE_ONLY (decl))
if (! first_global_object_name)
{
char *p;
char **name;
if (! DECL_WEAK (decl) && ! DECL_ONE_ONLY (decl))
name = &first_global_object_name;
else
name = &weak_global_object_name;
STRIP_NAME_ENCODING (p, fnname);
first_global_object_name = permalloc (strlen (p) + 1);
strcpy (first_global_object_name, p);
*name = permalloc (strlen (p) + 1);
strcpy (*name, p);
}
#ifdef ASM_WEAKEN_LABEL