From: Jeff Law <law@redhat.com>
To: Jan Kratochvil <jan.kratochvil@redhat.com>, gcc@gcc.gnu.org
Cc: Phil Muldoon <pmuldoon@redhat.com>, Tom Tromey <tom@tromey.com>,
gdb@sourceware.org
Subject: Re: [gcc libcc1] build_qualified_type for self-referencing/incomplete types
Date: Thu, 23 Apr 2015 22:06:00 -0000 [thread overview]
Message-ID: <55396CF6.8020707@redhat.com> (raw)
In-Reply-To: <20150418101953.GA12295@host1.jankratochvil.net>
On 04/18/2015 04:19 AM, Jan Kratochvil wrote:
> On Fri, 17 Apr 2015 17:22:13 +0200, Jan Kratochvil wrote:
>> How to get 'volatile struct sv' GCC 'tree' type for:
>> volatile struct sv { volatile struct sv *p; };
>
> I have found out how it can work, even with no change on the GCC side:
>
> Instead of current:
> plugin_build_record_type:
> record_type = make_node (RECORD_TYPE)
> plugin_build_add_field:
> add fields to record_type... But there is no qualified_record_type here!
> plugin_finish_record_or_union:
> TYPE_SIZE (record_type) etc. ... to finish the type
> plugin_build_qualified_type:
> qualified_record_type = build_qualified_type (record_type, ...)
> one can do instead:
> plugin_build_record_type:
> record_type = make_node (RECORD_TYPE)
> plugin_build_qualified_type:
> qualified_record_type = build_qualified_type (record_type, ...)
> plugin_build_add_field:
> add fields to qualified_record_type
> plugin_finish_record_or_union:
> TYPE_SIZE (qualified_record_type) etc. ... to finish the type
> And one forgets about the unfinished record_type.
>
> For a different cv-quals of the same record type one builds a new cv-qualified
> record from scratch.
I'm a bit surprised the former didn't work, but if the latter is working
consistently, then I'd stick with it.
jeff
next prev parent reply other threads:[~2015-04-23 22:06 UTC|newest]
Thread overview: 6+ messages / expand[flat|nested] mbox.gz Atom feed top
2015-04-10 12:31 Jan Kratochvil
2015-04-14 6:09 ` Jan Kratochvil
2015-04-17 15:22 ` Jan Kratochvil
2015-04-18 10:20 ` Jan Kratochvil
2015-04-23 22:06 ` Jeff Law [this message]
2015-04-24 6:27 ` Jan Kratochvil
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=55396CF6.8020707@redhat.com \
--to=law@redhat.com \
--cc=gcc@gcc.gnu.org \
--cc=gdb@sourceware.org \
--cc=jan.kratochvil@redhat.com \
--cc=pmuldoon@redhat.com \
--cc=tom@tromey.com \
/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).