genflags.c (gen_insn): Use IS_VSPACE.
authorChris Meyer <cmeyer@gatan.com>
Mon, 11 Mar 2002 22:39:35 +0000 (22:39 +0000)
committerRichard Henderson <rth@gcc.gnu.org>
Mon, 11 Mar 2002 22:39:35 +0000 (14:39 -0800)
        * genflags.c (gen_insn): Use IS_VSPACE.
        * genoutput.c (output_insn_data): Likewise.
        (process_template): Likewise.

From-SVN: r50616

gcc/ChangeLog
gcc/genflags.c
gcc/genoutput.c

index 964f9ec..5d41692 100644 (file)
@@ -1,3 +1,9 @@
+2002-03-11  Chris Meyer  <cmeyer@gatan.com>
+
+       * genflags.c (gen_insn): Use IS_VSPACE.
+       * genoutput.c (output_insn_data): Likewise.
+       (process_template): Likewise.
+
 2002-03-11  Richard Henderson  <rth@redhat.com>
 
        * toplev.c (rest_of_compilation): Don't compile if we've had errors.
index 031155f..010ac70 100644 (file)
@@ -201,7 +201,7 @@ gen_insn (insn)
       printf ("(");
       for (p = XSTR (insn, 2); *p; p++)
        {
-         if (*p == '\n')
+         if (IS_VSPACE (*p))
            printf (" \\\n");
          else
            printf ("%c", *p);
index 7ed98bb..80b73fc 100644 (file)
@@ -366,8 +366,13 @@ output_insn_data ()
            printf ("    \"");
            while (*p)
              {
-               if (*p == '\n' && prev != '\\')
-                 printf ("\\n\\\n");
+               if (IS_VSPACE (*p) && prev != '\\')
+                 {
+                   /* Preserve two consecutive \n's or \r's, but treat \r\n
+                      as a single newline.  */
+                   if (*p == '\n' && prev != '\r')
+                     printf ("\\n\\\n");
+                 }
                else
                  putchar (*p);
                prev = *p;
@@ -694,11 +699,11 @@ process_template (d, template)
 
       for (i = 0, cp = &template[1]; *cp; )
        {
-         while (*cp == '\n' || *cp == ' ' || *cp== '\t')
+         while (ISSPACE (*cp))
            cp++;
 
          printf ("  \"");
-         while (*cp != '\n' && *cp != '\0')
+         while (!IS_VSPACE (*cp) && *cp != '\0')
            {
              putchar (*cp);
              cp++;