Skip to content

Commit

Permalink
chore(ssa): Use correct prefix when printing array values in global s…
Browse files Browse the repository at this point in the history
…pace (#7095)
  • Loading branch information
vezenovm authored Jan 16, 2025
1 parent c172880 commit ad5a980
Showing 1 changed file with 7 additions and 2 deletions.
9 changes: 7 additions & 2 deletions compiler/noirc_evaluator/src/ssa/ir/printer.rs
Original file line number Diff line number Diff line change
Expand Up @@ -169,13 +169,14 @@ fn display_instruction(
write!(f, "{} = ", value_list)?;
}

display_instruction_inner(dfg, &dfg[instruction], results, f)
display_instruction_inner(dfg, &dfg[instruction], results, in_global_space, f)
}

fn display_instruction_inner(
dfg: &DataFlowGraph,
instruction: &Instruction,
results: &[ValueId],
in_global_space: bool,
f: &mut Formatter,
) -> Result {
let show = |id| value(dfg, id);
Expand Down Expand Up @@ -286,7 +287,11 @@ fn display_instruction_inner(
if i != 0 {
write!(f, ", ")?;
}
write!(f, "{}", show(*element))?;
let mut value = show(*element);
if in_global_space {
value = value.replace('v', "g");
}
write!(f, "{}", value)?;
}

writeln!(f, "] : {typ}")
Expand Down

0 comments on commit ad5a980

Please sign in to comment.