diff options
author | Nathan Sidwell <nathan@codesourcery.com> | 2003-07-05 16:11:53 +0000 |
---|---|---|
committer | Nathan Sidwell <nathan@gcc.gnu.org> | 2003-07-05 16:11:53 +0000 |
commit | f5924ac1ecc7def8262994d4a90fdcbc3df40f9d (patch) | |
tree | d2e9fdc94df1c994011ca95833f07282659dd155 | |
parent | f92c5313e17a9b084d8bb80f272d3b9996156d1f (diff) | |
download | gcc-f5924ac1ecc7def8262994d4a90fdcbc3df40f9d.zip gcc-f5924ac1ecc7def8262994d4a90fdcbc3df40f9d.tar.gz gcc-f5924ac1ecc7def8262994d4a90fdcbc3df40f9d.tar.bz2 |
toplev.c (output_clean_symbol_name): Remove.
* toplev.c (output_clean_symbol_name): Remove.
* toplev.h (output_clean_symbol_name): Remove.
* config/alpha/alpha.c (unicosmk_output_module_name): Use
lbasename & clean_symbol_name.
From-SVN: r68978
-rw-r--r-- | gcc/ChangeLog | 7 | ||||
-rw-r--r-- | gcc/config/alpha/alpha.c | 21 | ||||
-rw-r--r-- | gcc/toplev.c | 16 | ||||
-rw-r--r-- | gcc/toplev.h | 1 |
4 files changed, 16 insertions, 29 deletions
diff --git a/gcc/ChangeLog b/gcc/ChangeLog index a8630de..33ea3ab 100644 --- a/gcc/ChangeLog +++ b/gcc/ChangeLog @@ -1,3 +1,10 @@ +2003-07-05 Nathan Sidwell <nathan@codesourcery.com> + + * toplev.c (output_clean_symbol_name): Remove. + * toplev.h (output_clean_symbol_name): Remove. + * config/alpha/alpha.c (unicosmk_output_module_name): Use + lbasename & clean_symbol_name. + 2003-07-05 Kazu Hirata <kazu@cs.umass.edu> * ggc.h: Follow spelling conventions. diff --git a/gcc/config/alpha/alpha.c b/gcc/config/alpha/alpha.c index 927073f..df386de 100644 --- a/gcc/config/alpha/alpha.c +++ b/gcc/config/alpha/alpha.c @@ -9278,22 +9278,19 @@ unicosmk_initial_elimination_offset (int from, int to) static void unicosmk_output_module_name (FILE *file) { - const char *name; - - /* Strip directories. */ - - name = strrchr (main_input_filename, '/'); - if (name) - ++name; - else - name = main_input_filename; - + const char *name = lbasename (main_input_filename); + unsigned len = strlen (name); + char *clean_name = alloca (len + 2); + char *ptr = clean_name; + /* CAM only accepts module names that start with a letter or '$'. We prefix the module name with a '$' if necessary. */ if (!ISALPHA (*name)) - putc ('$', file); - output_clean_symbol_name (file, name); + *ptr++ = '$'; + memcpy (ptr, name, len + 1); + clean_symbol_name (clean_name); + fputs (clean_name, file); } /* Output the definition of a common variable. */ diff --git a/gcc/toplev.c b/gcc/toplev.c index 2f83d68..3337467 100644 --- a/gcc/toplev.c +++ b/gcc/toplev.c @@ -1699,22 +1699,6 @@ output_quoted_string (FILE *asm_file, const char *string) #endif } -/* Output NAME into FILE after having turned it into something - usable as an identifier in a target's assembly file. */ -void -output_clean_symbol_name (FILE *file, const char *name) -{ - /* Make a copy of NAME. */ - char *id = xstrdup (name); - - /* Make it look like a valid identifier for an assembler. */ - clean_symbol_name (id); - - fputs (id, file); - free (id); -} - - /* Output a file name in the form wanted by System V. */ void diff --git a/gcc/toplev.h b/gcc/toplev.h index 0be768f..e750207 100644 --- a/gcc/toplev.h +++ b/gcc/toplev.h @@ -89,7 +89,6 @@ extern void warning_for_asm (struct rtx_def *, const char *, ...) ATTRIBUTE_GCC_DIAG(2,3); extern void warn_deprecated_use (union tree_node *); -extern void output_clean_symbol_name (FILE *, const char *); #ifdef BUFSIZ extern void output_quoted_string (FILE *, const char *); extern void output_file_directive (FILE *, const char *); |