summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--llvm/tools/llvm-bcanalyzer/llvm-bcanalyzer.cpp2
-rw-r--r--llvm/tools/llvm-cov/SourceCoverageView.cpp4
-rw-r--r--llvm/tools/llvm-objcopy/ELF/Object.cpp12
-rw-r--r--llvm/tools/llvm-pdbutil/DumpOutputStyle.cpp16
-rw-r--r--llvm/tools/llvm-readobj/COFFDumper.cpp2
-rw-r--r--llvm/tools/llvm-readobj/ELFDumper.cpp2
-rw-r--r--llvm/tools/llvm-readobj/MachODumper.cpp2
7 files changed, 18 insertions, 22 deletions
diff --git a/llvm/tools/llvm-bcanalyzer/llvm-bcanalyzer.cpp b/llvm/tools/llvm-bcanalyzer/llvm-bcanalyzer.cpp
index 092dbd13675..9007ede938a 100644
--- a/llvm/tools/llvm-bcanalyzer/llvm-bcanalyzer.cpp
+++ b/llvm/tools/llvm-bcanalyzer/llvm-bcanalyzer.cpp
@@ -956,7 +956,7 @@ static int AnalyzeBitcode() {
for (unsigned i = 0, e = Stats.CodeFreq.size(); i != e; ++i)
if (unsigned Freq = Stats.CodeFreq[i].NumInstances)
FreqPairs.push_back(std::make_pair(Freq, i));
- std::stable_sort(FreqPairs.begin(), FreqPairs.end());
+ llvm::stable_sort(FreqPairs);
std::reverse(FreqPairs.begin(), FreqPairs.end());
outs() << "\tRecord Histogram:\n";
diff --git a/llvm/tools/llvm-cov/SourceCoverageView.cpp b/llvm/tools/llvm-cov/SourceCoverageView.cpp
index 4d4795fbe40..616f667e2c8 100644
--- a/llvm/tools/llvm-cov/SourceCoverageView.cpp
+++ b/llvm/tools/llvm-cov/SourceCoverageView.cpp
@@ -189,8 +189,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::stable_sort(ExpansionSubViews.begin(), ExpansionSubViews.end());
- std::stable_sort(InstantiationSubViews.begin(), InstantiationSubViews.end());
+ llvm::stable_sort(ExpansionSubViews);
+ llvm::stable_sort(InstantiationSubViews);
auto NextESV = ExpansionSubViews.begin();
auto EndESV = ExpansionSubViews.end();
auto NextISV = InstantiationSubViews.begin();
diff --git a/llvm/tools/llvm-objcopy/ELF/Object.cpp b/llvm/tools/llvm-objcopy/ELF/Object.cpp
index f5452ced8f9..3830f9273d9 100644
--- a/llvm/tools/llvm-objcopy/ELF/Object.cpp
+++ b/llvm/tools/llvm-objcopy/ELF/Object.cpp
@@ -1468,11 +1468,9 @@ Error Object::removeSymbols(function_ref<bool(const Symbol &)> ToRemove) {
void Object::sortSections() {
// Put all sections in offset order. Maintain the ordering as closely as
// possible while meeting that demand however.
- auto CompareSections = [](const SecPtr &A, const SecPtr &B) {
+ llvm::stable_sort(Sections, [](const SecPtr &A, const SecPtr &B) {
return A->OriginalOffset < B->OriginalOffset;
- };
- std::stable_sort(std::begin(this->Sections), std::end(this->Sections),
- CompareSections);
+ });
}
static uint64_t alignToAddr(uint64_t Offset, uint64_t Addr, uint64_t Align) {
@@ -1490,8 +1488,7 @@ static uint64_t alignToAddr(uint64_t Offset, uint64_t Addr, uint64_t Align) {
// Orders segments such that if x = y->ParentSegment then y comes before x.
static void orderSegments(std::vector<Segment *> &Segments) {
- std::stable_sort(std::begin(Segments), std::end(Segments),
- compareSegmentsByOffset);
+ llvm::stable_sort(Segments, compareSegmentsByOffset);
}
// This function finds a consistent layout for a list of segments starting from
@@ -1746,8 +1743,7 @@ Error BinaryWriter::finalize() {
for (Segment *Seg : OrderedSegments)
Seg->PAddr = Seg->VAddr;
- std::stable_sort(std::begin(OrderedSegments), std::end(OrderedSegments),
- compareSegmentsByPAddr);
+ llvm::stable_sort(OrderedSegments, compareSegmentsByPAddr);
// Because we add a ParentSegment for each section we might have duplicate
// segments in OrderedSegments. If there were duplicates then LayoutSegments
diff --git a/llvm/tools/llvm-pdbutil/DumpOutputStyle.cpp b/llvm/tools/llvm-pdbutil/DumpOutputStyle.cpp
index 28d93e8f7bb..4ad26bef20c 100644
--- a/llvm/tools/llvm-pdbutil/DumpOutputStyle.cpp
+++ b/llvm/tools/llvm-pdbutil/DumpOutputStyle.cpp
@@ -317,10 +317,10 @@ static inline std::string formatModuleDetailKind(SymbolKind K) {
std::vector<StatCollection::KindAndStat>
StatCollection::getStatsSortedBySize() const {
std::vector<KindAndStat> SortedStats(Individual.begin(), Individual.end());
- std::stable_sort(SortedStats.begin(), SortedStats.end(),
- [](const KindAndStat &LHS, const KindAndStat &RHS) {
- return LHS.second.Size > RHS.second.Size;
- });
+ llvm::stable_sort(SortedStats,
+ [](const KindAndStat &LHS, const KindAndStat &RHS) {
+ return LHS.second.Size > RHS.second.Size;
+ });
return SortedStats;
}
@@ -889,10 +889,10 @@ Error DumpOutputStyle::dumpUdtStats() {
std::vector<StrAndStat> NamespacedStatsSorted;
for (const auto &Stat : NamespacedStats)
NamespacedStatsSorted.push_back({Stat.getKey(), Stat.second});
- std::stable_sort(NamespacedStatsSorted.begin(), NamespacedStatsSorted.end(),
- [](const StrAndStat &L, const StrAndStat &R) {
- return L.Stat.Size > R.Stat.Size;
- });
+ llvm::stable_sort(NamespacedStatsSorted,
+ [](const StrAndStat &L, const StrAndStat &R) {
+ return L.Stat.Size > R.Stat.Size;
+ });
for (const auto &Stat : NamespacedStatsSorted) {
std::string Label = formatv("namespace '{0}'", Stat.Key);
P.formatLine("{0} | {1:N} {2:N}",
diff --git a/llvm/tools/llvm-readobj/COFFDumper.cpp b/llvm/tools/llvm-readobj/COFFDumper.cpp
index 0cf9a9d1fe6..59c0ab87ee5 100644
--- a/llvm/tools/llvm-readobj/COFFDumper.cpp
+++ b/llvm/tools/llvm-readobj/COFFDumper.cpp
@@ -1593,7 +1593,7 @@ void COFFDumper::printNeededLibraries() {
Libs.push_back(Name);
}
- std::stable_sort(Libs.begin(), Libs.end());
+ llvm::stable_sort(Libs);
for (const auto &L : Libs) {
outs() << " " << L << "\n";
diff --git a/llvm/tools/llvm-readobj/ELFDumper.cpp b/llvm/tools/llvm-readobj/ELFDumper.cpp
index addebf5c6d4..e102388c55d 100644
--- a/llvm/tools/llvm-readobj/ELFDumper.cpp
+++ b/llvm/tools/llvm-readobj/ELFDumper.cpp
@@ -1877,7 +1877,7 @@ void ELFDumper<ELFT>::printNeededLibraries() {
if (Entry.d_tag == ELF::DT_NEEDED)
Libs.push_back(getDynamicString(Entry.d_un.d_val));
- std::stable_sort(Libs.begin(), Libs.end());
+ llvm::stable_sort(Libs);
for (const auto &L : Libs)
W.startLine() << L << "\n";
diff --git a/llvm/tools/llvm-readobj/MachODumper.cpp b/llvm/tools/llvm-readobj/MachODumper.cpp
index bc9a72b6085..5e82f1c38f7 100644
--- a/llvm/tools/llvm-readobj/MachODumper.cpp
+++ b/llvm/tools/llvm-readobj/MachODumper.cpp
@@ -694,7 +694,7 @@ void MachODumper::printNeededLibraries() {
}
}
- std::stable_sort(Libs.begin(), Libs.end());
+ llvm::stable_sort(Libs);
for (const auto &L : Libs) {
outs() << " " << L << "\n";
OpenPOWER on IntegriCloud