improve descriptions of function attrs

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@57060 91177308-0d34-0410-b5e6-96231b3b80d8
This commit is contained in:
Chris Lattner 2008-10-04 18:23:17 +00:00
parent 0c46a7d666
commit 88d4b597ba

View File

@ -920,38 +920,44 @@ define void @f() optsize
<dl> <dl>
<dt><tt>alwaysinline</tt></dt> <dt><tt>alwaysinline</tt></dt>
<dd>This attribute requests inliner to inline this function irrespective of <dd>This attribute indicates that the inliner should attempt to inline this
inlining size threshold for this function.</dd> function into callers whenever possible, ignoring any active inlining size
threshold for this caller.</dd>
<dt><tt>noinline</tt></dt> <dt><tt>noinline</tt></dt>
<dd>This attributes requests inliner to never inline this function in any <dd>This attribute indicates that the inliner should never inline this function
situation. This attribute may not be used together with <tt>alwaysinline</tt> in any situation. This attribute may not be used together with
attribute.</dd> <tt>alwaysinline</tt> attribute.</dd>
<dt><tt>optsize</tt></dt> <dt><tt>optsize</tt></dt>
<dd>This attribute suggests that optimization passes and code generator passes <dd>This attribute suggests that optimization passes and code generator passes
make choices that help reduce code size.</dd> make choices that keep the code size of this function low, and otherwise do
optimizations specifically to reduce code size.</dd>
<dt><tt>noreturn</tt></dt> <dt><tt>noreturn</tt></dt>
<dd>This function attribute indicates that the function never returns. This <dd>This function attribute indicates that the function never returns normally.
tells LLVM that every call to this function should be treated as if This produces undefined behavior at runtime if the function ever does
an <tt>unreachable</tt> instruction immediately followed the call.</dd> dynamically return.</dd>
<dt><tt>nounwind</tt></dt> <dt><tt>nounwind</tt></dt>
<dd>This function attribute indicates that no exceptions unwind out of the <dd>This function attribute indicates that the function never returns with an
function. Usually this is because the function makes no use of exceptions, unwind or exceptional control flow. If the function does unwind, its runtime
but it may also be that the function catches any exceptions thrown when behavior is undefined.</dd>
executing it.</dd>
<dt><tt>readnone</tt></dt>
<dd>This attribute indicates that the function computes its result (or its
thrown exception) based strictly on its arguments. It does not read any global
mutable state (e.g. memory, control registers, etc) visible to caller functions.
Furthermore, <tt>readnone</tt> functions never change any state visible to their
caller.
<dt><tt>readonly</tt></dt> <dt><tt>readonly</tt></dt>
<dd>This function attribute indicates that the function has no side-effects <dd>This function attribute indicates that the function has no side-effects on
except for producing a return value or throwing an exception. The value the calling function, but that it depends on state (memory state, control
returned must only depend on the function arguments and/or global variables. register state, etc) that may be set in the caller. A readonly function always
It may use values obtained by dereferencing pointers.</dd> returns the same value (or throws the same exception) whenever it is called with
<dt><tt>readnone</tt></dt> a particular set of arguments and global state.</dd>
<dd>A <tt>readnone</tt> function has the same restrictions as a <tt>readonly</tt>
function, but in addition it is not allowed to dereference any pointer arguments
or global variables.
</dl> </dl>
</div> </div>