summaryrefslogtreecommitdiffstats
path: root/llvm/lib/ProfileData/CoverageMappingWriter.cpp
diff options
context:
space:
mode:
authorJustin Bogner <mail@justinbogner.com>2015-02-04 00:12:18 +0000
committerJustin Bogner <mail@justinbogner.com>2015-02-04 00:12:18 +0000
commit70e0c09e6c0d19d8eba4740d20bf58ae9274bc47 (patch)
tree0da5a8dc46a8fbc57d2712b2e1fc0140c081dfb6 /llvm/lib/ProfileData/CoverageMappingWriter.cpp
parent585316cb415d9104792ae1afb31eb8f3e1e35418 (diff)
downloadbcm5719-llvm-70e0c09e6c0d19d8eba4740d20bf58ae9274bc47.tar.gz
bcm5719-llvm-70e0c09e6c0d19d8eba4740d20bf58ae9274bc47.zip
InstrProf: Use a stable sort when reading coverage regions
Keeping regions that start at the same location in insertion order makes this logic easier to test / more deterministic. llvm-svn: 228083
Diffstat (limited to 'llvm/lib/ProfileData/CoverageMappingWriter.cpp')
-rw-r--r--llvm/lib/ProfileData/CoverageMappingWriter.cpp2
1 files changed, 1 insertions, 1 deletions
diff --git a/llvm/lib/ProfileData/CoverageMappingWriter.cpp b/llvm/lib/ProfileData/CoverageMappingWriter.cpp
index aef5511fc0e..d90d2f56515 100644
--- a/llvm/lib/ProfileData/CoverageMappingWriter.cpp
+++ b/llvm/lib/ProfileData/CoverageMappingWriter.cpp
@@ -109,7 +109,7 @@ static void writeCounter(ArrayRef<CounterExpression> Expressions, Counter C,
void CoverageMappingWriter::write(raw_ostream &OS) {
// Sort the regions in an ascending order by the file id and the starting
// location.
- std::sort(MappingRegions.begin(), MappingRegions.end());
+ std::stable_sort(MappingRegions.begin(), MappingRegions.end());
// Write out the fileid -> filename mapping.
encodeULEB128(VirtualFileMapping.size(), OS);
OpenPOWER on IntegriCloud