<dl>
- <dt><tt><b><a name="linkage_internal">internal</a></b></tt> </dt>
+ <dt><tt><b><a name="linkage_internal">internal</a></b></tt>: </dt>
<dd>Global values with internal linkage are only directly accessible by
objects in the current module. In particular, linking code into a module with
allowed to be discarded.
</dd>
+ <dt><tt><b><a name="linkage_common">common</a></b></tt>: </dt>
+
+ <dd>"<tt>common</tt>" linkage is exactly the same as <tt>linkonce</tt>
+ linkage, except that unreferenced <tt>common</tt> globals may not be
+ discarded. This is used for globals that may be emitted in multiple
+ translation units, but that are not guaranteed to be emitted into every
+ translation unit that uses them. One example of this is tentative
+ definitions in C, such as "<tt>int X;</tt>" at global scope.
+ </dd>
+
<dt><tt><b><a name="linkage_weak">weak</a></b></tt>: </dt>
- <dd>"<tt>weak</tt>" linkage is exactly the same as <tt>linkonce</tt> linkage,
- except that unreferenced <tt>weak</tt> globals may not be discarded. This is
- used for globals that may be emitted in multiple translation units, but that
- are not guaranteed to be emitted into every translation unit that uses them.
- One example of this are common globals in C, such as "<tt>int X;</tt>" at
- global scope.
+ <dd>"<tt>weak</tt>" linkage is the same as <tt>common</tt> linkage, except
+ that some targets may choose to emit different assembly sequences for them
+ for target-dependent reasons. This is used for globals that are declared
+ "weak" in C source code.
</dd>
<dt><tt><b><a name="linkage_appending">appending</a></b></tt>: </dt>
<td><a href="#t_integer">integer</a>,
<a href="#t_floating">floating point</a>,
<a href="#t_pointer">pointer</a>,
- <a href="#t_vector">vector</a>
+ <a href="#t_vector">vector</a>,
<a href="#t_struct">structure</a>,
<a href="#t_array">array</a>,
+ <a href="#t_label">label</a>.
</td>
</tr>
<tr>
<td><a href="#t_primitive">primitive</a></td>
<td><a href="#t_label">label</a>,
<a href="#t_void">void</a>,
- <a href="#t_integer">integer</a>,
<a href="#t_floating">floating point</a>.</td>
</tr>
<tr>
<p>The <a href="#t_firstclass">first class</a> types are perhaps the
most important. Values of these types are the only ones which can be
produced by instructions, passed as arguments, or used as operands to
-instructions. This means that all structures and arrays must be
-manipulated either by pointer or by component.</p>
+instructions.</p>
</div>
<!-- ======================================================================= -->
The first operand of an '<tt>extractvalue</tt>' instruction is a
value of <a href="#t_struct">struct</a> or <a href="#t_array">array</a>
type. The operands are constant indices to specify which value to extract
-in the same manner as indices in a
+in a similar manner as indices in a
'<tt><a href="#i_getelementptr">getelementptr</a></tt>' instruction.
</p>
<h5>Example:</h5>
<pre>
- %result = extractvalue {i32, float} %agg, i32 0 <i>; yields i32</i>
+ %result = extractvalue {i32, float} %agg, 0 <i>; yields i32</i>
</pre>
</div>
<h5>Syntax:</h5>
<pre>
- <result> = insertvalue <aggregate type> <val>, <ty> <val>, i32 <idx> <i>; yields <n x <ty>></i>
+ <result> = insertvalue <aggregate type> <val>, <ty> <val>, <idx> <i>; yields <n x <ty>></i>
</pre>
<h5>Overview:</h5>
The first operand of an '<tt>insertvalue</tt>' instruction is a
value of <a href="#t_struct">struct</a> or <a href="#t_array">array</a> type.
The second operand is a first-class value to insert.
-type of the first operand. The following operands are constant indices
-indicating the position at which to insert the value in the same manner as
+The following operands are constant indices
+indicating the position at which to insert the value in a similar manner as
indices in a
'<tt><a href="#i_getelementptr">getelementptr</a></tt>' instruction.
The value to insert must have the same type as the value identified
<h5>Example:</h5>
<pre>
- %result = insertvalue {i32, float} %agg, i32 1, i32 0 <i>; yields {i32, float}</i>
+ %result = insertvalue {i32, float} %agg, 1, 0 <i>; yields {i32, float}</i>
</pre>
</div>