summaryrefslogtreecommitdiffstats
path: root/llvm/utils/TableGen/CodeGenDAGPatterns.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'llvm/utils/TableGen/CodeGenDAGPatterns.cpp')
-rw-r--r--llvm/utils/TableGen/CodeGenDAGPatterns.cpp5
1 files changed, 3 insertions, 2 deletions
diff --git a/llvm/utils/TableGen/CodeGenDAGPatterns.cpp b/llvm/utils/TableGen/CodeGenDAGPatterns.cpp
index 31ce74534e4..8b9253499af 100644
--- a/llvm/utils/TableGen/CodeGenDAGPatterns.cpp
+++ b/llvm/utils/TableGen/CodeGenDAGPatterns.cpp
@@ -4551,9 +4551,10 @@ void CodeGenDAGPatterns::GenerateVariants() {
PatternsToMatch[i].getAddedComplexity(), Record::getNewUID()));
MatchedPredicates.push_back(Matches);
+ // Add a new match the same as this pattern.
unsigned NumPatterns = PatternsToMatch.size();
- for (unsigned p = 0; p != NumPatterns; ++p)
- MatchedPredicates[p].resize(NumPatterns, MatchedPredicates[p][i]);
+ for (auto &P : MatchedPredicates)
+ P.resize(NumPatterns, P[i]);
}
LLVM_DEBUG(errs() << "\n");
OpenPOWER on IntegriCloud