template <typename T> static T readBigEndian(T t) {
if (llvm::sys::IsLittleEndianHost)
- return SwapByteOrder(t);
+ return llvm::sys::getSwappedBytes(t);
return t;
}
if (cmd == LC_SEGMENT_64) {
const segment_command_64 *seg =
reinterpret_cast<const segment_command_64*>(lc);
- const unsigned sectionCount = (swap ? SwapByteOrder(seg->nsects)
+ const unsigned sectionCount = (swap ? llvm::sys::getSwappedBytes(seg->nsects)
: seg->nsects);
const section_64 *sects = reinterpret_cast<const section_64*>
(lc + sizeof(segment_command_64));
if (cmd == LC_SEGMENT) {
const segment_command *seg =
reinterpret_cast<const segment_command*>(lc);
- const unsigned sectionCount = (swap ? SwapByteOrder(seg->nsects)
+ const unsigned sectionCount = (swap ? llvm::sys::getSwappedBytes(seg->nsects)
: seg->nsects);
const section *sects = reinterpret_cast<const section*>
(lc + sizeof(segment_command));
for (const Section §ion : _file.sections) {
for (uint32_t index : section.indirectSymbols) {
if (_swap)
- *indirects++ = SwapByteOrder(index);
+ *indirects++ = llvm::sys::getSwappedBytes(index);
else
*indirects++ = index;
}
for (const Section *section : segInfo.sections) {
for (uint32_t index : section->indirectSymbols) {
if (_swap)
- *indirects++ = SwapByteOrder(index);
+ *indirects++ = llvm::sys::getSwappedBytes(index);
else
*indirects++ = index;
}