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

Method GetEmptyDebugExpression

source/opt/debug_info_manager.cpp:416–438  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

414}
415
416Instruction* DebugInfoManager::GetEmptyDebugExpression() {
417 if (empty_debug_expr_inst_ != nullptr) return empty_debug_expr_inst_;
418
419 uint32_t result_id = context()->TakeNextId();
420 std::unique_ptr<Instruction> empty_debug_expr(new Instruction(
421 context(), spv::Op::OpExtInst, context()->get_type_mgr()->GetVoidTypeId(),
422 result_id,
423 {
424 {spv_operand_type_t::SPV_OPERAND_TYPE_ID, {GetDbgSetImportId()}},
425 {spv_operand_type_t::SPV_OPERAND_TYPE_EXTENSION_INSTRUCTION_NUMBER,
426 {static_cast<uint32_t>(CommonDebugInfoDebugExpression)}},
427 }));
428
429 // Add to the front of |ext_inst_debuginfo_|.
430 empty_debug_expr_inst_ =
431 context()->module()->ext_inst_debuginfo_begin()->InsertBefore(
432 std::move(empty_debug_expr));
433
434 RegisterDbgInst(empty_debug_expr_inst_);
435 if (context()->AreAnalysesValid(IRContext::Analysis::kAnalysisDefUse))
436 context()->get_def_use_mgr()->AnalyzeInstDefUse(empty_debug_expr_inst_);
437 return empty_debug_expr_inst_;
438}
439
440Instruction* DebugInfoManager::GetDebugInlinedAt(uint32_t dbg_inlined_at_id) {
441 auto* inlined_at = GetDbgInst(dbg_inlined_at_id);

Callers

nothing calls this directly

Calls 9

get_type_mgrMethod · 0.80
AreAnalysesValidMethod · 0.80
AnalyzeInstDefUseMethod · 0.80
TakeNextIdMethod · 0.45
GetVoidTypeIdMethod · 0.45
InsertBeforeMethod · 0.45
moduleMethod · 0.45
get_def_use_mgrMethod · 0.45

Tested by

no test coverage detected