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]

Re: begin_function debug hook.


On Sun, Jul 15, 2001 at 03:15:44PM +0100, Neil Booth wrote:
> The remaining hooks are more tricky than those so far.
> 
> This does begin_function.  There remain 2 functions,
> sdbout_mark_begin_function() and dbxout_begin_function() that don't
> fit despite their names.  I don't know enough about varasm.c and the
> code in final.c to know whether there is scope for rationalisation of
> these or not.  Certainly there doesn't seem to be an easy way to
> integrate the two, so another hook will be needed for those.

I think the hook you're currently calling begin_function isn't.

There should be three hooks: 

	begin_function		Called before the function is declared,
				e.g. dbxout_begin_function and
				sdbout_mark_begin_function.

	begin_prologue		Called after the function directives have
				been emitted, but before any code has been
				generated.  This is the one you converted
				today, for those that have
				begin_function_before_prologue set.

	end_prologue		Called after prologue instructions are
				emitted.  This is those for which you have
				begin_function_before_prologue clear.


>    dwarf2out_end_epilogue,
> +  debug_nothing_int, 0,		/* begin_function */

To avoid confusion I think you should treat this the same way as
you did dwarf2out_end_epilogue -- call the debug hook first and
then if we're doing dwarf2 eh, but not dwarf2 debug, then call
dwarf2out_begin_prologue explicitly.


r~


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