[LLVMdev] regarding function pointer pass

netra at cse.iitb.ac.in netra at cse.iitb.ac.in
Sun Mar 27 23:42:20 PDT 2011


Hi,
I am a Mtech student at IIT,Bombay and presently studying llvm as a part
of my Seminar work.Currently,i am writing a simple pass that would detect
function pointer call,use and declarations in the src program.
I could detect function pointer calls using the getCalledFunction().

However,i am stuck in identifying function pointer declaration and use.
is there a way one can distinguish between data and function pointers
in llvm?

I tried the following,
    I->getType()->getElementType()->getTypeID()

but this always returns me 12 i.e pointer type id (for pointers)
irrespective if the pointer is a data or a function pointer.

Kindly let me know where i am going wrong.

Regards,
Netra
Mtech,CSE,IIT BOMBAY




More information about the llvm-dev mailing list