Akshay Jain
2013-Apr-16 01:33 UTC
[LLVMdev] creating and inserting a function with variable arguments
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()? If not can someone tell me any other method? It will be very helpful if anyone can help. Thanks in advance -- *Akshay Jain * -------------- next part -------------- An HTML attachment was scrubbed... URL: <http://lists.llvm.org/pipermail/llvm-dev/attachments/20130416/1974cb5f/attachment.html>
Óscar Fuentes
2013-Apr-16 01:52 UTC
[LLVMdev] creating and inserting a function with variable arguments
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.
Akshay Jain
2013-Apr-16 09:41 UTC
[LLVMdev] creating and inserting a function with variable arguments
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>
Maybe Matching Threads
- [LLVMdev] creating and inserting a function with variable arguments
- [LLVMdev] creating and inserting a function with variable arguments
- [LLVMdev] creating and inserting a function with variable arguments
- [LLVMdev] creating and inserting a function with variable arguments
- [LLVMdev] Inserting Calls to var args Functions