[cfe-commits] r146236 - in /cfe/trunk: lib/AST/ExprConstant.cpp test/Sema/builtins.c

Richard Smith richard at metafoo.co.uk
Fri Dec 9 08:56:13 PST 2011


On Fri, December 9, 2011 15:15, Jonathan Sauer wrote:
>> Author: rsmith
>> Date: Thu Dec  8 20:04:48 2011
>> New Revision: 146236
>>
>> URL: http://llvm.org/viewvc/llvm-project?rev=146236&view=rev
>> Log:
>> Replace the implementation of __builtin_constant_p (which was based on the
>> GCC
>> documentation) with one based on what GCC's __builtin_constant_p is actually
>>  intended to do (discovered by asking a friendly GCC developer).
>
> Great work! How does this affect <http://llvm.org/bugs/show_bug.cgi?id=4898>?

That's a largely separate issue. The new implementation is still in clang's
constant folder, and as such runs before inlining. An IR-level representation
would still be needed to support detecting constants after inlining, although
the semantics of __builtin_constant_p are slightly different in that case
(it's documented as not detecting string literals as constant after inlining).

- Richard




More information about the cfe-commits mailing list