| 259 | } |
| 260 | |
| 261 | inline void Function::MoveBasicBlockToAfter(uint32_t id, BasicBlock* ip) { |
| 262 | std::unique_ptr<BasicBlock> block_to_move = std::move(*FindBlock(id).Get()); |
| 263 | blocks_.erase(std::find(std::begin(blocks_), std::end(blocks_), nullptr)); |
| 264 | |
| 265 | assert(block_to_move->GetParent() == ip->GetParent() && |
| 266 | "Both blocks have to be in the same function."); |
| 267 | |
| 268 | InsertBasicBlockAfter(std::move(block_to_move), ip); |
| 269 | } |
| 270 | |
| 271 | inline void Function::RemoveEmptyBlocks() { |
| 272 | auto first_empty = |