[llvm] 2eabcb7 - [TableGen] Use range-based for loop. NFC
Craig Topper via llvm-commits
llvm-commits at lists.llvm.org
Sat Feb 1 23:46:14 PST 2025
Author: Craig Topper
Date: 2025-02-01T23:44:43-08:00
New Revision: 2eabcb73c2aea04720854d4c999019cab2b18efb
URL: https://github.com/llvm/llvm-project/commit/2eabcb73c2aea04720854d4c999019cab2b18efb
DIFF: https://github.com/llvm/llvm-project/commit/2eabcb73c2aea04720854d4c999019cab2b18efb.diff
LOG: [TableGen] Use range-based for loop. NFC
Added:
Modified:
llvm/utils/TableGen/DAGISelMatcherGen.cpp
Removed:
################################################################################
diff --git a/llvm/utils/TableGen/DAGISelMatcherGen.cpp b/llvm/utils/TableGen/DAGISelMatcherGen.cpp
index e1c25075e384d4..55213b74ffb0d5 100644
--- a/llvm/utils/TableGen/DAGISelMatcherGen.cpp
+++ b/llvm/utils/TableGen/DAGISelMatcherGen.cpp
@@ -580,8 +580,8 @@ bool MatcherGen::EmitMatcherCode(unsigned Variant) {
// checks (e.g. addrmode matches). We emit this after the structural match
// because they are generally more expensive to evaluate and more
diff icult to
// factor.
- for (unsigned i = 0, e = MatchedComplexPatterns.size(); i != e; ++i) {
- auto &N = *MatchedComplexPatterns[i].first;
+ for (const auto &MCP : MatchedComplexPatterns) {
+ auto &N = *MCP.first;
// Remember where the results of this match get stuck.
if (N.isLeaf()) {
@@ -595,7 +595,7 @@ bool MatcherGen::EmitMatcherCode(unsigned Variant) {
}
// Get the slot we recorded the value in from the name on the node.
- unsigned RecNodeEntry = MatchedComplexPatterns[i].second;
+ unsigned RecNodeEntry = MCP.second;
const ComplexPattern *CP = N.getComplexPatternInfo(CGP);
assert(CP && "Not a valid ComplexPattern!");
More information about the llvm-commits
mailing list