This patch groups the three Memprof data structures into a struct
named IndexedMemProfData and teaches InstrProfWriter to use it. This
way, we can pass IndexedMemProfData to writeMemProf and its helpers
instead of individual data structures.
As a follow-up, we can use the new struct in MemProfReader also. That
in turn allows loadInput in llvm-profdata to move the MemProf data
into the writer context, saving a few seconds for a large MemProf
profile.
This patch groups the three Memprof data structures into a struct named IndexedMemProfData and teaches InstrProfWriter to use it. This way, we can pass IndexedMemProfData to writeMemProf and its helpers instead of individual data structures.
As a follow-up, we can use the new struct in MemProfReader also. That in turn allows loadInput in llvm-profdata to move the MemProf data into the writer context, saving a few seconds for a large MemProf profile.