From 9bb92cb53742195f318dc230e5e306b5bbb9f9d6 Mon Sep 17 00:00:00 2001 From: Artyom Skrobov Date: Sat, 14 Jun 2014 11:36:01 +0000 Subject: Renaming SwapByteOrder() to getSwappedBytes() The next commit will add swapByteOrder(), acting in-place git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@210973 91177308-0d34-0410-b5e6-96231b3b80d8 --- lib/ExecutionEngine/RuntimeDyld/RuntimeDyldImpl.h | 6 +++--- lib/MC/ELFObjectWriter.cpp | 2 +- lib/Object/MachOObjectFile.cpp | 2 +- lib/Object/MachOUniversal.cpp | 2 +- lib/ProfileData/InstrProfReader.cpp | 2 +- lib/Support/DataExtractor.cpp | 2 +- 6 files changed, 8 insertions(+), 8 deletions(-) (limited to 'lib') diff --git a/lib/ExecutionEngine/RuntimeDyld/RuntimeDyldImpl.h b/lib/ExecutionEngine/RuntimeDyld/RuntimeDyldImpl.h index 4c7f0b52c7..3e9a68a2a3 100644 --- a/lib/ExecutionEngine/RuntimeDyld/RuntimeDyldImpl.h +++ b/lib/ExecutionEngine/RuntimeDyld/RuntimeDyldImpl.h @@ -245,14 +245,14 @@ protected: void writeInt16BE(uint8_t *Addr, uint16_t Value) { if (IsTargetLittleEndian) - Value = sys::SwapByteOrder(Value); + Value = sys::getSwappedBytes(Value); *Addr = (Value >> 8) & 0xFF; *(Addr + 1) = Value & 0xFF; } void writeInt32BE(uint8_t *Addr, uint32_t Value) { if (IsTargetLittleEndian) - Value = sys::SwapByteOrder(Value); + Value = sys::getSwappedBytes(Value); *Addr = (Value >> 24) & 0xFF; *(Addr + 1) = (Value >> 16) & 0xFF; *(Addr + 2) = (Value >> 8) & 0xFF; @@ -261,7 +261,7 @@ protected: void writeInt64BE(uint8_t *Addr, uint64_t Value) { if (IsTargetLittleEndian) - Value = sys::SwapByteOrder(Value); + Value = sys::getSwappedBytes(Value); *Addr = (Value >> 56) & 0xFF; *(Addr + 1) = (Value >> 48) & 0xFF; *(Addr + 2) = (Value >> 40) & 0xFF; diff --git a/lib/MC/ELFObjectWriter.cpp b/lib/MC/ELFObjectWriter.cpp index 0a54627f8c..0a17c33f7f 100644 --- a/lib/MC/ELFObjectWriter.cpp +++ b/lib/MC/ELFObjectWriter.cpp @@ -1179,7 +1179,7 @@ prependCompressionHeader(uint64_t Size, if (Size <= Magic.size() + sizeof(Size) + CompressedContents.size()) return false; if (sys::IsLittleEndianHost) - Size = sys::SwapByteOrder(Size); + Size = sys::getSwappedBytes(Size); CompressedContents.insert(CompressedContents.begin(), Magic.size() + sizeof(Size), 0); std::copy(Magic.begin(), Magic.end(), CompressedContents.begin()); diff --git a/lib/Object/MachOObjectFile.cpp b/lib/Object/MachOObjectFile.cpp index e61422885b..18f5cc057a 100644 --- a/lib/Object/MachOObjectFile.cpp +++ b/lib/Object/MachOObjectFile.cpp @@ -45,7 +45,7 @@ struct section_base { template static void SwapValue(T &Value) { - Value = sys::SwapByteOrder(Value); + Value = sys::getSwappedBytes(Value); } template diff --git a/lib/Object/MachOUniversal.cpp b/lib/Object/MachOUniversal.cpp index ea4773feee..f34a3b452f 100644 --- a/lib/Object/MachOUniversal.cpp +++ b/lib/Object/MachOUniversal.cpp @@ -24,7 +24,7 @@ using namespace object; template static void SwapValue(T &Value) { - Value = sys::SwapByteOrder(Value); + Value = sys::getSwappedBytes(Value); } template diff --git a/lib/ProfileData/InstrProfReader.cpp b/lib/ProfileData/InstrProfReader.cpp index c7809b8b8c..d0493d34c2 100644 --- a/lib/ProfileData/InstrProfReader.cpp +++ b/lib/ProfileData/InstrProfReader.cpp @@ -158,7 +158,7 @@ bool RawInstrProfReader::hasFormat(const MemoryBuffer &DataBuffer) { uint64_t Magic = *reinterpret_cast(DataBuffer.getBufferStart()); return getRawMagic() == Magic || - sys::SwapByteOrder(getRawMagic()) == Magic; + sys::getSwappedBytes(getRawMagic()) == Magic; } template diff --git a/lib/Support/DataExtractor.cpp b/lib/Support/DataExtractor.cpp index 7b829215d2..c320554b63 100644 --- a/lib/Support/DataExtractor.cpp +++ b/lib/Support/DataExtractor.cpp @@ -21,7 +21,7 @@ static T getU(uint32_t *offset_ptr, const DataExtractor *de, if (de->isValidOffsetForDataOfSize(offset, sizeof(val))) { std::memcpy(&val, &Data[offset], sizeof(val)); if (sys::IsLittleEndianHost != isLittleEndian) - val = sys::SwapByteOrder(val); + val = sys::getSwappedBytes(val); // Advance the offset *offset_ptr += sizeof(val); -- cgit v1.2.3