* 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
+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.
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. */
#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
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 *);