On Fri, Feb 14, 2014 at 9:59 AM, Dominik Vogt <v...@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 via email to