[Bitcode] Replace hand-coded little endian handling with Endian.h functions.
[oota-llvm.git] / lib / Bitcode / Writer / BitcodeWriter.cpp
index 6da329d3b2316dd1cf174b4ef17fb42dc1ba67da..e79eeb079ed886aadd04931e394551384782f30d 100644 (file)
@@ -2406,10 +2406,7 @@ enum {
 
 static void WriteInt32ToBuffer(uint32_t Value, SmallVectorImpl<char> &Buffer,
                                uint32_t &Position) {
-  Buffer[Position + 0] = (unsigned char) (Value >>  0);
-  Buffer[Position + 1] = (unsigned char) (Value >>  8);
-  Buffer[Position + 2] = (unsigned char) (Value >> 16);
-  Buffer[Position + 3] = (unsigned char) (Value >> 24);
+  support::endian::write32le(&Buffer[Position], Value);
   Position += 4;
 }