eliminating dead functions

Hi
    I am wondering if there is way to eliminate functions that are not
used after two files have been linked. Can the optimizer do it ? Or is
there a way you can have it done while linking it self ?

thanks for answers
shrey

shreyas krishnan wrote:

Hi
    I am wondering if there is way to eliminate functions that are not
used after two files have been linked. Can the optimizer do it ? Or is
there a way you can have it done while linking it self ?
  
I think there's an LLVM optimization to do this; however, it should only delete functions with internal linkage. Functions with external linkage could be referenced and used by code that is linked in later.

The -internalize pass will change external functions to have internal linkage, enabling this optimization.

-- John T.