[CodeGen] SelectionDAGBuilder - Use const-ref iterator in for-range loops. NFCI.

Avoid unnecessary copies, reported by MSVC static analyzer.
This commit is contained in:
Simon Pilgrim 2021-09-21 10:19:12 +01:00
parent f5d23d36de
commit 20b58855e0
1 changed files with 2 additions and 2 deletions

View File

@ -1409,7 +1409,7 @@ bool SelectionDAGBuilder::handleDebugValue(ArrayRef<const Value *> Values,
BitsToDescribe = *VarSize;
if (auto Fragment = Expr->getFragmentInfo())
BitsToDescribe = Fragment->SizeInBits;
for (auto RegAndSize : RFV.getRegsAndSizes()) {
for (const auto &RegAndSize : RFV.getRegsAndSizes()) {
// Bail out if all bits are described already.
if (Offset >= BitsToDescribe)
break;
@ -5629,7 +5629,7 @@ bool SelectionDAGBuilder::EmitFuncArgumentDbgValue(
auto splitMultiRegDbgValue = [&](ArrayRef<std::pair<unsigned, TypeSize>>
SplitRegs) {
unsigned Offset = 0;
for (auto RegAndSize : SplitRegs) {
for (const auto &RegAndSize : SplitRegs) {
// If the expression is already a fragment, the current register
// offset+size might extend beyond the fragment. In this case, only
// the register bits that are inside the fragment are relevant.