Skip to content
Commit 8ab77a78 authored by Kazu Hirata's avatar Kazu Hirata
Browse files

[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
Loading
Loading
Loading
Loading
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please to comment