forked from OSchip/llvm-project
WinCOFFObjectWriter.cpp: make write_uint32_le more efficient
llvm-svn: 218574
This commit is contained in:
parent
04e9d9ce64
commit
ba80b5d43c
|
@ -28,6 +28,7 @@
|
||||||
#include "llvm/MC/MCValue.h"
|
#include "llvm/MC/MCValue.h"
|
||||||
#include "llvm/Support/COFF.h"
|
#include "llvm/Support/COFF.h"
|
||||||
#include "llvm/Support/Debug.h"
|
#include "llvm/Support/Debug.h"
|
||||||
|
#include "llvm/Support/Endian.h"
|
||||||
#include "llvm/Support/ErrorHandling.h"
|
#include "llvm/Support/ErrorHandling.h"
|
||||||
#include "llvm/Support/TimeValue.h"
|
#include "llvm/Support/TimeValue.h"
|
||||||
#include <cstdio>
|
#include <cstdio>
|
||||||
|
@ -196,12 +197,9 @@ public:
|
||||||
};
|
};
|
||||||
}
|
}
|
||||||
|
|
||||||
static inline void write_uint32_le(void *Data, uint32_t const &Value) {
|
static inline void write_uint32_le(void *Data, uint32_t Value) {
|
||||||
uint8_t *Ptr = reinterpret_cast<uint8_t *>(Data);
|
support::endian::write<uint32_t, support::little, support::unaligned>(Data,
|
||||||
Ptr[0] = (Value & 0x000000FF) >> 0;
|
Value);
|
||||||
Ptr[1] = (Value & 0x0000FF00) >> 8;
|
|
||||||
Ptr[2] = (Value & 0x00FF0000) >> 16;
|
|
||||||
Ptr[3] = (Value & 0xFF000000) >> 24;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
//------------------------------------------------------------------------------
|
//------------------------------------------------------------------------------
|
||||||
|
|
Loading…
Reference in New Issue