diff --git a/lib/ProfileData/Coverage/CoverageMapping.cpp b/lib/ProfileData/Coverage/CoverageMapping.cpp index 8dbd58632f0..588a0807f0a 100644 --- a/lib/ProfileData/Coverage/CoverageMapping.cpp +++ b/lib/ProfileData/Coverage/CoverageMapping.cpp @@ -83,7 +83,7 @@ Counter CounterExpressionBuilder::simplify(Counter ExpressionTree) { return Counter::getZero(); // Group the terms by counter ID. - std::sort(Terms.begin(), Terms.end(), [](const Term &LHS, const Term &RHS) { + llvm::sort(Terms.begin(), Terms.end(), [](const Term &LHS, const Term &RHS) { return LHS.CounterID < RHS.CounterID; }); @@ -457,8 +457,8 @@ class SegmentBuilder { /// Sort a nested sequence of regions from a single file. static void sortNestedRegions(MutableArrayRef Regions) { - std::sort(Regions.begin(), Regions.end(), [](const CountedRegion &LHS, - const CountedRegion &RHS) { + llvm::sort(Regions.begin(), Regions.end(), [](const CountedRegion &LHS, + const CountedRegion &RHS) { if (LHS.startLoc() != RHS.startLoc()) return LHS.startLoc() < RHS.startLoc(); if (LHS.endLoc() != RHS.endLoc()) @@ -555,7 +555,7 @@ std::vector CoverageMapping::getUniqueSourceFiles() const { for (const auto &Function : getCoveredFunctions()) Filenames.insert(Filenames.end(), Function.Filenames.begin(), Function.Filenames.end()); - std::sort(Filenames.begin(), Filenames.end()); + llvm::sort(Filenames.begin(), Filenames.end()); auto Last = std::unique(Filenames.begin(), Filenames.end()); Filenames.erase(Last, Filenames.end()); return Filenames; diff --git a/lib/ProfileData/GCOV.cpp b/lib/ProfileData/GCOV.cpp index d6e44389f2b..6a94aa0de43 100644 --- a/lib/ProfileData/GCOV.cpp +++ b/lib/ProfileData/GCOV.cpp @@ -592,7 +592,7 @@ void FileInfo::print(raw_ostream &InfoOS, StringRef MainFilename, SmallVector Filenames; for (const auto &LI : LineInfo) Filenames.push_back(LI.first()); - std::sort(Filenames.begin(), Filenames.end()); + llvm::sort(Filenames.begin(), Filenames.end()); for (StringRef Filename : Filenames) { auto AllLines = LineConsumer(Filename); diff --git a/lib/ProfileData/ProfileSummaryBuilder.cpp b/lib/ProfileData/ProfileSummaryBuilder.cpp index a415a5cee23..62f00d693c6 100644 --- a/lib/ProfileData/ProfileSummaryBuilder.cpp +++ b/lib/ProfileData/ProfileSummaryBuilder.cpp @@ -58,7 +58,7 @@ void SampleProfileSummaryBuilder::addRecord( void ProfileSummaryBuilder::computeDetailedSummary() { if (DetailedSummaryCutoffs.empty()) return; - std::sort(DetailedSummaryCutoffs.begin(), DetailedSummaryCutoffs.end()); + llvm::sort(DetailedSummaryCutoffs.begin(), DetailedSummaryCutoffs.end()); auto Iter = CountFrequencies.begin(); const auto End = CountFrequencies.end();