Use endian::write32le instead of endian::write.

llvm-svn: 295120
This commit is contained in:
Rui Ueyama 2017-02-14 23:28:19 +00:00
parent cbb4e7c1fb
commit 86e3ef92f3

View File

@ -48,6 +48,7 @@
#include <vector> #include <vector>
using namespace llvm; using namespace llvm;
using llvm::support::endian::write32le;
#define DEBUG_TYPE "WinCOFFObjectWriter" #define DEBUG_TYPE "WinCOFFObjectWriter"
@ -204,11 +205,6 @@ public:
} // end anonymous namespace } // 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 // 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 // into the string table is stored in the last 4 bytes instead, leaving
// the first 4 bytes as 0. // the first 4 bytes as 0.
void COFFSymbol::set_name_offset(uint32_t Offset) { void COFFSymbol::set_name_offset(uint32_t Offset) {
write_uint32_le(Data.Name + 0, 0); write32le(Data.Name + 0, 0);
write_uint32_le(Data.Name + 4, Offset); write32le(Data.Name + 4, Offset);
} }
//------------------------------------------------------------------------------ //------------------------------------------------------------------------------