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

Method AddDebugValueForVariable

source/opt/debug_info_manager.cpp:564–586  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

562}
563
564bool DebugInfoManager::AddDebugValueForVariable(Instruction* line,
565 uint32_t variable_id,
566 uint32_t value_id,
567 Instruction* insert_pos) {
568 assert(line != nullptr);
569
570 auto dbg_decl_itr = var_id_to_dbg_decl_.find(variable_id);
571 if (dbg_decl_itr == var_id_to_dbg_decl_.end()) return false;
572
573 bool modified = false;
574 for (auto* dbg_decl_or_val : dbg_decl_itr->second) {
575 // Avoid inserting the new DebugValue between OpPhi or OpVariable
576 // instructions.
577 Instruction* insert_before = insert_pos->NextNode();
578 while (insert_before->opcode() == spv::Op::OpPhi ||
579 insert_before->opcode() == spv::Op::OpVariable) {
580 insert_before = insert_before->NextNode();
581 }
582 modified |= AddDebugValueForDecl(dbg_decl_or_val, value_id, insert_before,
583 line) != nullptr;
584 }
585 return modified;
586}
587
588Instruction* DebugInfoManager::AddDebugValueForDecl(Instruction* dbg_decl,
589 uint32_t value_id,

Callers 4

RewriteDebugDeclaresMethod · 0.80
ProcessStoreMethod · 0.80
ApplyReplacementsMethod · 0.80

Calls 3

NextNodeMethod · 0.80
endMethod · 0.45
opcodeMethod · 0.45

Tested by

no test coverage detected