Don't emit adjacent operands in -fdump-go-spec

Submitted by Ian Taylor on Jan. 29, 2011, 2:32 a.m.

Details

Message ID mcrtygsqw1q.fsf@google.com
State New
Headers show

Commit Message

Ian Taylor Jan. 29, 2011, 2:32 a.m.
This patch changes -fdump-go-spec to avoid emitting two adjacent
operands.  That sometimes happens when C code is using string
concatenation.  It would be possible in principle to use turn C adjacent
string concatenation to use Go's + operator, but for the current uses of
-fdump-go-spec that is an unimportant tweak.  Bootstrapped and ran Go
testsuite on x86_64-unknown-linux-gnu.  Committed to mainline.

Ian


2011-01-28  Ian Lance Taylor  <iant@google.com>

	* godump.c (go_define): Ignore macros whose definitions include
	two adjacent operands.

Patch hide | download patch | download mbox

Index: gcc/godump.c
===================================================================
--- gcc/godump.c	(revision 169270)
+++ gcc/godump.c	(working copy)
@@ -142,6 +142,9 @@  go_define (unsigned int lineno, const ch
 	    const char *start;
 	    char *n;
 
+	    if (saw_operand)
+	      goto unknown;
+
 	    start = p;
 	    while (ISALNUM (*p) || *p == '_')
 	      ++p;