diff options
author | Vedant Kumar <vsk@apple.com> | 2017-10-24 20:03:37 +0000 |
---|---|---|
committer | Vedant Kumar <vsk@apple.com> | 2017-10-24 20:03:37 +0000 |
commit | 8c07280f0e431d675da395b8b1652682e6a19b3f (patch) | |
tree | ae22ab5c94e63a51d718dc12bb3e8c4029021ec2 /llvm/tools | |
parent | 7b4eddf0eadec11db167cf594f4eff5697a967c6 (diff) | |
download | bcm5719-llvm-8c07280f0e431d675da395b8b1652682e6a19b3f.tar.gz bcm5719-llvm-8c07280f0e431d675da395b8b1652682e6a19b3f.zip |
[llvm-cov] Use a stable sort on sub-views
We need to use a stable sort on instantiation and expansion sub-views to
produce consistent output. Fortunately, we've gotten lucky and the tests
have checks for the stable order.
This is needed to unblock D39245. Once that lands, we'll have better
test coverage for sort non-determinism.
llvm-svn: 316490
Diffstat (limited to 'llvm/tools')
-rw-r--r-- | llvm/tools/llvm-cov/SourceCoverageView.cpp | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/llvm/tools/llvm-cov/SourceCoverageView.cpp b/llvm/tools/llvm-cov/SourceCoverageView.cpp index f2e8788fec8..31ab1325c7b 100644 --- a/llvm/tools/llvm-cov/SourceCoverageView.cpp +++ b/llvm/tools/llvm-cov/SourceCoverageView.cpp @@ -178,8 +178,8 @@ void SourceCoverageView::print(raw_ostream &OS, bool WholeFile, // We need the expansions and instantiations sorted so we can go through them // while we iterate lines. - std::sort(ExpansionSubViews.begin(), ExpansionSubViews.end()); - std::sort(InstantiationSubViews.begin(), InstantiationSubViews.end()); + std::stable_sort(ExpansionSubViews.begin(), ExpansionSubViews.end()); + std::stable_sort(InstantiationSubViews.begin(), InstantiationSubViews.end()); auto NextESV = ExpansionSubViews.begin(); auto EndESV = ExpansionSubViews.end(); auto NextISV = InstantiationSubViews.begin(); |