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";
// 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();
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) {
// 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
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
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;
}
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}",
Libs.push_back(Name);
}
- std::stable_sort(Libs.begin(), Libs.end());
+ llvm::stable_sort(Libs);
for (const auto &L : Libs) {
outs() << " " << L << "\n";
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";
}
}
- std::stable_sort(Libs.begin(), Libs.end());
+ llvm::stable_sort(Libs);
for (const auto &L : Libs) {
outs() << " " << L << "\n";