diff options
author | Simon Pilgrim <llvm-dev@redking.me.uk> | 2021-09-17 14:00:16 +0100 |
---|---|---|
committer | Simon Pilgrim <llvm-dev@redking.me.uk> | 2021-09-17 14:04:54 +0100 |
commit | 4af76434706a65d839ff167d98455d0704cad70b (patch) | |
tree | 06a700c795bb29f41cf4206eef943253d5254044 /llvm/lib/CodeGen/LiveDebugVariables.cpp | |
parent | bbebb564f9316fd37605eb92028d15f9e005d212 (diff) | |
download | llvm-4af76434706a65d839ff167d98455d0704cad70b.zip llvm-4af76434706a65d839ff167d98455d0704cad70b.tar.gz llvm-4af76434706a65d839ff167d98455d0704cad70b.tar.bz2 |
[CodeGen] LiveDebug - Use const-ref iterator in for-range loop. NFCI.
Avoid unnecessary copies, reported by MSVC static analyzer.
Diffstat (limited to 'llvm/lib/CodeGen/LiveDebugVariables.cpp')
-rw-r--r-- | llvm/lib/CodeGen/LiveDebugVariables.cpp | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/llvm/lib/CodeGen/LiveDebugVariables.cpp b/llvm/lib/CodeGen/LiveDebugVariables.cpp index 9a86cc7..c929c1d 100644 --- a/llvm/lib/CodeGen/LiveDebugVariables.cpp +++ b/llvm/lib/CodeGen/LiveDebugVariables.cpp @@ -417,7 +417,7 @@ public: void addDef(SlotIndex Idx, ArrayRef<MachineOperand> LocMOs, bool IsIndirect, bool IsList, const DIExpression &Expr) { SmallVector<unsigned> Locs; - for (MachineOperand Op : LocMOs) + for (const MachineOperand &Op : LocMOs) Locs.push_back(getLocationNo(Op)); DbgVariableValue DbgValue(Locs, IsIndirect, IsList, Expr); // Add a singular (Idx,Idx) -> value mapping. |