diff options
author | Kazu Hirata <kazu@google.com> | 2023-01-28 15:22:37 -0800 |
---|---|---|
committer | Kazu Hirata <kazu@google.com> | 2023-01-28 15:22:37 -0800 |
commit | f6b8f05bb399e8f5fd176b2c9dd383cd029467f1 (patch) | |
tree | 44464725d41404c5a2ccf5694583bc41ff718da1 /llvm/lib/Support/APInt.cpp | |
parent | 02a52b7306026f9d5eb42267d7261974dea1a9ba (diff) | |
download | llvm-f6b8f05bb399e8f5fd176b2c9dd383cd029467f1.zip llvm-f6b8f05bb399e8f5fd176b2c9dd383cd029467f1.tar.gz llvm-f6b8f05bb399e8f5fd176b2c9dd383cd029467f1.tar.bz2 |
Use llvm::byteswap instead of ByteSwap_{16,32,64} (NFC)
Diffstat (limited to 'llvm/lib/Support/APInt.cpp')
-rw-r--r-- | llvm/lib/Support/APInt.cpp | 8 |
1 files changed, 4 insertions, 4 deletions
diff --git a/llvm/lib/Support/APInt.cpp b/llvm/lib/Support/APInt.cpp index dda7747..9e0d9064 100644 --- a/llvm/lib/Support/APInt.cpp +++ b/llvm/lib/Support/APInt.cpp @@ -707,18 +707,18 @@ bool APInt::isSubsetOfSlowCase(const APInt &RHS) const { APInt APInt::byteSwap() const { assert(BitWidth >= 16 && BitWidth % 8 == 0 && "Cannot byteswap!"); if (BitWidth == 16) - return APInt(BitWidth, ByteSwap_16(uint16_t(U.VAL))); + return APInt(BitWidth, llvm::byteswap<uint16_t>(U.VAL)); if (BitWidth == 32) - return APInt(BitWidth, ByteSwap_32(unsigned(U.VAL))); + return APInt(BitWidth, llvm::byteswap<uint32_t>(U.VAL)); if (BitWidth <= 64) { - uint64_t Tmp1 = ByteSwap_64(U.VAL); + uint64_t Tmp1 = llvm::byteswap<uint64_t>(U.VAL); Tmp1 >>= (64 - BitWidth); return APInt(BitWidth, Tmp1); } APInt Result(getNumWords() * APINT_BITS_PER_WORD, 0); for (unsigned I = 0, N = getNumWords(); I != N; ++I) - Result.U.pVal[I] = ByteSwap_64(U.pVal[N - I - 1]); + Result.U.pVal[I] = llvm::byteswap<uint64_t>(U.pVal[N - I - 1]); if (Result.BitWidth != BitWidth) { Result.lshrInPlace(Result.BitWidth - BitWidth); Result.BitWidth = BitWidth; |