| 292 | } |
| 293 | |
| 294 | std::unique_ptr<BasicBlock> InlinePass::AddGuardBlock( |
| 295 | std::vector<std::unique_ptr<BasicBlock>>* new_blocks, |
| 296 | std::unordered_map<uint32_t, uint32_t>* callee2caller, |
| 297 | std::unique_ptr<BasicBlock> new_blk_ptr, uint32_t entry_blk_label_id) { |
| 298 | const auto guard_block_id = context()->TakeNextId(); |
| 299 | if (guard_block_id == 0) { |
| 300 | return nullptr; |
| 301 | } |
| 302 | AddBranch(guard_block_id, &new_blk_ptr); |
| 303 | new_blocks->push_back(std::move(new_blk_ptr)); |
| 304 | // Start the next block. |
| 305 | new_blk_ptr = MakeUnique<BasicBlock>(NewLabel(guard_block_id)); |
| 306 | // Reset the mapping of the callee's entry block to point to |
| 307 | // the guard block. Do this so we can fix up phis later on to |
| 308 | // satisfy dominance. |
| 309 | (*callee2caller)[entry_blk_label_id] = guard_block_id; |
| 310 | return new_blk_ptr; |
| 311 | } |
| 312 | |
| 313 | InstructionList::iterator InlinePass::AddStoresForVariableInitializers( |
| 314 | const std::unordered_map<uint32_t, uint32_t>& callee2caller, |
nothing calls this directly
no test coverage detected