This is the mail archive of the
gcc-patches@gcc.gnu.org
mailing list for the GCC project.
Re: [PATCH] Add support for the Win32 hook prologue (try 5)
- From: Stefan Dösinger <stefan at codeweavers dot com>
- To: Ross Ridge <rridge at csclub dot uwaterloo dot ca>
- Cc: gcc-patches at gcc dot gnu dot org
- Date: Fri, 25 Sep 2009 01:01:42 +0200
- Subject: Re: [PATCH] Add support for the Win32 hook prologue (try 5)
- References: <20090924143440.B819F73F77@caffeine.csclub.uwaterloo.ca>
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?