diff options
author | Chris Lattner <sabre@nondot.org> | 2010-01-09 19:15:14 +0000 |
---|---|---|
committer | Chris Lattner <sabre@nondot.org> | 2010-01-09 19:15:14 +0000 |
commit | 0de4caa57b9e6d9a3dcccfd2cc79a91dcf106c62 (patch) | |
tree | ed17124e63e1ece7af54222f80fe3c05da86d8b9 /llvm | |
parent | bb857e5d68a2ae3f8621d3112d5d0bf076bae132 (diff) | |
download | bcm5719-llvm-0de4caa57b9e6d9a3dcccfd2cc79a91dcf106c62.tar.gz bcm5719-llvm-0de4caa57b9e6d9a3dcccfd2cc79a91dcf106c62.zip |
improve documentation for linkonce to be less confusing.
llvm-svn: 93066
Diffstat (limited to 'llvm')
-rw-r--r-- | llvm/docs/LangRef.html | 15 |
1 files changed, 11 insertions, 4 deletions
diff --git a/llvm/docs/LangRef.html b/llvm/docs/LangRef.html index 9c6a6d91e6f..6315993fdf6 100644 --- a/llvm/docs/LangRef.html +++ b/llvm/docs/LangRef.html @@ -558,10 +558,17 @@ define i32 @main() { <i>; i32()* </i> <dt><tt><b><a name="linkage_linkonce">linkonce</a></b></tt></dt> <dd>Globals with "<tt>linkonce</tt>" 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 <tt>linkonce</tt> globals are - allowed to be discarded.</dd> + 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 + <tt>linkonce</tt> globals are allowed to be discarded. Note that + <tt>linkonce</tt> 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 "<tt>linkonce_odr</tt>" + linkage.</dd> <dt><tt><b><a name="linkage_weak">weak</a></b></tt></dt> <dd>"<tt>weak</tt>" linkage has the same merging semantics as |