aboutsummaryrefslogtreecommitdiff
path: root/llvm/lib/CodeGen/LiveDebugValues/VarLocBasedImpl.cpp
diff options
context:
space:
mode:
authorWang, Xin10 <xin10.wang@intel.com>2023-05-28 22:23:32 -0400
committerWang, Xin10 <xin10.wang@intel.com>2023-05-28 22:24:21 -0400
commitfbb241c5523c07842af6cbe7a3a5a1c6513f1302 (patch)
tree12d9876cc60608096b61915da198f4e37f0bfeb8 /llvm/lib/CodeGen/LiveDebugValues/VarLocBasedImpl.cpp
parent9032a94637981cce528f0838df4d4d474105d076 (diff)
downloadllvm-fbb241c5523c07842af6cbe7a3a5a1c6513f1302.zip
llvm-fbb241c5523c07842af6cbe7a3a5a1c6513f1302.tar.gz
llvm-fbb241c5523c07842af6cbe7a3a5a1c6513f1302.tar.bz2
use ref to avoid copy in range for-loop
Use big obj copy in range for-loop will call copy constructor every time, which can be avoided by use ref instead. Reviewed By: skan Differential Revision: https://reviews.llvm.org/D150024
Diffstat (limited to 'llvm/lib/CodeGen/LiveDebugValues/VarLocBasedImpl.cpp')
-rw-r--r--llvm/lib/CodeGen/LiveDebugValues/VarLocBasedImpl.cpp2
1 files changed, 1 insertions, 1 deletions
diff --git a/llvm/lib/CodeGen/LiveDebugValues/VarLocBasedImpl.cpp b/llvm/lib/CodeGen/LiveDebugValues/VarLocBasedImpl.cpp
index c5942ae..8aa9807 100644
--- a/llvm/lib/CodeGen/LiveDebugValues/VarLocBasedImpl.cpp
+++ b/llvm/lib/CodeGen/LiveDebugValues/VarLocBasedImpl.cpp
@@ -1312,7 +1312,7 @@ void VarLocBasedLDV::cleanupEntryValueTransfers(
return;
auto TransRange = EntryValTransfers.equal_range(TRInst);
- for (auto TDPair : llvm::make_range(TransRange.first, TransRange.second)) {
+ for (auto &TDPair : llvm::make_range(TransRange.first, TransRange.second)) {
const VarLoc &EmittedEV = VarLocIDs[TDPair.second];
if (std::tie(EntryVL.Var, EntryVL.Locs[0].Value.RegNo, EntryVL.Expr) ==
std::tie(EmittedEV.Var, EmittedEV.Locs[0].Value.RegNo,