@@ -1801,7 +1801,7 @@ static unsigned GetNumNodeResults(Record *Operator, CodeGenDAGPatterns &CDP) {
1801
1801
// The number of results of a fragment with alternative records is the
1802
1802
// maximum number of results across all alternatives.
1803
1803
unsigned NumResults = 0 ;
1804
- for (auto T : PFRec->getTrees ())
1804
+ for (const auto & T : PFRec->getTrees ())
1805
1805
NumResults = std::max (NumResults, T->getNumTypes ());
1806
1806
return NumResults;
1807
1807
}
@@ -2023,7 +2023,7 @@ void TreePatternNode::InlinePatternFragments(
2023
2023
if (ChildAlternatives[i].empty ())
2024
2024
return ;
2025
2025
2026
- for (auto NewChild : ChildAlternatives[i])
2026
+ for (const auto & NewChild : ChildAlternatives[i])
2027
2027
assert ((Child->getPredicateCalls ().empty () ||
2028
2028
NewChild->getPredicateCalls () == Child->getPredicateCalls ()) &&
2029
2029
" Non-empty child predicate clobbered!" );
@@ -2098,7 +2098,7 @@ void TreePatternNode::InlinePatternFragments(
2098
2098
}
2099
2099
2100
2100
// Loop over all fragment alternatives.
2101
- for (auto Alternative : Frag->getTrees ()) {
2101
+ for (const auto & Alternative : Frag->getTrees ()) {
2102
2102
TreePatternNodePtr FragTree = Alternative->clone ();
2103
2103
2104
2104
if (!PredFn.isAlwaysTrue ())
@@ -3214,7 +3214,7 @@ void CodeGenDAGPatterns::ParsePatternFragments(bool OutFrags) {
3214
3214
// it.
3215
3215
Record *Transform = Frag->getValueAsDef (" OperandTransform" );
3216
3216
if (!getSDNodeTransform (Transform).second .empty ()) // not noop xform?
3217
- for (auto T : P->getTrees ())
3217
+ for (const auto & T : P->getTrees ())
3218
3218
T->setTransformFn (Transform);
3219
3219
}
3220
3220
@@ -4187,7 +4187,7 @@ void CodeGenDAGPatterns::ParseOnePattern(Record *TheDef,
4187
4187
// resolve cases where the input type is known to be a pointer type (which
4188
4188
// is considered resolved), but the result knows it needs to be 32- or
4189
4189
// 64-bits. Infer the other way for good measure.
4190
- for (auto T : Pattern.getTrees ())
4190
+ for (const auto & T : Pattern.getTrees ())
4191
4191
for (unsigned i = 0 , e = std::min (Result.getOnlyTree ()->getNumTypes (),
4192
4192
T->getNumTypes ());
4193
4193
i != e; ++i) {
@@ -4241,7 +4241,7 @@ void CodeGenDAGPatterns::ParseOnePattern(Record *TheDef,
4241
4241
// will lead to a contradiction, which is not an error however, but
4242
4242
// a sign that this pattern will simply never match.
4243
4243
if (Temp.getOnlyTree ()->hasPossibleType ())
4244
- for (auto T : Pattern.getTrees ())
4244
+ for (const auto & T : Pattern.getTrees ())
4245
4245
if (T->hasPossibleType ())
4246
4246
AddPatternToMatch (&Pattern,
4247
4247
PatternToMatch (TheDef, makePredList (Preds),
@@ -4704,7 +4704,7 @@ void CodeGenDAGPatterns::GenerateVariants() {
4704
4704
}
4705
4705
}
4706
4706
4707
- for (auto it : PatternsWithVariants) {
4707
+ for (const auto & it : PatternsWithVariants) {
4708
4708
unsigned i = it.first ;
4709
4709
const MultipleUseVarSet &DepVars = it.second .first ;
4710
4710
const std::vector<TreePatternNodePtr> &Variants = it.second .second ;
0 commit comments