This is the mail archive of the
gcc-patches@gcc.gnu.org
mailing list for the GCC project.
Re: PATCH: Yet another ObjC-ish "hook" in c-decl.c
On Thu, 2 Sep 2004, Ziemowit Laski wrote:
> Actually, I didn't find the arg_info trees that cryptic, since they contain
> pre-chewed PARM_DECLs and TYPE_DECLs. I'm also not sure why you'd want to
> change this, but I guess we can worry about this later.
They are accessed by
#define ARG_INFO_PARMS(args) TREE_PURPOSE(args)
#define ARG_INFO_TAGS(args) TREE_VALUE(args)
#define ARG_INFO_TYPES(args) TREE_CHAIN(args)
#define ARG_INFO_OTHERS(args) TREE_TYPE(args)
but not entirely consistently, but also built up manually in the parser
without those macros. Although not strictly necessary to change as part
of moving declarators from trees (they are contained in, rather than
containing, declarators, and don't need to store constant expression
flags), in the interests of reducing garbage production associated with
declarators (and the general interests of better static typing rather than
making everything a tree) it seemed appropriate to replace them by a more
specific structure
struct c_arg_info {
tree parms;
tree tags;
tree types;
tree others;
};
that could be allocated along with the declarators on a parser obstack.
--
Joseph S. Myers http://www.srcf.ucam.org/~jsm28/gcc/
http://www.srcf.ucam.org/~jsm28/gcc/#c90status - status of C90 for GCC 3.5
jsm@polyomino.org.uk (personal mail)
jsm28@gcc.gnu.org (Bugzilla assignments and CCs)