diff options
author | Richard Smith <richard-llvm@metafoo.co.uk> | 2012-08-25 00:44:02 +0000 |
---|---|---|
committer | Richard Smith <richard-llvm@metafoo.co.uk> | 2012-08-25 00:44:02 +0000 |
commit | f994353801abafd394a61f7a88a767fe57ed848a (patch) | |
tree | da59c0325da18f79b3e486a971b33360564e8bf3 /clang/docs/UsersManual.html | |
parent | 3e056dea1bea121835ad4471ef490282855ee710 (diff) | |
download | bcm5719-llvm-f994353801abafd394a61f7a88a767fe57ed848a.tar.gz bcm5719-llvm-f994353801abafd394a61f7a88a767fe57ed848a.zip |
Update the user's manual for some of the new -fcatch-undefined-behavior features.
llvm-svn: 162635
Diffstat (limited to 'clang/docs/UsersManual.html')
-rw-r--r-- | clang/docs/UsersManual.html | 22 |
1 files changed, 17 insertions, 5 deletions
diff --git a/clang/docs/UsersManual.html b/clang/docs/UsersManual.html index 69f916c94e8..50a373886a6 100644 --- a/clang/docs/UsersManual.html +++ b/clang/docs/UsersManual.html @@ -880,18 +880,30 @@ on runtime code generation to check for undefined behavior.</dt> <dd>This option, which defaults to off, controls whether or not Clang adds runtime checks for undefined runtime behavior. If a check fails, <tt>__builtin_trap()</tt> is used to indicate failure. -The checks are: +The currently implemented checks include: <ul> <li>Subscripting where the static type of one operand is a variable which is decayed from an array type and the other operand is greater than the size of the array or less than zero.</li> <li>Shift operators where the amount shifted is greater or equal to the promoted bit-width of the left-hand-side or less than zero.</li> -<li>If control flow reaches __builtin_unreachable. -<li>When llvm implements more __builtin_object_size support, reads and - writes for objects that __builtin_object_size indicates we aren't - accessing valid memory. Bit-fields and vectors are not yet checked. +<li>If control flow reaches __builtin_unreachable.</li> +<li>Reads and writes for objects which are inappropriately aligned or are not + large enough (in cases where the size can be determined). +<li>Signed integer overflow, including all the checks added by <tt>-ftrapv</tt> + and also checking for signed left shift overflow.</li> +<li>Binding a reference to a storage location which is not of an appropriate + alignment or size (in cases where the size can be determined), or binding + a reference to an empty glvalue (a dereferenced null pointer). +<li>Class member access or member function call where the <tt>this</tt> + pointer is not of an appropriate alignment or size (in cases where the size + can be determined), or where it is null.</li> </ul> + +<p>The sizes of objects are determined using <tt>__builtin_object_size</tt>, and +consequently may be able to detect more problems at higher optimization levels. +Bit-fields and vectors are not yet checked.</p> + </dd> <dt id="opt_faddress-sanitizer"><b>-f[no-]address-sanitizer</b>: |