[cfe-commits] [PATCH] Simplify isPowerOfTwo signature

Rafael EspĂ­ndola rafael.espindola at gmail.com
Wed Dec 12 08:56:45 PST 2012

> 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
> isKnownToBeAPowerOfTwo?

That is true. In functions like isKnownNonZero one can only interpret
the name as meaning "is know to be non zero" but with
isKnownPowerOfTwo is that it can mean "is know to be a power of two"
or "is a known power of two".

Will send a patch with isKnownToBeAPowerOfTwo in a sec.

>> 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!

r169988. Thanks.

> Ciao, Duncan.


More information about the cfe-commits mailing list