| 661 | } |
| 662 | |
| 663 | void LoopUtils::PopulateLoopNest( |
| 664 | Loop* new_loop, const LoopCloningResult& cloning_result) const { |
| 665 | std::unordered_map<Loop*, Loop*> loop_mapping; |
| 666 | loop_mapping[loop_] = new_loop; |
| 667 | |
| 668 | if (loop_->HasParent()) loop_->GetParent()->AddNestedLoop(new_loop); |
| 669 | PopulateLoopDesc(new_loop, loop_, cloning_result); |
| 670 | |
| 671 | for (Loop& sub_loop : |
| 672 | make_range(++TreeDFIterator<Loop>(loop_), TreeDFIterator<Loop>())) { |
| 673 | Loop* cloned = new Loop(context_); |
| 674 | if (Loop* parent = loop_mapping[sub_loop.GetParent()]) |
| 675 | parent->AddNestedLoop(cloned); |
| 676 | loop_mapping[&sub_loop] = cloned; |
| 677 | PopulateLoopDesc(cloned, &sub_loop, cloning_result); |
| 678 | } |
| 679 | |
| 680 | loop_desc_->AddLoopNest(std::unique_ptr<Loop>(new_loop)); |
| 681 | } |
| 682 | |
| 683 | // Populates |new_loop| descriptor according to |old_loop|'s one. |
| 684 | void LoopUtils::PopulateLoopDesc( |
nothing calls this directly
no test coverage detected