changing function type

Previous Topic Next Topic
 
classic Classic list List threaded Threaded
2 messages Options
Reply | Threaded
Open this post in threaded view
|

changing function type

Ryan M. Lefever
Is there any way to change the type of a function in LLVM without
creating a copy of the function and replacing all references of the old
function with the new function.  For example, if I wanted to remove a
parameter from the function, how could I accomplish that?

Thanks,
Ryan
_______________________________________________
LLVM Developers mailing list
[hidden email]         http://llvm.cs.uiuc.edu
http://lists.cs.uiuc.edu/mailman/listinfo/llvmdev
Reply | Threaded
Open this post in threaded view
|

Re: changing function type

Chris Lattner
On Mon, 2 Oct 2006, Ryan M. Lefever wrote:
> Is there any way to change the type of a function in LLVM without
> creating a copy of the function and replacing all references of the old
> function with the new function.

Nope.

> For example, if I wanted to remove a
> parameter from the function, how could I accomplish that?

You'd have to do what you describe above.  Check out the
IPO/DeadArgElim.cpp transformation, which does just this.

-Chris

--
http://nondot.org/sabre/
http://llvm.org/
_______________________________________________
LLVM Developers mailing list
[hidden email]         http://llvm.cs.uiuc.edu
http://lists.cs.uiuc.edu/mailman/listinfo/llvmdev