This is the mail archive of the
gcc@gcc.gnu.org
mailing list for the GCC project.
Re: Tree node questions
- From: Ian Lance Taylor <iant at google dot com>
- To: Brendon Costa <bcosta at avdat dot com dot au>
- Cc: gcc at gcc dot gnu dot org, Brendon Costa <brendon at christian dot net>
- Date: 13 Oct 2006 00:11:11 -0700
- Subject: Re: Tree node questions
- References: <452EFC03.20101@avdat.com.au>
Brendon Costa <bcosta@avdat.com.au> writes:
> If I have a FUNCTION_DECL node that returns non-null for
> DECL_TEMPLATE_INFO() then it is a template or template instantiation.
> How can I tell if it is a full instantiation (I.e. not general
> template or partial specialisation)?
DECL_TEMPLATE_INSTANTIATION, I believe.
> Does this also apply to nodes that represent template types
> (structs/classes)?
For them I believe you want CLASSTYPE_TEMPLATE_INSTANTIATION.
> Also up to now I have been using my own "tree walker" as I seem to be
> unable to get walk_tree to work as I need. I have come across a few
> problems in my own tree walker and need to change it, but before I do
> I thought I would see if there already exists something that works
> similarly.
>
> Basically I would like to know the current "tree depth" and context
> for the parent nodes in the tree as it is walked down.
>
> Is there any way of getting the current depth and node context using
> walk_tree or a similar function?
I don't know of any straightforward way, no.
> One final question. Are there any functions and if so what types that
> are skipped by gimplify_function_tree defined in gimplify.c?
Every function that is going to be expanded into assembly code should
go through gimplify_function_tree. gcc won't ordinarily bother to
expand static functions which are not used.
Ian