14#ifndef LLVM_SUPPORT_SWAPBYTEORDER_H
15#define LLVM_SUPPORT_SWAPBYTEORDER_H
22#if defined(__linux__) || defined(__GNU__) || defined(__HAIKU__) || \
23 defined(__Fuchsia__) || defined(__EMSCRIPTEN__)
26#include <sys/machine.h>
30#define BIG_ENDIAN 4321
31#define LITTLE_ENDIAN 1234
32#if defined(_BIG_ENDIAN)
33#define BYTE_ORDER BIG_ENDIAN
35#define BYTE_ORDER LITTLE_ENDIAN
38#define BIG_ENDIAN 4321
39#define LITTLE_ENDIAN 1234
40#define BYTE_ORDER BIG_ENDIAN
42#if !defined(BYTE_ORDER) && !defined(_WIN32)
43#include <machine/endian.h>
64#if defined(BYTE_ORDER) && defined(BIG_ENDIAN) && BYTE_ORDER == BIG_ENDIAN
110 return static_cast<T>(
#define LLVM_DEPRECATED(MSG, FIX)
Given that RA is a live value
This file implements the C++20 <bit> header.
LLVM Value Representation.
@ C
The default llvm calling convention, compatible with C.
static const bool IsLittleEndianHost
unsigned char getSwappedBytes(unsigned char C)
constexpr bool IsBigEndianHost
void swapByteOrder(T &Value)
This is an optimization pass for GlobalISel generic memory operations.
uint64_t ByteSwap_64(uint64_t value)
This function returns a byte-swapped representation of the 64-bit argument.
constexpr T byteswap(T V) noexcept
Reverses the bytes in the given integer value V.
uint32_t ByteSwap_32(uint32_t value)
This function returns a byte-swapped representation of the 32-bit argument.
uint16_t ByteSwap_16(uint16_t value)
ByteSwap_16 - This function returns a byte-swapped representation of the 16-bit argument.