Nicolas COLLIN <nicolas.col...@fr.thalesgroup.com> writes: >> From internal representation. I got the body with DECL_SAVED_TREE >> and I > succeed to get the name of functions and methods called from > CALL_EXPR, using TREE_OPERAND, EXPR_STMT_EXPR, etc... But I can't get > the object on which is called the method (for example in att.getX(); i > would like to get the name :"att"). I tried in many ways but never got > it.
There need not be any such name (f().getX()), or for a given call there may be more than one such name (f ? a.getX() : b.getX() with the method call factored out by the optimizers). Assuming you are working in SSA form, and assuming you have an SSA_VAR, the best you can do is look back to the defining statement to see if you can find a VAR_DECL there. Ian