This is the mail archive of the gcc-patches@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: [PATCH] Add support for the Win32 hook prologue (try 5)


Am 24.09.2009 um 16:34 schrieb Ross Ridge:

if (TREE_CODE (decl) != FUNCTION_DECL)
{
warning (OPT_Wattributes, "%qE attribute only applies to functions",
name);
*no_add_attrs = true;
return NULL_TREE;
}


Ross Ridge
Where is the attribute stored and how do I access it?

According to tree.h, the correct place to look for the attributes for a decl_required = true, type_required = false and function_type_required = false attribute is in the DECL, which suggests the DECL_ATTRIBUTE macro instead of the TYPE_ATTRIBUTE macro is the correct one to use. However, DECL_ATTRIBUTES doesn't seem to like the current_function_decl tree :-/

Looking at other targets I saw that e.g. the avr target has a TREE_CODE (func) == FUNCTION_DECL check before it uses DECL_ATTRIBUTES in a similar situation. This seems to allow the bootstrap to go forward, but I'm still busy compiling. I am wondering though, judging by the names, why would current_function_decl ever be something else but a FUNCTION_DECL?


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