Use the range variant of find instead of unpacking begin/end
If the result of the find is only used to compare against end(), just
use is_contained instead.
No functionality change is intended.
llvm-svn: 278433
diff --git a/llvm/lib/Analysis/EHPersonalities.cpp b/llvm/lib/Analysis/EHPersonalities.cpp
index 5f951f5..8896ef0 100644
--- a/llvm/lib/Analysis/EHPersonalities.cpp
+++ b/llvm/lib/Analysis/EHPersonalities.cpp
@@ -82,7 +82,7 @@
}
// Note that this is a member of the given color.
ColorVector &Colors = BlockColors[Visiting];
- if (std::find(Colors.begin(), Colors.end(), Color) == Colors.end())
+ if (!is_contained(Colors, Color))
Colors.push_back(Color);
else
continue;
diff --git a/llvm/lib/Analysis/GlobalsModRef.cpp b/llvm/lib/Analysis/GlobalsModRef.cpp
index 8289e58..0da888d 100644
--- a/llvm/lib/Analysis/GlobalsModRef.cpp
+++ b/llvm/lib/Analysis/GlobalsModRef.cpp
@@ -521,7 +521,7 @@
// Can't say anything about it. However, if it is inside our SCC,
// then nothing needs to be done.
CallGraphNode *CalleeNode = CG[Callee];
- if (std::find(SCC.begin(), SCC.end(), CalleeNode) == SCC.end())
+ if (!is_contained(SCC, CalleeNode))
KnowNothing = true;
}
} else {
diff --git a/llvm/lib/Analysis/LazyCallGraph.cpp b/llvm/lib/Analysis/LazyCallGraph.cpp
index 404b831..fc6b02b 100644
--- a/llvm/lib/Analysis/LazyCallGraph.cpp
+++ b/llvm/lib/Analysis/LazyCallGraph.cpp
@@ -907,8 +907,7 @@
RefSCC &TargetRC = *G->lookupRefSCC(TargetN);
assert(&TargetRC != this && "The target must not be a member of this RefSCC");
- assert(std::find(G->LeafRefSCCs.begin(), G->LeafRefSCCs.end(), this) ==
- G->LeafRefSCCs.end() &&
+ assert(!is_contained(G->LeafRefSCCs, this) &&
"Cannot have a leaf RefSCC source.");
// First remove it from the node.
diff --git a/llvm/lib/Analysis/PHITransAddr.cpp b/llvm/lib/Analysis/PHITransAddr.cpp
index b4aad74..84ecd4a 100644
--- a/llvm/lib/Analysis/PHITransAddr.cpp
+++ b/llvm/lib/Analysis/PHITransAddr.cpp
@@ -62,8 +62,7 @@
// If it's an instruction, it is either in Tmp or its operands recursively
// are.
- SmallVectorImpl<Instruction*>::iterator Entry =
- std::find(InstInputs.begin(), InstInputs.end(), I);
+ SmallVectorImpl<Instruction *>::iterator Entry = find(InstInputs, I);
if (Entry != InstInputs.end()) {
InstInputs.erase(Entry);
return true;
@@ -126,8 +125,7 @@
if (!I) return;
// If the instruction is in the InstInputs list, remove it.
- SmallVectorImpl<Instruction*>::iterator Entry =
- std::find(InstInputs.begin(), InstInputs.end(), I);
+ SmallVectorImpl<Instruction *>::iterator Entry = find(InstInputs, I);
if (Entry != InstInputs.end()) {
InstInputs.erase(Entry);
return;
@@ -150,8 +148,7 @@
if (!Inst) return V;
// Determine whether 'Inst' is an input to our PHI translatable expression.
- bool isInput =
- std::find(InstInputs.begin(), InstInputs.end(), Inst) != InstInputs.end();
+ bool isInput = is_contained(InstInputs, Inst);
// Handle inputs instructions if needed.
if (isInput) {
@@ -165,7 +162,7 @@
// translated, we need to incorporate the value into the expression or fail.
// In either case, the instruction itself isn't an input any longer.
- InstInputs.erase(std::find(InstInputs.begin(), InstInputs.end(), Inst));
+ InstInputs.erase(find(InstInputs, Inst));
// If this is a PHI, go ahead and translate it.
if (PHINode *PN = dyn_cast<PHINode>(Inst))
@@ -272,8 +269,7 @@
isNSW = isNUW = false;
// If the old 'LHS' was an input, add the new 'LHS' as an input.
- if (std::find(InstInputs.begin(), InstInputs.end(), BOp) !=
- InstInputs.end()) {
+ if (is_contained(InstInputs, BOp)) {
RemoveInstInputs(BOp, InstInputs);
AddAsInput(LHS);
}