summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--lld/lib/ReaderWriter/MachO/MachONormalizedFileBinaryReader.cpp6
-rw-r--r--lld/lib/ReaderWriter/MachO/MachONormalizedFileBinaryWriter.cpp4
2 files changed, 5 insertions, 5 deletions
diff --git a/lld/lib/ReaderWriter/MachO/MachONormalizedFileBinaryReader.cpp b/lld/lib/ReaderWriter/MachO/MachONormalizedFileBinaryReader.cpp
index 2ca3442a5fd..16d235da2f8 100644
--- a/lld/lib/ReaderWriter/MachO/MachONormalizedFileBinaryReader.cpp
+++ b/lld/lib/ReaderWriter/MachO/MachONormalizedFileBinaryReader.cpp
@@ -107,7 +107,7 @@ appendIndirectSymbols(IndirectSymbols &isyms, StringRef buffer, bool swap,
template <typename T> static T readBigEndian(T t) {
if (llvm::sys::IsLittleEndianHost)
- return SwapByteOrder(t);
+ return llvm::sys::getSwappedBytes(t);
return t;
}
@@ -223,7 +223,7 @@ readBinary(std::unique_ptr<MemoryBuffer> &mb,
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));
@@ -265,7 +265,7 @@ readBinary(std::unique_ptr<MemoryBuffer> &mb,
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));
diff --git a/lld/lib/ReaderWriter/MachO/MachONormalizedFileBinaryWriter.cpp b/lld/lib/ReaderWriter/MachO/MachONormalizedFileBinaryWriter.cpp
index f96a9f29a2c..a593f07619e 100644
--- a/lld/lib/ReaderWriter/MachO/MachONormalizedFileBinaryWriter.cpp
+++ b/lld/lib/ReaderWriter/MachO/MachONormalizedFileBinaryWriter.cpp
@@ -787,7 +787,7 @@ void MachOFileLayout::writeSymbolTable() {
for (const Section &section : _file.sections) {
for (uint32_t index : section.indirectSymbols) {
if (_swap)
- *indirects++ = SwapByteOrder(index);
+ *indirects++ = llvm::sys::getSwappedBytes(index);
else
*indirects++ = index;
}
@@ -799,7 +799,7 @@ void MachOFileLayout::writeSymbolTable() {
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;
}
OpenPOWER on IntegriCloud