15 #ifndef LLVM_SUPPORT_SWAPBYTEORDER_H 16 #define LLVM_SUPPORT_SWAPBYTEORDER_H 21 #if defined(_MSC_VER) && !defined(_DEBUG) 31 #if defined(_MSC_VER) && !defined(_DEBUG) 34 return _byteswap_ushort(value);
36 uint16_t
Hi = value << 8;
37 uint16_t
Lo = value >> 8;
45 #if defined(__llvm__) || (LLVM_GNUC_PREREQ(4, 3, 0) && !defined(__ICC)) 46 return __builtin_bswap32(value);
47 #elif defined(_MSC_VER) && !defined(_DEBUG) 48 return _byteswap_ulong(value);
54 return (Byte0 << 24) | (Byte1 << 8) | (Byte2 >> 8) | (Byte3 >> 24);
61 #if defined(__llvm__) || (LLVM_GNUC_PREREQ(4, 3, 0) && !defined(__ICC)) 62 return __builtin_bswap64(value);
63 #elif defined(_MSC_VER) && !defined(_DEBUG) 64 return _byteswap_uint64(value);
68 return (Hi << 32) |
Lo;
82 #if __LONG_MAX__ == __INT_MAX__ 85 #elif __LONG_MAX__ == __LONG_LONG_MAX__ 89 #error "Unknown long size!"
void swapByteOrder(T &Value)
This class represents lattice values for constants.
uint32_t SwapByteOrder_32(uint32_t value)
SwapByteOrder_32 - This function returns a byte-swapped representation of the 32-bit argument...
uint16_t SwapByteOrder_16(uint16_t value)
SwapByteOrder_16 - This function returns a byte-swapped representation of the 16-bit argument...
uint64_t SwapByteOrder_64(uint64_t value)
SwapByteOrder_64 - This function returns a byte-swapped representation of the 64-bit argument...
unsigned char getSwappedBytes(unsigned char C)
LLVM Value Representation.