document llvm.used and llvm.metadata. Stub out llvm.global_[cd]tors

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@76396 91177308-0d34-0410-b5e6-96231b3b80d8
This commit is contained in:
Chris Lattner 2009-07-20 05:55:19 +00:00
parent 987e7eb59c
commit 857755c2a5

View File

@ -91,6 +91,15 @@
<li><a href="#inlineasm">Inline Assembler Expressions</a></li>
</ol>
</li>
<li><a href="#intrinsic_globals">Intrinsic Global Variables</a>
<ol>
<li><a href="#intg_used">The '<tt>llvm.used</tt>' Global Variable</a></li>
<li><a href="#intg_global_ctors">The '<tt>llvm.global_ctors</tt>'
Global Variable</a></li>
<li><a href="#intg_global_dtors">The '<tt>llvm.global_dtors</tt>'
Global Variable</a></li>
</ol>
</li>
<li><a href="#instref">Instruction Reference</a>
<ol>
<li><a href="#terminators">Terminator Instructions</a>
@ -2150,6 +2159,76 @@ call void asm sideeffect "eieio", ""()
</div>
<!-- *********************************************************************** -->
<div class="doc_section">
<a name="intrinsic_globals">Intrinsic Global Variables</a>
</div>
<!-- *********************************************************************** -->
<p>LLVM has a number of "magic" global variables that contain data that affect
code generation or other IR semantics. These are documented here. All globals
of this sort should have a section specified as "llvm.metadata". This section
and all globals that start with "llvm." are reserved for LLVM.</p>
<!-- ======================================================================= -->
<div class="doc_subsection">
<a name="intg_used">The '<tt>llvm.used</tt>' Global Variable</a>
</div>
<div class="doc_text">
<p>The <tt>@llvm.used</tt> global is an array with i8* element type which has <a
href="#linkage_appending">appending linkage</a>. This array contains a list of
pointers to global variables and functions which may optionally have a pointer
cast formed of bitcast or getelementptr. For example, a legal use of it is:</p>
<pre>
@X = global i8 4
@Y = global i32 123
@llvm.used = appending global [2 x i8*] [
i8* @X,
i8* bitcast (i32* @Y to i8*)
], section "llvm.metadata"
</pre>
<p>If a global variable appears in the <tt>@llvm.used</tt> list, then the
compiler, assembler, and linker are required to treat the symbol as if there is
a reference to the global that it cannot see. For example, if a variable has
internal linkage and no references other than that from the <tt>@llvm.used</tt>
list, it cannot be deleted. This is commonly used to represent references from
inline asms and other things the compiler cannot "see", and corresponds to
"attribute((used))" in GNU C.</p>
<p>On some targets, the code generator must emit a directive to the assembler or
object file to prevent the assembler and linker from molesting the symbol.</p>
</div>
<!-- ======================================================================= -->
<div class="doc_subsection">
<a name="intg_global_ctors">The '<tt>llvm.global_ctors</tt>' Global Variable</a>
</div>
<div class="doc_text">
<p>TODO: Describe this.</p>
</div>
<!-- ======================================================================= -->
<div class="doc_subsection">
<a name="intg_global_dtors">The '<tt>llvm.global_dtors</tt>' Global Variable</a>
</div>
<div class="doc_text">
<p>TODO: Describe this.</p>
</div>
<!-- *********************************************************************** -->
<div class="doc_section"> <a name="instref">Instruction Reference</a> </div>
<!-- *********************************************************************** -->