On Aug 26, 2012, at 11:37 PM, Ted Kremenek <kreme...@apple.com> wrote:

> On Aug 25, 2012, at 12:09 PM, Chris Lattner <clatt...@apple.com> wrote:
> 
>>> Teach CFG that 'if (x & 0)' and 'if (x * 0)' is an unfeasible branch.
>> 
>> Why not teach the general front-end constant folding logic (in 
>> lib/AST/ExprConstant.cpp) to handle this identity, and then just use it?
> 
> I may have misunderstood the point of ExprConstant, but I thought it's 
> semantics are tied to restrictions on what we can consider an integer 
> constant expression.  Is that not the case?

The "Expr::isIntegerConstantExpr" and "isCXX11ConstantExpr" are limited to 
folding exactly what the standards spec specifies.  EvaluateAsRValue and 
EvaluateAsInt can use "any crazy technique that we want to" :-)

-Chris
_______________________________________________
cfe-commits mailing list
cfe-commits@cs.uiuc.edu
http://lists.cs.uiuc.edu/mailman/listinfo/cfe-commits

Reply via email to