On Wed, Jul 5, 2023 at 12:21 PM Thomas Schwinge <tho...@codesourcery.com> wrote: > > Hi! > > On 2012-08-10T11:06:46-0400, Diego Novillo <dnovi...@google.com> wrote: > > * gengtype-lex.l (USER_GTY): Add pattern for "user". > > * gengtype-parse.c (option): Handle USER_GTY. > > (opts_have): New. > > (type): Call it. > > If the keyword 'user' is used, do not walk the fields > > of the structure. > > * gengtype.h (USER_GTY): Add. > > These changes got incorporated in > commit 0823efedd0fb8669b7e840954bc54c3b2cf08d67 (Subversion r190402). > > > --- a/gcc/gengtype-lex.l > > +++ b/gcc/gengtype-lex.l > > @@ -108,6 +108,7 @@ EOID [^[:alnum:]_] > > "enum"/{EOID} { return ENUM; } > > "ptr_alias"/{EOID} { return PTR_ALIAS; } > > "nested_ptr"/{EOID} { return NESTED_PTR; } > > +"user"/{EOID} { return USER_GTY; } > > [0-9]+ { return NUM; } > > "param"[0-9]*"_is"/{EOID} { > > *yylval = XDUPVAR (const char, yytext, yyleng, yyleng+1); > > > --- a/gcc/gengtype-parse.c > > +++ b/gcc/gengtype-parse.c > > @@ -499,6 +499,10 @@ option (options_p prev) > > [...] > > > --- a/gcc/gengtype.h > > +++ b/gcc/gengtype.h > > @@ -463,6 +463,7 @@ enum > > ELLIPSIS, > > PTR_ALIAS, > > NESTED_PTR, > > + USER_GTY, > > PARAM_IS, > > NUM, > > SCALAR, > > This did add 'USER_GTY' to what nowadays is known as 'enum gty_token', > but didn't accordingly update 'gcc/gengtype-parse.c:token_names', leaving > those out of sync. Updating 'gcc/gengtype-parse.c:token_value_format' > wasn't necessary, as: > > /* print_token assumes that any token >= FIRST_TOKEN_WITH_VALUE may have > a meaningful value to be printed. */ > FIRST_TOKEN_WITH_VALUE = PARAM_IS > > This, in turn, got further confused -- or "fixed" -- by later changes: > 2014 commit 63f5d5b818319129217e41bcb23db53f99ff11b0 (Subversion r218558) > "remove gengtype support for param_is use_param, if_marked and splay tree > allocators", > which reciprocally missed corresponding clean-up. > > OK to push the attached > "GTY: Repair 'enum gty_token', 'token_names' desynchronization"?
OK. > > On top of that, I'll then re-submit an adjusted > <https://inbox.sourceware.org/873522vkmu....@euler.schwinge.homeip.net> > "GTY: Clean up obsolete parametrized structs remnants". > > > Grüße > Thomas > > > ----------------- > Siemens Electronic Design Automation GmbH; Anschrift: Arnulfstraße 201, 80634 > München; Gesellschaft mit beschränkter Haftung; Geschäftsführer: Thomas > Heurung, Frank Thürauf; Sitz der Gesellschaft: München; Registergericht > München, HRB 106955