[Coverage] Make sorting criteria for CounterMappingRegions local.
authorIgor Kudrin <ikudrin.dev@gmail.com>
Wed, 31 Aug 2016 07:01:17 +0000 (07:01 +0000)
committerIgor Kudrin <ikudrin.dev@gmail.com>
Wed, 31 Aug 2016 07:01:17 +0000 (07:01 +0000)
commitf3c8a9cfbba46ba2a4024794da38343af4dcb7ea
tree655a815760043009424e2eb7aaf37d0fa277bbf1
parenta815f488d5f6e878cc90736b2b5f4df59f0ec4aa
[Coverage] Make sorting criteria for CounterMappingRegions local.

Move the comparison function into the only place there it is used,
i.e. the call to std::stable_sort in CoverageMappingWriter::write().

Add sorting by region kinds as it is required to ensure stable order
in our tests and to simplify D23987.

Differential Revision: https://reviews.llvm.org/D24034

llvm-svn: 280198
llvm/include/llvm/ProfileData/Coverage/CoverageMapping.h
llvm/lib/ProfileData/Coverage/CoverageMappingWriter.cpp