mirror of
https://github.com/c64scene-ar/llvm-6502.git
synced 2024-12-13 04:30:23 +00:00
Bitcode/BitstreamReader.h: Tweak for big endian hosts.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@149980 91177308-0d34-0410-b5e6-96231b3b80d8
This commit is contained in:
parent
e26cdbe1c7
commit
b0b527b62c
@ -17,6 +17,7 @@
|
||||
|
||||
#include "llvm/ADT/OwningPtr.h"
|
||||
#include "llvm/Bitcode/BitCodes.h"
|
||||
#include "llvm/Support/Endian.h"
|
||||
#include "llvm/Support/StreamableMemoryObject.h"
|
||||
#include <climits>
|
||||
#include <string>
|
||||
@ -242,12 +243,13 @@ public:
|
||||
}
|
||||
|
||||
uint32_t getWord(size_t pos) {
|
||||
uint32_t word = -1;
|
||||
uint8_t buf[sizeof(uint32_t)];
|
||||
memset(buf, 0xFF, sizeof(buf));
|
||||
BitStream->getBitcodeBytes().readBytes(pos,
|
||||
sizeof(word),
|
||||
reinterpret_cast<uint8_t *>(&word),
|
||||
sizeof(buf),
|
||||
buf,
|
||||
NULL);
|
||||
return word;
|
||||
return *reinterpret_cast<support::ulittle32_t *>(buf);
|
||||
}
|
||||
|
||||
bool AtEndOfStream() {
|
||||
|
Loading…
Reference in New Issue
Block a user