aboutsummaryrefslogtreecommitdiff
path: root/llvm/utils/TableGen/SubtargetEmitter.cpp
diff options
context:
space:
mode:
authorDavid Majnemer <david.majnemer@gmail.com>2016-08-12 03:55:06 +0000
committerDavid Majnemer <david.majnemer@gmail.com>2016-08-12 03:55:06 +0000
commit42531260b3e0cc6256bd64911fc3db7aea59a68e (patch)
treebb5d1b3e84331a2673079b42a25135d177d5f8e4 /llvm/utils/TableGen/SubtargetEmitter.cpp
parent1a2cb97f7b6b0a3ad14c7f076b10a1a19834fac7 (diff)
downloadllvm-42531260b3e0cc6256bd64911fc3db7aea59a68e.zip
llvm-42531260b3e0cc6256bd64911fc3db7aea59a68e.tar.gz
llvm-42531260b3e0cc6256bd64911fc3db7aea59a68e.tar.bz2
Use the range variant of find/find_if 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: 278469
Diffstat (limited to 'llvm/utils/TableGen/SubtargetEmitter.cpp')
-rw-r--r--llvm/utils/TableGen/SubtargetEmitter.cpp8
1 files changed, 2 insertions, 6 deletions
diff --git a/llvm/utils/TableGen/SubtargetEmitter.cpp b/llvm/utils/TableGen/SubtargetEmitter.cpp
index bc56384..9719412 100644
--- a/llvm/utils/TableGen/SubtargetEmitter.cpp
+++ b/llvm/utils/TableGen/SubtargetEmitter.cpp
@@ -826,9 +826,7 @@ void SubtargetEmitter::GenSchedClassTables(const CodeGenProcModel &ProcModel,
HasVariants = true;
break;
}
- IdxIter PIPos = std::find(TI->ProcIndices.begin(),
- TI->ProcIndices.end(), ProcModel.Index);
- if (PIPos != TI->ProcIndices.end()) {
+ if (is_contained(TI->ProcIndices, ProcModel.Index)) {
HasVariants = true;
break;
}
@@ -843,9 +841,7 @@ void SubtargetEmitter::GenSchedClassTables(const CodeGenProcModel &ProcModel,
// If ProcIndices contains 0, this class applies to all processors.
assert(!SC.ProcIndices.empty() && "expect at least one procidx");
if (SC.ProcIndices[0] != 0) {
- IdxIter PIPos = std::find(SC.ProcIndices.begin(),
- SC.ProcIndices.end(), ProcModel.Index);
- if (PIPos == SC.ProcIndices.end())
+ if (!is_contained(SC.ProcIndices, ProcModel.Index))
continue;
}
IdxVec Writes = SC.Writes;