]> granicus.if.org Git - llvm/commitdiff
Use endian::write32le instead of endian::write.
authorRui Ueyama <ruiu@google.com>
Tue, 14 Feb 2017 23:28:19 +0000 (23:28 +0000)
committerRui Ueyama <ruiu@google.com>
Tue, 14 Feb 2017 23:28:19 +0000 (23:28 +0000)
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@295120 91177308-0d34-0410-b5e6-96231b3b80d8

lib/MC/WinCOFFObjectWriter.cpp

index d364951f87e130854dd0eb25fbd9d931f6f27be4..7f626462e6e38f16b21a43382527a1d85e26f1e6 100644 (file)
@@ -48,6 +48,7 @@
 #include <vector>
 
 using namespace llvm;
+using llvm::support::endian::write32le;
 
 #define DEBUG_TYPE "WinCOFFObjectWriter"
 
@@ -204,11 +205,6 @@ public:
 
 } // end anonymous namespace
 
-static inline void write_uint32_le(void *Data, uint32_t Value) {
-  support::endian::write<uint32_t, support::little, support::unaligned>(Data,
-                                                                        Value);
-}
-
 //------------------------------------------------------------------------------
 // Symbol class implementation
 
@@ -216,8 +212,8 @@ static inline void write_uint32_le(void *Data, uint32_t Value) {
 // into the string table is stored in the last 4 bytes instead, leaving
 // the first 4 bytes as 0.
 void COFFSymbol::set_name_offset(uint32_t Offset) {
-  write_uint32_le(Data.Name + 0, 0);
-  write_uint32_le(Data.Name + 4, Offset);
+  write32le(Data.Name + 0, 0);
+  write32le(Data.Name + 4, Offset);
 }
 
 //------------------------------------------------------------------------------