This is the mail archive of the gcc@gcc.gnu.org mailing list for the GCC project.
Index Nav: | [Date Index] [Subject Index] [Author Index] [Thread Index] | |
---|---|---|
Message Nav: | [Date Prev] [Date Next] | [Thread Prev] [Thread Next] |
Other format: | [Raw text] |
From: Daniel Berlin <dberlin@dberlin.org> To: sean yang <seanatpurdue@hotmail.com> CC: gcc@gcc.gnu.org Subject: Re: adding nodes in a tree --after GIMPLIFICATION, before SSA Date: Wed, 19 Apr 2006 22:38:11 -0700
In fact, there are only *two* places a call can occur in GIMPLE at that point: bare, or the RHS of a MODIFY_EXPR.
The following code will give you *all* the CALL_EXPR statements in a function.
block_stmt_iterator bsi; basic_block bb;
FOR_EACH_BB (bb)
{
for (bsi = bsi_start (bb); !bsi_end_p (bsi); bsi_next (&bsi))
{
tree stmt = bsi_stmt (bsi);
if (TREE_CODE (stmt) == CALL_EXPR
|| (TREE_CODE (stmt) == MODIFY_EXPR && TREE_CODE (TREE_OPERAND (stmt, 1) == CALL_EXPR))
{
/* Do your thing, make sure to use BSI_SAME flags so that iteration will move properly. */
}
}
}
Index Nav: | [Date Index] [Subject Index] [Author Index] [Thread Index] | |
---|---|---|
Message Nav: | [Date Prev] [Date Next] | [Thread Prev] [Thread Next] |