aboutsummaryrefslogtreecommitdiff
path: root/llvm/lib/Transforms/Utils/Local.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'llvm/lib/Transforms/Utils/Local.cpp')
-rw-r--r--llvm/lib/Transforms/Utils/Local.cpp8
1 files changed, 3 insertions, 5 deletions
diff --git a/llvm/lib/Transforms/Utils/Local.cpp b/llvm/lib/Transforms/Utils/Local.cpp
index 47a7049..768765b 100644
--- a/llvm/lib/Transforms/Utils/Local.cpp
+++ b/llvm/lib/Transforms/Utils/Local.cpp
@@ -2178,11 +2178,9 @@ void llvm::insertDebugValuesForPHIs(BasicBlock *BB,
auto V = DbgValueMap.find(VI);
if (V != DbgValueMap.end()) {
auto *DbgII = cast<DbgVariableIntrinsic>(V->second);
- auto NewDI = NewDbgValueMap.find({Parent, DbgII});
- if (NewDI == NewDbgValueMap.end()) {
- auto *NewDbgII = cast<DbgVariableIntrinsic>(DbgII->clone());
- NewDI = NewDbgValueMap.insert({{Parent, DbgII}, NewDbgII}).first;
- }
+ auto [NewDI, Inserted] = NewDbgValueMap.try_emplace({Parent, DbgII});
+ if (Inserted)
+ NewDI->second = cast<DbgVariableIntrinsic>(DbgII->clone());
DbgVariableIntrinsic *NewDbgII = NewDI->second;
// If PHI contains VI as an operand more than once, we may
// replaced it in NewDbgII; confirm that it is present.