Skip to content

[BOLT] Use llvm::unique (NFC) #136513

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 1 addition & 2 deletions bolt/lib/Core/BinaryBasicBlock.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -372,8 +372,7 @@ void BinaryBasicBlock::updateJumpTableSuccessors() {
[](const BinaryBasicBlock *BB1, const BinaryBasicBlock *BB2) {
return BB1->getInputOffset() < BB2->getInputOffset();
});
SuccessorBBs.erase(std::unique(SuccessorBBs.begin(), SuccessorBBs.end()),
SuccessorBBs.end());
SuccessorBBs.erase(llvm::unique(SuccessorBBs), SuccessorBBs.end());

for (BinaryBasicBlock *BB : SuccessorBBs)
addSuccessor(BB);
Expand Down
2 changes: 1 addition & 1 deletion bolt/lib/Core/BinaryFunction.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -2376,7 +2376,7 @@ Error BinaryFunction::buildCFG(MCPlusBuilder::AllocatorIdTy AllocatorId) {
// Without doing jump table value profiling we don't have a use for extra
// (duplicate) branches.
llvm::sort(TakenBranches);
auto NewEnd = std::unique(TakenBranches.begin(), TakenBranches.end());
auto NewEnd = llvm::unique(TakenBranches);
TakenBranches.erase(NewEnd, TakenBranches.end());

for (std::pair<uint32_t, uint32_t> &Branch : TakenBranches) {
Expand Down
3 changes: 1 addition & 2 deletions bolt/lib/Core/DebugNames.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -440,8 +440,7 @@ void DWARF5AcceleratorTable::computeBucketCount() {
for (const auto &E : Entries)
Uniques.push_back(E.second.HashValue);
array_pod_sort(Uniques.begin(), Uniques.end());
std::vector<uint32_t>::iterator P =
std::unique(Uniques.begin(), Uniques.end());
std::vector<uint32_t>::iterator P = llvm::unique(Uniques);

UniqueHashCount = std::distance(Uniques.begin(), P);

Expand Down
Loading