[LLVMdev] How to get type of a call instruction

Óscar Fuentes ofv at wanadoo.es
Mon Feb 11 04:33:21 PST 2013


[please keep the discussion on-list, thanks]

Blind Faith <person.of.book at gmail.com> writes:

> CallInst::getCalledFunction followed by Function::getFunctionType does not
> work for indirect calls, because getCalledFunction returns NULL for
> indirect calls, and my focus is indirect calls. Any idea how to get the
> Function Type from indirect calls?

Maybe CallInst::getCalledValue ?

getCalledValue - Get a pointer to the function that is invoked by this instruction

Note that it returns a Value*, not a Function*.

Then you can use Value::getType.



More information about the llvm-dev mailing list