Hi, all!
I have a question concerning GGC and gengtype in particular.
The question is: can I have DIFFERENT <<GTY(())>>-ed types and
variables with the SAME NAMES in two DIFFERENT front ends?
More expanded: I am trying to implement a front-end of a C-derived
language (say, Z); and have used the c-parser.c as a base for the
source code of z-parser.c. Of course, I need to add the new "Z"
variants of grammatical rules, and, when doing so, I don't want to
deal with Objective-C (and OpenMP) parts of parser code. So I have
eliminated most of ObjC/OpenMP-related functions and fragments.
Now I am looking at c_parser/the_parser definitions [near
c-parser.c:L168]:
] typedef struct GTY(()) c_parser {
] /* The look-ahead tokens. */
] c_token tokens[2];
] /* How many look-ahead tokens are available (0, 1 or 2). */
] ...
] BOOL_BITFIELD lex_untranslated_string : 1;
] /* Objective-C specific parser/lexer information. */
] BOOL_BITFIELD objc_pq_context : 1;
] /* The following flag is needed to contextualize Objective-C lexical
] analysis. In some cases (e.g., 'int NSObject;'), it is
] undesirable to bind an identifier to an Objective-C class, even
] if a class with that name exists. */
] BOOL_BITFIELD objc_need_raw_identifier : 1;
] } c_parser;
]
]
] /* The actual parser and external interface. ??? Does this need to be
] garbage-collected? */
]
] static GTY (()) c_parser *the_parser;
So I want to remove this objc_pq_context and objc_needed_raw fields of
struct c_parser. But I don't want to rename c_parser/the_parser
type/variable since this will add a lot of changes (additional places
to worry about when porting to new GCC version).
So, please, answer: can I don't worry leaving these two GTY-ed
(c_parser/the_parser) with their own names in my "Z" front end?
Thanks in advance!