80 column rule.
[oota-llvm.git] / docs / LangRef.html
index 7b8d4f8c854506251cf156e9327d1ceb1a621541..88970f971ecad8cb4e3c9cc23e262003e1555c22 100644 (file)
@@ -55,6 +55,7 @@
           <li><a href="#t_opaque">Opaque Type</a></li>
         </ol>
       </li>
+      <li><a href="#t_uprefs">Type Up-references</a></li>
     </ol>
   </li>
   <li><a href="#constants">Constants</a>
@@ -480,13 +481,20 @@ All Global Variables and Functions have one of the following types of linkage:
 
 <dl>
 
-  <dt><tt><b><a name="linkage_internal">internal</a></b></tt>: </dt>
+  <dt><tt><b><a name="linkage_private">private</a></b></tt>: </dt>
 
-  <dd>Global values with internal linkage are only directly accessible by
+  <dd>Global values with private linkage are only directly accessible by
   objects in the current module.  In particular, linking code into a module with
-  an internal global value may cause the internal to be renamed as necessary to
-  avoid collisions.  Because the symbol is internal to the module, all
-  references can be updated.  This corresponds to the notion of the
+  an private global value may cause the private to be renamed as necessary to
+  avoid collisions.  Because the symbol is private to the module, all
+  references can be updated. This doesn't show up in any symbol table in the
+  object file.
+  </dd>
+
+  <dt><tt><b><a name="linkage_internal">internal</a></b></tt>: </dt>
+
+  <dd> Similar to private, but the value shows as a local symbol (STB_LOCAL in
+  the case of ELF) in the object file. This corresponds to the notion of the
   '<tt>static</tt>' keyword in C.
   </dd>
 
@@ -552,7 +560,7 @@ All Global Variables and Functions have one of the following types of linkage:
   <dd>"<tt>dllimport</tt>" linkage causes the compiler to reference a function
     or variable via a global pointer to a pointer that is set up by the DLL
     exporting the symbol. On Microsoft Windows targets, the pointer name is
-    formed by combining <code>_imp__</code> and the function or variable name.
+    formed by combining <code>__imp_</code> and the function or variable name.
   </dd>
 
   <dt><tt><b><a name="linkage_dllexport">dllexport</a></b></tt>: </dt>
@@ -560,7 +568,7 @@ All Global Variables and Functions have one of the following types of linkage:
   <dd>"<tt>dllexport</tt>" linkage causes the compiler to provide a global
     pointer to a pointer in a DLL, so that it can be referenced with the
     <tt>dllimport</tt> attribute. On Microsoft Windows targets, the pointer
-    name is formed by combining <code>_imp__</code> and the function or variable
+    name is formed by combining <code>__imp_</code> and the function or variable
     name.
   </dd>
 
@@ -715,7 +723,6 @@ change.</p>
 
 </div>
 
-
 <!-- ======================================================================= -->
 <div class="doc_subsection">
   <a name="globalvars">Global Variables</a>
@@ -1337,6 +1344,13 @@ value.</p>
   </tr>
   </tbody>
 </table>
+
+<p>Note that the code generator does not yet support large integer types
+to be used as function return types. The specific limit on how large a
+return type the code generator can currently handle is target-dependent;
+currently it's often 64 bits for 32-bit targets and 128 bits for 64-bit
+targets.</p>
+
 </div>
 
 <!-- _______________________________________________________________________ -->
@@ -1397,6 +1411,11 @@ As a special case, however, zero length arrays are recognized to be variable
 length.  This allows implementation of 'pascal style arrays' with the  LLVM
 type "{ i32, [0 x float]}", for example.</p>
 
+<p>Note that the code generator does not yet support large aggregate types
+to be used as function return types. The specific limit on how large an
+aggregate return type the code generator can currently handle is
+target-dependent, and also dependent on the aggregate element types.</p>
+
 </div>
 
 <!-- _______________________________________________________________________ -->
@@ -1482,6 +1501,12 @@ instruction.</p>
       an <tt>i32</tt>.</td>
   </tr>
 </table>
+
+<p>Note that the code generator does not yet support large aggregate types
+to be used as function return types. The specific limit on how large an
+aggregate return type the code generator can currently handle is
+target-dependent, and also dependent on the aggregate element types.</p>
+
 </div>
 
 <!-- _______________________________________________________________________ -->
@@ -1586,6 +1611,12 @@ be any integer or floating point type.</p>
     <td class="left">Vector of 2 64-bit integer values.</td>
   </tr>
 </table>
+
+<p>Note that the code generator does not yet support large vector types
+to be used as function return types. The specific limit on how large a
+vector return type codegen can currently handle is target-dependent;
+currently it's often a few times longer than a hardware vector register.</p>
+
 </div>
 
 <!-- _______________________________________________________________________ -->
