public inbox for gcc@gcc.gnu.org
 help / color / mirror / Atom feed
* Function Name from CALL_INSN RTX
@ 2011-10-18  8:21 Iyer, Balaji V
  2011-10-18  8:23 ` Ian Lance Taylor
  0 siblings, 1 reply; 4+ messages in thread
From: Iyer, Balaji V @ 2011-10-18  8:21 UTC (permalink / raw)
  To: 'gcc@gcc.gnu.org'

Hello Everyone,
       Is it possible to extract the function name (as a tree or char *)  from a CALL_INSN RTX? Is there a #define or a series of #defines that can accomplish this? 
       
       The tried to find this information by stepping through the print_rtx function using gdb and the information (as a char *) is currently stored in the following location of a CALL_INSN: "insn->u.fld[4]->rt_rtx->u.fld[1]->rt_rtx->u.fld[0]->rt_rtx->u.fld[0]->rt_rtx->u.fld[0]->rt_str "

      Does anyone know of a #define or a function I can call to retrieve this information? I would prefer to use functions or #defines rather than absolute locations for future compatibility.

Any help is greatly appreciated!

Thanks,

Balaji V. Iyer.

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

* Re: Function Name from CALL_INSN RTX
  2011-10-18  8:21 Function Name from CALL_INSN RTX Iyer, Balaji V
@ 2011-10-18  8:23 ` Ian Lance Taylor
  2011-10-18 15:00   ` Iyer, Balaji V
  0 siblings, 1 reply; 4+ messages in thread
From: Ian Lance Taylor @ 2011-10-18  8:23 UTC (permalink / raw)
  To: Iyer, Balaji V; +Cc: 'gcc@gcc.gnu.org'

"Iyer, Balaji V" <balaji.v.iyer@intel.com> writes:

>        Is it possible to extract the function name (as a tree or char *)  from a CALL_INSN RTX? Is there a #define or a series of #defines that can accomplish this? 

Not always, of course.  A call through a function pointer has no name.

The function get_callee_fndecl will do its best to get the function decl
from a CALL_EXPR.

Ian

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

* RE: Function Name from CALL_INSN RTX
  2011-10-18  8:23 ` Ian Lance Taylor
@ 2011-10-18 15:00   ` Iyer, Balaji V
  2011-10-18 15:12     ` Ian Lance Taylor
  0 siblings, 1 reply; 4+ messages in thread
From: Iyer, Balaji V @ 2011-10-18 15:00 UTC (permalink / raw)
  To: Ian Lance Taylor; +Cc: 'gcc@gcc.gnu.org'

Thanks for the help Ian. The function get_callee_fndecl takes in a tree and returns a tree. I would like to get the function name from the RTX. Is there a function for this purpose? 

Thanks,

Balaji V. Iyer.


________________________________________
From: Ian Lance Taylor [iant@google.com]
Sent: Tuesday, October 18, 2011 12:47 AM
To: Iyer, Balaji V
Cc: 'gcc@gcc.gnu.org'
Subject: Re: Function Name from CALL_INSN RTX

"Iyer, Balaji V" <balaji.v.iyer@intel.com> writes:

>        Is it possible to extract the function name (as a tree or char *)  from a CALL_INSN RTX? Is there a #define or a series of #defines that can accomplish this?

Not always, of course.  A call through a function pointer has no name.

The function get_callee_fndecl will do its best to get the function decl
from a CALL_EXPR.

Ian

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

* Re: Function Name from CALL_INSN RTX
  2011-10-18 15:00   ` Iyer, Balaji V
@ 2011-10-18 15:12     ` Ian Lance Taylor
  0 siblings, 0 replies; 4+ messages in thread
From: Ian Lance Taylor @ 2011-10-18 15:12 UTC (permalink / raw)
  To: Iyer, Balaji V; +Cc: 'gcc@gcc.gnu.org'

"Iyer, Balaji V" <balaji.v.iyer@intel.com> writes:

> Thanks for the help Ian. The function get_callee_fndecl takes in a tree and returns a tree. I would like to get the function name from the RTX. Is there a function for this purpose? 

Please don't top-post.  Thanks.

Sorry about that, I overlooked that you wanted RTL.  I don't know of any
straightforward and general way to get the function name for RTL.  For
some backends the call will refer directly to the function.  For others
it won't.  Even when the function is in the CALL_INSN, its location will
in general be backend specific, although for most backends it will be in
operand 0.

Ian

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

end of thread, other threads:[~2011-10-18 13:53 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2011-10-18  8:21 Function Name from CALL_INSN RTX Iyer, Balaji V
2011-10-18  8:23 ` Ian Lance Taylor
2011-10-18 15:00   ` Iyer, Balaji V
2011-10-18 15:12     ` Ian Lance Taylor

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).