mirror of
https://github.com/c64scene-ar/llvm-6502.git
synced 2025-06-16 12:24:03 +00:00
Make the host endianness check an integer constant expression.
I will remove the isBigEndianHost function once I update clang. The ifdef logic is designed to * not use configure/cmake to avoid breaking -arch i686 -arch ppc. * default to little endian * be as small as possible It looks like sys/endian.h is the preferred header on most modern BSD systems, but it is better to change this in a followup patch as machine/endian.h is available on FreeBSD, OpenBSD, NetBSD and OS X. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@179527 91177308-0d34-0410-b5e6-96231b3b80d8
This commit is contained in:
@ -101,7 +101,7 @@ void FoldingSetNodeID::AddString(StringRef String) {
|
||||
// Otherwise do it the hard way.
|
||||
// To be compatible with above bulk transfer, we need to take endianness
|
||||
// into account.
|
||||
if (sys::isBigEndianHost()) {
|
||||
if (sys::IsBigEndianHost) {
|
||||
for (Pos += 4; Pos <= Size; Pos += 4) {
|
||||
unsigned V = ((unsigned char)String[Pos - 4] << 24) |
|
||||
((unsigned char)String[Pos - 3] << 16) |
|
||||
@ -110,7 +110,7 @@ void FoldingSetNodeID::AddString(StringRef String) {
|
||||
Bits.push_back(V);
|
||||
}
|
||||
} else {
|
||||
assert(sys::isLittleEndianHost() && "Unexpected host endianness");
|
||||
assert(sys::IsLittleEndianHost && "Unexpected host endianness");
|
||||
for (Pos += 4; Pos <= Size; Pos += 4) {
|
||||
unsigned V = ((unsigned char)String[Pos - 1] << 24) |
|
||||
((unsigned char)String[Pos - 2] << 16) |
|
||||
|
Reference in New Issue
Block a user