From 71373ab86ce86eacc8e41306dc2bc5e14a9e117b Mon Sep 17 00:00:00 2001 From: Jaebaek Seo Date: Mon, 27 Jul 2020 10:43:18 -0400 Subject: [PATCH] Make function call readable --- source/opt/scalar_replacement_pass.cpp | 11 +++++++---- 1 file changed, 7 insertions(+), 4 deletions(-) diff --git a/source/opt/scalar_replacement_pass.cpp b/source/opt/scalar_replacement_pass.cpp index 6276c97e4d..d71d605bfd 100644 --- a/source/opt/scalar_replacement_pass.cpp +++ b/source/opt/scalar_replacement_pass.cpp @@ -173,12 +173,15 @@ bool ScalarReplacementPass::ReplaceWholeDebugDeclare( // Add DebugValue instruction with Indexes operand and Deref operation. int32_t idx = 0; for (const auto* var : replacements) { + uint32_t dbg_local_variable = + dbg_decl->GetSingleWordOperand(kDebugDeclareOperandLocalVariableIndex); + uint32_t index_id = context()->get_constant_mgr()->GetSIntConst(idx); + Instruction* added_dbg_value = context()->get_debug_info_mgr()->AddDebugValueWithIndex( - dbg_decl->GetSingleWordOperand( - kDebugDeclareOperandLocalVariableIndex), - var->result_id(), deref_expr->result_id(), - context()->get_constant_mgr()->GetSIntConst(idx), var->NextNode()); + dbg_local_variable, + /*value_id=*/var->result_id(), /*expr_id=*/deref_expr->result_id(), + index_id, /*insert_before=*/var->NextNode()); if (added_dbg_value == nullptr) return false; added_dbg_value->UpdateDebugInfoFrom(dbg_decl); ++idx;