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);
}
}