From 6fee8f021d6bfb1dcf2ed224145ccbe9ae228d0b Mon Sep 17 00:00:00 2001 From: zack Date: Mon, 26 Mar 2007 21:00:20 +0000 Subject: * gengtype-lex.l: Distinguish unions from structures in the token type. Don't call find_structure; return the tag as a string. * gengtype-yacc.y: Add new token types ENT_TYPEDEF_UNION and ENT_UNION. Type of these, ENT_TYPEDEF_STRUCT, and ENT_STRUCT is string. Reorganize typedef_struct production accordingly. Use create_nested_ptr_option. * gengtype.c (create_nested_ptr_option): New function. * gengtype.h: Declare it. git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@123232 138bc75d-0d04-0410-961f-82ee72b054a4 --- gcc/gengtype-lex.l | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) (limited to 'gcc/gengtype-lex.l') diff --git a/gcc/gengtype-lex.l b/gcc/gengtype-lex.l index 1d136251e10..baf09bcd5fe 100644 --- a/gcc/gengtype-lex.l +++ b/gcc/gengtype-lex.l @@ -171,12 +171,12 @@ ITYPE {IWORD}({WS}{IWORD})* for (taglen = 1; ISIDNUM (tagstart[taglen]); taglen++) ; - yylval.t = find_structure ((const char *) xmemdup (tagstart, taglen, - taglen + 1), - union_p); + yylval.s = (const char *) xmemdup (tagstart, taglen, taglen + 1); + BEGIN(in_struct); update_lineno (yytext, yyleng); - return typedef_p ? ENT_TYPEDEF_STRUCT : ENT_STRUCT; + return union_p ? (typedef_p ? ENT_TYPEDEF_UNION : ENT_UNION) + : (typedef_p ? ENT_TYPEDEF_STRUCT : ENT_STRUCT); } [^[:alnum:]_](extern|static){WS}/"GTY" { -- cgit v1.2.1