diff --git a/llvm/utils/TableGen/DAGISelEmitter.cpp b/llvm/utils/TableGen/DAGISelEmitter.cpp index 7b3dc03a67e1..2f211e2958fa 100644 --- a/llvm/utils/TableGen/DAGISelEmitter.cpp +++ b/llvm/utils/TableGen/DAGISelEmitter.cpp @@ -163,9 +163,9 @@ void DAGISelEmitter::run(raw_ostream &OS) { // Convert each variant of each pattern into a Matcher. Records.startTimer("Convert to matchers"); std::vector PatternMatchers; - for (unsigned i = 0, e = Patterns.size(); i != e; ++i) { + for (const PatternToMatch *PTM : Patterns) { for (unsigned Variant = 0; ; ++Variant) { - if (Matcher *M = ConvertPatternToMatcher(*Patterns[i], Variant, CGP)) + if (Matcher *M = ConvertPatternToMatcher(*PTM, Variant, CGP)) PatternMatchers.push_back(M); else break;