]> gcc.gnu.org Git - gcc.git/commitdiff
(ASM_FILE_START): Quote special characters in file names.
authorPaul Eggert <eggert@gnu.org>
Tue, 28 Sep 1993 00:23:58 +0000 (00:23 +0000)
committerPaul Eggert <eggert@gnu.org>
Tue, 28 Sep 1993 00:23:58 +0000 (00:23 +0000)
From-SVN: r5497

gcc/config/a29k/a29k.h
gcc/config/a29k/unix.h
gcc/config/alpha/alpha.h
gcc/config/i386/aix386ng.h
gcc/config/i386/bsd.h
gcc/config/i386/gas.h
gcc/config/i386/sun386.h

index 95656cc1b4415f9d208aba2156699a6e8344b6ea..640ad2d095ee8503f10f565d9a66f3570328d160 100644 (file)
@@ -1311,7 +1311,9 @@ extern char *a29k_function_name;
   for (p = main_input_filename; *p; p++)                       \
     if (*p == '/')                                             \
       after_dir = p + 1;                                       \
-  fprintf (FILE, "\t.file \"%s\"\n", after_dir);               \
+  fprintf (FILE, "\t.file ");                                  \
+  output_quoted_string (FILE, after_dir);                      \
+  fprintf (FILE, "\n");                                                \
   fprintf (FILE, "\t.sect .lit,lit\n"); }
 
 /* Output to assembler file text saying following lines
index e135b48554b409fe07dadb0482146ef4e1cf36ee..ca77015437f9046351e5a0d2075d1a6ef5753d48 100644 (file)
@@ -61,7 +61,9 @@ the Free Software Foundation, 675 Mass Ave, Cambridge, MA 02139, USA.  */
   for (p = main_input_filename; *p; p++)                       \
     if (*p == '/')                                             \
       after_dir = p + 1;                                       \
-  fprintf (FILE, "\t.file \"%s\"\n", after_dir);               \
+  fprintf (FILE, "\t.file ");                                  \
+  output_quoted_string (FILE, after_dir);                      \
+  fprintf (FILE, "\n");                                                \
   if (flag_shared_data)                                                \
     fprintf (FILE, "\t.sect .shdata,data\n");                  \
   fprintf (FILE, "\t.sect .lit,lit\n");  }
index 1758919bb169278f3249b79618eb5dd59ea05ed0..4e63134f950833b9b9cc4b7d7bfa47ce1e4c9079 100644 (file)
@@ -1354,7 +1354,9 @@ extern char *current_function_name;
   for (p = main_input_filename; *p; p++)                       \
     if (*p == '/')                                             \
       after_dir = p + 1;                                       \
-  fprintf (FILE, "\n\t.file 2 \"%s\"\n", after_dir);           \
+  fprintf (FILE, "\n\t.file 2 ");                              \
+  output_quoted_string (FILE, after_dir);                      \
+  fprintf (FILE, "\n");                                                \
 }
 
 /* Output to assembler file text saying following lines
index 6eecde84d848905c4ceb9f251b1ea39b3f9ce703..16d687540e317efbe0057b7ca9c7b195d0ad464d 100644 (file)
@@ -57,7 +57,9 @@ the Free Software Foundation, 675 Mass Ave, Cambridge, MA 02139, USA.  */
 
 #undef ASM_FILE_START
 #define ASM_FILE_START(FILE)                                   \
-  do { fprintf (FILE, "\t.file\t\"%s\"\n", dump_base_name);    \
+  do { fprintf (FILE, "\t.file\t");                            \
+       output_quoted_string (FILE, dump_base_name);            \
+       fprintf (FILE, "\n");                                   \
        if (optimize)                                           \
           ASM_FILE_START_1 (FILE);                             \
        else                                                    \
index 164290c5a5bbd16d4050e653cffc7cbca790e694..c0f8d9db59e619366af02e0ab550879a2c2b6dd1 100644 (file)
@@ -48,7 +48,10 @@ the Free Software Foundation, 675 Mass Ave, Cambridge, MA 02139, USA.  */
    ??? I am skeptical of this -- RMS.  */
 
 #define ASM_FILE_START(FILE) \
-  fprintf (FILE, "\t.file\t\"%s\"\n", dump_base_name);
+  do { fprintf (FILE, "\t.file\t");                            \
+       output_quoted_string (FILE, dump_base_name);            \
+       fprintf (FILE, "\n");                                   \
+  } while (0)
 
 /* This was suggested, but it shouldn't be right for DBX output. -- RMS
    #define ASM_OUTPUT_SOURCE_FILENAME(FILE, NAME) */
index cad9f51e4b55fdae2e974562803b383b7abf6c51..7dc3da061afbfec1dfa5f60c38e0406495536ebe 100644 (file)
@@ -93,19 +93,11 @@ the Free Software Foundation, 675 Mass Ave, Cambridge, MA 02139, USA.  */
      fprintf ((FILE), "\t.align 2,0x90\n");  /* Use log of 4 as arg.  */
 \f
 #undef ASM_FILE_START
-/* ASM_FILE_START(FILE) used to be defined as:
-     fprintf (FILE, "\t.file\t\"%s\"\n", dump_base_name);
-   However, the string dump_base_name may contain backslashes.  (This may often
-   be the case when gcc is run under operating systems such as DOS and OS/2.)
-   Each backslash in dump_base_name must be converted to two consecutive
-   backslashes on output.  */
 #define ASM_FILE_START(FILE) \
-  { char *p; \
-    fprintf (FILE, "\t.file\t\""); \
-    for (p = dump_base_name; *p != '\0'; p++) \
-      if (*p == '\\') fprintf (FILE, "\\\\");  \
-      else fprintf (FILE, "%c", *p); \
-    fprintf (FILE, "\"\n"); }
+  do { fprintf (FILE, "\t.file\t");                    \
+       output_quoted_string (FILE, dump_base_name);    \
+       fprintf (FILE, "\n");                           \
+  } while (0)
 
 /* A C statement or statements which output an assembler instruction
    opcode to the stdio stream STREAM.  The macro-operand PTR is a
index 9809723bc9a630436f6cc8d7b1d679bfa47ce438..df247229e3d4390a3e73cc73c764f863c019a9aa 100644 (file)
@@ -70,7 +70,9 @@ do                                                            \
        }                                               \
       strncpy (shorter, na, 14);                       \
       shorter[14] = 0;                                 \
-      fprintf (FILE, "\t.file\t\"%s\"\n", shorter);    \
+      fprintf (FILE, "\t.file\t");                     \
+      output_quoted_string (FILE, shorter);            \
+      fprintf (FILE, "\n");                            \
     }                                                  \
     fprintf (FILE, "\t.version\t\"%s %s\"\n",          \
             language_string, version_string);          \
This page took 0.074846 seconds and 5 git commands to generate.