Skip to content

Commit

Permalink
[COFF] Fix endianness of .llvm.call-graph-profile section data
Browse files Browse the repository at this point in the history
  • Loading branch information
ZequanWu committed Jul 12, 2020
1 parent d1bcddb commit 77272d1
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions llvm/lib/MC/WinCOFFObjectWriter.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -1116,9 +1116,9 @@ uint64_t WinCOFFObjectWriter::writeObject(MCAssembler &Asm,
for (const MCAssembler::CGProfileEntry &CGPE : Asm.CGProfile) {
uint32_t FromIndex = CGPE.From->getSymbol().getIndex();
uint32_t ToIndex = CGPE.To->getSymbol().getIndex();
OS.write((const char *)&FromIndex, sizeof(uint32_t));
OS.write((const char *)&ToIndex, sizeof(uint32_t));
OS.write((const char *)&CGPE.Count, sizeof(uint64_t));
support::endian::write(OS, FromIndex, W.Endian);
support::endian::write(OS, ToIndex, W.Endian);
support::endian::write(OS, CGPE.Count, W.Endian);
}
}

Expand Down

0 comments on commit 77272d1

Please sign in to comment.