[PATCH] Mostly correct conditional handling for Consumed analysis

Delesley Hutchins delesley at google.com
Wed Aug 28 11:43:13 PDT 2013


>> > -    CS_None,
>> > +    CS_None = 0,
>>
>> Any particular reason for this change?
>
> So that CS_None evaluates to false if a ConsumedState value is used in a
> conditional.
>
> It would still evaluate to false; it's value when unspecified will be zero.

I don't like relying on auto-conversion from an enum to a bool; for
readability, I would prefer values of type ConsumedState to be tested
against a particular enum value.  (Otherwise, I have to go look at the
enum definition to see which value is false.)

I've gone over the memory management strategy with Chris, and I
believe it to be sound.

LGTM, on condition that the enum tests are made explicit, and the
memory management strategy is suitably documented in a future patch.

  -DeLesley



More information about the cfe-commits mailing list