@@ -1615,6 +1646,56 @@ structure type).</p>
 </table>
 </div>
 
+<!-- ======================================================================= -->
+<div class="doc_subsection">
+  <a name="t_uprefs">Type Up-references</a>
+</div>
+
+<div class="doc_text">
+<h5>Overview:</h5>
+<p>
+An "up reference" allows you to refer to a lexically enclosing type without
+requiring it to have a name. For instance, a structure declaration may contain a
+pointer to any of the types it is lexically a member of.  Example of up
+references (with their equivalent as named type declarations) include:</p>
+
+<pre>
+   { \2 * }                %x = type { %t* }
+   { \2 }*                 %y = type { %y }*
+   \1*                     %z = type %z*
+</pre>
+
+<p>
+An up reference is needed by the asmprinter for printing out cyclic types when
+there is no declared name for a type in the cycle.  Because the asmprinter does
+not want to print out an infinite type string, it needs a syntax to handle
+recursive types that have no names (all names are optional in llvm IR).
+</p>
+
+<h5>Syntax:</h5>
+<pre>
+   \&lt;level&gt;
+</pre>
+
+<p>
+The level is the count of the lexical type that is being referred to.
+</p>
+
+<h5>Examples:</h5>
+
+<table class="layout">
+  <tr class="layout">
+    <td class="left"><tt>\1*</tt></td>
+    <td class="left">Self-referential pointer.</td>
+  </tr>
+  <tr class="layout">
+    <td class="left"><tt>{ { \3*, i8 }, i32 }</tt></td>
+    <td class="left">Recursive structure where the upref refers to the out-most
+                     structure.</td>
+  </tr>
+</table>
+</div>
+
 
 <!-- *********************************************************************** -->
 <div class="doc_section"> <a name="constants">Constants</a> </div>
@@ -2034,6 +2115,15 @@ return value.</p>
   ret void                        <i>; Return from a void function</i>
   ret { i32, i8 } { i32 4, i8 2 } <i>; Return an aggregate of values 4 and 2</i>
 </pre>
+
+<p>Note that the code generator does not yet fully support large
+   return values. The specific sizes that are currently supported are
+   dependent on the target. For integers, on 32-bit targets the limit
+   is often 64 bits, and on 64-bit targets the limit is often 128 bits.
+   For aggregate types, the current limits are dependent on the element
+   types; for example targets are often limited to 2 total integer
+   elements and 2 total floating-point elements.</p>
+
 </div>
 <!-- _______________________________________________________________________ -->
 <div class="doc_subsubsection"> <a name="i_br">'<tt>br</tt>' Instruction</a> </div>
@@ -3231,6 +3321,10 @@ result is null if there is insufficient memory available.</p>
   %array3 = malloc i32, i32 4, align 1024       <i>; yields {i32*}:array3</i>
   %array4 = malloc i32, align 1024              <i>; yields {i32*}:array4</i>
 </pre>
+
+<p>Note that the code generator does not yet respect the
+   alignment value.</p>
+
 </div>
 
 <!-- _______________________________________________________________________ -->
@@ -4056,6 +4150,10 @@ Otherwise, the result is an <tt>i1</tt>.
   &lt;result&gt; = icmp ule i16 -4, 5        <i>; yields: result=false</i>
   &lt;result&gt; = icmp sge i16  4, 5        <i>; yields: result=false</i>
 </pre>
+
+<p>Note that the code generator does not yet support vector types with
+   the <tt>icmp</tt> instruction.</p>
+
 </div>
 
 <!-- _______________________________________________________________________ -->
@@ -4148,6 +4246,10 @@ always yields an <a href="#t_primitive">i1</a> result, as follows:</p>
   &lt;result&gt; = fcmp olt float 4.0, 5.0    <i>; yields: result=true</i>
   &lt;result&gt; = fcmp ueq double 1.0, 2.0   <i>; yields: result=false</i>
 </pre>
+
+<p>Note that the code generator does not yet support vector types with
+   the <tt>fcmp</tt> instruction.</p>
+
 </div>
 
 <!-- _______________________________________________________________________ -->
@@ -4345,6 +4447,10 @@ by element.
 <pre>
   %X = select i1 true, i8 17, i8 42          <i>; yields i8:17</i>
 </pre>
+
+<p>Note that the code generator does not yet support conditions
+   with vector type.</p>
+
 </div>
 
 
@@ -4493,6 +4599,10 @@ argument.</p>
 
 <p>See the <a href="#int_varargs">variable argument processing</a> section.</p>
 
+<p>Note that the code generator does not yet fully support va_arg
+   on many targets. Also, it does not currently support va_arg with
+   aggregate types on any target.</p>
+
 </div>
 
 <!-- *********************************************************************** -->