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

Method SaveTextResult

source/disassemble.cpp:519–535  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

517}
518
519spv_result_t Disassembler::SaveTextResult(spv_text* text_result) const {
520 if (!print_) {
521 size_t length = text_.str().size();
522 char* str = new char[length + 1];
523 if (!str) return SPV_ERROR_OUT_OF_MEMORY;
524 strncpy(str, text_.str().c_str(), length + 1);
525 spv_text text = new spv_text_t();
526 if (!text) {
527 delete[] str;
528 return SPV_ERROR_OUT_OF_MEMORY;
529 }
530 text->str = str;
531 text->length = length;
532 *text_result = text;
533 }
534 return SPV_SUCCESS;
535}
536
537spv_result_t DisassembleHeader(void* user_data, spv_endianness_t endian,
538 uint32_t /* magic */, uint32_t version,

Callers 2

spvBinaryToTextFunction · 0.80

Calls 3

c_strMethod · 0.80
sizeMethod · 0.45
strMethod · 0.45

Tested by

no test coverage detected