File tree Expand file tree Collapse file tree 1 file changed +9
-9
lines changed
llvm/lib/Target/WebAssembly Expand file tree Collapse file tree 1 file changed +9
-9
lines changed Original file line number Diff line number Diff line change @@ -28,17 +28,17 @@ const SortRegion *SortRegionInfo::getRegionFor(const MachineBasicBlock *MBB) {
28
28
// WE->contains(ML->getHeader()), but not ML->contains(WE->getHeader()).
29
29
if ((ML && !WE) || (ML && WE && WE->contains (ML->getHeader ()))) {
30
30
// If the smallest region containing MBB is a loop
31
- if ( LoopMap.count (ML))
32
- return LoopMap[ML]. get ();
33
- LoopMap[ML] = std::make_unique<ConcreteSortRegion<MachineLoop>>(ML);
34
- return LoopMap[ML] .get ();
31
+ auto [It, Inserted] = LoopMap.try_emplace (ML);
32
+ if (Inserted)
33
+ It-> second = std::make_unique<ConcreteSortRegion<MachineLoop>>(ML);
34
+ return It-> second .get ();
35
35
} else {
36
36
// If the smallest region containing MBB is an exception
37
- if ( ExceptionMap.count (WE))
38
- return ExceptionMap[WE]. get ();
39
- ExceptionMap[WE] =
40
- std::make_unique<ConcreteSortRegion<WebAssemblyException>>(WE);
41
- return ExceptionMap[WE] .get ();
37
+ auto [It, Inserted] = ExceptionMap.try_emplace (WE);
38
+ if (Inserted)
39
+ It-> second =
40
+ std::make_unique<ConcreteSortRegion<WebAssemblyException>>(WE);
41
+ return It-> second .get ();
42
42
}
43
43
}
44
44
You can’t perform that action at this time.
0 commit comments