[Support] Use llvm::byteswap in SwapByteOrder.h (NFC)
This patch defines ByteSwap_{32,64} and getSwappedBytes with
llvm::byteswap.
It's tempting to define something like:
template <typename T,
typename = std::enable_if_t<std::is_integral_v<T>>>
inline T getSwappedBytes(T C) { return llvm::byteswap(C); }
But this doesn't work. The host compiler would issue:
error: call to 'getSwappedBytes' is ambiguous
while compiling lldb/source/Utility/UUID.cpp.
parent
7db6a45e
Please register or sign in to comment