[llvm-commits] [llvm] r116247 - in /llvm/trunk: include/llvm/Support/MathExtras.h include/llvm/System/SwapByteOrder.h unittests/CMakeLists.txt unittests/Support/SwapByteOrderTest.cpp

Chris Lattner clattner at apple.com
Mon Nov 22 20:06:57 PST 2010


On Nov 17, 2010, at 10:59 PM, Michael Spencer wrote:

>> 
>> This seems like *massive* overkill.  All the template metaprogramming isn't making the code easier to read and follow, it is making it more verbose and difficult to understand.  Instead of defining SwapByteOrder like this, why not just define overloads for signed/unsigned char/short/int/long/long long  ?
>> 
>> -Chris
> 
> These were added due to concerns about which types were accepted. This
> seemed like the cleanest and most explicit way to say what the intent
> of each function was.
> 
> Adding all of those overloads seems more complicated to me than this,
> but I'm fine either way. As long as there are no surprises to the
> user.

Ok, done in r119992, thanks.

-Chris



More information about the llvm-commits mailing list