Skip to content

Commit 7c6d0d2

Browse files
[llvm] Use llvm::unique (NFC) (#95628)
1 parent bb3091a commit 7c6d0d2

32 files changed

+55
-73
lines changed

llvm/include/llvm/ADT/IntervalTree.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -654,7 +654,7 @@ class IntervalTree {
654654
References.push_back(std::addressof(Data));
655655
}
656656
std::stable_sort(Points.begin(), Points.end());
657-
auto Last = std::unique(Points.begin(), Points.end());
657+
auto Last = llvm::unique(Points);
658658
Points.erase(Last, Points.end());
659659

660660
EndPoints.assign(Points.begin(), Points.end());

llvm/include/llvm/ExecutionEngine/Orc/Core.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -361,7 +361,7 @@ class SymbolLookupSet {
361361
/// by construction, this method can be used to turn it into a proper set.
362362
void removeDuplicates() {
363363
sortByAddress();
364-
auto LastI = std::unique(Symbols.begin(), Symbols.end());
364+
auto LastI = llvm::unique(Symbols);
365365
Symbols.erase(LastI, Symbols.end());
366366
}
367367

llvm/include/llvm/ProfileData/InstrProf.h

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -696,8 +696,7 @@ void InstrProfSymtab::finalizeSymtab() {
696696
llvm::sort(MD5NameMap, less_first());
697697
llvm::sort(MD5FuncMap, less_first());
698698
llvm::sort(AddrToMD5Map, less_first());
699-
AddrToMD5Map.erase(std::unique(AddrToMD5Map.begin(), AddrToMD5Map.end()),
700-
AddrToMD5Map.end());
699+
AddrToMD5Map.erase(llvm::unique(AddrToMD5Map), AddrToMD5Map.end());
701700
Sorted = true;
702701
}
703702

llvm/lib/Analysis/Delinearization.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -294,7 +294,7 @@ void llvm::findArrayDimensions(ScalarEvolution &SE,
294294

295295
// Remove duplicates.
296296
array_pod_sort(Terms.begin(), Terms.end());
297-
Terms.erase(std::unique(Terms.begin(), Terms.end()), Terms.end());
297+
Terms.erase(llvm::unique(Terms), Terms.end());
298298

299299
// Put larger terms first.
300300
llvm::sort(Terms, [](const SCEV *LHS, const SCEV *RHS) {

llvm/lib/Analysis/ImportedFunctionsInliningStatistics.cpp

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -175,9 +175,8 @@ void ImportedFunctionsInliningStatistics::dump(const bool Verbose) {
175175
void ImportedFunctionsInliningStatistics::calculateRealInlines() {
176176
// Removing duplicated Callers.
177177
llvm::sort(NonImportedCallers);
178-
NonImportedCallers.erase(
179-
std::unique(NonImportedCallers.begin(), NonImportedCallers.end()),
180-
NonImportedCallers.end());
178+
NonImportedCallers.erase(llvm::unique(NonImportedCallers),
179+
NonImportedCallers.end());
181180

182181
for (const auto &Name : NonImportedCallers) {
183182
auto &Node = *NodesMap[Name];

llvm/lib/Analysis/StackSafetyAnalysis.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -690,7 +690,7 @@ void StackSafetyDataFlowAnalysis<CalleeTy>::runDataFlow() {
690690
Callees.push_back(CS.first.Callee);
691691

692692
llvm::sort(Callees);
693-
Callees.erase(std::unique(Callees.begin(), Callees.end()), Callees.end());
693+
Callees.erase(llvm::unique(Callees), Callees.end());
694694

695695
for (auto &Callee : Callees)
696696
Callers[Callee].push_back(F.first);

llvm/lib/CodeGen/AsmPrinter/AccelTable.cpp

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -49,9 +49,7 @@ void AccelTableBase::finalize(AsmPrinter *Asm, StringRef Prefix) {
4949
[](const AccelTableData *A, const AccelTableData *B) {
5050
return *A < *B;
5151
});
52-
E.second.Values.erase(
53-
std::unique(E.second.Values.begin(), E.second.Values.end()),
54-
E.second.Values.end());
52+
E.second.Values.erase(llvm::unique(E.second.Values), E.second.Values.end());
5553
}
5654

5755
// Figure out how many buckets we need, then compute the bucket contents and

llvm/lib/CodeGen/AsmPrinter/DebugLocEntry.h

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -238,10 +238,10 @@ class DebugLocEntry {
238238
if (Values.size() == 1)
239239
return;
240240
llvm::sort(Values);
241-
Values.erase(std::unique(Values.begin(), Values.end(),
242-
[](const DbgValueLoc &A, const DbgValueLoc &B) {
243-
return A.getExpression() == B.getExpression();
244-
}),
241+
Values.erase(llvm::unique(Values,
242+
[](const DbgValueLoc &A, const DbgValueLoc &B) {
243+
return A.getExpression() == B.getExpression();
244+
}),
245245
Values.end());
246246
}
247247

llvm/lib/CodeGen/AsmPrinter/DwarfDebug.cpp

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1130,11 +1130,11 @@ sortGlobalExprs(SmallVectorImpl<DwarfCompileUnit::GlobalExpr> &GVEs) {
11301130
return !!FragmentB;
11311131
return FragmentA->OffsetInBits < FragmentB->OffsetInBits;
11321132
});
1133-
GVEs.erase(std::unique(GVEs.begin(), GVEs.end(),
1134-
[](DwarfCompileUnit::GlobalExpr A,
1135-
DwarfCompileUnit::GlobalExpr B) {
1136-
return A.Expr == B.Expr;
1137-
}),
1133+
GVEs.erase(llvm::unique(GVEs,
1134+
[](DwarfCompileUnit::GlobalExpr A,
1135+
DwarfCompileUnit::GlobalExpr B) {
1136+
return A.Expr == B.Expr;
1137+
}),
11381138
GVEs.end());
11391139
return GVEs;
11401140
}

llvm/lib/CodeGen/CodeGenPrepare.cpp

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -6271,9 +6271,7 @@ bool CodeGenPrepare::splitLargeGEPOffsets() {
62716271
};
62726272
// Sorting all the GEPs of the same data structures based on the offsets.
62736273
llvm::sort(LargeOffsetGEPs, compareGEPOffset);
6274-
LargeOffsetGEPs.erase(
6275-
std::unique(LargeOffsetGEPs.begin(), LargeOffsetGEPs.end()),
6276-
LargeOffsetGEPs.end());
6274+
LargeOffsetGEPs.erase(llvm::unique(LargeOffsetGEPs), LargeOffsetGEPs.end());
62776275
// Skip if all the GEPs have the same offsets.
62786276
if (LargeOffsetGEPs.front().second == LargeOffsetGEPs.back().second)
62796277
continue;

llvm/lib/CodeGen/RegisterCoalescer.cpp

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -4248,8 +4248,7 @@ bool RegisterCoalescer::runOnMachineFunction(MachineFunction &fn) {
42484248
// Removing sub-register operands may allow GR32_ABCD -> GR32 and DPR_VFP2 ->
42494249
// DPR inflation.
42504250
array_pod_sort(InflateRegs.begin(), InflateRegs.end());
4251-
InflateRegs.erase(std::unique(InflateRegs.begin(), InflateRegs.end()),
4252-
InflateRegs.end());
4251+
InflateRegs.erase(llvm::unique(InflateRegs), InflateRegs.end());
42534252
LLVM_DEBUG(dbgs() << "Trying to inflate " << InflateRegs.size()
42544253
<< " regs.\n");
42554254
for (Register Reg : InflateRegs) {

llvm/lib/CodeGen/SplitKit.cpp

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -184,8 +184,7 @@ void SplitAnalysis::analyzeUses() {
184184

185185
// Remove duplicates, keeping the smaller slot for each instruction.
186186
// That is what we want for early clobbers.
187-
UseSlots.erase(std::unique(UseSlots.begin(), UseSlots.end(),
188-
SlotIndex::isSameInstr),
187+
UseSlots.erase(llvm::unique(UseSlots, SlotIndex::isSameInstr),
189188
UseSlots.end());
190189

191190
// Compute per-live block info.

llvm/lib/DebugInfo/DWARF/DWARFContext.cpp

Lines changed: 8 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -807,13 +807,14 @@ collectContributionData(DWARFContext::unit_iterator_range Units) {
807807
// type units in dwo or dwp files) share contributions. We don't want
808808
// to report them more than once.
809809
Contributions.erase(
810-
std::unique(Contributions.begin(), Contributions.end(),
811-
[](const std::optional<StrOffsetsContributionDescriptor> &L,
812-
const std::optional<StrOffsetsContributionDescriptor> &R) {
813-
if (L && R)
814-
return L->Base == R->Base && L->Size == R->Size;
815-
return false;
816-
}),
810+
llvm::unique(
811+
Contributions,
812+
[](const std::optional<StrOffsetsContributionDescriptor> &L,
813+
const std::optional<StrOffsetsContributionDescriptor> &R) {
814+
if (L && R)
815+
return L->Base == R->Base && L->Size == R->Size;
816+
return false;
817+
}),
817818
Contributions.end());
818819
return Contributions;
819820
}

llvm/lib/MC/MCParser/AsmParser.cpp

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -6079,8 +6079,7 @@ bool AsmParser::parseMSInlineAsm(
60796079

60806080
// Set the unique clobbers.
60816081
array_pod_sort(ClobberRegs.begin(), ClobberRegs.end());
6082-
ClobberRegs.erase(std::unique(ClobberRegs.begin(), ClobberRegs.end()),
6083-
ClobberRegs.end());
6082+
ClobberRegs.erase(llvm::unique(ClobberRegs), ClobberRegs.end());
60846083
Clobbers.assign(ClobberRegs.size(), std::string());
60856084
for (unsigned I = 0, E = ClobberRegs.size(); I != E; ++I) {
60866085
raw_string_ostream OS(Clobbers[I]);

llvm/lib/MC/MCParser/MasmParser.cpp

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -7443,8 +7443,7 @@ bool MasmParser::parseMSInlineAsm(
74437443

74447444
// Set the unique clobbers.
74457445
array_pod_sort(ClobberRegs.begin(), ClobberRegs.end());
7446-
ClobberRegs.erase(std::unique(ClobberRegs.begin(), ClobberRegs.end()),
7447-
ClobberRegs.end());
7446+
ClobberRegs.erase(llvm::unique(ClobberRegs), ClobberRegs.end());
74487447
Clobbers.assign(ClobberRegs.size(), std::string());
74497448
for (unsigned I = 0, E = ClobberRegs.size(); I != E; ++I) {
74507449
raw_string_ostream OS(Clobbers[I]);

llvm/lib/MCA/HardwareUnits/RegisterFile.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -550,7 +550,7 @@ void RegisterFile::collectWrites(
550550
sort(Writes, [](const WriteRef &Lhs, const WriteRef &Rhs) {
551551
return Lhs.getWriteState() < Rhs.getWriteState();
552552
});
553-
auto It = std::unique(Writes.begin(), Writes.end());
553+
auto It = llvm::unique(Writes);
554554
Writes.resize(std::distance(Writes.begin(), It));
555555
}
556556

llvm/lib/ProfileData/Coverage/CoverageMapping.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1352,7 +1352,7 @@ std::vector<StringRef> CoverageMapping::getUniqueSourceFiles() const {
13521352
for (const auto &Function : getCoveredFunctions())
13531353
llvm::append_range(Filenames, Function.Filenames);
13541354
llvm::sort(Filenames);
1355-
auto Last = std::unique(Filenames.begin(), Filenames.end());
1355+
auto Last = llvm::unique(Filenames);
13561356
Filenames.erase(Last, Filenames.end());
13571357
return Filenames;
13581358
}

llvm/lib/ProfileData/InstrProfWriter.cpp

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -920,8 +920,7 @@ Error InstrProfWriter::writeImpl(ProfOStream &OS) {
920920

921921
// Remove duplicate binary ids.
922922
llvm::sort(BinaryIds);
923-
BinaryIds.erase(std::unique(BinaryIds.begin(), BinaryIds.end()),
924-
BinaryIds.end());
923+
BinaryIds.erase(llvm::unique(BinaryIds), BinaryIds.end());
925924

926925
for (const auto &BI : BinaryIds) {
927926
// Increment by binary id length data type size.

llvm/lib/Target/NVPTX/NVVMReflect.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -209,7 +209,7 @@ static bool runNVVMReflect(Function &F, unsigned SmVersion) {
209209
// Removing via isInstructionTriviallyDead may add duplicates to the ToRemove
210210
// array. Filter out the duplicates before starting to erase from parent.
211211
std::sort(ToRemove.begin(), ToRemove.end());
212-
auto NewLastIter = std::unique(ToRemove.begin(), ToRemove.end());
212+
auto NewLastIter = llvm::unique(ToRemove);
213213
ToRemove.erase(NewLastIter, ToRemove.end());
214214

215215
for (Instruction *I : ToRemove)

llvm/lib/Target/X86/X86ISelLowering.cpp

Lines changed: 4 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -13353,11 +13353,11 @@ static SDValue lowerV8I16GeneralSingleInputShuffle(
1335313353
SmallVector<int, 4> LoInputs;
1335413354
copy_if(LoMask, std::back_inserter(LoInputs), [](int M) { return M >= 0; });
1335513355
array_pod_sort(LoInputs.begin(), LoInputs.end());
13356-
LoInputs.erase(std::unique(LoInputs.begin(), LoInputs.end()), LoInputs.end());
13356+
LoInputs.erase(llvm::unique(LoInputs), LoInputs.end());
1335713357
SmallVector<int, 4> HiInputs;
1335813358
copy_if(HiMask, std::back_inserter(HiInputs), [](int M) { return M >= 0; });
1335913359
array_pod_sort(HiInputs.begin(), HiInputs.end());
13360-
HiInputs.erase(std::unique(HiInputs.begin(), HiInputs.end()), HiInputs.end());
13360+
HiInputs.erase(llvm::unique(HiInputs), HiInputs.end());
1336113361
int NumLToL = llvm::lower_bound(LoInputs, 4) - LoInputs.begin();
1336213362
int NumHToL = LoInputs.size() - NumLToL;
1336313363
int NumLToH = llvm::lower_bound(HiInputs, 4) - HiInputs.begin();
@@ -14245,13 +14245,11 @@ static SDValue lowerV16I8Shuffle(const SDLoc &DL, ArrayRef<int> Mask,
1424514245
copy_if(Mask, std::back_inserter(LoInputs),
1424614246
[](int M) { return M >= 0 && M < 8; });
1424714247
array_pod_sort(LoInputs.begin(), LoInputs.end());
14248-
LoInputs.erase(std::unique(LoInputs.begin(), LoInputs.end()),
14249-
LoInputs.end());
14248+
LoInputs.erase(llvm::unique(LoInputs), LoInputs.end());
1425014249
SmallVector<int, 4> HiInputs;
1425114250
copy_if(Mask, std::back_inserter(HiInputs), [](int M) { return M >= 8; });
1425214251
array_pod_sort(HiInputs.begin(), HiInputs.end());
14253-
HiInputs.erase(std::unique(HiInputs.begin(), HiInputs.end()),
14254-
HiInputs.end());
14252+
HiInputs.erase(llvm::unique(HiInputs), HiInputs.end());
1425514253

1425614254
bool TargetLo = LoInputs.size() >= HiInputs.size();
1425714255
ArrayRef<int> InPlaceInputs = TargetLo ? LoInputs : HiInputs;

llvm/lib/Target/X86/X86LoadValueInjectionLoadHardening.cpp

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -439,9 +439,8 @@ X86LoadValueInjectionLoadHardeningPass::getGadgetGraph(
439439

440440
// Remove duplicate transmitters
441441
llvm::sort(DefTransmitters);
442-
DefTransmitters.erase(
443-
std::unique(DefTransmitters.begin(), DefTransmitters.end()),
444-
DefTransmitters.end());
442+
DefTransmitters.erase(llvm::unique(DefTransmitters),
443+
DefTransmitters.end());
445444
};
446445

447446
// Find all of the transmitters

llvm/lib/Target/X86/X86SpeculativeLoadHardening.cpp

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -822,8 +822,7 @@ X86SpeculativeLoadHardeningPass::tracePredStateThroughCFG(
822822

823823
// Sort and unique the codes to minimize them.
824824
llvm::sort(UncondCodeSeq);
825-
UncondCodeSeq.erase(std::unique(UncondCodeSeq.begin(), UncondCodeSeq.end()),
826-
UncondCodeSeq.end());
825+
UncondCodeSeq.erase(llvm::unique(UncondCodeSeq), UncondCodeSeq.end());
827826

828827
// Build a checking version of the successor.
829828
BuildCheckingBlockForSuccAndConds(MBB, *UncondSucc, /*SuccCount*/ 1,

llvm/lib/Target/XCore/XCoreLowerThreadLocal.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -79,7 +79,7 @@ static bool replaceConstantExprOp(ConstantExpr *CE, Pass *P) {
7979
do {
8080
SmallVector<WeakTrackingVH, 8> WUsers(CE->users());
8181
llvm::sort(WUsers);
82-
WUsers.erase(std::unique(WUsers.begin(), WUsers.end()), WUsers.end());
82+
WUsers.erase(llvm::unique(WUsers), WUsers.end());
8383
while (!WUsers.empty())
8484
if (WeakTrackingVH WU = WUsers.pop_back_val()) {
8585
if (PHINode *PN = dyn_cast<PHINode>(WU)) {

llvm/lib/Transforms/IPO/AttributorAttributes.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1473,7 +1473,7 @@ struct AAPointerInfoFloating : public AAPointerInfoImpl {
14731473

14741474
// Make a strictly ascending list of offsets as required by addAccess()
14751475
llvm::sort(Offsets);
1476-
auto *Last = std::unique(Offsets.begin(), Offsets.end());
1476+
auto *Last = llvm::unique(Offsets);
14771477
Offsets.erase(Last, Offsets.end());
14781478

14791479
VectorType *VT = dyn_cast<VectorType>(&Ty);

llvm/lib/Transforms/Scalar/PlaceSafepoints.cpp

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -310,8 +310,7 @@ bool PlaceSafepointsPass::runImpl(Function &F, const TargetLibraryInfo &TLI) {
310310
// We can sometimes end up with duplicate poll locations. This happens if
311311
// a single loop is visited more than once. The fact this happens seems
312312
// wrong, but it does happen for the split-backedge.ll test case.
313-
PollLocations.erase(std::unique(PollLocations.begin(), PollLocations.end()),
314-
PollLocations.end());
313+
PollLocations.erase(llvm::unique(PollLocations), PollLocations.end());
315314

316315
// Insert a poll at each point the analysis pass identified
317316
// The poll location must be the terminator of a loop latch block.

llvm/lib/Transforms/Scalar/Reassociate.cpp

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1815,10 +1815,10 @@ ReassociatePass::buildMinimalMultiplyDAG(IRBuilderBase &Builder,
18151815
}
18161816
// Unique factors with equal powers -- we've folded them into the first one's
18171817
// base.
1818-
Factors.erase(std::unique(Factors.begin(), Factors.end(),
1819-
[](const Factor &LHS, const Factor &RHS) {
1820-
return LHS.Power == RHS.Power;
1821-
}),
1818+
Factors.erase(llvm::unique(Factors,
1819+
[](const Factor &LHS, const Factor &RHS) {
1820+
return LHS.Power == RHS.Power;
1821+
}),
18221822
Factors.end());
18231823

18241824
// Iteratively collect the base of each factor with an add power into the

llvm/lib/Transforms/Scalar/RewriteStatepointsForGC.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2148,7 +2148,7 @@ static void relocationViaAlloca(
21482148
}
21492149

21502150
llvm::sort(Uses);
2151-
auto Last = std::unique(Uses.begin(), Uses.end());
2151+
auto Last = llvm::unique(Uses);
21522152
Uses.erase(Last, Uses.end());
21532153

21542154
for (Instruction *Use : Uses) {

llvm/lib/Transforms/Scalar/SROA.cpp

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2178,8 +2178,7 @@ checkVectorTypesForPromotion(Partition &P, const DataLayout &DL,
21782178
cast<FixedVectorType>(LHSTy)->getNumElements();
21792179
};
21802180
llvm::sort(CandidateTys, RankVectorTypesComp);
2181-
CandidateTys.erase(std::unique(CandidateTys.begin(), CandidateTys.end(),
2182-
RankVectorTypesEq),
2181+
CandidateTys.erase(llvm::unique(CandidateTys, RankVectorTypesEq),
21832182
CandidateTys.end());
21842183
} else {
21852184
// The only way to have the same element type in every vector type is to

llvm/lib/Transforms/Utils/SimplifyCFG.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4905,7 +4905,7 @@ bool SimplifyCFGOpt::SimplifyBranchOnICmpChain(BranchInst *BI,
49054905
// There might be duplicate constants in the list, which the switch
49064906
// instruction can't handle, remove them now.
49074907
array_pod_sort(Values.begin(), Values.end(), ConstantIntSortPredicate);
4908-
Values.erase(std::unique(Values.begin(), Values.end()), Values.end());
4908+
Values.erase(llvm::unique(Values), Values.end());
49094909

49104910
// If Extra was used, we require at least two switch values to do the
49114911
// transformation. A switch with one value is just a conditional branch.

llvm/tools/llvm-dwarfdump/llvm-dwarfdump.cpp

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -502,7 +502,7 @@ static void filterByAccelName(
502502
getDies(DICtx, DICtx.getDebugNames(), Name, Dies);
503503
}
504504
llvm::sort(Dies);
505-
Dies.erase(std::unique(Dies.begin(), Dies.end()), Dies.end());
505+
Dies.erase(llvm::unique(Dies), Dies.end());
506506

507507
DIDumpOptions DumpOpts = getDumpOpts(DICtx);
508508
DumpOpts.GetNameForDWARFReg = GetNameForDWARFReg;
@@ -646,7 +646,7 @@ static bool collectObjectSources(ObjectFile &Obj, DWARFContext &DICtx,
646646

647647
// Dedup and order the sources.
648648
llvm::sort(Sources);
649-
Sources.erase(std::unique(Sources.begin(), Sources.end()), Sources.end());
649+
Sources.erase(llvm::unique(Sources), Sources.end());
650650

651651
for (StringRef Name : Sources)
652652
OS << Name << "\n";

llvm/tools/llvm-nm/llvm-nm.cpp

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2395,8 +2395,7 @@ exportSymbolNamesFromFiles(const std::vector<std::string> &InputFilenames) {
23952395
llvm::erase_if(SymbolList,
23962396
[](const NMSymbol &s) { return !s.shouldPrint(); });
23972397
sortSymbolList(SymbolList);
2398-
SymbolList.erase(std::unique(SymbolList.begin(), SymbolList.end()),
2399-
SymbolList.end());
2398+
SymbolList.erase(llvm::unique(SymbolList), SymbolList.end());
24002399
printExportSymbolList(SymbolList);
24012400
}
24022401

llvm/tools/llvm-objdump/llvm-objdump.cpp

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1570,8 +1570,7 @@ static void addSymbolizer(
15701570
LabelAddrs.insert(LabelAddrs.end(), LabelAddrsRef.begin(),
15711571
LabelAddrsRef.end());
15721572
llvm::sort(LabelAddrs);
1573-
LabelAddrs.resize(std::unique(LabelAddrs.begin(), LabelAddrs.end()) -
1574-
LabelAddrs.begin());
1573+
LabelAddrs.resize(llvm::unique(LabelAddrs) - LabelAddrs.begin());
15751574
// Add the labels.
15761575
for (unsigned LabelNum = 0; LabelNum != LabelAddrs.size(); ++LabelNum) {
15771576
auto Name = std::make_unique<std::string>();

0 commit comments

Comments
 (0)