diff options
author | Xinliang David Li <davidxl@google.com> | 2016-01-22 19:53:31 +0000 |
---|---|---|
committer | Xinliang David Li <davidxl@google.com> | 2016-01-22 19:53:31 +0000 |
commit | 46ad363ba4a55efe6346e2de3a97fd90cdf5108a (patch) | |
tree | b0218e5e2cb58297d351fc36c3b9f3b73e7b9d42 /llvm/lib/ProfileData | |
parent | 0b783ef076baa4e144ad253be07206ef2147c915 (diff) | |
download | bcm5719-llvm-46ad363ba4a55efe6346e2de3a97fd90cdf5108a.tar.gz bcm5719-llvm-46ad363ba4a55efe6346e2de3a97fd90cdf5108a.zip |
Revert 258486 -- for a better fix coming soon
llvm-svn: 258538
Diffstat (limited to 'llvm/lib/ProfileData')
-rw-r--r-- | llvm/lib/ProfileData/InstrProfWriter.cpp | 17 |
1 files changed, 7 insertions, 10 deletions
diff --git a/llvm/lib/ProfileData/InstrProfWriter.cpp b/llvm/lib/ProfileData/InstrProfWriter.cpp index 7945469268c..4c7f5de26aa 100644 --- a/llvm/lib/ProfileData/InstrProfWriter.cpp +++ b/llvm/lib/ProfileData/InstrProfWriter.cpp @@ -14,16 +14,12 @@ #include "llvm/ProfileData/InstrProfWriter.h" #include "llvm/ADT/StringExtras.h" -#include "llvm/Support/CommandLine.h" #include "llvm/Support/EndianStream.h" #include "llvm/Support/OnDiskHashTable.h" #include <tuple> using namespace llvm; -static cl::opt<bool> WriteVPInBE("write-vp-data-in-big", cl::ReallyHidden, - cl::init(false)); - // A struct to define how the data stream should be patched. For Indexed // profiling, only uint64_t data type is needed. struct PatchItem { @@ -78,6 +74,8 @@ public: } namespace { +static support::endianness ValueProfDataEndianness = support::little; + class InstrProfRecordTrait { public: typedef StringRef key_type; @@ -136,18 +134,17 @@ public: std::unique_ptr<ValueProfData> VDataPtr = ValueProfData::serializeFrom(ProfileData.second); uint32_t S = VDataPtr->getSize(); - VDataPtr->swapBytesFromHost( - InstrProfWriter::getValueProfDataEndianness()); + VDataPtr->swapBytesFromHost(ValueProfDataEndianness); Out.write((const char *)VDataPtr.get(), S); } } }; } -support::endianness InstrProfWriter::getValueProfDataEndianness() { - if (WriteVPInBE) - return support::big; - return support::little; +// Internal interface for testing purpose only. +void InstrProfWriter::setValueProfDataEndianness( + support::endianness Endianness) { + ValueProfDataEndianness = Endianness; } std::error_code InstrProfWriter::addRecord(InstrProfRecord &&I, |