aboutsummaryrefslogtreecommitdiff
path: root/llvm/lib/CodeGen/LiveDebugValues/InstrRefBasedImpl.cpp
diff options
context:
space:
mode:
authorKazu Hirata <kazu@google.com>2025-05-22 23:50:58 -0700
committerGitHub <noreply@github.com>2025-05-22 23:50:58 -0700
commitcc78177e8f50f1d217b2fba5677fc1664aabd91e (patch)
tree29723bff7e4aa91ccee9c273b9a5b4172e6e1822 /llvm/lib/CodeGen/LiveDebugValues/InstrRefBasedImpl.cpp
parent05674b21fed51a940b93e09b38d1833010f3f694 (diff)
downloadllvm-cc78177e8f50f1d217b2fba5677fc1664aabd91e.zip
llvm-cc78177e8f50f1d217b2fba5677fc1664aabd91e.tar.gz
llvm-cc78177e8f50f1d217b2fba5677fc1664aabd91e.tar.bz2
[llvm] Use *Map::try_emplace (NFC) (#141190)
try_emplace can default-construct values, so we do not need to do so on our own. Plus, try_emplace(Key) is much simpler/shorter than insert({Key, LongValueType()}).
Diffstat (limited to 'llvm/lib/CodeGen/LiveDebugValues/InstrRefBasedImpl.cpp')
-rw-r--r--llvm/lib/CodeGen/LiveDebugValues/InstrRefBasedImpl.cpp3
1 files changed, 1 insertions, 2 deletions
diff --git a/llvm/lib/CodeGen/LiveDebugValues/InstrRefBasedImpl.cpp b/llvm/lib/CodeGen/LiveDebugValues/InstrRefBasedImpl.cpp
index a1fd5a7..fdf5018 100644
--- a/llvm/lib/CodeGen/LiveDebugValues/InstrRefBasedImpl.cpp
+++ b/llvm/lib/CodeGen/LiveDebugValues/InstrRefBasedImpl.cpp
@@ -1691,8 +1691,7 @@ bool InstrRefBasedLDV::transferDebugInstrRef(MachineInstr &MI,
// filled in later.
for (const DbgOp &Op : DbgOps) {
if (!Op.IsConst)
- if (FoundLocs.insert({Op.ID, TransferTracker::LocationAndQuality()})
- .second)
+ if (FoundLocs.try_emplace(Op.ID).second)
ValuesToFind.push_back(Op.ID);
}