OSDN Git Service

Simplify code a bit. NFC.
authorRafael Espindola <rafael.espindola@gmail.com>
Thu, 13 Nov 2014 14:45:22 +0000 (14:45 +0000)
committerRafael Espindola <rafael.espindola@gmail.com>
Thu, 13 Nov 2014 14:45:22 +0000 (14:45 +0000)
Thanks to Sean Silva for the suggestion.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@221892 91177308-0d34-0410-b5e6-96231b3b80d8

include/llvm/Bitcode/BitstreamReader.h

index ed1ecc3..abe21c7 100644 (file)
@@ -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<word_t, support::little, support::unaligned>(
+            Array);
     NextChar += BytesRead;
     BitsInCurWord = BytesRead * 8;
   }