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

Richard Trieu rtrieu at google.com
Fri Mar 23 11:19:06 PDT 2012


On Fri, Mar 23, 2012 at 8:04 AM, Sebastian Redl <
sebastian.redl at getdesigned.at> wrote:

> On 22.03.2012 00:30, Richard Trieu wrote:
> > Author: rtrieu
> > Date: Wed Mar 21 18:30:30 2012
> > New Revision: 153226
> >
> > URL: http://llvm.org/viewvc/llvm-project?rev=153226&view=rev
> > Log:
> > Change the binary operator data recursive evaluator to not stop at the
> first
> > non-constant value encountered.  This allows the evaluator to deduce that
> > expressions like (x<  5 || true) is equal to true.  Previously, it would
> visit
> > x and determined that the entire expression is could not evaluated to a
> > constant.
> >
> It should still stop evaluating if the LHS has side effects. Does that
> work correctly?
>
> Sebastian
>
> Is it the expected behavior to stop when side effects are found?  I
stripped out the early exit so the evaluator will fully process every
entry.  The regression I fixed only requires the resulting value of the
binary operator and didn't care about side-effects, so an early exit would
likely show the problem again.
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.llvm.org/pipermail/cfe-commits/attachments/20120323/b2602ec6/attachment.html>


More information about the cfe-commits mailing list