Add the control flow info of a new node added during partitioning. The new node has the same control flow info as src.
| 687 | // Add the control flow info of a new node added during partitioning. |
| 688 | // The new node has the same control flow info as src. |
| 689 | void AddControlFlowInfo(const Node* node, const Node* src, |
| 690 | std::vector<ControlFlowInfo>* cf_info) { |
| 691 | int id = node->id(); |
| 692 | if (static_cast<size_t>(id) >= cf_info->size()) { |
| 693 | cf_info->resize(id + 1); |
| 694 | } |
| 695 | const ControlFlowInfo& src_info = (*cf_info)[src->id()]; |
| 696 | ControlFlowInfo* info = &(*cf_info)[id]; |
| 697 | info->frame = src_info.frame; |
| 698 | info->parent_frame = src_info.parent_frame; |
| 699 | info->frame_name = src_info.frame_name; |
| 700 | } |
| 701 | |
| 702 | // Constructs a control loop. Returns a struct containing the newly created |
| 703 | // enter, merge, and switch nodes. The enter and merge nodes are used in the |
no test coverage detected