diff --git a/include/llvm/Bitcode/BitstreamReader.h b/include/llvm/Bitcode/BitstreamReader.h index ed1ecc385f0..abe21c7da97 100644 --- a/include/llvm/Bitcode/BitstreamReader.h +++ b/include/llvm/Bitcode/BitstreamReader.h @@ -334,12 +334,9 @@ public: return; } - // Handle big-endian byte-swapping if necessary. - support::detail::packed_endian_specific_integral< - word_t, support::little, support::unaligned> EndianValue; - memcpy(&EndianValue, Array, sizeof(Array)); - - CurWord = EndianValue; + CurWord = + support::endian::read( + Array); NextChar += BytesRead; BitsInCurWord = BytesRead * 8; }