aboutsummaryrefslogtreecommitdiff
path: root/llvm/lib/CodeGen/LiveDebugVariables.cpp
diff options
context:
space:
mode:
authorSimon Pilgrim <llvm-dev@redking.me.uk>2021-09-17 14:00:16 +0100
committerSimon Pilgrim <llvm-dev@redking.me.uk>2021-09-17 14:04:54 +0100
commit4af76434706a65d839ff167d98455d0704cad70b (patch)
tree06a700c795bb29f41cf4206eef943253d5254044 /llvm/lib/CodeGen/LiveDebugVariables.cpp
parentbbebb564f9316fd37605eb92028d15f9e005d212 (diff)
downloadllvm-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.cpp2
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.