From 872936ad0b64f529c953e86d1be1928cc29b902e Mon Sep 17 00:00:00 2001 From: Mike Stump Date: Mon, 7 Dec 1998 23:36:08 +0000 Subject: [PATCH] bsd.h (ASM_FILE_START): Don't use dump_base_name... * i386/bsd.h (ASM_FILE_START): Don't use dump_base_name, it is wrong and should only be used for dump related things, not debugging information, instead main_input_filename should be used. Also, reuse output_file_directive if possible. * i386/aix386ng.h (ASM_FILE_START): Likewise. * i386/isc.h (ASM_FILE_START): Likewise. * i386/win-nt.h (ASM_FILE_START): Likewise. * i386/sun386.h (ASM_FILE_START): Likewise. From-SVN: r24174 --- gcc/ChangeLog | 11 +++++++++++ gcc/config/i386/aix386ng.h | 4 +--- gcc/config/i386/bsd.h | 4 +--- gcc/config/i386/go32.h | 1 - gcc/config/i386/isc.h | 31 +++++++++++++++++-------------- gcc/config/i386/sun386.h | 8 ++++---- gcc/config/i386/win-nt.h | 4 +--- 7 files changed, 35 insertions(+), 28 deletions(-) diff --git a/gcc/ChangeLog b/gcc/ChangeLog index 15ada9af673..a871069a878 100644 --- a/gcc/ChangeLog +++ b/gcc/ChangeLog @@ -1,3 +1,14 @@ +Tue Dec 8 00:34:05 1998 Mike Stump + + * i386/bsd.h (ASM_FILE_START): Don't use dump_base_name, it is + wrong and should only be used for dump related things, not + debugging information, instead main_input_filename should be used. + Also, reuse output_file_directive if possible. + * i386/aix386ng.h (ASM_FILE_START): Likewise. + * i386/isc.h (ASM_FILE_START): Likewise. + * i386/win-nt.h (ASM_FILE_START): Likewise. + * i386/sun386.h (ASM_FILE_START): Likewise. + Mon Dec 7 23:56:28 1998 Robert Lipe * configure.in (mips*-*-linux*): Handle big and little endian diff --git a/gcc/config/i386/aix386ng.h b/gcc/config/i386/aix386ng.h index a177b69250f..3b3d65ac816 100644 --- a/gcc/config/i386/aix386ng.h +++ b/gcc/config/i386/aix386ng.h @@ -58,9 +58,7 @@ Boston, MA 02111-1307, USA. */ #undef ASM_FILE_START #define ASM_FILE_START(FILE) \ - do { fprintf (FILE, "\t.file\t"); \ - output_quoted_string (FILE, dump_base_name); \ - fprintf (FILE, "\n"); \ + do { output_file_directive (FILE, main_input_filename); \ if (optimize) \ ASM_FILE_START_1 (FILE); \ else \ diff --git a/gcc/config/i386/bsd.h b/gcc/config/i386/bsd.h index d50be3664c1..34db79a79d5 100644 --- a/gcc/config/i386/bsd.h +++ b/gcc/config/i386/bsd.h @@ -49,9 +49,7 @@ Boston, MA 02111-1307, USA. */ ??? I am skeptical of this -- RMS. */ #define ASM_FILE_START(FILE) \ - do { fprintf (FILE, "\t.file\t"); \ - output_quoted_string (FILE, dump_base_name); \ - fprintf (FILE, "\n"); \ + do { output_file_directive (FILE, main_input_filename); \ } while (0) /* This was suggested, but it shouldn't be right for DBX output. -- RMS diff --git a/gcc/config/i386/go32.h b/gcc/config/i386/go32.h index c190f7fed15..ec585df722d 100644 --- a/gcc/config/i386/go32.h +++ b/gcc/config/i386/go32.h @@ -74,7 +74,6 @@ dtor_section () \ /* Output at beginning of assembler file. */ /* The .file command should always begin the output. */ -/* Use the main_input_filename instead of dump_base_name */ #undef ASM_FILE_START #define ASM_FILE_START(FILE) \ diff --git a/gcc/config/i386/isc.h b/gcc/config/i386/isc.h index 5c39896df01..92d0b7e95d5 100644 --- a/gcc/config/i386/isc.h +++ b/gcc/config/i386/isc.h @@ -72,20 +72,23 @@ message. */ #undef ASM_FILE_START -#define ASM_FILE_START(FILE) \ - do { \ - char c; \ - int max = 0; \ - char *string = dump_base_name; \ - \ - fputs ("\t.file\t\"", FILE); \ - \ - while ((c = *string++) != 0 && max++ < 14) { \ - if (c == '\"' || c == '\\') \ - putc ('\\', FILE); \ - putc (c, FILE); \ - } \ - fputs ("\"\n", FILE); \ +#define ASM_FILE_START(FILE) \ + do { \ + int len = strlen (main_input_filename); \ + char *na = main_input_filename + len; \ + char shorter[15]; \ + /* NA gets MAIN_INPUT_FILENAME sans directory names. */\ + while (na > main_input_filename) \ + { \ + if (na[-1] == '/') \ + break; \ + na--; \ + } \ + strncpy (shorter, na, 14); \ + shorter[14] = 0; \ + fprintf (FILE, "\t.file\t"); \ + output_quoted_string (FILE, shorter); \ + fprintf (FILE, "\n"); \ } while (0) /* Work around assembler forward label references generated in exception diff --git a/gcc/config/i386/sun386.h b/gcc/config/i386/sun386.h index 4d4d66c181a..4302ec40841 100644 --- a/gcc/config/i386/sun386.h +++ b/gcc/config/i386/sun386.h @@ -59,11 +59,11 @@ do \ do { \ extern char *version_string, *language_string; \ { \ - int len = strlen (dump_base_name); \ - char *na = dump_base_name + len; \ + int len = strlen (main_input_filename); \ + char *na = main_input_filename + len; \ char shorter[15]; \ - /* NA gets DUMP_BASE_NAME sans directory names. */\ - while (na > dump_base_name) \ + /* NA gets MAIN_INPUT_FILENAME sans directory names. */\ + while (na > main_input_filename) \ { \ if (na[-1] == '/') \ break; \ diff --git a/gcc/config/i386/win-nt.h b/gcc/config/i386/win-nt.h index 60c0bb6a1f6..97f10c39d00 100644 --- a/gcc/config/i386/win-nt.h +++ b/gcc/config/i386/win-nt.h @@ -131,9 +131,7 @@ while (0) #undef ASM_FILE_START #endif #define ASM_FILE_START(FILE) \ - do { fprintf (FILE, "\t.file\t"); \ - output_quoted_string (FILE, dump_base_name); \ - fprintf (FILE, "\n"); \ + do { output_file_directive (FILE, main_input_filename); \ fprintf (FILE, ".global\t__fltused\n"); \ } while (0)