[LLVMdev] clang and static functions

Chris Lattner clattner at apple.com
Mon Dec 14 12:36:57 PST 2009

On Dec 14, 2009, at 12:18 PM, Arvind Sudarsanam wrote:

> Hi,
> Sorry for not being specific. I just wanted to know if there is any
> way at all to force clang to generate intermediate code for static
> functions when they are not being called anywhere inside the current
> module. Other compilers seem to generate intermediate code (lcc, for
> instance).

You can mark it with 'attribute used'.  Other than that, no, clang  
tries hard not to generate dead code.  Also, in C++, it's not even  
valid to instantiate unused templates.


More information about the llvm-dev mailing list