[cfe-commits] [PATCH] Simplify isPowerOfTwo signature
baldrick at free.fr
Tue Dec 11 22:51:57 PST 2012
On 12/12/12 02:05, Rafael Espíndola wrote:
>> I think that's Chandler's point—the interface shouldn't imply that it's a
>> target-independent predicate, even though the current implementation is.
>> What about renaming to isKnownPowerOfTwo, to make it clear that the target
>> could affect the answer?
> Those are independent, no? I do like isKnownPowerOfTwo better, since
> sometimes, with or without the target, we just don't know.
the problem with "isKnownPowerOfTwo" is that it suggests that the actually
power of two is known (eg 4) when in fact the power of two may not be
known, only the fact that it is a power of two. Maybe something like
> But if we are not using the target, passing TargetData gives the
> impression that it is used, when in fact it is not.
It gives the impression that it might be used, which is correct (it might be
used one day!). However we've spent more time discussing this than it would
take to rip it out and put it back many times, so if the data layout parameter
gets your goat why don't you just rip it out!
More information about the cfe-commits