[llvm] [nfc][InstrFDO]Encapsulate header writes in a class member function (PR #90142)
Mingming Liu via llvm-commits
llvm-commits at lists.llvm.org
Fri May 17 11:51:52 PDT 2024
================
@@ -763,16 +771,25 @@ Error InstrProfWriter::writeImpl(ProfOStream &OS) {
}
InfoObj->CSSummaryBuilder = nullptr;
+ const size_t MemProfOffset =
+ BackPatchStartOffset + sizeof(IndexedInstrProf::Header::HashOffset);
+ const size_t BinaryIdOffset =
+ MemProfOffset + sizeof(IndexedInstrProf::Header::MemProfOffset);
+ const size_t TemporalProfTracesOffset =
+ BinaryIdOffset + sizeof(IndexedInstrProf::Header::BinaryIdOffset);
+ const size_t VTableNamesOffset =
+ TemporalProfTracesOffset +
+ sizeof(IndexedInstrProf::Header::TemporalProfTracesOffset);
if (!WritePrevVersion) {
// Now do the final patch:
PatchItem PatchItems[] = {
// Patch the Header.HashOffset field.
- {HashTableStartFieldOffset, &HashTableStart, 1},
+ {BackPatchStartOffset, &HashTableStart, 1},
----------------
minglotus-6 wrote:
I updated the code to use `sizeof(uint64_t)`
https://github.com/llvm/llvm-project/pull/90142
More information about the llvm-commits
mailing list