[LLVMdev] creating and inserting a function with variable arguments

Akshay Jain jivan.molu at gmail.com
Tue Apr 16 02:41:18 PDT 2013


I have tried it, but I always end up with some kind of error. Can you
explain how can I get a function type for function which returns void
(nothing) and it's arguments are (int, int, int, void *, void *, ...) ??

Thanks in advance.


On Tue, Apr 16, 2013 at 7:22 AM, Óscar Fuentes <ofv at wanadoo.es> wrote:

> Akshay Jain <jivan.molu at gmail.com> writes:
>
> > I am working on a pass in which I need to define and insert a function
> with
> > variable arguments. Can I do it with the help of getOrInsertFunction()?
>
> Sure. There is an overload of getOrInsertFunction that takes a
> FunctionType, and there are FunctionType::get static methods where you
> say if the function type takes a variable number of arguments. See the
> doxygen documentation for FunctionType and Module::getOrInsertFunction.
>
> _______________________________________________
> LLVM Developers mailing list
> LLVMdev at cs.uiuc.edu         http://llvm.cs.uiuc.edu
> http://lists.cs.uiuc.edu/mailman/listinfo/llvmdev
>



-- 
*Akshay Jain
*
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.llvm.org/pipermail/llvm-dev/attachments/20130416/ea348371/attachment.html>


More information about the llvm-dev mailing list