diff --git a/lld/COFF/MapFile.cpp b/lld/COFF/MapFile.cpp index eb98bb484f9f4..9b7c05b9e68b9 100644 --- a/lld/COFF/MapFile.cpp +++ b/lld/COFF/MapFile.cpp @@ -75,10 +75,9 @@ static void sortUniqueSymbols(std::vector &syms, // Remove duplicate symbol pointers parallelSort(v, std::less()); - auto end = std::unique(v.begin(), v.end(), - [](const SortEntry &a, const SortEntry &b) { - return a.first == b.first; - }); + auto end = llvm::unique(v, [](const SortEntry &a, const SortEntry &b) { + return a.first == b.first; + }); v.erase(end, v.end()); // Sort by RVA then original order diff --git a/lld/ELF/AArch64ErrataFix.cpp b/lld/ELF/AArch64ErrataFix.cpp index b5641e5d9ce55..e2b1cf14daa72 100644 --- a/lld/ELF/AArch64ErrataFix.cpp +++ b/lld/ELF/AArch64ErrataFix.cpp @@ -461,12 +461,12 @@ void AArch64Err843419Patcher::init() { llvm::stable_sort(mapSyms, [](const Defined *a, const Defined *b) { return a->value < b->value; }); - mapSyms.erase( - std::unique(mapSyms.begin(), mapSyms.end(), - [=](const Defined *a, const Defined *b) { - return isCodeMapSymbol(a) == isCodeMapSymbol(b); - }), - mapSyms.end()); + mapSyms.erase(llvm::unique(mapSyms, + [=](const Defined *a, const Defined *b) { + return isCodeMapSymbol(a) == + isCodeMapSymbol(b); + }), + mapSyms.end()); // Always start with a Code Mapping Symbol. if (!mapSyms.empty() && !isCodeMapSymbol(mapSyms.front())) mapSyms.erase(mapSyms.begin()); diff --git a/lld/ELF/ARMErrataFix.cpp b/lld/ELF/ARMErrataFix.cpp index a7120c43e51d3..d14d28ee43a2f 100644 --- a/lld/ELF/ARMErrataFix.cpp +++ b/lld/ELF/ARMErrataFix.cpp @@ -354,11 +354,11 @@ void ARMErr657417Patcher::init() { llvm::stable_sort(mapSyms, [](const Defined *a, const Defined *b) { return a->value < b->value; }); - mapSyms.erase(std::unique(mapSyms.begin(), mapSyms.end(), - [=](const Defined *a, const Defined *b) { - return (isThumbMapSymbol(a) == - isThumbMapSymbol(b)); - }), + mapSyms.erase(llvm::unique(mapSyms, + [=](const Defined *a, const Defined *b) { + return (isThumbMapSymbol(a) == + isThumbMapSymbol(b)); + }), mapSyms.end()); // Always start with a Thumb Mapping Symbol if (!mapSyms.empty() && !isThumbMapSymbol(mapSyms.front())) diff --git a/lld/ELF/BPSectionOrderer.cpp b/lld/ELF/BPSectionOrderer.cpp index 4adb42ef4ff93..793176c7725a3 100644 --- a/lld/ELF/BPSectionOrderer.cpp +++ b/lld/ELF/BPSectionOrderer.cpp @@ -53,7 +53,7 @@ struct BPOrdererELF : lld::BPOrderer { hashes.push_back(byte); llvm::sort(hashes); - hashes.erase(std::unique(hashes.begin(), hashes.end()), hashes.end()); + hashes.erase(llvm::unique(hashes), hashes.end()); } static StringRef getSymName(const Defined &sym) { return sym.getName(); } diff --git a/lld/ELF/SyntheticSections.cpp b/lld/ELF/SyntheticSections.cpp index 196ecc4fee8c8..2531227cb99b7 100644 --- a/lld/ELF/SyntheticSections.cpp +++ b/lld/ELF/SyntheticSections.cpp @@ -590,7 +590,7 @@ SmallVector EhFrameSection::getFdeData() const { auto eq = [](const FdeData &a, const FdeData &b) { return a.pcRel == b.pcRel; }; - ret.erase(std::unique(ret.begin(), ret.end(), eq), ret.end()); + ret.erase(llvm::unique(ret, eq), ret.end()); return ret; } diff --git a/lld/MachO/BPSectionOrderer.cpp b/lld/MachO/BPSectionOrderer.cpp index 950afd0421f06..1295d21cad8a1 100644 --- a/lld/MachO/BPSectionOrderer.cpp +++ b/lld/MachO/BPSectionOrderer.cpp @@ -73,7 +73,7 @@ struct BPOrdererMachO : lld::BPOrderer { } llvm::sort(hashes); - hashes.erase(std::unique(hashes.begin(), hashes.end()), hashes.end()); + hashes.erase(llvm::unique(hashes), hashes.end()); } static llvm::StringRef getSymName(const Defined &sym) { diff --git a/lld/include/lld/Common/BPSectionOrdererBase.inc b/lld/include/lld/Common/BPSectionOrdererBase.inc index b19d3670d34cc..51dfb6471644a 100644 --- a/lld/include/lld/Common/BPSectionOrdererBase.inc +++ b/lld/include/lld/Common/BPSectionOrdererBase.inc @@ -260,7 +260,7 @@ auto BPOrderer::computeOrder( auto &uns = startupSectionIdxUNs[sectionIdx]; uns.append(compressionUns); llvm::sort(uns); - uns.erase(std::unique(uns.begin(), uns.end()), uns.end()); + uns.erase(llvm::unique(uns), uns.end()); } }