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]

Re: How to get attribute of callee


Phung Nguyen schrieb:
> Dear all,
> 
> I am porting GCC to a new target. I don't know how to get attribute of
> callee of a call.
> 
> I defined a new attribute to assign to a function but when writing for
> pattern name "call" or "call_value", I don't know how to know if the
> callee is assigned the attribute.  As the code for the call depends on
> the attribute of the callee, I need to get the corresponding function
> decl tree. As the operand of "call" or "call_value" might be
> SYMBOL_REF (direct call) or REG (indirect call), I don't know how to
> get the function declaration (fndecl).
> 
> Could you please advise me a solution for it? I highly appreciate your help.

Try this:

-- Store that info in the CUMULATIVE_ARGS object
-- Pass the info in a "call cookie" as last argument of
   the function like this: FUNCTION_ARG resp. FUNCTION_ARG_ADVANCE
   get called with mode=VOIDmode. Return a CONST_INT and evaluate
   the respective operand of call insn resp. call_calue insn.






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