This is the mail archive of the
gcc@gcc.gnu.org
mailing list for the GCC project.
Help with BLOCK vs BIND_EXPR trees?
- From: Jerry Quinn <jlquinn at optonline dot net>
- To: gcc at gcc dot gnu dot org
- Date: Wed, 03 Jun 2009 16:27:55 -0400
- Subject: Help with BLOCK vs BIND_EXPR trees?
Hi, all. I have a basic question about GENERIC trees.
I'm playing with writing a front end, and find the distinction between
BLOCK and BIND_EXPR to be somewhat confusing. In particular, I'm trying
to get a handle on how to represent a function in GENERIC form.
On the surface the texi docs and code comments don't seem to agree:
Section on function trees say FUNCTION_DECL represents a function, and
that DECL_INITIAL is not empty. But it doesn't say what should be
contained there. It says DECL_SAVED_TREE should contain the body of the
function.
The comments in tree.h say that DECL_INITIAL holds the body of a
function, with a BLOCK tree at the root.
BLOCK nodes are described under TREE_SSA->GIMPLE, though these nodes are
part of GENERIC if I understand correctly. In this section, it says
that block scopes and variables are declared in BIND_EXPR nodes.
Can someone please clarify how these things are supposed to relate in
GENERIC form, assuming the default conversion to GIMPLE will be used?
Thanks,
Jerry Quinn