mirror of
https://github.com/RPCS3/llvm-mirror.git
synced 2024-10-19 02:52:53 +02:00
[Analysis, IR, CodeGen] Use llvm::erase_if (NFC)
This commit is contained in:
parent
4a14b47a89
commit
0abf9f34bf
@ -1129,9 +1129,9 @@ public:
|
||||
for (auto &KeyValuePair : OuterAnalysisInvalidationMap) {
|
||||
AnalysisKey *OuterID = KeyValuePair.first;
|
||||
auto &InnerIDs = KeyValuePair.second;
|
||||
InnerIDs.erase(llvm::remove_if(InnerIDs, [&](AnalysisKey *InnerID) {
|
||||
return Inv.invalidate(InnerID, IRUnit, PA); }),
|
||||
InnerIDs.end());
|
||||
llvm::erase_if(InnerIDs, [&](AnalysisKey *InnerID) {
|
||||
return Inv.invalidate(InnerID, IRUnit, PA);
|
||||
});
|
||||
if (InnerIDs.empty())
|
||||
DeadKeys.push_back(OuterID);
|
||||
}
|
||||
|
@ -1039,23 +1039,20 @@ static LazyCallGraph::SCC &updateCGAndAnalysisManagerForPass(
|
||||
DeadTargets.push_back(&E.getNode());
|
||||
}
|
||||
// Remove the easy cases quickly and actually pull them out of our list.
|
||||
DeadTargets.erase(
|
||||
llvm::remove_if(DeadTargets,
|
||||
[&](Node *TargetN) {
|
||||
SCC &TargetC = *G.lookupSCC(*TargetN);
|
||||
RefSCC &TargetRC = TargetC.getOuterRefSCC();
|
||||
llvm::erase_if(DeadTargets, [&](Node *TargetN) {
|
||||
SCC &TargetC = *G.lookupSCC(*TargetN);
|
||||
RefSCC &TargetRC = TargetC.getOuterRefSCC();
|
||||
|
||||
// We can't trivially remove internal targets, so skip
|
||||
// those.
|
||||
if (&TargetRC == RC)
|
||||
return false;
|
||||
// We can't trivially remove internal targets, so skip
|
||||
// those.
|
||||
if (&TargetRC == RC)
|
||||
return false;
|
||||
|
||||
RC->removeOutgoingEdge(N, *TargetN);
|
||||
LLVM_DEBUG(dbgs() << "Deleting outgoing edge from '"
|
||||
<< N << "' to '" << TargetN << "'\n");
|
||||
return true;
|
||||
}),
|
||||
DeadTargets.end());
|
||||
RC->removeOutgoingEdge(N, *TargetN);
|
||||
LLVM_DEBUG(dbgs() << "Deleting outgoing edge from '" << N << "' to '"
|
||||
<< TargetN << "'\n");
|
||||
return true;
|
||||
});
|
||||
|
||||
// Now do a batch removal of the internal ref edges left.
|
||||
auto NewRefSCCs = RC->removeInternalRefEdge(N, DeadTargets);
|
||||
|
@ -11620,9 +11620,7 @@ static bool findArrayDimensionsRec(ScalarEvolution &SE,
|
||||
}
|
||||
|
||||
// Remove all SCEVConstants.
|
||||
Terms.erase(
|
||||
remove_if(Terms, [](const SCEV *E) { return isa<SCEVConstant>(E); }),
|
||||
Terms.end());
|
||||
erase_if(Terms, [](const SCEV *E) { return isa<SCEVConstant>(E); });
|
||||
|
||||
if (Terms.size() > 0)
|
||||
if (!findArrayDimensionsRec(SE, Terms, Sizes))
|
||||
|
@ -1636,9 +1636,7 @@ bool DwarfDebug::buildLocationList(SmallVectorImpl<DebugLocEntry> &DebugLoc,
|
||||
|
||||
// Remove all values that are no longer live.
|
||||
size_t Index = std::distance(EB, EI);
|
||||
auto Last =
|
||||
remove_if(OpenRanges, [&](OpenRange &R) { return R.first <= Index; });
|
||||
OpenRanges.erase(Last, OpenRanges.end());
|
||||
erase_if(OpenRanges, [&](OpenRange &R) { return R.first <= Index; });
|
||||
|
||||
// If we are dealing with a clobbering entry, this iteration will result in
|
||||
// a location list entry starting after the clobbering instruction.
|
||||
|
@ -300,7 +300,7 @@ NodeList Liveness::getAllReachingDefs(RegisterRef RefRR,
|
||||
auto DeadP = [](const NodeAddr<DefNode*> DA) -> bool {
|
||||
return DA.Addr->getFlags() & NodeAttrs::Dead;
|
||||
};
|
||||
RDefs.resize(std::distance(RDefs.begin(), llvm::remove_if(RDefs, DeadP)));
|
||||
llvm::erase_if(RDefs, DeadP);
|
||||
|
||||
return RDefs;
|
||||
}
|
||||
|
@ -361,10 +361,7 @@ StackMaps::parseRegisterLiveOutMask(const uint32_t *Mask) const {
|
||||
}
|
||||
}
|
||||
|
||||
LiveOuts.erase(
|
||||
llvm::remove_if(LiveOuts,
|
||||
[](const LiveOutReg &LO) { return LO.Reg == 0; }),
|
||||
LiveOuts.end());
|
||||
llvm::erase_if(LiveOuts, [](const LiveOutReg &LO) { return LO.Reg == 0; });
|
||||
|
||||
return LiveOuts;
|
||||
}
|
||||
|
@ -1304,8 +1304,7 @@ public:
|
||||
///
|
||||
/// Erases all attachments matching the \c shouldRemove predicate.
|
||||
template <class PredTy> void remove_if(PredTy shouldRemove) {
|
||||
Attachments.erase(llvm::remove_if(Attachments, shouldRemove),
|
||||
Attachments.end());
|
||||
llvm::erase_if(Attachments, shouldRemove);
|
||||
}
|
||||
};
|
||||
|
||||
|
@ -1169,11 +1169,10 @@ bool MDAttachments::erase(unsigned ID) {
|
||||
return true;
|
||||
}
|
||||
|
||||
auto I = std::remove_if(Attachments.begin(), Attachments.end(),
|
||||
[ID](const Attachment &A) { return A.MDKind == ID; });
|
||||
bool Changed = I != Attachments.end();
|
||||
Attachments.erase(I, Attachments.end());
|
||||
return Changed;
|
||||
auto OldSize = Attachments.size();
|
||||
llvm::erase_if(Attachments,
|
||||
[ID](const Attachment &A) { return A.MDKind == ID; });
|
||||
return OldSize != Attachments.size();
|
||||
}
|
||||
|
||||
MDNode *Value::getMetadata(unsigned KindID) const {
|
||||
|
Loading…
Reference in New Issue
Block a user