| 579 | } |
| 580 | |
| 581 | spv_result_t DisassembleTargetInstruction( |
| 582 | void* user_data, const spv_parsed_instruction_t* parsed_instruction) { |
| 583 | assert(user_data); |
| 584 | auto wrapped = static_cast<WrappedDisassembler*>(user_data); |
| 585 | // Check if this is the instruction we want to disassemble. |
| 586 | if (wrapped->word_count() == parsed_instruction->num_words && |
| 587 | std::equal(wrapped->inst_binary(), |
| 588 | wrapped->inst_binary() + wrapped->word_count(), |
| 589 | parsed_instruction->words)) { |
| 590 | // Found the target instruction. Disassemble it and signal that we should |
| 591 | // stop searching so we don't output the same instruction again. |
| 592 | if (auto error = |
| 593 | wrapped->disassembler()->HandleInstruction(*parsed_instruction)) |
| 594 | return error; |
| 595 | return SPV_REQUESTED_TERMINATION; |
| 596 | } |
| 597 | return SPV_SUCCESS; |
| 598 | } |
| 599 | |
| 600 | uint32_t GetLineLengthWithoutColor(const std::string line) { |
| 601 | // Currently, every added color is in the form \x1b...m, so instead of doing a |
nothing calls this directly
no test coverage detected