File tree Expand file tree Collapse file tree 1 file changed +4
-7
lines changed
llvm/include/llvm/Analysis Expand file tree Collapse file tree 1 file changed +4
-7
lines changed Original file line number Diff line number Diff line change @@ -338,14 +338,11 @@ template <class Tr>
338338typename Tr::RegionNodeT *RegionBase<Tr>::getBBNode(BlockT *BB) const {
339339 assert (contains (BB) && " Can get BB node out of this region!" );
340340
341- typename BBNodeMapT::const_iterator at = BBNodeMap.find (BB);
342-
343- if (at == BBNodeMap.end ()) {
341+ auto [at, Inserted] = BBNodeMap.try_emplace (BB);
342+ if (Inserted) {
344343 auto Deconst = const_cast <RegionBase<Tr> *>(this );
345- typename BBNodeMapT::value_type V = {
346- BB,
347- std::make_unique<RegionNodeT>(static_cast <RegionT *>(Deconst), BB)};
348- at = BBNodeMap.insert (std::move (V)).first ;
344+ at->second =
345+ std::make_unique<RegionNodeT>(static_cast <RegionT *>(Deconst), BB);
349346 }
350347 return at->second .get ();
351348}
You can’t perform that action at this time.
0 commit comments