Skip to content

Commit

Permalink
Make function call readable
Browse files Browse the repository at this point in the history
  • Loading branch information
jaebaek committed Jul 27, 2020
1 parent 98e65d8 commit 71373ab
Showing 1 changed file with 7 additions and 4 deletions.
11 changes: 7 additions & 4 deletions source/opt/scalar_replacement_pass.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down

0 comments on commit 71373ab

Please sign in to comment.