Using mem_attrs to get the tree of a function being called?
Alexandre Courbot
Alexandre.Courbot@lifl.fr
Wed Apr 30 16:45:00 GMT 2003
Hello everybody,
When outputting a function call, I need to know the exact structure of the
function being called (name, arguments types, etc.). The best way to get all
these informations being the tree representation. Since in a call insn the
function to be called is a mem expression, I assumed that I could get the
decl of the function thanks to the mem_attrs. So my output pattern for
call_value contains the following code to check I can do so (operands[1]
being the function):
tree mexpr = MEM_EXPR(operands[1]);
if (mexpr) printf("Expr is valid!\n");
else printf("Expr is NULL\n");
Unfortunately, mexpr is always NULL, while I expected it to point to the
function_decl corresponding to the function being called. Even the MEM_ATTRS
macro returns NULL. Are mem_attrs not used when dealing with functions? If
so, is there any good reason why this is so or shall I go ahead and try to
implement it? Or am I missing something else?
Any hint welcome,
Thanks,
Alex.
More information about the Gcc
mailing list