mirror of
https://github.com/intel/llvm.git
synced 2026-01-22 23:49:22 +08:00
[ProfileData] Remove getHostEndianness (NFC)
With the recent redefinition of llvm::endianness::native, it is equal to either llvm::endianness::big or llvm::endianness::little depending on the host endianness. Since getHostEndianness just returns llvm::endianness::native, this patch removes the function and "constant propagates" llvm::endianness:native.
This commit is contained in:
@@ -949,10 +949,6 @@ void InstrProfRecord::reserveSites(uint32_t ValueKind, uint32_t NumValueSites) {
|
||||
getOrCreateValueSitesForKind(ValueKind).reserve(NumValueSites);
|
||||
}
|
||||
|
||||
inline support::endianness getHostEndianness() {
|
||||
return sys::IsLittleEndianHost ? support::little : support::big;
|
||||
}
|
||||
|
||||
// Include definitions for value profile data
|
||||
#define INSTR_PROF_VALUE_PROF_DATA
|
||||
#include "llvm/ProfileData/InstrProfData.inc"
|
||||
|
||||
@@ -413,10 +413,9 @@ private:
|
||||
}
|
||||
|
||||
support::endianness getDataEndianness() const {
|
||||
support::endianness HostEndian = getHostEndianness();
|
||||
if (!ShouldSwapBytes)
|
||||
return HostEndian;
|
||||
if (HostEndian == support::little)
|
||||
return llvm::endianness::native;
|
||||
if (llvm::endianness::native == llvm::endianness::little)
|
||||
return support::big;
|
||||
else
|
||||
return support::little;
|
||||
|
||||
@@ -989,7 +989,7 @@ void ValueProfRecord::swapBytes(support::endianness Old,
|
||||
if (Old == New)
|
||||
return;
|
||||
|
||||
if (getHostEndianness() != Old) {
|
||||
if (llvm::endianness::native != Old) {
|
||||
sys::swapByteOrder<uint32_t>(NumValueSites);
|
||||
sys::swapByteOrder<uint32_t>(Kind);
|
||||
}
|
||||
@@ -1001,7 +1001,7 @@ void ValueProfRecord::swapBytes(support::endianness Old,
|
||||
sys::swapByteOrder<uint64_t>(VD[I].Value);
|
||||
sys::swapByteOrder<uint64_t>(VD[I].Count);
|
||||
}
|
||||
if (getHostEndianness() == Old) {
|
||||
if (llvm::endianness::native == Old) {
|
||||
sys::swapByteOrder<uint32_t>(NumValueSites);
|
||||
sys::swapByteOrder<uint32_t>(Kind);
|
||||
}
|
||||
@@ -1086,7 +1086,7 @@ ValueProfData::getValueProfData(const unsigned char *D,
|
||||
void ValueProfData::swapBytesToHost(support::endianness Endianness) {
|
||||
using namespace support;
|
||||
|
||||
if (Endianness == getHostEndianness())
|
||||
if (Endianness == llvm::endianness::native)
|
||||
return;
|
||||
|
||||
sys::swapByteOrder<uint32_t>(TotalSize);
|
||||
@@ -1094,7 +1094,7 @@ void ValueProfData::swapBytesToHost(support::endianness Endianness) {
|
||||
|
||||
ValueProfRecord *VR = getFirstValueProfRecord(this);
|
||||
for (uint32_t K = 0; K < NumValueKinds; K++) {
|
||||
VR->swapBytes(Endianness, getHostEndianness());
|
||||
VR->swapBytes(Endianness, llvm::endianness::native);
|
||||
VR = getValueProfRecordNext(VR);
|
||||
}
|
||||
}
|
||||
@@ -1102,13 +1102,13 @@ void ValueProfData::swapBytesToHost(support::endianness Endianness) {
|
||||
void ValueProfData::swapBytesFromHost(support::endianness Endianness) {
|
||||
using namespace support;
|
||||
|
||||
if (Endianness == getHostEndianness())
|
||||
if (Endianness == llvm::endianness::native)
|
||||
return;
|
||||
|
||||
ValueProfRecord *VR = getFirstValueProfRecord(this);
|
||||
for (uint32_t K = 0; K < NumValueKinds; K++) {
|
||||
ValueProfRecord *NVR = getValueProfRecordNext(VR);
|
||||
VR->swapBytes(getHostEndianness(), Endianness);
|
||||
VR->swapBytes(llvm::endianness::native, Endianness);
|
||||
VR = NVR;
|
||||
}
|
||||
sys::swapByteOrder<uint32_t>(TotalSize);
|
||||
|
||||
Reference in New Issue
Block a user