diff options
author | Xinliang David Li <davidxl@google.com> | 2015-11-17 23:00:40 +0000 |
---|---|---|
committer | Xinliang David Li <davidxl@google.com> | 2015-11-17 23:00:40 +0000 |
commit | 99556877aec2c39fbdf1c62a2caba5b7fccff613 (patch) | |
tree | 58d20e948e92ebaccb75539050afc8c573100724 /llvm/lib | |
parent | 4689ef59436d586622c2f07c525919658e350892 (diff) | |
download | bcm5719-llvm-99556877aec2c39fbdf1c62a2caba5b7fccff613.tar.gz bcm5719-llvm-99556877aec2c39fbdf1c62a2caba5b7fccff613.zip |
[PGO] Move value profile data definitions out of IndexedInstrProf
Move the data structure defintions out of the namespace. The defs will
be shared by raw format. [NFC]
llvm-svn: 253394
Diffstat (limited to 'llvm/lib')
-rw-r--r-- | llvm/lib/ProfileData/InstrProf.cpp | 7 | ||||
-rw-r--r-- | llvm/lib/ProfileData/InstrProfReader.cpp | 5 | ||||
-rw-r--r-- | llvm/lib/ProfileData/InstrProfWriter.cpp | 6 |
3 files changed, 7 insertions, 11 deletions
diff --git a/llvm/lib/ProfileData/InstrProf.cpp b/llvm/lib/ProfileData/InstrProf.cpp index 2dd0f916c6d..fc7fc8aa1e2 100644 --- a/llvm/lib/ProfileData/InstrProf.cpp +++ b/llvm/lib/ProfileData/InstrProf.cpp @@ -131,8 +131,6 @@ GlobalVariable *createPGOFuncNameVar(Function &F, StringRef FuncName) { return createPGOFuncNameVar(*F.getParent(), F.getLinkage(), FuncName); } -namespace IndexedInstrProf { - uint32_t ValueProfRecord::getHeaderSize(uint32_t NumValueSites) { uint32_t Size = offsetof(ValueProfRecord, SiteCountArray) + sizeof(uint8_t) * NumValueSites; @@ -174,7 +172,8 @@ void ValueProfRecord::serializeFrom(const InstrProfRecord &Record, DstVD[I] = SrcVD[I]; switch (ValueKind) { case IPVK_IndirectCallTarget: - DstVD[I].Value = ComputeHash(HashType, (const char *)DstVD[I].Value); + DstVD[I].Value = IndexedInstrProf::ComputeHash( + IndexedInstrProf::HashType, (const char *)DstVD[I].Value); break; default: llvm_unreachable("value kind not handled !"); @@ -361,6 +360,4 @@ InstrProfValueData *ValueProfRecord::getValueData() { return reinterpret_cast<InstrProfValueData *>((char *)this + getHeaderSize(NumValueSites)); } - -} // End of IndexedInstrProf namespace. } diff --git a/llvm/lib/ProfileData/InstrProfReader.cpp b/llvm/lib/ProfileData/InstrProfReader.cpp index 6f201243736..479b6bc61d9 100644 --- a/llvm/lib/ProfileData/InstrProfReader.cpp +++ b/llvm/lib/ProfileData/InstrProfReader.cpp @@ -313,9 +313,8 @@ typedef InstrProfLookupTrait::offset_type offset_type; bool InstrProfLookupTrait::ReadValueProfilingData( const unsigned char *&D, const unsigned char *const End) { - ErrorOr<std::unique_ptr<IndexedInstrProf::ValueProfData>> VDataPtrOrErr = - IndexedInstrProf::ValueProfData::getValueProfData( - D, End, ValueProfDataEndianness); + ErrorOr<std::unique_ptr<ValueProfData>> VDataPtrOrErr = + ValueProfData::getValueProfData(D, End, ValueProfDataEndianness); if (VDataPtrOrErr.getError()) return false; diff --git a/llvm/lib/ProfileData/InstrProfWriter.cpp b/llvm/lib/ProfileData/InstrProfWriter.cpp index b6725df5278..cb123e29982 100644 --- a/llvm/lib/ProfileData/InstrProfWriter.cpp +++ b/llvm/lib/ProfileData/InstrProfWriter.cpp @@ -53,7 +53,7 @@ public: M += ProfRecord.Counts.size() * sizeof(uint64_t); // Value data - M += IndexedInstrProf::ValueProfData::getSize(ProfileData.second); + M += ValueProfData::getSize(ProfileData.second); } LE.write<offset_type>(M); @@ -77,8 +77,8 @@ public: LE.write<uint64_t>(I); // Write value data - std::unique_ptr<IndexedInstrProf::ValueProfData> VDataPtr = - IndexedInstrProf::ValueProfData::serializeFrom(ProfileData.second); + std::unique_ptr<ValueProfData> VDataPtr = + ValueProfData::serializeFrom(ProfileData.second); uint32_t S = VDataPtr->getSize(); VDataPtr->swapBytesFromHost(ValueProfDataEndianness); Out.write((const char *)VDataPtr.get(), S); |