[cfe-commits] r51113 - in /cfe/trunk: include/clang/AST/Builtins.def include/clang/AST/Expr.h include/clang/AST/StmtNodes.def include/clang/Basic/DiagnosticKinds.def lib/AST/Expr.cpp lib/AST/StmtPrinter.cpp lib/CodeGen/CGExprScalar.cpp lib/Sema/S

Chris Lattner clattner at apple.com
Fri May 16 12:51:51 PDT 2008

On May 16, 2008, at 10:59 AM, Eli Friedman wrote:

> On Fri, May 16, 2008 at 7:51 AM, Chris Lattner <clattner at apple.com>  
> wrote:
>> I think it would be reasonable to have the code generator use  
>> isConstantExpr
>> instead of 'EmitScalarExpr' in the code generator.  Alternatively,  
>> you could
>> have the AST have implicit casts to int.  The problem with that is  
>> that int
>> may not be i32... I'll let you decide what is best.
> I'll have to think about this one a bit (skipping the emit step seems
> likely to lead to subtle bugs, although I can't think of any off the
> top of my head).

Ok.  If sema guarantees that the operands pass 'isConstantExpr', it  
seems like a reasonable thing for the codegen to use.

Thanks again Eli!


More information about the cfe-commits mailing list