| 119 | } |
| 120 | |
| 121 | bool BasicBlock::WhileEachSuccessorLabel( |
| 122 | const std::function<bool(const uint32_t)>& f) const { |
| 123 | const auto br = &insts_.back(); |
| 124 | switch (br->opcode()) { |
| 125 | case spv::Op::OpBranch: |
| 126 | return f(br->GetOperand(0).words[0]); |
| 127 | case spv::Op::OpBranchConditional: |
| 128 | case spv::Op::OpSwitch: { |
| 129 | bool is_first = true; |
| 130 | return br->WhileEachInId([&is_first, &f](const uint32_t* idp) { |
| 131 | if (!is_first) return f(*idp); |
| 132 | is_first = false; |
| 133 | return true; |
| 134 | }); |
| 135 | } |
| 136 | default: |
| 137 | return true; |
| 138 | } |
| 139 | } |
| 140 | |
| 141 | void BasicBlock::ForEachSuccessorLabel( |
| 142 | const std::function<void(uint32_t*)>& f) { |
no test coverage detected