[llvm] r221892 - Simplify code a bit. NFC.

Rafael Espindola rafael.espindola at gmail.com
Thu Nov 13 06:45:22 PST 2014


Author: rafael
Date: Thu Nov 13 08:45:22 2014
New Revision: 221892

URL: http://llvm.org/viewvc/llvm-project?rev=221892&view=rev
Log:
Simplify code a bit. NFC.

Thanks to Sean Silva for the suggestion.

Modified:
    llvm/trunk/include/llvm/Bitcode/BitstreamReader.h

Modified: llvm/trunk/include/llvm/Bitcode/BitstreamReader.h
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/include/llvm/Bitcode/BitstreamReader.h?rev=221892&r1=221891&r2=221892&view=diff
==============================================================================
--- llvm/trunk/include/llvm/Bitcode/BitstreamReader.h (original)
+++ llvm/trunk/include/llvm/Bitcode/BitstreamReader.h Thu Nov 13 08:45:22 2014
@@ -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;
   }





More information about the llvm-commits mailing list