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: Saving the Tree declaration node in GCC 4.1.1.


"Rohit Arul Raj" <rohitarulraj@gmail.com> writes:

> Before emitting a call instruction, i need to check for function
> attributes. Based on that i need to emit the corresponding call
> instruction. For that, before emitting the call instruction, i check
> for the attributes of the called function through the declaration
> node.
> 
> tree fn_id, fn_decl;
> fn_id = get_identifier(name);
> fn_decl = lookup_name(fn_id);

I don't understand where you are trying to emit the call instruction.
Why do you only have the name?  What language are you compiling?

Certainly calling lookup_name seems wrong.

Given a CALL_EXPR, you can use get_callee_fndecl to find the caller.

At the RTL level, you can usually use TARGET_ENCODE_SECTION_INFO and
SYMBOL_REF_FLAG to good effect.  Or look at how ARM handles
ENCODED_LONG_CALL_ATTR_P via TARGET_STRIP_NAME_ENCODING.

Ian


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