Whenever the utility copies a block it stores it in a temporary buffer, this function adds the buffer into the Function. The blocks will be inserted after the block |insert_point|.
| 887 | // function adds the buffer into the Function. The blocks will be inserted |
| 888 | // after the block |insert_point|. |
| 889 | void LoopUnrollerUtilsImpl::AddBlocksToFunction( |
| 890 | const BasicBlock* insert_point) { |
| 891 | for (auto basic_block_iterator = function_.begin(); |
| 892 | basic_block_iterator != function_.end(); ++basic_block_iterator) { |
| 893 | if (basic_block_iterator->id() == insert_point->id()) { |
| 894 | basic_block_iterator.InsertBefore(&blocks_to_add_); |
| 895 | return; |
| 896 | } |
| 897 | } |
| 898 | |
| 899 | assert( |
| 900 | false && |
| 901 | "Could not add basic blocks to function as insert point was not found."); |
| 902 | } |
| 903 | |
| 904 | // Assign all result_ids in |basic_block| instructions to new IDs and preserve |
| 905 | // the mapping of new ids to old ones. |
nothing calls this directly
no test coverage detected