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/LiveDebugValues/VarLocBasedImpl.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/LiveDebugValues/VarLocBasedImpl.cpp')
-rw-r--r-- | llvm/lib/CodeGen/LiveDebugValues/VarLocBasedImpl.cpp | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/llvm/lib/CodeGen/LiveDebugValues/VarLocBasedImpl.cpp b/llvm/lib/CodeGen/LiveDebugValues/VarLocBasedImpl.cpp index 99a57b5..899163c 100644 --- a/llvm/lib/CodeGen/LiveDebugValues/VarLocBasedImpl.cpp +++ b/llvm/lib/CodeGen/LiveDebugValues/VarLocBasedImpl.cpp @@ -627,7 +627,7 @@ private: /// add each of them to \p Regs and return true. bool getDescribingRegs(SmallVectorImpl<uint32_t> &Regs) const { bool AnyRegs = false; - for (auto Loc : Locs) + for (const auto &Loc : Locs) if (Loc.Kind == MachineLocKind::RegisterKind) { Regs.push_back(Loc.Value.RegNo); AnyRegs = true; |