[llvm] 595d8d4 - [TableGen] Make use of find_if. NFC.
Jay Foad via llvm-commits
llvm-commits at lists.llvm.org
Mon Feb 12 08:46:15 PST 2024
Author: Jay Foad
Date: 2024-02-12T16:46:07Z
New Revision: 595d8d4e856217f69dc05448ae852c24e65cc181
URL: https://github.com/llvm/llvm-project/commit/595d8d4e856217f69dc05448ae852c24e65cc181
DIFF: https://github.com/llvm/llvm-project/commit/595d8d4e856217f69dc05448ae852c24e65cc181.diff
LOG: [TableGen] Make use of find_if. NFC.
Added:
Modified:
llvm/utils/TableGen/CodeGenRegisters.cpp
Removed:
################################################################################
diff --git a/llvm/utils/TableGen/CodeGenRegisters.cpp b/llvm/utils/TableGen/CodeGenRegisters.cpp
index 4b8954059d5587..25f38648366300 100644
--- a/llvm/utils/TableGen/CodeGenRegisters.cpp
+++ b/llvm/utils/TableGen/CodeGenRegisters.cpp
@@ -1898,13 +1898,8 @@ void CodeGenRegBank::computeRegUnitWeights() {
static std::vector<RegUnitSet>::const_iterator
findRegUnitSet(const std::vector<RegUnitSet> &UniqueSets,
const RegUnitSet &Set) {
- std::vector<RegUnitSet>::const_iterator I = UniqueSets.begin(),
- E = UniqueSets.end();
- for (; I != E; ++I) {
- if (I->Units == Set.Units)
- break;
- }
- return I;
+ return find_if(UniqueSets,
+ [&Set](const RegUnitSet &I) { return I.Units == Set.Units; });
}
// Return true if the RUSubSet is a subset of RUSuperSet.
More information about the llvm-commits
mailing list