aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorRichard Kenner <kenner@gcc.gnu.org>1994-10-17 18:47:09 -0400
committerRichard Kenner <kenner@gcc.gnu.org>1994-10-17 18:47:09 -0400
commit02c1d408e26cfba29ae64906de31cf009e91567e (patch)
treed0703a09e59e8d4c424b1d9b6ec271eefa10be13
parent305243a443e5bdabc1889f7f0c55dfb8d3c3f506 (diff)
downloadgcc-02c1d408e26cfba29ae64906de31cf009e91567e.zip
gcc-02c1d408e26cfba29ae64906de31cf009e91567e.tar.gz
gcc-02c1d408e26cfba29ae64906de31cf009e91567e.tar.bz2
(rescan): Preserve newlines after macro names at the top level since this is...
(rescan): Preserve newlines after macro names at the top level since this is more likely to do the right thing with line numbers. From-SVN: r8287
-rw-r--r--gcc/cccp.c12
1 files changed, 10 insertions, 2 deletions
diff --git a/gcc/cccp.c b/gcc/cccp.c
index b434300..7f3613d 100644
--- a/gcc/cccp.c
+++ b/gcc/cccp.c
@@ -3276,9 +3276,17 @@ startagain:
/* This is now known to be a macro call.
Discard the macro name from the output,
- along with any following whitespace just copied. */
+ along with any following whitespace just copied,
+ but preserve newlines at the top level since this
+ is more likely to do the right thing with line numbers. */
obp = op->buf + obufp_before_macroname;
- op->lineno = op_lineno_before_macroname;
+ if (ip->macro != 0)
+ op->lineno = op_lineno_before_macroname;
+ else {
+ int newlines = op->lineno - op_lineno_before_macroname;
+ while (0 < newlines--)
+ *obp++ = '\n';
+ }
/* Prevent accidental token-pasting with a character
before the macro call. */