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

Method RegisterDebugInstruction

source/val/validation_state.cpp:579–602  ·  view source on GitHub ↗

Improves diagnostic messages by collecting names of IDs

Source from the content-addressed store, hash-verified

577
578// Improves diagnostic messages by collecting names of IDs
579void ValidationState_t::RegisterDebugInstruction(const Instruction* inst) {
580 switch (inst->opcode()) {
581 case spv::Op::OpName: {
582 const auto target = inst->GetOperandAs<uint32_t>(0);
583 const std::string str = inst->GetOperandAs<std::string>(1);
584 AssignNameToId(target, str);
585 break;
586 }
587 case spv::Op::OpMemberName: {
588 const auto target = inst->GetOperandAs<uint32_t>(0);
589 const std::string str = inst->GetOperandAs<std::string>(2);
590 AssignNameToId(target, str);
591 break;
592 }
593 case spv::Op::OpSourceContinued:
594 case spv::Op::OpSource:
595 case spv::Op::OpSourceExtension:
596 case spv::Op::OpString:
597 case spv::Op::OpLine:
598 case spv::Op::OpNoLine:
599 default:
600 break;
601 }
602}
603
604void ValidationState_t::RegisterInstruction(Instruction* inst) {
605 if (inst->id()) all_definitions_.insert(std::make_pair(inst->id(), inst));

Callers 1

ProcessInstructionFunction · 0.80

Calls 1

opcodeMethod · 0.45

Tested by

no test coverage detected