MCPcopy Create free account
hub / github.com/KhronosGroup/SPIRV-Tools / DisassembleTargetInstruction

Function DisassembleTargetInstruction

source/disassemble.cpp:581–598  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

579}
580
581spv_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
600uint32_t GetLineLengthWithoutColor(const std::string line) {
601 // Currently, every added color is in the form \x1b...m, so instead of doing a

Callers

nothing calls this directly

Calls 4

word_countMethod · 0.80
inst_binaryMethod · 0.80
disassemblerMethod · 0.80
HandleInstructionMethod · 0.45

Tested by

no test coverage detected