[cfe-dev] integer constant expression oh my!
Nuno Lopes
nunoplopes at sapo.pt
Tue Nov 18 08:38:23 PST 2008
> On Sun, Nov 16, 2008 at 1:51 PM, Chris Lattner <clattner at apple.com> wrote:
>> I wrote up some thoughts about how I think that constants should
>> eventually be handled in clang:
>> http://clang.llvm.org/docs/InternalsManual.html#Constants
>>
>> The goal is for Expr::isConstantExpr and many other things to
>> eventually go away, and only have one piece of code that does the
>> constant folding tree walk. Before we get too far along this path, I
>> thought it would be good to see if this makes sense to others... so,
>> what say you all? :)
This is great as it's horrible to find the same bug over and over again in
slightly different places because the code is duplicated.
One thing I would like to add (that I was discussing yesterday in IRC) is a
Expr::EvaluateToBool() (just export the HandleConversionToBool() from
ExprConstant.cpp). This function is important to fix a few bugs in codegen
and sema. What do you think?
Nuno
More information about the cfe-dev
mailing list