[LLVMdev] Pass to remove unused functions

Chris Lattner clattner at apple.com
Tue May 5 16:15:42 PDT 2009

On May 5, 2009, at 4:07 PM, Villmow, Micah wrote:

> I thought this pass would do it, but when I run it over my bc file  
> the output file is the same as the input file.

that's probably because your symbols are not internal.

> The issue I guess  is a little different. When I link in the huge bc  
> file with the tiny bc file, I only want the resulting bc file to  
> have the function definitions that the tiny bc file requires and not  
> every function in the huge bc file.
> Any idea’s how to do this with the current llvm toolset?

You have to roll your own using the lower level APIs.  You can move  
functions between modules etc.  Alternatively, you can link the two  
modules and mark the functions you don't want as internal, then use  

-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.llvm.org/pipermail/llvm-dev/attachments/20090505/720877dd/attachment.html>

More information about the llvm-dev mailing list