| 82 | } |
| 83 | |
| 84 | spv_result_t extractOpSourceContinued( |
| 85 | const spv_position_t& loc, const spv_parsed_instruction_t& instruction, |
| 86 | std::string* output) { |
| 87 | assert(output != nullptr); |
| 88 | assert(instruction.opcode == |
| 89 | static_cast<unsigned>(spv::Op::OpSourceContinued)); |
| 90 | if (instruction.num_operands != 1) { |
| 91 | spvtools::Error(spvtools::utils::CLIMessageConsumer, "", loc, |
| 92 | "Missing operands for OpSourceContinued."); |
| 93 | return SPV_ERROR_INVALID_BINARY; |
| 94 | } |
| 95 | |
| 96 | const auto& operand = instruction.operands[0]; |
| 97 | const char* stringBegin = |
| 98 | reinterpret_cast<const char*>(instruction.words + operand.offset); |
| 99 | const char* stringEnd = reinterpret_cast<const char*>( |
| 100 | instruction.words + operand.offset + operand.num_words); |
| 101 | return ExtractStringLiteral(loc, stringBegin, stringEnd, output); |
| 102 | } |
| 103 | |
| 104 | spv_result_t extractOpSource(const spv_position_t& loc, |
| 105 | const spv_parsed_instruction_t& instruction, |
no test coverage detected