<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
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>
<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>
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
<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>
<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>
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
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>
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>