Multiple inheritance
Mike Stump
mrs@wrs.com
Tue Dec 2 22:54:00 GMT 1997
> From: "Joshua S. Allen" <allen@eecs.tulane.edu>
> To: egcs@cygnus.com
> Date: Mon, 1 Dec 1997 09:05:40 -0600 (CST)
> (1) I need to construct a table of direct parents of a class.
Why? Anyway, you can construct it from BINFO_BASETYPES, but it sounds
more like you'd just be replicating it.
> Whereas this could easily be done at parse time,
Ick, very hard to do at parse time.
> it is presenting me with problems and I was wondering if you could
> direct me to how this information could be extracted from the parse
> tree.
Better to extract it from the internal data structures of the
compiler.
> Once I locate the method in a class, what is the format of the return
> value I give to the calling function.
>From the code (assuming just one value):
return my_tree_cons (basetype_path, rval, NULL_TREE),
where rval is TREE_VEC_ELT (CLASSTYPE_METHOD_VEC (type), idx),
and basetype_path denotes the subobject desired (you'll have to
understand the code a bit to understand how to figure out
this value.)
An easier way to do this would seem to me to just redefine hides with
whatever rules you want. If you do that, then the rest of the code
should just work, though I may be missing something because you didn't
describe what it is you wanted to do very well. I could give better
help with a better idea of what it is you wanted to do.
Good luck.
More information about the Gcc
mailing list