| 184 | } |
| 185 | |
| 186 | const char* spvOpcodeString(const uint32_t opcode) { |
| 187 | const auto beg = kOpcodeTableEntries; |
| 188 | const auto end = kOpcodeTableEntries + ARRAY_SIZE(kOpcodeTableEntries); |
| 189 | spv_opcode_desc_t needle = {"", static_cast<SpvOp>(opcode), |
| 190 | 0, nullptr, |
| 191 | 0, {}, |
| 192 | false, false, |
| 193 | 0, nullptr, |
| 194 | ~0u, ~0u}; |
| 195 | auto comp = [](const spv_opcode_desc_t& lhs, const spv_opcode_desc_t& rhs) { |
| 196 | return lhs.opcode < rhs.opcode; |
| 197 | }; |
| 198 | auto it = std::lower_bound(beg, end, needle, comp); |
| 199 | if (it != end && it->opcode == opcode) { |
| 200 | return it->name; |
| 201 | } |
| 202 | |
| 203 | assert(0 && "Unreachable!"); |
| 204 | return "unknown"; |
| 205 | } |
| 206 | |
| 207 | int32_t spvOpcodeIsScalarType(const SpvOp opcode) { |
| 208 | switch (opcode) { |
no outgoing calls
no test coverage detected