[PATCH] Improved __builtin_constant_p

Janusz Sobczak janusz.sobczak at mobica.com
Tue Jul 15 04:10:17 PDT 2014


>>! In D4492#5, @rsmith wrote:
> This makes Clang's constant expression evaluator and its IR generation disagree about the value of `__builtin_constant_p`.
How would you address this issue? My concern is that there are cases, where we need to fold to a constant early (i.e. global variable initialisation) and other cases where we can emit IR code and make the decision about 'constantness' at a later stage.

> 
> What's the motivation behind this change?
Matching GCC behaviour as closely as we can.

http://reviews.llvm.org/D4492






More information about the cfe-commits mailing list