From 873187c0426e069e92da3b644133059a8ee3948e Mon Sep 17 00:00:00 2001 From: Chris Lattner Date: Sat, 9 Jan 2010 19:15:14 +0000 Subject: improve documentation for linkonce to be less confusing. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@93066 91177308-0d34-0410-b5e6-96231b3b80d8 --- docs/LangRef.html | 15 +++++++++++---- 1 file changed, 11 insertions(+), 4 deletions(-) (limited to 'docs') diff --git a/docs/LangRef.html b/docs/LangRef.html index 9c6a6d91e6..6315993fdf 100644 --- a/docs/LangRef.html +++ b/docs/LangRef.html @@ -558,10 +558,17 @@ define i32 @main() { ; i32()*
linkonce
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.
+ the same name when linkage occurs. This can be used to implement + some forms of inline functions, templates, or other code which must be + generated in each translation unit that uses it, but where the body may + be overridden with a more definitive definition later. Unreferenced + linkonce globals are allowed to be discarded. Note that + linkonce linkage does not actually allow the optimizer to + inline the body of this function into callers because it doesn't know if + this definition of the function is the definitive definition within the + program or whether it will be overridden by a stronger definition. + To enable inlining and other optimizations, use "linkonce_odr" + linkage.
weak
"weak" linkage has the same merging semantics as -- cgit v1.2.3