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

Function BinaryToDot

tools/cfg/bin_to_dot.cpp:168–186  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

166} // anonymous namespace
167
168spv_result_t BinaryToDot(const spv_const_context context, const uint32_t* words,
169 size_t num_words, std::iostream* out,
170 spv_diagnostic* diagnostic) {
171 // Invalid arguments return error codes, but don't necessarily generate
172 // diagnostics. These are programmer errors, not user errors.
173 if (!diagnostic) return SPV_ERROR_INVALID_DIAGNOSTIC;
174 const spvtools::AssemblyGrammar grammar(context);
175
176 spvtools::FriendlyNameMapper friendly_mapper(context, words, num_words);
177 DotConverter converter(friendly_mapper.GetNameMapper(), out);
178 converter.Begin();
179 if (auto error = spvBinaryParse(context, &converter, words, num_words,
180 nullptr, HandleInstruction, diagnostic)) {
181 return error;
182 }
183 converter.End();
184
185 return SPV_SUCCESS;
186}

Callers 1

mainFunction · 0.85

Calls 4

spvBinaryParseFunction · 0.85
GetNameMapperMethod · 0.80
BeginMethod · 0.80
EndMethod · 0.45

Tested by

no test coverage detected