@@ -448,11 +448,12 @@ static void calculateCXXStateNumbers(WinEHFuncInfo &FuncInfo,
448
448
449
449
// It's possible for a cleanup to be visited twice: it might have multiple
450
450
// cleanupret instructions.
451
- if (FuncInfo.EHPadStateMap .count (CleanupPad))
451
+ auto [It, Inserted] = FuncInfo.EHPadStateMap .try_emplace (CleanupPad);
452
+ if (!Inserted)
452
453
return ;
453
454
454
455
int CleanupState = addUnwindMapEntry (FuncInfo, ParentState, BB);
455
- FuncInfo. EHPadStateMap [CleanupPad] = CleanupState;
456
+ It-> second = CleanupState;
456
457
LLVM_DEBUG (dbgs () << " Assigning state #" << CleanupState << " to BB "
457
458
<< BB->getName () << ' \n ' );
458
459
for (const BasicBlock *PredBlock : predecessors (BB)) {
@@ -554,11 +555,12 @@ static void calculateSEHStateNumbers(WinEHFuncInfo &FuncInfo,
554
555
555
556
// It's possible for a cleanup to be visited twice: it might have multiple
556
557
// cleanupret instructions.
557
- if (FuncInfo.EHPadStateMap .count (CleanupPad))
558
+ auto [It, Inserted] = FuncInfo.EHPadStateMap .try_emplace (CleanupPad);
559
+ if (!Inserted)
558
560
return ;
559
561
560
562
int CleanupState = addSEHFinally (FuncInfo, ParentState, BB);
561
- FuncInfo. EHPadStateMap [CleanupPad] = CleanupState;
563
+ It-> second = CleanupState;
562
564
LLVM_DEBUG (dbgs () << " Assigning state #" << CleanupState << " to BB "
563
565
<< BB->getName () << ' \n ' );
564
566
for (const BasicBlock *PredBlock : predecessors (BB))
0 commit comments