On Tue, Jul 31, 2012 at 8:44 AM, <mario.miller@xxxxxx> wrote: > > I'm currently developing a Plugin with GCC 4.6.3. I want to traverse function bodies; that is where I get problems. I use the DECL_SAVED_TREE macro to get the tree of the function body. When I get the tree-code-name of this tree I usually get "bind_expr" with which I can get all variable declarations in this function. This works pretty well. But I want to analyse some other expressions of this function, too (like return_expression, if_statements, etc.). How can I do this? I tried using the DECL_SAVED_TREE macro twice (like tree t = DECL_SAVED_TREE(DECL_SAVED_TREE(node)) but this returns NULL always. I also tried the TREE_CHAIN macro (like tree t = DECL_SAVED_TREE(node); t = TREE_CHAIN(t)) but this returns NULL aswell. > What am I doing wrong? Hope you can help me. Once you have a BIND_EXPR, look at BIND_EXPR_BODY. Ian