This is the mail archive of the gcc@gcc.gnu.org mailing list for the GCC project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

Using mem_attrs to get the tree of a function being called?


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.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]