[LLVMdev] Inlining

Duncan Sands baldrick at free.fr
Sat Jan 9 08:41:26 PST 2010

Hi Alastair,

> Forgive my confusion, but I can't help notice that LangRef states:
> Globals with "linkonce" linkage are merged with other globals of the same name when linkage occurs. This is typically used to implement inline functions, templates, or other code which must be generated in each translation unit that uses it. Unreferenced linkonce globals are allowed to be discarded.
> Why would linkonce be used to implement inline functions if it's not safe to inline linkonce functions?

I was wrong - linkonce is an exception to the general rule that a "weak" linkage
type prevents inlining unless of the "_odr" form.



More information about the llvm-dev mailing list