public inbox for gcc@gcc.gnu.org
 help / color / mirror / Atom feed
From: Richard Biener <richard.guenther@gmail.com>
To: vogt@linux.vnet.ibm.com
Cc: GCC Development <gcc@gcc.gnu.org>
Subject: Re: Need help: Is a VAR_DECL type builtin or not?
Date: Fri, 14 Feb 2014 13:40:00 -0000	[thread overview]
Message-ID: <CAFiYyc1HbvtrmGjoBA1DXtFNtkdbJAVbC6inpG_TNz_pTjfhGg@mail.gmail.com> (raw)
In-Reply-To: <20140214085908.GA5228@linux.vnet.ibm.com>

On Fri, Feb 14, 2014 at 9:59 AM, Dominik Vogt <vogt@linux.vnet.ibm.com> wrote:
> Given a specific VAR_DECL tree node, I need to find out whether
> its type is built in or not.  Up to now I have
>
>   tree tn = TYPE_NAME (TREE_TYPE (var_decl));
>   if (tn != NULL_TREE && TREE_CODE (tn) == TYPE_DECL && DECL_NAME (tn))
>     {
>       ...
>     }
>
> This if-condition is true for both,
>
>   int x;
>   const int x;
>   ...
>
> and
>
>   typedef int i_t;
>   i_t x;
>   const i_t x;
>   ...
>
> I need to weed out the class of VAR_DECLs that directly use built
> in types.

Try DECL_IS_BUILTIN.  But I question how you define "builtin" here?

Richard.

> Ciao
>
> Dominik ^_^  ^_^
>
> --
>
> Dominik Vogt
> IBM Germany
>

  reply	other threads:[~2014-02-14 13:40 UTC|newest]

Thread overview: 5+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2014-02-14  8:59 Dominik Vogt
2014-02-14 13:40 ` Richard Biener [this message]
2014-02-17 12:15   ` Dominik Vogt
2014-02-17 13:28     ` Richard Biener
2014-02-17 17:33       ` Ian Lance Taylor

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=CAFiYyc1HbvtrmGjoBA1DXtFNtkdbJAVbC6inpG_TNz_pTjfhGg@mail.gmail.com \
    --to=richard.guenther@gmail.com \
    --cc=gcc@gcc.gnu.org \
    --cc=vogt@linux.vnet.ibm.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).