[LLVMdev] Function Type and Argument List

kapil anand kapilanand2 at gmail.com
Fri Jan 2 15:47:06 PST 2009


Hi all,

I am having some problem using the Function class. For my application,
FunctionType is not known at the time I initialize the function. So, I just
initialize the Function as return type
void with no arguments. As I work on my function, I get to know the
arguments and I insert the arguments in ArgumentList data structure of the
function. The FunctionType is defined as const and I can't change that.

When I insert a call to this function, I look at ArgumentList Data
structure, and determine the number of arguments and pass them with the
call. But, FunctionType is same as original type( with no arguments). The
insertion of Call Instruction checks the functiontype and gives me an
assertion failure that I am calling the function with wrong type.

So, is there any way I can modify the functiontype after initializing the
function?

Thanks

--Kapil
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.llvm.org/pipermail/llvm-dev/attachments/20090102/be2a1478/attachment.html>


More information about the llvm-dev mailing list