This is the mail archive of the gcc-bugs@gcc.gnu.org mailing list for the GCC project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]

Re: ridpointer problem [Re: block reordering problem]


On Sun, Sep 10, 2000 at 12:25:06AM -0700, Zack Weinberg wrote:
> Arrrgh.  I did think I got all of those, really.

Hmm.  It looks like you thought about it, certainly.  I was thinking
to myself "why don't we just make one keyword spelling canonical in
the lexer".  Then I discovered that you've done exactly that in the
C++ front end, but not the C front end.

The following also fixes the test case in question.


r~


	* c-parse.in: Revert last change.
	(_yylex): Return the canonical spelling of a keyword.

Index: c-parse.in
===================================================================
RCS file: /cvs/gcc/egcs/gcc/c-parse.in,v
retrieving revision 1.56
diff -c -p -d -r1.56 c-parse.in
*** c-parse.in	2000/09/10 07:07:20	1.56
--- c-parse.in	2000/09/10 08:28:16
*************** _yylex ()
*** 3219,3225 ****
  
      case CPP_NAME:
        if (C_IS_RESERVED_WORD (yylval.ttype))
! 	return rid_to_yy[C_RID_CODE (yylval.ttype)];
  
        if (IDENTIFIER_POINTER (yylval.ttype)[0] == '@')
  	{
--- 3219,3230 ----
  
      case CPP_NAME:
        if (C_IS_RESERVED_WORD (yylval.ttype))
! 	{
! 	  enum rid rid_code = C_RID_CODE (yylval.ttype);
! 	  /* Return the canonical spelling for this keyword.  */
! 	  yylval.ttype = ridpointer[(int) rid_code];
! 	  return rid_to_yy[(int) rid_code];
! 	}
  
        if (IDENTIFIER_POINTER (yylval.ttype)[0] == '@')
  	{

Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]