This is the mail archive of the
gcc@gcc.gnu.org
mailing list for the GCC project.
Re: Obtaining a callsite address.
On Sun, Mar 10, 2013 at 9:35 PM, Basile Starynkevitch
<basile@starynkevitch.net> wrote:
> On Sun, Mar 10, 2013 at 01:51:04PM +1100, Matt Davis wrote:
>> I have a GIMPLE_CALL gimple object. I want to get the tree node
>> representing the callsite for this particular instance of a call, how
>> can I get this information?
>
> I'm not sure to understand your question (what exactly do you mean by "callsite").
Hi Basile,
Thanks for the quick response. I have a particular instance of a
function call within a function that I am analyzing (and
transforming). I want the address of that function call, for which I
do have a gimple_call instance of. I want to somehow create a symbol
identifying that particular address/location for that instance of the
function call. I need this address at runtime. I was inserting labels
just after each function call, but the placement of my label was not
always immediately after the function call, even if I set the label as
being addressable and/or volatile.
> However, the called function can be obtained by gimple_call_fndecl which gives a tree.
Yep, but that fndecl is not unique to just that instance of the
function call, but applies to all calls of that function. Ultimately
I need the address for all calls in the program.
-Matt