diff options
Diffstat (limited to 'lib/AST/VTableBuilder.cpp')
-rw-r--r-- | lib/AST/VTableBuilder.cpp | 33 |
1 files changed, 14 insertions, 19 deletions
diff --git a/lib/AST/VTableBuilder.cpp b/lib/AST/VTableBuilder.cpp index dfc5774ab4988..846a6085743e1 100644 --- a/lib/AST/VTableBuilder.cpp +++ b/lib/AST/VTableBuilder.cpp @@ -2105,8 +2105,7 @@ void ItaniumVTableBuilder::dumpLayout(raw_ostream &Out) { const CXXMethodDecl *MD = I.second; ThunkInfoVectorTy ThunksVector = Thunks[MD]; - llvm::sort(ThunksVector.begin(), ThunksVector.end(), - [](const ThunkInfo &LHS, const ThunkInfo &RHS) { + llvm::sort(ThunksVector, [](const ThunkInfo &LHS, const ThunkInfo &RHS) { assert(LHS.Method == nullptr && RHS.Method == nullptr); return std::tie(LHS.This, LHS.Return) < std::tie(RHS.This, RHS.Return); }); @@ -2206,13 +2205,12 @@ VTableLayout::VTableLayout(ArrayRef<size_t> VTableIndices, else this->VTableIndices = OwningArrayRef<size_t>(VTableIndices); - llvm::sort(this->VTableThunks.begin(), this->VTableThunks.end(), - [](const VTableLayout::VTableThunkTy &LHS, - const VTableLayout::VTableThunkTy &RHS) { - assert((LHS.first != RHS.first || LHS.second == RHS.second) && - "Different thunks should have unique indices!"); - return LHS.first < RHS.first; - }); + llvm::sort(this->VTableThunks, [](const VTableLayout::VTableThunkTy &LHS, + const VTableLayout::VTableThunkTy &RHS) { + assert((LHS.first != RHS.first || LHS.second == RHS.second) && + "Different thunks should have unique indices!"); + return LHS.first < RHS.first; + }); } VTableLayout::~VTableLayout() { } @@ -3345,8 +3343,7 @@ static bool rebucketPaths(VPtrInfoVector &Paths) { PathsSorted.reserve(Paths.size()); for (auto& P : Paths) PathsSorted.push_back(*P); - llvm::sort(PathsSorted.begin(), PathsSorted.end(), - [](const VPtrInfo &LHS, const VPtrInfo &RHS) { + llvm::sort(PathsSorted, [](const VPtrInfo &LHS, const VPtrInfo &RHS) { return LHS.MangledPath < RHS.MangledPath; }); bool Changed = false; @@ -3409,10 +3406,9 @@ static void removeRedundantPaths(std::list<FullPathTy> &FullPaths) { for (const FullPathTy &OtherPath : FullPaths) { if (&SpecificPath == &OtherPath) continue; - if (std::all_of(SpecificPath.begin(), SpecificPath.end(), - [&](const BaseSubobject &BSO) { - return OtherPath.count(BSO) != 0; - })) { + if (llvm::all_of(SpecificPath, [&](const BaseSubobject &BSO) { + return OtherPath.count(BSO) != 0; + })) { return true; } } @@ -3488,10 +3484,9 @@ static const FullPathTy *selectBestPath(ASTContext &Context, // It's possible that the overrider isn't in this path. If so, skip it // because this path didn't introduce it. const CXXRecordDecl *OverridingParent = OverridingMethod->getParent(); - if (std::none_of(SpecificPath.begin(), SpecificPath.end(), - [&](const BaseSubobject &BSO) { - return BSO.getBase() == OverridingParent; - })) + if (llvm::none_of(SpecificPath, [&](const BaseSubobject &BSO) { + return BSO.getBase() == OverridingParent; + })) continue; CurrentOverrides.insert(OverridingMethod); } |