This is the mail archive of the
gcc@gcc.gnu.org
mailing list for the GCC project.
Access the BIND_EXPR of a function
- From: "Thomas A.M. Bernard" <t dot bernard at uva dot nl>
- To: gcc at gnu dot org
- Date: Mon, 30 Jun 2008 18:59:49 +0200
- Subject: Access the BIND_EXPR of a function
Hi,
When I encounter a FUNCTION_DECL, I want to access the node BIND_EXPR
where I can find the artificial declarations of the current functions
that the compiler adds. Following what the documentation says, I use the
macro DECL_SAVED_TREE which should point to the node BIND_EXPR (used as
follows, DECL_SAVED_TREE (current_function_decl)). Unfortunately, this
returns the STATEMENT_LIST node instead. In theory in the GIMPLE, if
there are artificial declarations, FUNCTION_DECL has a child called body
which points to BIND_EXPR and then BIND_EXPR has a child body which
points to STATEMENT_LIST.
Btw, I use GCC 4.1. Any ideas for accessing the BIND_EXPR node?
Thomas