Re: MI: fix base members in references

Nick Roberts
2006-12-11T05:58:23Z

> If you can't explain why your change is correct, then by default, it is
> not the correct fix. We can't just throw bandages at the codebase;
> that's how you get bigger onions, not better programs.

I'm not claiming it's correct, just a step in the right direction, but we could
go round in circles (or onion rings!) here. Its not a RFA.

> > > get_type_deref looks at the type, and if it is a pointer or reference,
> > > it dereferences it. I assume that this is because we want to show the
> > > children of pointers to structs and references to structs. Is that
> > > right?
> >
> > My patch was just for references to pointers.
>
> Sorry, I don't know how else to explain what that function does;

I'm not querying your explanation, just saying that the patch *wasn't* about
showing the children of pointers to structs and references to structs.

> that's
> the important thing here. What does not happen that you want to make
> happen, and why doesn't it happen? The explanation in my previous
> message _should_ answer those questions, if I've understood the
> discussion right, but maybe it doesn't.

What doesn't work: references to pointers to structs/unions.

All my patch does is add an extra level of dereferencing to the relevant
cplus_* functions. Presumably you could also have references to references to
pointers, pointers to references to pointers etc so maybe the change should
look something like:

while (TYPE_CODE (type) == TYPE_CODE_PTR)
|| TYPE_CODE (type) == TYPE_CODE_REF)
type = get_target_type (type);

but I suspect the business of fake children would make this awkward.

--
Nick http://www.inet.net.nz/~nickrob