[cfe-dev] Constant expression checking rewrite

Ted Kremenek kremenek at apple.com
Fri May 16 15:25:47 PDT 2008


On May 16, 2008, at 2:43 PM, Eli Friedman wrote:

> On Fri, May 16, 2008 at 2:27 PM, Ted Kremenek <kremenek at apple.com>  
> wrote:
>> It is very useful for isConstantExpr to evaluate the actual value  
>> of the
>> expression as an APSInt constant.
>
> I think you're confusing Expr::isConstantExpr and  
> Expr::isIntegerConstantExpr
>
> Okay, I'll try to rephrase the paragraph more simply: I don't think we
> need Expr::isConstantExpr outside of Sema; the current users don't
> really want it, and I can't think of any other interesting uses.
>
> -Eli
> _______________________________________________
> cfe-dev mailing list
> cfe-dev at cs.uiuc.edu
> http://lists.cs.uiuc.edu/mailman/listinfo/cfe-dev

You have indeed identified my confusion.  Thanks for the clarification!

One potential client outside of Sema for Expr::isConstantExpr are  
refactoring clients that wish to determine if a transformed AST is  
constant expression in the C99 sense.  Even this isn't strictly  
needed; transformed code can be checked by just running the parser 
+semantic analyzer on it.

The clients of Expr::isConstantExpr that I see outside of Sema are the  
DeadStores analysis and CGExprAgg.  What interface do you suggest that  
these clients use instead?

Ted



More information about the cfe-dev mailing list