[llvm-commits] [llvm] r94117 - /llvm/trunk/include/llvm/ADT/ImmutableSet.h

Chris Lattner clattner at apple.com
Thu Jan 21 16:01:08 PST 2010


On Jan 21, 2010, at 3:54 PM, Bill Wendling wrote:

>> +    assert(!getLeft()
>> +           || ImutInfo::isLess(ImutInfo::KeyOfValue(getLeft()- 
>> >getValue()),
>> +                               ImutInfo::KeyOfValue(getValue()))
>> +           && "Value in left child is not less that current value");
>> +
>> +
>> +    assert(!getRight()
>> +           || ImutInfo::isLess(ImutInfo::KeyOfValue(getValue()),
>> +                               ImutInfo::KeyOfValue(getRight()- 
>> >getValue()))
>> +           && "Current value is not less that value of right  
>> child");
>>
> Would it be good to put the "or" part in parentheses to make this  
> more readable for people who don't have the precedence table  
> memorized? :-)

Yes, particularly because people who do have it memorized will tell  
you that the code is "wrong" without them. :)

assert(x || y && z) -> assert(x || (y && z));

It will still do the same thing as assert((x || y) && z), but it is  
"strange".

-Chris



More information about the llvm-commits mailing list