[llvm-commits] [llvm] r57197 - /llvm/trunk/docs/LangRef.html

Devang Patel dpatel at apple.com
Mon Oct 6 11:50:38 PDT 2008


Author: dpatel
Date: Mon Oct  6 13:50:38 2008
New Revision: 57197

URL: http://llvm.org/viewvc/llvm-project?rev=57197&view=rev
Log:
Update function attributes docs.

Modified:
    llvm/trunk/docs/LangRef.html

Modified: llvm/trunk/docs/LangRef.html
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/docs/LangRef.html?rev=57197&r1=57196&r2=57197&view=diff

==============================================================================
--- llvm/trunk/docs/LangRef.html (original)
+++ llvm/trunk/docs/LangRef.html Mon Oct  6 13:50:38 2008
@@ -749,8 +749,9 @@
 <a href="#callingconv">calling convention</a>, a return type, an optional
 <a href="#paramattrs">parameter attribute</a> for the return type, a function 
 name, a (possibly empty) argument list (each with optional 
-<a href="#paramattrs">parameter attributes</a>), an optional section, an
-optional alignment, an optional <a href="#gc">garbage collector name</a>, 
+<a href="#paramattrs">parameter attributes</a>), optional 
+<a href="#fnattrs">function attributes</a>, an optional section, 
+an optional alignment, an optional <a href="#gc">garbage collector name</a>, 
 an opening curly brace, a list of basic blocks, and a closing curly brace.
 
 LLVM function declarations consist of the "<tt>declare</tt>" keyword, an
@@ -861,23 +862,27 @@
     value, but is also valid on pointers to scalars.  The copy is considered to
     belong to the caller not the callee (for example,
     <tt><a href="#readonly">readonly</a></tt> functions should not write to
-    <tt>byval</tt> parameters).</dd>
+    <tt>byval</tt> parameters). This is not a valid attribute for return
+    values. </dd>
 
     <dt><tt>sret</tt></dt>
     <dd>This indicates that the pointer parameter specifies the address of a
     structure that is the return value of the function in the source program.
     This pointer must be guaranteed by the caller to be valid: loads and stores
     to the structure may be assumed by the callee to not to trap.  This may only
-    be applied to the first parameter.</dd>
+    be applied to the first parameter. This is not a valid attribute for
+    return values. </dd>
 
     <dt><tt>noalias</tt></dt>
     <dd>This indicates that the parameter does not alias any global or any other
     parameter.  The caller is responsible for ensuring that this is the case,
-    usually by placing the value in a stack allocation.</dd>
+    usually by placing the value in a stack allocation. This is not a valid
+    attribute for return values.</dd>
 
     <dt><tt>nest</tt></dt>
     <dd>This indicates that the pointer parameter can be excised using the
-    <a href="#int_trampoline">trampoline intrinsics</a>.</dd>
+    <a href="#int_trampoline">trampoline intrinsics</a>. This is not a valid
+    attribute for return values.</dd>
   </dl>
 
 </div>
@@ -2041,7 +2046,8 @@
 <h5>Syntax:</h5>
 
 <pre>
-  <result> = invoke [<a href="#callingconv">cconv</a>] <ptr to function ty> <function ptr val>(<function args>) 
+  <result> = invoke [<a href="#callingconv">cconv</a>] [<a href="#pa\
+ramattrs">RetAttrs</a>] <ptr to function ty> <function ptr val>(<function args>) 
                 to label <normal label> unwind label <exception label>
 </pre>
 
@@ -2066,6 +2072,11 @@
     convention</a> the call should use.  If none is specified, the call defaults
     to using C calling conventions.
   </li>
+
+  <li>The optional <a href="#paramattrs">Parameter Attributes</a> list for
+   return values. Only '<tt>zeroext</tt>', '<tt>signext</tt>', 
+   and '<tt>inreg</tt>' attributes are valid here.</li>
+
   <li>'<tt>ptr to function ty</tt>': shall be the signature of the pointer to
   function value being invoked.  In most cases, this is a direct function
   invocation, but indirect <tt>invoke</tt>s are just as possible, branching off
@@ -2086,6 +2097,9 @@
   <li>'<tt>exception label</tt>': the label reached when a callee returns with
   the <a href="#i_unwind"><tt>unwind</tt></a> instruction. </li>
 
+  <li>The optional <a href="fnattrs">function attributes</a> list. Only
+  '<tt>noreturn</tt>', '<tt>nounwind</tt>', '<tt>readonly</tt>' and
+  '<tt>readnone</tt>' attributes are valid here.</li>
 </ol>
 
 <h5>Semantics:</h5>
@@ -4235,7 +4249,7 @@
 
 <h5>Syntax:</h5>
 <pre>
-  <result> = [tail] call [<a href="#callingconv">cconv</a>] <ty> [<fnty>*] <fnptrval>(<param list>)
+  <result> = [tail] call [<a href="#callingconv">cconv</a>] [<a href="#paramattrs">RetAttrs</a>] <ty> [<fnty>*] <fnptrval>(<param list>)
 </pre>
 
 <h5>Overview:</h5>
@@ -4259,6 +4273,13 @@
     convention</a> the call should use.  If none is specified, the call defaults
     to using C calling conventions.
   </li>
+
+  <li>
+    <p>The optional <a href="#paramattrs">Parameter Attributes</a> list for
+    return values. Only '<tt>zeroext</tt>', '<tt>signext</tt>', 
+    and '<tt>inreg</tt>' attributes are valid here.</p>
+  </li>
+
   <li>
     <p>'<tt>ty</tt>': the type of the call instruction itself which is also
     the type of the return value.  Functions that return no value are marked
@@ -4283,6 +4304,11 @@
     indicates the function accepts a variable number of arguments, the extra 
     arguments can be specified.</p>
   </li>
+  <li> 
+  <p>The optional <a href="fnattrs">function attributes</a> list. Only
+  '<tt>noreturn</tt>', '<tt>nounwind</tt>', '<tt>readonly</tt>' and
+  '<tt>readnone</tt>' attributes are valid here.</p>
+  </li>
 </ol>
 
 <h5>Semantics:</h5>
@@ -4304,9 +4330,11 @@
   call void %foo(i8 97 signext)
 
   %struct.A = type { i32, i8 }
-  %r = call %struct.A @foo()                     <i>; yields { 32, i8 }</i>
+  %r = call %struct.A @foo()                        <i>; yields { 32, i8 }</i>
   %gr = extractvalue %struct.A %r, 0                <i>; yields i32</i>
   %gr1 = extractvalue %struct.A %r, 1               <i>; yields i8</i>
+  %Z = call void @foo() noreturn                    <i>; indicates that foo never returns nomrally
+  %ZZ = call zeroext i32 @bar()                     <i>; Return value is zero extended
 </pre>
 
 </div>





More information about the llvm-commits mailing list