public inbox for gcc-help@gcc.gnu.org
 help / color / mirror / Atom feed
From: Ian Lance Taylor <iant@google.com>
To: David Philippi <philippi@absint.com>
Cc: gcc-help@gcc.gnu.org
Subject: Re: TYPE_DECL nodes and what type they represent
Date: Fri, 24 Apr 2009 19:42:00 -0000	[thread overview]
Message-ID: <m3mya5yh2s.fsf@google.com> (raw)
In-Reply-To: <200904241737.05485.philippi@absint.com> (David Philippi's message of "Fri\, 24 Apr 2009 17\:37\:05 +0200")

David Philippi <philippi@absint.com> writes:

> I'm somewhat at a loss with getting the type information out of TYPE_DECL 
> nodes. From the comments in the code it seems like I should be able to 
> identify not only the typedef name but also the original builtin / compound 
> type which is the base for the typedef.
> I've found the DECL_ORIGINAL_TYPE macro but I've not been able to get the type 
> from its return value so far. Any pointers to documentation or code with nice 
> comments about this would be welcome. The tree documentation in the wiki is 
> nice but I couldn't find the required information there.

The documentation is minimal, but see also
http://gcc.gnu.org/onlinedocs/gccint/Types.html

A typedef statement will normally create a TYPE_DECL node.  For a
TYPE_DECL x, DECL_NAME(x) is the name of the typedef, and TREE_TYPE(x)
is the type.  DECL_ORIGINAL_TYPE exists mainly for debugging
information.

Ian

      reply	other threads:[~2009-04-24 19:42 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2009-04-24 15:37 David Philippi
2009-04-24 19:42 ` Ian Lance Taylor [this message]

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=m3mya5yh2s.fsf@google.com \
    --to=iant@google.com \
    --cc=gcc-help@gcc.gnu.org \
    --cc=philippi@absint.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).