public inbox for gdb@sourceware.org
 help / color / mirror / Atom feed
From: Jan Kratochvil <jan.kratochvil@redhat.com>
To: 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: Tue, 14 Apr 2015 06:09:00 -0000	[thread overview]
Message-ID: <20150414060905.GA22747@host1.jankratochvil.net> (raw)
In-Reply-To: <20150410123145.GA18073@host1.jankratochvil.net>

On Fri, 10 Apr 2015 14:31:45 +0200, Jan Kratochvil wrote:
> What is the recommended fix?  I expect pointer to a declaration / opaque type
> which gets completed only when one references the 'p' field later?

It looks as it got fixed by:

-plugin_build_record_type (cc1_plugin::connection *self)
+plugin_build_record_type (cc1_plugin::connection *self, const char *name)
 {
   plugin_context *ctx = static_cast<plugin_context *> (self);
-  return convert_out (ctx->preserve (make_node (RECORD_TYPE)));
+  tree node (make_node (RECORD_TYPE));
+  tree type_decl (build_decl (input_location, TYPE_DECL, get_identifier (name),
+                             node));
+  TYPE_NAME (node) = type_decl;
+  TYPE_STUB_DECL (node) = type_decl;
+  C_TYPE_BEING_DEFINED (node) = 1;
+  return convert_out (ctx->preserve (node));


Jan

  reply	other threads:[~2015-04-14  6:09 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 [this message]
2015-04-17 15:22   ` Jan Kratochvil
2015-04-18 10:20     ` Jan Kratochvil
2015-04-23 22:06       ` Jeff Law
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=20150414060905.GA22747@host1.jankratochvil.net \
    --to=jan.kratochvil@redhat.com \
    --cc=gcc@gcc.gnu.org \
    --cc=gdb@sourceware.org \
    --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).