This is the mail archive of the
gcc@gcc.gnu.org
mailing list for the GCC project.
Re: Manipulating the tree Structure
- From: Revital1 Eres <ERES at il dot ibm dot com>
- To: "Andrea Callia D'Iddio" <andrea dot calliadiddio at gmail dot com>
- Cc: gcc <gcc at gcc dot gnu dot org>
- Date: Mon, 12 Mar 2007 17:06:25 +0200
- Subject: Re: Manipulating the tree Structure
gcc-owner@gcc.gnu.org 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.
> I have serchead too much but i have not found any information.
> Thanks to all,
You can use the TREE_CODE of stmt to know that instruction type.
Almost all the tree-* files manipulate the stmt tree so you can grep
in those files to find more examples.
Revital
> Andrea Callia D'Iddio