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) {
2828 // WE->contains(ML->getHeader()), but not ML->contains(WE->getHeader()).
2929 if ((ML && !WE) || (ML && WE && WE->contains (ML->getHeader ()))) {
3030 // 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 ();
3535 } else {
3636 // 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 ();
4242 }
4343}
4444
You can’t perform that action at this time.
0 commit comments