public inbox for gcc@gcc.gnu.org
 help / color / mirror / Atom feed
* function name in labels
@ 2004-01-20 14:20 Jan Hoogerbrugge
  2004-01-20 15:16 ` Steven Bosscher
  2004-01-22 22:51 ` Per Bothner
  0 siblings, 2 replies; 3+ messages in thread
From: Jan Hoogerbrugge @ 2004-01-20 14:20 UTC (permalink / raw)
  To: gcc

Hi,

I want to prefix labels in the assembly output with the current function 
name. So
in function foo(), I would like to have labels such as foo_L1 and foo_L12. 
This
makes it possible for me to recognize code in the output of profiles. Any 
idea
where I can find the name of the current function? I tried
current_function_name() but that does not work when compiling C++.

Jan

_________________________________________________________________
MSN Search, for accurate results! http://search.msn.nl

^ permalink raw reply	[flat|nested] 3+ messages in thread

* Re: function name in labels
  2004-01-20 14:20 function name in labels Jan Hoogerbrugge
@ 2004-01-20 15:16 ` Steven Bosscher
  2004-01-22 22:51 ` Per Bothner
  1 sibling, 0 replies; 3+ messages in thread
From: Steven Bosscher @ 2004-01-20 15:16 UTC (permalink / raw)
  To: Jan Hoogerbrugge, gcc

On Tuesday 20 January 2004 15:20, Jan Hoogerbrugge wrote:
> Hi,
>
> I want to prefix labels in the assembly output with the current function
> name. So
> in function foo(), I would like to have labels such as foo_L1 and foo_L12.
> This
> makes it possible for me to recognize code in the output of profiles. Any
> idea
> where I can find the name of the current function? I tried
> current_function_name() but that does not work when compiling C++.

Try "(*lang_hooks.decl_printable_name) (cfun->decl, 0)".

Gr.
Steven

^ permalink raw reply	[flat|nested] 3+ messages in thread

* Re: function name in labels
  2004-01-20 14:20 function name in labels Jan Hoogerbrugge
  2004-01-20 15:16 ` Steven Bosscher
@ 2004-01-22 22:51 ` Per Bothner
  1 sibling, 0 replies; 3+ messages in thread
From: Per Bothner @ 2004-01-22 22:51 UTC (permalink / raw)
  To: Jan Hoogerbrugge; +Cc: gcc

Jan Hoogerbrugge wrote:

> Hi,
> 
> I want to prefix labels in the assembly output with the current function 
> name. So
> in function foo(), I would like to have labels such as foo_L1 and 
> foo_L12. This
> makes it possible for me to recognize code in the output of profiles. 

Another benefit: this might make it easier for the compile server
to generate identical assembler files when compiling multiple
output files compared to multiple non-server compilations.

An altenative would be to reset the label-counter, but that causes
with inlining.  It is possible tree-based inling might reduce the
problem, but "function-relative" label names avoids the problem.
-- 
	--Per Bothner
per@bothner.com   http://per.bothner.com/

^ permalink raw reply	[flat|nested] 3+ messages in thread

end of thread, other threads:[~2004-01-22 22:06 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2004-01-20 14:20 function name in labels Jan Hoogerbrugge
2004-01-20 15:16 ` Steven Bosscher
2004-01-22 22:51 ` Per Bothner

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).