diff options
| author | Rafael Espindola <rafael.espindola@gmail.com> | 2013-04-15 14:44:24 +0000 |
|---|---|---|
| committer | Rafael Espindola <rafael.espindola@gmail.com> | 2013-04-15 14:44:24 +0000 |
| commit | 41cb64f4fa9e9976508faf56a788178bc826e64a (patch) | |
| tree | ac92b1ecca7fc340c4c7439587066076e3a89ed4 /llvm/lib/ExecutionEngine/RuntimeDyld | |
| parent | cb45bc1861c3ebfec86fa7add7463a210839dd39 (diff) | |
| download | bcm5719-llvm-41cb64f4fa9e9976508faf56a788178bc826e64a.tar.gz bcm5719-llvm-41cb64f4fa9e9976508faf56a788178bc826e64a.zip | |
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.
llvm-svn: 179527
Diffstat (limited to 'llvm/lib/ExecutionEngine/RuntimeDyld')
| -rw-r--r-- | llvm/lib/ExecutionEngine/RuntimeDyld/RuntimeDyldImpl.h | 6 |
1 files changed, 3 insertions, 3 deletions
diff --git a/llvm/lib/ExecutionEngine/RuntimeDyld/RuntimeDyldImpl.h b/llvm/lib/ExecutionEngine/RuntimeDyld/RuntimeDyldImpl.h index f1009945775..555ea96943e 100644 --- a/llvm/lib/ExecutionEngine/RuntimeDyld/RuntimeDyldImpl.h +++ b/llvm/lib/ExecutionEngine/RuntimeDyld/RuntimeDyldImpl.h @@ -202,14 +202,14 @@ protected: void writeInt16BE(uint8_t *Addr, uint16_t Value) { - if (sys::isLittleEndianHost()) + if (sys::IsLittleEndianHost) Value = sys::SwapByteOrder(Value); *Addr = (Value >> 8) & 0xFF; *(Addr+1) = Value & 0xFF; } void writeInt32BE(uint8_t *Addr, uint32_t Value) { - if (sys::isLittleEndianHost()) + if (sys::IsLittleEndianHost) Value = sys::SwapByteOrder(Value); *Addr = (Value >> 24) & 0xFF; *(Addr+1) = (Value >> 16) & 0xFF; @@ -218,7 +218,7 @@ protected: } void writeInt64BE(uint8_t *Addr, uint64_t Value) { - if (sys::isLittleEndianHost()) + if (sys::IsLittleEndianHost) Value = sys::SwapByteOrder(Value); *Addr = (Value >> 56) & 0xFF; *(Addr+1) = (Value >> 48) & 0xFF; |

