[llvm-commits] [llvm] r107199 - /llvm/trunk/include/llvm/ADT/SmallPtrSet.h

Jakob Stoklund Olesen stoklund at 2pi.dk
Wed Jun 30 10:16:14 PDT 2010


On Jun 30, 2010, at 9:51 AM, Daniel Dunbar wrote:

> Wait, wait, we have two nearly equivalent functions with the same name
> and different semantics?

Well, one is a template that can calculate a runtime constant, and one is a function.

And the names NextPowerOf2 vs NextPowerOfTwo are clearly distinct ;-)

I have been confused a couple of times by NextPowerOf2() not being idempotent, but I have learned it now which is why I complained to Duncan. He was of course talking about the template NextPowerOfTwo<> which is indeed idempotent.

It's all very confusing.

I like Duncan's suggestion of renaming the template to RoundUpToPowerOfTwo or something similar.





More information about the llvm-commits mailing list