This is the mail archive of the
gcc@gcc.gnu.org
mailing list for the GCC project.
Looping through the gimple for CALL_EXPR
- From: "Paulo J. Matos" <pocmatos at gmail dot com>
- To: gcc at gcc dot gnu dot org
- Date: Mon, 11 Jan 2010 15:46:42 +0000
- Subject: Looping through the gimple for CALL_EXPR
Hi all,
I am using gcc 4.3.4 to loop through the gimple tree to find
CALL_EXPR. This is what I have (even though I tried several variants,
none of which worked):
tree body_stmt = DECL_SAVED_TREE (current_function_decl);
while (body_stmt) //
{
if (TREE_CODE (body_stmt) == CALL_EXPR)
{
printf("CALL_EXPR found in %s\n",
IDENTIFIER_POINTER(DECL_NAME(current_function_decl)));
}
body_stmt = TREE_CHAIN (body_stmt);
}
I have read in the internals doc about EXPR_STMT and EXPR_STMT_EXPR
but using them to access the expression through the statement and then
checking if the expressions is a CALL expression doesn't work either.
In fact, EXPR_STMT doesn't even seem to be defined.
Any tips?
--
Paulo Jorge Matos - pocmatos at gmail.com
http://www.pmatos.net