Left two files out of the previous commit
authorArtyom Skrobov <Artyom.Skrobov@arm.com>
Sat, 14 Jun 2014 12:40:04 +0000 (12:40 +0000)
committerArtyom Skrobov <Artyom.Skrobov@arm.com>
Sat, 14 Jun 2014 12:40:04 +0000 (12:40 +0000)
llvm-svn: 210975

lld/lib/ReaderWriter/MachO/MachONormalizedFileBinaryReader.cpp
lld/lib/ReaderWriter/MachO/MachONormalizedFileBinaryWriter.cpp

index 2ca3442..16d235d 100644 (file)
@@ -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));
index f96a9f2..a593f07 100644 (file)
@@ -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;
         }