Andrea Callia D'Iddio wrote on 12/03/2007 16:56:53:

> Hi all,
> i have a very little question for you. I have a basic block and by a
> statement iterator i can obtain a tree structure in the following
> manner:
>          tree stmt = bsi_stmt (si);
> I want to use this tree structure to manipulate the statement, for
> example i 'd like to know if statement is an assignement or another
> instruction type. And if the statement is an assignement i'd like to
> know wich is the name of the variable.

The key is whether the tree_code is "MODIFY_EXPR", which is (copied from
tree.def):
/* Assignment expression.  Operand 0 is the what to set; 1, the new value.
*/
DEFTREECODE (MODIFY_EXPR, "modify_expr", tcc_expression, 2)

So, I think you should do something like:
enum tree_code code = TREE_CODE (stmt);
switch (code)
{
      case MODIFY_EXPR:
...
}

Good luck,
Tehila.

> I have serchead too much but i have not found any information.
> Thanks to all,
>
> Andrea Callia D'Iddio

Reply via email to