[cfe-commits] r146241 - /cfe/trunk/docs/InternalsManual.html

Richard Smith richard-llvm at metafoo.co.uk
Thu Dec 8 19:40:28 PST 2011


Author: rsmith
Date: Thu Dec  8 21:40:28 2011
New Revision: 146241

URL: http://llvm.org/viewvc/llvm-project?rev=146241&view=rev
Log:
Document the updated behaviour of __builtin_constant_p introduced in r146236.

Modified:
    cfe/trunk/docs/InternalsManual.html

Modified: cfe/trunk/docs/InternalsManual.html
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/docs/InternalsManual.html?rev=146241&r1=146240&r2=146241&view=diff
==============================================================================
--- cfe/trunk/docs/InternalsManual.html (original)
+++ cfe/trunk/docs/InternalsManual.html Thu Dec  8 21:40:28 2011
@@ -1692,7 +1692,10 @@
     any evaluatable subexpression to be accepted as an integer constant
     expression.</li>
 <li><b><tt>__builtin_constant_p</tt></b>: This returns true (as a integer
-    constant expression) if the operand is any evaluatable constant.  As a
+    constant expression) if the operand evaluates to either a numeric value
+    (that is, not a pointer cast to integral type) of integral, enumeration,
+    floating or complex type, or if it evaluates to the address of the first
+    character of a string literal (possibly cast to some other type). As a
     special case, if <tt>__builtin_constant_p</tt> is the (potentially
     parenthesized) condition of a conditional operator expression ("?:"), only
     the true side of the conditional operator is considered, and it is evaluated
@@ -1707,7 +1710,9 @@
     floating-point literal.</li>
 <li><b><tt>__builtin_abs,copysign,..</tt></b>: These are constant folded as
     general constant expressions.</li>
-<li><b><tt>__builtin_strlen</tt></b> and <b><tt>strlen</tt></b>: These are constant folded as integer constant expressions if the argument is a string literal.</li>
+<li><b><tt>__builtin_strlen</tt></b> and <b><tt>strlen</tt></b>: These are
+    constant folded as integer constant expressions if the argument is a string
+    literal.</li>
 </ul>
 
 





More information about the cfe-commits mailing list