mirror of
https://github.com/c64scene-ar/llvm-6502.git
synced 2025-03-13 08:35:46 +00:00
WinCOFFObjectWriter.cpp: make write_uint32_le more efficient
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@218574 91177308-0d34-0410-b5e6-96231b3b80d8
This commit is contained in:
parent
aada52189e
commit
e05d3b921f
@ -28,6 +28,7 @@
|
||||
#include "llvm/MC/MCValue.h"
|
||||
#include "llvm/Support/COFF.h"
|
||||
#include "llvm/Support/Debug.h"
|
||||
#include "llvm/Support/Endian.h"
|
||||
#include "llvm/Support/ErrorHandling.h"
|
||||
#include "llvm/Support/TimeValue.h"
|
||||
#include <cstdio>
|
||||
@ -196,12 +197,9 @@ public:
|
||||
};
|
||||
}
|
||||
|
||||
static inline void write_uint32_le(void *Data, uint32_t const &Value) {
|
||||
uint8_t *Ptr = reinterpret_cast<uint8_t *>(Data);
|
||||
Ptr[0] = (Value & 0x000000FF) >> 0;
|
||||
Ptr[1] = (Value & 0x0000FF00) >> 8;
|
||||
Ptr[2] = (Value & 0x00FF0000) >> 16;
|
||||
Ptr[3] = (Value & 0xFF000000) >> 24;
|
||||
static inline void write_uint32_le(void *Data, uint32_t Value) {
|
||||
support::endian::write<uint32_t, support::little, support::unaligned>(Data,
|
||||
Value);
|
||||
}
|
||||
|
||||
//------------------------------------------------------------------------------
|
||||
|
Loading…
x
Reference in New Issue
Block a user