"Rohit Arul Raj" <[EMAIL PROTECTED]> 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