[Coverage] Collect all function records in an object (D69471 followup)
authorVedant Kumar <vsk@apple.com>
Mon, 2 Mar 2020 19:37:19 +0000 (11:37 -0800)
committerVedant Kumar <vsk@apple.com>
Mon, 2 Mar 2020 20:01:09 +0000 (12:01 -0800)
commit80cd518b809ddb3caaf1dc59db3fbc6d1bcaf2e0
treed859f36ba583643e7255b12630447b4ff19a365f
parent375437ab92a879629cd6abef057428f3572514c2
[Coverage] Collect all function records in an object (D69471 followup)

After the format change from D69471, there can be more than one section
in an object that contains coverage function records. Look up each of
these sections and concatenate all the records together.

This re-enables the instrprof-merging.cpp test, which previously was
failing on OSes which use comdats.

Thanks to Jeremy Morse, who very kindly provided object files from the
bot I broke to help me debug.
compiler-rt/test/profile/instrprof-merging.cpp [moved from compiler-rt/test/profile/instrprof-merging.disabled with 100% similarity]
llvm/include/llvm/ProfileData/Coverage/CoverageMappingReader.h
llvm/lib/ProfileData/Coverage/CoverageMappingReader.cpp