search for: makefunctionclone

Displaying 8 results from an estimated 8 matches for "makefunctionclone".

2011 Feb 28
2
[LLVMdev] Extending FunctionType
...at illinois.edu> wrote: > On 2/28/11 10:04 AM, Frits van Bommel wrote: >> I don't think a full clone is necessary, since he wants to replace the >> function. He only needs to create the new function and splice in the >> body of the old one. > > That is exactly what MakeFunctionClone() does.  It creates a new function > and uses CloneFunctionInto() to create a copy of the instructions in the old > function in the new function.  The old function can be removed afterward if > desired. I'm pretty sure MakeFunctionClone() actually *copies* basic blocks + instructions...
2011 Feb 28
0
[LLVMdev] Extending FunctionType
...rameter and then clone the body of the old main() function into the new >> main() function. > I don't think a full clone is necessary, since he wants to replace the > function. He only needs to create the new function and splice in the > body of the old one. That is exactly what MakeFunctionClone() does. It creates a new function and uses CloneFunctionInto() to create a copy of the instructions in the old function in the new function. The old function can be removed afterward if desired. I'm not sure if the code below would work. I don't see a mechanism that updates instruct...
2011 Feb 28
3
[LLVMdev] Extending FunctionType
2011/2/28 John Criswell <criswell at illinois.edu>: > On 2/28/11 6:31 AM, Gabriel Rodríguez wrote: > > Hi all, > > I am trying to extend a FunctionType to include new parameters. In > particular, I want to > ensure that the main function has been declared with both argsc and argsv. > However > there seems to be no easy way to accomplish this: >
2011 May 07
0
[LLVMdev] Change the return type of a function
...unction 3) Find all calls calling the old function and replace them with calls to the new function. This is necessary because a function cannot have its type changed once it has been created. Automatic Pool Allocation adds parameters to functions (which is similar to what you need to do). See MakeFunctionClone() in poolalloc/lib/PoolAllocate/PoolAllocate.cpp in the poolalloc project. Use svn co http://llvm.org/svn/llvm-project/poolalloc/trunk poolalloc ... to get a copy from SVN. -- John T. > > > -- > Regards, > Gokul Ramaswamy, > Graduate Student, > Department of CSE, IIT Bom...
2011 May 07
2
[LLVMdev] Change the return type of a function
Hello All, I want to change the return type of a function in a Pass(in a module Pass). I dont want to change any of the arguments of that function. Assume that, I can handle the returning values properly inside the function. Please guide me how to do this ? -- Regards, Gokul Ramaswamy, Graduate Student, Department of CSE, IIT Bombay http://www.cse.iitb.ac.in/~ramaswamy --------------
2011 Feb 28
0
[LLVMdev] Extending FunctionType
...ith the new parameter and then clone the body of the old main() function into the new main() function. There is code to do that in the poolalloc project. Check out http://llvm.org/svn/llvm-project/poolalloc/trunk and look for the code that does this in lib/PoolAllocate/PoolAllocate.cpp in the MakeFunctionClone() method. -- John T. > > Thanks in advance, and best regards, > Gabriel -------------- next part -------------- An HTML attachment was scrubbed... URL: <http://lists.llvm.org/pipermail/llvm-dev/attachments/20110228/9fb1b1be/attachment.html>
2011 May 08
1
[LLVMdev] Change the return type of a function
...ing the old function and replace them with calls to > the new function. > > This is necessary because a function cannot have its type changed once it > has been created. > > Automatic Pool Allocation adds parameters to functions (which is similar to > what you need to do). See MakeFunctionClone() in > poolalloc/lib/PoolAllocate/PoolAllocate.cpp in the poolalloc project. Use > > svn co http://llvm.org/svn/llvm-project/poolalloc/trunk poolalloc > > ... to get a copy from SVN. > > -- John T. > > > > -- > Regards, > Gokul Ramaswamy, > Graduate Studen...
2011 Feb 28
2
[LLVMdev] Extending FunctionType
Hi all, I am trying to extend a FunctionType to include new parameters. In particular, I want to ensure that the main function has been declared with both argsc and argsv. However there seems to be no easy way to accomplish this: llvm::Function::getFunctionType() returns a a reference to a const object, while modifying only the argument list yields an error during verification since the