[cfe-dev] integer constant expression oh my!

Daniel Dunbar daniel at zuster.org
Sun Nov 16 19:06:25 PST 2008


I don't think that is a problem. isICE just calls Evaluate to see if
it has overflow and if it can eval the expression, then does its own
little verification traversal to make sure it matches the ICE rules.

 - Daniel

On Sun, Nov 16, 2008 at 5:42 PM, Chris Lattner <clattner at apple.com> wrote:
>
> On Nov 16, 2008, at 3:55 PM, Eli Friedman wrote:
>
>> On Sun, Nov 16, 2008 at 3:43 PM, Daniel Dunbar <daniel at zuster.org> wrote:
>>>
>>> I'm not sure what you mean about rewrite ICE checking around Evaluate.
>>> Is this just about replacing pieces like sizeof with calls to
>>> Evaluate?
>>
>> I'm thinking the following: except for a few exceptional cases (like
>> ICEs containing a comma operator), isICE doesn't care about what value
>> the subexpressions evaluate to.  Therefore, we can split isICE into
>> two parts: verifying that the expression has the structure of an ICE,
>> and actually evaluating it.  The structure verification has relatively
>> little overlap with Evaluate, and the evaluation part can be taken
>> care of with a simple call to Evaluate.
>
> I'd really like that, except that integer overflow prevents things from
> being an ICE.  Doesn't that mean isICE needs to evaluate the constants?
>
> -Chris
>



More information about the cfe-dev mailing list