[CodeGen] RegisterCoalescer::buildVRegToDbgValueMap - use const-ref value in for-range loop. NFCI.

Avoid unnecessary copies, reported by MSVC static analyzer.
This commit is contained in:
Simon Pilgrim 2021-09-22 18:38:10 +01:00
parent 85a586501b
commit 5cabe4d9d3
1 changed files with 1 additions and 1 deletions

View File

@ -3708,7 +3708,7 @@ void RegisterCoalescer::buildVRegToDbgValueMap(MachineFunction &MF)
// vreg => DbgValueLoc map.
auto CloseNewDVRange = [this, &ToInsert](SlotIndex Slot) {
for (auto *X : ToInsert) {
for (auto Op : X->debug_operands()) {
for (const auto &Op : X->debug_operands()) {
if (Op.isReg() && Op.getReg().isVirtual())
DbgVRegToValues[Op.getReg()].push_back({Slot, X});
}