| 216 | } |
| 217 | |
| 218 | BasicBlock* Function::InsertBasicBlockBefore( |
| 219 | std::unique_ptr<BasicBlock>&& new_block, BasicBlock* position) { |
| 220 | for (auto bb_iter = begin(); bb_iter != end(); ++bb_iter) { |
| 221 | if (&*bb_iter == position) { |
| 222 | new_block->SetParent(this); |
| 223 | bb_iter = bb_iter.InsertBefore(std::move(new_block)); |
| 224 | return &*bb_iter; |
| 225 | } |
| 226 | } |
| 227 | assert(false && "Could not find insertion point."); |
| 228 | return nullptr; |
| 229 | } |
| 230 | |
| 231 | bool Function::HasEarlyReturn() const { |
| 232 | auto post_dominator_analysis = |
no test coverage detected