From: Doug Evans <xdje42@gmail.com>
To: Gaius Mulley <gaius.mulley@southwales.ac.uk>
Cc: "gdb-patches@sourceware.org" <gdb-patches@sourceware.org>
Subject: Re: m2-typeprint.c:m2_range's use of TYPE_DOMAIN_TYPE: Eh?
Date: Wed, 21 Jan 2015 04:15:00 -0000 [thread overview]
Message-ID: <CAP9bCMTyMLAwRL2yYrQK3uUOfXYB1V2g-5gvfGQwWtUB9-YGqQ@mail.gmail.com> (raw)
In-Reply-To: <878ugxt7i2.fsf@southwales.ac.uk>
On Tue, Jan 20, 2015 at 2:25 PM, Gaius Mulley
<gaius.mulley@southwales.ac.uk> wrote:
> Doug Evans <xdje42@gmail.com> writes:
>
>> Hi.
>>
>> Does anyone know why m2_range uses TYPE_DOMAIN_TYPE here?
>>
>> [...]
>> Alas, vptr_basetype is overloaded and is used also for TYPE_DOMAIN_TYPE:
>>
>> #define TYPE_DOMAIN_TYPE(thistype) TYPE_MAIN_TYPE(thistype)->vptr_basetype
>>
>> hence wondering why in the world m2_range is using it. :-)
>
> Hi Doug,
>
> feel free to clean up the code and make it comply with other languages.
> I've a feeling that this code will need an overhaul against gm2-1.1.1
> (grafted on gcc-4.7.4). The gcc/gm2 interface has pretty much all
> been rewritten since gm2-1.0 (which was grafted onto gcc-4.1.2).
Thanks.
Alas cleaning up this code is non-obvious.
What do I replace TYPE_DOMAIN_TYPE with?
I'm tempted to just go with TYPE_TARGET_TYPE
and let y'all fix it later if that's wrong.
>
>> For TYPE_CODE_{MEMBERPTR,METHODPTR,METHOD},
>> any reason why their "domain type" (I'll want to rename that)
>> cannot live in type_specific?
>>
>> ---
>>
>> void
>> m2_range (struct type *type, struct ui_file *stream, int show,
>> int level, const struct type_print_options *flags)
>> {
>> if (TYPE_HIGH_BOUND (type) == TYPE_LOW_BOUND (type))
>> m2_print_type (TYPE_DOMAIN_TYPE (type), "", stream, show, level,
>> flags);
>> else
>> {
>> struct type *target = TYPE_TARGET_TYPE (type);
>>
>> fprintf_filtered (stream, "[");
>> print_type_scalar (target, TYPE_LOW_BOUND (type), stream);
>> fprintf_filtered (stream, "..");
>> print_type_scalar (target, TYPE_HIGH_BOUND (type), stream);
>> fprintf_filtered (stream, "]");
>> }
>> }
>
> regards,
> Gaius
next prev parent reply other threads:[~2015-01-21 4:15 UTC|newest]
Thread overview: 4+ messages / expand[flat|nested] mbox.gz Atom feed top
2015-01-19 18:30 Doug Evans
2015-01-20 22:25 ` Gaius Mulley
2015-01-21 4:15 ` Doug Evans [this message]
2015-01-21 11:05 ` Gaius Mulley
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=CAP9bCMTyMLAwRL2yYrQK3uUOfXYB1V2g-5gvfGQwWtUB9-YGqQ@mail.gmail.com \
--to=xdje42@gmail.com \
--cc=gaius.mulley@southwales.ac.uk \
--cc=gdb-patches@sourceware.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).