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: Add support for the Win32 hook prologue (try 8)


On 10/07/2009 12:08 PM, Stefan Dösinger wrote:
I noticed that the function context isn't set, and the
current_function_decl isn't updated by the time the attribute callbacks
execute. Thus I use current_function_decl, not
decl_function_context(node) to find out if the function is nested or
not. If this is not correct(I only checked the C frontend so far),
please suggest a better solution. The only other way I found was to
check the nestedness during code generation, which doesn't seem right to
me(and puts the error at the end of the function, not its declaration).

Ah, I see what you mean here. Yes, the decl context hasn't been set up yet. However, testing for current_function_decl isn't correct either. I think the only thing you'll be able to do is an error during code generation. You can put the error message at the correct line by using DECL_SOURCE_LOCATION and the error_at function.


The patch is ok with that fix.


r~



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