Need help: Is a VAR_DECL type builtin or not?
Richard Biener
richard.guenther@gmail.com
Fri Feb 14 13:40:00 GMT 2014
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
>
More information about the Gcc
mailing list