[cfe-commits] r43448 - /cfe/trunk/Sema/SemaExpr.cpp

Chris Lattner clattner at apple.com
Tue Oct 30 13:28:42 PDT 2007


On Oct 29, 2007, at 9:45 AM, Ted Kremenek wrote:
> Author: kremenek
> URL: http://llvm.org/viewvc/llvm-project?rev=43448&view=rev
> Log:
> For floating point equality check, we now ignore parentheses.  e.g.:
> (x) == x  is the treated the same as x == x.

Thanks Ted,

> +++ cfe/trunk/Sema/SemaExpr.cpp Mon Oct 29 11:45:23 2007
> @@ -1191,6 +1191,20 @@
>    return QualType();
>  }
>
> +// Utility method to plow through parentheses to get the first nested
> +// non-ParenExpr expr.
> +static inline Expr* IgnoreParen(Expr* E) {
> +
>
> +  while (true) {
> +    if (ParenExpr* P = dyn_cast<ParenExpr>(E))
> +      E = P->getSubExpr();
> +    else
> +      break;
> +  }

How about:

   while (ParenExpr* P = dyn_cast<ParenExpr>(E))
     E = P->getSubExpr();

?

-Chris



More information about the cfe-commits mailing list