File tree Expand file tree Collapse file tree 1 file changed +3
-5
lines changed
llvm/lib/Transforms/Utils Expand file tree Collapse file tree 1 file changed +3
-5
lines changed Original file line number Diff line number Diff line change @@ -2178,11 +2178,9 @@ void llvm::insertDebugValuesForPHIs(BasicBlock *BB,
2178
2178
auto V = DbgValueMap.find (VI);
2179
2179
if (V != DbgValueMap.end ()) {
2180
2180
auto *DbgII = cast<DbgVariableIntrinsic>(V->second );
2181
- auto NewDI = NewDbgValueMap.find ({Parent, DbgII});
2182
- if (NewDI == NewDbgValueMap.end ()) {
2183
- auto *NewDbgII = cast<DbgVariableIntrinsic>(DbgII->clone ());
2184
- NewDI = NewDbgValueMap.insert ({{Parent, DbgII}, NewDbgII}).first ;
2185
- }
2181
+ auto [NewDI, Inserted] = NewDbgValueMap.try_emplace ({Parent, DbgII});
2182
+ if (Inserted)
2183
+ NewDI->second = cast<DbgVariableIntrinsic>(DbgII->clone ());
2186
2184
DbgVariableIntrinsic *NewDbgII = NewDI->second ;
2187
2185
// If PHI contains VI as an operand more than once, we may
2188
2186
// replaced it in NewDbgII; confirm that it is present.
You can’t perform that action at this time.
0 commit comments