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

Function extractOpSourceContinued

tools/objdump/extract_source.cpp:84–102  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

82}
83
84spv_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
104spv_result_t extractOpSource(const spv_position_t& loc,
105 const spv_parsed_instruction_t& instruction,

Callers 1

ExtractSourceFromModuleFunction · 0.85

Calls 2

ExtractStringLiteralFunction · 0.85
ErrorFunction · 0.50

Tested by

no test coverage detected