mirror of
https://github.com/c64scene-ar/llvm-6502.git
synced 2025-06-21 02:24:22 +00:00
ok, ok, stop fighting type punning warnings by just using a union.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@174827 91177308-0d34-0410-b5e6-96231b3b80d8
This commit is contained in:
@ -364,13 +364,16 @@ public:
|
|||||||
uint32_t R = uint32_t(CurWord);
|
uint32_t R = uint32_t(CurWord);
|
||||||
|
|
||||||
// Read the next word from the stream.
|
// Read the next word from the stream.
|
||||||
char buf[sizeof(word_t)] = {0};
|
union {
|
||||||
BitStream->getBitcodeBytes().readBytes(NextChar, sizeof(buf),
|
uint8_t ArrayMember[sizeof(word_t)];
|
||||||
(uint8_t*)buf, NULL);
|
support::detail::packed_endian_specific_integral
|
||||||
|
<word_t, support::little, support::unaligned> EndianMember;
|
||||||
|
} buf = { { 0 } };
|
||||||
|
|
||||||
typedef support::detail::packed_endian_specific_integral
|
BitStream->getBitcodeBytes().readBytes(NextChar, sizeof(buf),
|
||||||
<word_t, support::little, support::unaligned> Endian_T;
|
buf.ArrayMember, NULL);
|
||||||
CurWord = *(Endian_T*)buf;
|
// Handle big-endian byte-swapping if necessary.
|
||||||
|
CurWord = buf.EndianMember;
|
||||||
|
|
||||||
NextChar += sizeof(word_t);
|
NextChar += sizeof(word_t);
|
||||||
|
|
||||||
|
Reference in New Issue
Block a user