for (const auto &E : Pool)
Entries.push_back(&E);
- llvm::sort(
- Entries.begin(), Entries.end(),
- [](const StringMapEntry<EntryTy> *A, const StringMapEntry<EntryTy> *B) {
- return A->getValue().Offset < B->getValue().Offset;
- });
+ llvm::sort(Entries, [](const StringMapEntry<EntryTy> *A,
+ const StringMapEntry<EntryTy> *B) {
+ return A->getValue().Offset < B->getValue().Offset;
+ });
for (const auto &Entry : Entries) {
assert(ShouldCreateSymbols == static_cast<bool>(Entry->getValue().Symbol) &&
// sort the vector to print analysis in alphabatic order of function name.
llvm::sort(
- FPRMPairVector.begin(), FPRMPairVector.end(),
+ FPRMPairVector,
[](const FuncPtrRegMaskPair *A, const FuncPtrRegMaskPair *B) -> bool {
return A->first->getName() < B->first->getName();
});
write(Len);
write(Number);
- llvm::sort(
- SortedLinesByFile.begin(), SortedLinesByFile.end(),
- [](StringMapEntry<GCOVLines> *LHS, StringMapEntry<GCOVLines> *RHS) {
- return LHS->getKey() < RHS->getKey();
- });
+ llvm::sort(SortedLinesByFile, [](StringMapEntry<GCOVLines> *LHS,
+ StringMapEntry<GCOVLines> *RHS) {
+ return LHS->getKey() < RHS->getKey();
+ });
for (auto &I : SortedLinesByFile)
I->getValue().writeOut();
write(0);
for (const NodesMapTy::value_type& Node : NodesMap)
SortedNodes.push_back(&Node);
- llvm::sort(
- SortedNodes.begin(), SortedNodes.end(),
- [&](const SortedNodesTy::value_type &Lhs,
- const SortedNodesTy::value_type &Rhs) {
- if (Lhs->second->NumberOfInlines != Rhs->second->NumberOfInlines)
- return Lhs->second->NumberOfInlines > Rhs->second->NumberOfInlines;
- if (Lhs->second->NumberOfRealInlines !=
- Rhs->second->NumberOfRealInlines)
- return Lhs->second->NumberOfRealInlines >
- Rhs->second->NumberOfRealInlines;
- return Lhs->first() < Rhs->first();
- });
+ llvm::sort(SortedNodes, [&](const SortedNodesTy::value_type &Lhs,
+ const SortedNodesTy::value_type &Rhs) {
+ if (Lhs->second->NumberOfInlines != Rhs->second->NumberOfInlines)
+ return Lhs->second->NumberOfInlines > Rhs->second->NumberOfInlines;
+ if (Lhs->second->NumberOfRealInlines != Rhs->second->NumberOfRealInlines)
+ return Lhs->second->NumberOfRealInlines >
+ Rhs->second->NumberOfRealInlines;
+ return Lhs->first() < Rhs->first();
+ });
return SortedNodes;
}
for (auto &PTB : Index) {
auto &Blocks = PTB.second;
llvm::sort(
- Blocks.begin(), Blocks.end(),
+ Blocks,
[](const BlockIndexer::Block &L, const BlockIndexer::Block &R) {
return (L.WallclockTime->seconds() < R.WallclockTime->seconds() &&
L.WallclockTime->nanos() < R.WallclockTime->nanos());
Entries.reserve(Symbols.getNumItems());
for (const auto &Sym : make_range(Symbols.begin(), Symbols.end()))
Entries.push_back(std::make_pair(Sym.getKey(), Sym.getValue()));
- llvm::sort(
- Entries.begin(), Entries.end(),
- [](const Entry &LHS, const Entry &RHS) { return LHS.first < RHS.first; });
+ llvm::sort(Entries, [](const Entry &LHS, const Entry &RHS) {
+ return LHS.first < RHS.first;
+ });
for (const auto &Sym : Entries) {
if (Sym.second.ObjectAddress)
OS << format("\t%016" PRIx64, uint64_t(*Sym.second.ObjectAddress));
for (const auto &E : Strings)
if (E.getValue().isIndexed())
Result.emplace_back(E, true);
- llvm::sort(
- Result.begin(), Result.end(),
- [](const DwarfStringPoolEntryRef A, const DwarfStringPoolEntryRef B) {
- return A.getIndex() < B.getIndex();
- });
+ llvm::sort(Result, [](const DwarfStringPoolEntryRef A,
+ const DwarfStringPoolEntryRef B) {
+ return A.getIndex() < B.getIndex();
+ });
return Result;
}
}
// Finalize each ProcModel by sorting the record arrays.
for (CodeGenProcModel &PM : ProcModels) {
- llvm::sort(PM.WriteResDefs.begin(), PM.WriteResDefs.end(),
- LessRecord());
- llvm::sort(PM.ReadAdvanceDefs.begin(), PM.ReadAdvanceDefs.end(),
- LessRecord());
- llvm::sort(PM.ProcResourceDefs.begin(), PM.ProcResourceDefs.end(),
- LessRecord());
+ llvm::sort(PM.WriteResDefs, LessRecord());
+ llvm::sort(PM.ReadAdvanceDefs, LessRecord());
+ llvm::sort(PM.ProcResourceDefs, LessRecord());
LLVM_DEBUG(
PM.dump();
dbgs() << "WriteResDefs: "; for (RecIter RI = PM.WriteResDefs.begin(),
= SignaturesWithConstantForms.find(Operands);
if (MI != SignaturesWithConstantForms.end()) {
// Unique any duplicates out of the list.
- llvm::sort(MI->second.begin(), MI->second.end());
+ llvm::sort(MI->second);
MI->second.erase(std::unique(MI->second.begin(), MI->second.end()),
MI->second.end());
std::vector<std::vector<Record *>> FeatureBitsets;
for (auto &Rule : Rules)
FeatureBitsets.push_back(Rule.getRequiredFeatures());
- llvm::sort(
- FeatureBitsets.begin(), FeatureBitsets.end(),
- [&](const std::vector<Record *> &A, const std::vector<Record *> &B) {
- if (A.size() < B.size())
- return true;
- if (A.size() > B.size())
- return false;
- for (const auto &Pair : zip(A, B)) {
- if (std::get<0>(Pair)->getName() < std::get<1>(Pair)->getName())
- return true;
- if (std::get<0>(Pair)->getName() > std::get<1>(Pair)->getName())
- return false;
- }
+ llvm::sort(FeatureBitsets, [&](const std::vector<Record *> &A,
+ const std::vector<Record *> &B) {
+ if (A.size() < B.size())
+ return true;
+ if (A.size() > B.size())
+ return false;
+ for (const auto &Pair : zip(A, B)) {
+ if (std::get<0>(Pair)->getName() < std::get<1>(Pair)->getName())
+ return true;
+ if (std::get<0>(Pair)->getName() > std::get<1>(Pair)->getName())
return false;
- });
+ }
+ return false;
+ });
FeatureBitsets.erase(
std::unique(FeatureBitsets.begin(), FeatureBitsets.end()),
FeatureBitsets.end());
}
InsnMatcher.optimize();
}
- llvm::sort(
- EpilogueMatchers.begin(), EpilogueMatchers.end(),
- [](const std::unique_ptr<PredicateMatcher> &L,
- const std::unique_ptr<PredicateMatcher> &R) {
- return std::make_tuple(L->getKind(), L->getInsnVarID(), L->getOpIdx()) <
- std::make_tuple(R->getKind(), R->getInsnVarID(), R->getOpIdx());
- });
+ llvm::sort(EpilogueMatchers, [](const std::unique_ptr<PredicateMatcher> &L,
+ const std::unique_ptr<PredicateMatcher> &R) {
+ return std::make_tuple(L->getKind(), L->getInsnVarID(), L->getOpIdx()) <
+ std::make_tuple(R->getKind(), R->getInsnVarID(), R->getOpIdx());
+ });
}
bool RuleMatcher::hasFirstCondition() const {