Skip to content

Commit 9bcc094

Browse files
[llvm] Use llvm::erase_if (NFC)
1 parent 60b3e05 commit 9bcc094

File tree

3 files changed

+8
-15
lines changed

3 files changed

+8
-15
lines changed

llvm/lib/DebugInfo/LogicalView/Readers/LVCodeViewVisitor.cpp

Lines changed: 4 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -465,13 +465,10 @@ LVScope *LVNamespaceDeduction::get(LVStringRefs Components) {
465465
LVScope *LVNamespaceDeduction::get(StringRef ScopedName, bool CheckScope) {
466466
LVStringRefs Components = getAllLexicalComponents(ScopedName);
467467
if (CheckScope)
468-
Components.erase(std::remove_if(Components.begin(), Components.end(),
469-
[&](StringRef Component) {
470-
LookupSet::iterator Iter =
471-
IdentifiedNamespaces.find(Component);
472-
return Iter == IdentifiedNamespaces.end();
473-
}),
474-
Components.end());
468+
llvm::erase_if(Components, [&](StringRef Component) {
469+
LookupSet::iterator Iter = IdentifiedNamespaces.find(Component);
470+
return Iter == IdentifiedNamespaces.end();
471+
});
475472

476473
LLVM_DEBUG(
477474
{ dbgs() << formatv("ScopedName: '{0}'\n", ScopedName.str().c_str()); });

llvm/lib/Target/ARM/ARMLoadStoreOptimizer.cpp

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -2829,9 +2829,7 @@ ARMPreAllocLoadStoreOpt::RescheduleLoadStoreInstrs(MachineBasicBlock *MBB) {
28292829
return Var == DbgVar;
28302830
};
28312831

2832-
InstrVec.erase(
2833-
std::remove_if(InstrVec.begin(), InstrVec.end(), IsDbgVar),
2834-
InstrVec.end());
2832+
llvm::erase_if(InstrVec, IsDbgVar);
28352833
}
28362834
forEachDbgRegOperand(Instr,
28372835
[&](MachineOperand &Op) { Op.setReg(0); });

llvm/lib/Transforms/Scalar/JumpThreading.cpp

Lines changed: 3 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1977,11 +1977,9 @@ void JumpThreadingPass::updateSSA(
19771977

19781978
// Find debug values outside of the block
19791979
findDbgValues(DbgValues, &I);
1980-
DbgValues.erase(remove_if(DbgValues,
1981-
[&](const DbgValueInst *DbgVal) {
1982-
return DbgVal->getParent() == BB;
1983-
}),
1984-
DbgValues.end());
1980+
llvm::erase_if(DbgValues, [&](const DbgValueInst *DbgVal) {
1981+
return DbgVal->getParent() == BB;
1982+
});
19851983

19861984
// If there are no uses outside the block, we're done with this instruction.
19871985
if (UsesToRename.empty() && DbgValues.empty())

0 commit comments

Comments
 (0)