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

Method AddDebugValueForDecl

source/opt/debug_info_manager.cpp:588–612  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

586}
587
588Instruction* DebugInfoManager::AddDebugValueForDecl(Instruction* dbg_decl,
589 uint32_t value_id,
590 Instruction* insert_before,
591 Instruction* line) {
592 if (dbg_decl == nullptr || !IsDebugDeclare(dbg_decl)) return nullptr;
593
594 std::unique_ptr<Instruction> dbg_val(dbg_decl->Clone(context()));
595 dbg_val->SetResultId(context()->TakeNextId());
596 dbg_val->SetInOperand(kExtInstInstructionInIdx, {CommonDebugInfoDebugValue});
597 dbg_val->SetOperand(kDebugDeclareOperandVariableIndex, {value_id});
598 dbg_val->SetOperand(kDebugValueOperandExpressionIndex,
599 {GetEmptyDebugExpression()->result_id()});
600 dbg_val->UpdateDebugInfoFrom(dbg_decl, line);
601
602 auto* added_dbg_val = insert_before->InsertBefore(std::move(dbg_val));
603 AnalyzeDebugInst(added_dbg_val);
604 if (context()->AreAnalysesValid(IRContext::Analysis::kAnalysisDefUse))
605 context()->get_def_use_mgr()->AnalyzeInstDefUse(added_dbg_val);
606 if (context()->AreAnalysesValid(
607 IRContext::Analysis::kAnalysisInstrToBlockMapping)) {
608 auto insert_blk = context()->get_instr_block(insert_before);
609 context()->set_instr_block(added_dbg_val, insert_blk);
610 }
611 return added_dbg_val;
612}
613
614uint32_t DebugInfoManager::GetVulkanDebugOperation(Instruction* inst) {
615 assert(inst->GetShaderDebugOpcode() ==

Callers 2

TESTFunction · 0.80

Calls 13

SetInOperandMethod · 0.80
SetOperandMethod · 0.80
UpdateDebugInfoFromMethod · 0.80
AreAnalysesValidMethod · 0.80
AnalyzeInstDefUseMethod · 0.80
get_instr_blockMethod · 0.80
set_instr_blockMethod · 0.80
CloneMethod · 0.45
SetResultIdMethod · 0.45
TakeNextIdMethod · 0.45
result_idMethod · 0.45
InsertBeforeMethod · 0.45

Tested by 1

TESTFunction · 0.64