summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorrth <rth@138bc75d-0d04-0410-961f-82ee72b054a4>2002-03-11 22:39:35 +0000
committerrth <rth@138bc75d-0d04-0410-961f-82ee72b054a4>2002-03-11 22:39:35 +0000
commit337057dd46c607bfdb0d01974e8c8398f89c1741 (patch)
tree32b445dea72fa81baa922e65be1741e2dcc548fa
parent472832ddc91d3433dc0a6f0d30193ade26dd3eb6 (diff)
downloadgcc-337057dd46c607bfdb0d01974e8c8398f89c1741.tar.gz
* genflags.c (gen_insn): Use IS_VSPACE.
* genoutput.c (output_insn_data): Likewise. (process_template): Likewise. git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@50616 138bc75d-0d04-0410-961f-82ee72b054a4
-rw-r--r--gcc/ChangeLog6
-rw-r--r--gcc/genflags.c2
-rw-r--r--gcc/genoutput.c13
3 files changed, 16 insertions, 5 deletions
diff --git a/gcc/ChangeLog b/gcc/ChangeLog
index 964f9ec62df..5d416927af4 100644
--- a/gcc/ChangeLog
+++ b/gcc/ChangeLog
@@ -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.
diff --git a/gcc/genflags.c b/gcc/genflags.c
index 031155f14de..010ac706604 100644
--- a/gcc/genflags.c
+++ b/gcc/genflags.c
@@ -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);
diff --git a/gcc/genoutput.c b/gcc/genoutput.c
index 7ed98bbbe26..80b73fcb915 100644
--- a/gcc/genoutput.c
+++ b/gcc/genoutput.c
@@ -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++;