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.
| 50 | // If |id| is used multiple times in a single instruction, that instruction's |
| 51 | // opcode will appear a corresponding number of times. |
| 52 | std::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. |
| 63 | std::string DisassembleInst(Instruction* inst) { |
no test coverage detected