Hi.

Given a function pointer in GIMPLE IR, is there any way to find
address/offset to which function pointd to?

e.g. I have written  a code,
/** C code **/
void foo()
{
 . . . .
}

void (*fptr)(void) = foo;

int main()
{
  . . . . .
}

GIMPLE tree node for fptr would be,  VAR_DECL--*-->
POINTER_TYPE--*-->FUNCTION_TYPE ---*-->
(Star specifies that, deferencing few more fields inside a tree_node)
In Gimple code, I wont see any assignment statement for fptr=foo, as
its a globally initialized.

I was trying to trace GIMPLE data structure where possibly the
information that, fptr points to foo would be stored.

Is there any way to find it out?

- Seema Ravandale

Note: I am working on GCC-4.3.0

Reply via email to