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

Function GetUseOpcodes

test/opt/def_use_test.cpp:52–60  ·  view source on GitHub ↗

Returns the opcode of each use of |id|. If |id| is used multiple times in a single instruction, that instruction's opcode will appear a corresponding number of times.

Source from the content-addressed store, hash-verified

50// If |id| is used multiple times in a single instruction, that instruction's
51// opcode will appear a corresponding number of times.
52std::vector<spv::Op> GetUseOpcodes(const std::unique_ptr<IRContext>& context,
53 uint32_t id) {
54 std::vector<spv::Op> opcodes;
55 context->get_def_use_mgr()->ForEachUse(
56 id, [&opcodes](Instruction* user, uint32_t) {
57 opcodes.push_back(user->opcode());
58 });
59 return opcodes;
60}
61
62// Disassembles the given |inst| and returns the disassembly.
63std::string DisassembleInst(Instruction* inst) {

Callers 1

TESTFunction · 0.85

Calls 4

ForEachUseMethod · 0.80
get_def_use_mgrMethod · 0.45
push_backMethod · 0.45
opcodeMethod · 0.45

Tested by

no test coverage detected