This is the mail archive of the gdb-patches@sourceware.org mailing list for the GDB project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

Re: [patchv2] compile: Fix crash on cv-qualified self-reference


On 07/01/2015 02:24 PM, Jan Kratochvil wrote:

> I can change it that way but when you ask "isn't cleaner" then no, I think
> your hack is even a bit more ugly than my ugly hack.
> 
> There should be two virtual methods, one pure for 'switch (TYPE_CODE (type))'
> and the other one checking TYPE_INSTANCE_FLAG* in superclass overriden only by
> TYPE_CODE_STRUCT and TYPE_CODE_UNION (there would be no TYPE_CODE_*, though).

What would be the method name?  There's nothing
preventing adding a new type_FOO function that takes a type pointer as
parameter and hides the TYPE_CODE checks inside.  From the caller's
perspective, it'll be the same.  Once we get to C++ and if we consider
objectifying type, then converting that function to a method will
be trivial.

Thanks,
Pedro Alves


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]