| 371 | } |
| 372 | |
| 373 | Instruction* DebugInfoManager::DerefDebugExpression(Instruction* dbg_expr) { |
| 374 | assert(dbg_expr->GetCommonDebugOpcode() == CommonDebugInfoDebugExpression); |
| 375 | std::unique_ptr<Instruction> deref_expr(dbg_expr->Clone(context())); |
| 376 | uint32_t result_id = context()->TakeNextId(); |
| 377 | if (result_id == 0) return nullptr; |
| 378 | deref_expr->SetResultId(result_id); |
| 379 | Instruction* deref_op = GetDebugOperationWithDeref(); |
| 380 | if (!deref_op) return nullptr; |
| 381 | deref_expr->InsertOperand(kDebugExpressOperandOperationIndex, |
| 382 | {SPV_OPERAND_TYPE_ID, {deref_op->result_id()}}); |
| 383 | auto* deref_expr_instr = |
| 384 | context()->ext_inst_debuginfo_end()->InsertBefore(std::move(deref_expr)); |
| 385 | AnalyzeDebugInst(deref_expr_instr); |
| 386 | if (context()->AreAnalysesValid(IRContext::Analysis::kAnalysisDefUse)) |
| 387 | context()->get_def_use_mgr()->AnalyzeInstDefUse(deref_expr_instr); |
| 388 | return deref_expr_instr; |
| 389 | } |
| 390 | |
| 391 | Instruction* DebugInfoManager::GetDebugInfoNone() { |
| 392 | if (debug_info_none_inst_ != nullptr) return debug_info_none_inst_; |
no test coverage detected