| 55 | } |
| 56 | |
| 57 | const Instruction* BasicBlock::GetMergeInst() const { |
| 58 | const Instruction* result = nullptr; |
| 59 | // If it exists, the merge instruction immediately precedes the |
| 60 | // terminator. |
| 61 | auto iter = ctail(); |
| 62 | if (iter != cbegin()) { |
| 63 | --iter; |
| 64 | const auto opcode = iter->opcode(); |
| 65 | if (opcode == spv::Op::OpLoopMerge || opcode == spv::Op::OpSelectionMerge) { |
| 66 | result = &*iter; |
| 67 | } |
| 68 | } |
| 69 | return result; |
| 70 | } |
| 71 | |
| 72 | Instruction* BasicBlock::GetMergeInst() { |
| 73 | Instruction* result = nullptr; |
no test coverage detected