[LLVMdev] regarding function pointer pass

Anton Korobeynikov anton at korobeynikov.info
Mon Mar 28 08:32:49 PDT 2011


Hello

> 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.
This is correct. Both Function and GlobalVariable are the instances of
GlobalValue, which type is basically a pointer type (function and
global variables *are* pointers to the data / code). So, given the
Value you'd just need to figure out whether this is GlobalVariable or
Function.

http://llvm.org/docs/ProgrammersManual.html#isa will help.

-- 
With best regards, Anton Korobeynikov
Faculty of Mathematics and Mechanics, Saint Petersburg State University




More information about the llvm-dev mailing list