Skip to content

Commit

Permalink
chore: restore debug info
Browse files Browse the repository at this point in the history
  • Loading branch information
TomAFrench committed Jan 10, 2024
1 parent 63cacee commit 3b6f123
Show file tree
Hide file tree
Showing 2 changed files with 21 additions and 0 deletions.
5 changes: 5 additions & 0 deletions compiler/noirc_evaluator/src/brillig/brillig_ir.rs
Original file line number Diff line number Diff line change
Expand Up @@ -689,6 +689,11 @@ impl BrilligContext {
value_to_truncate: RegisterIndex,
bit_size: u32,
) {
self.debug_show.truncate_instruction(
destination_of_truncated_value,
value_to_truncate,
bit_size,
);
assert!(
bit_size <= BRILLIG_INTEGER_ARITHMETIC_BIT_SIZE,
"tried to truncate to a bit size greater than allowed {bit_size}"
Expand Down
16 changes: 16 additions & 0 deletions compiler/noirc_evaluator/src/brillig/brillig_ir/debug_show.rs
Original file line number Diff line number Diff line change
Expand Up @@ -325,6 +325,22 @@ impl DebugShow {
);
}

/// Debug function for cast_instruction
pub(crate) fn truncate_instruction(
&self,
destination: RegisterIndex,
source: RegisterIndex,
target_bit_size: u32,
) {
debug_println!(
self.enable_debug_trace,
" TRUNCATE {} FROM {} TO {} BITS",
destination,
source,
target_bit_size
);
}

/// Debug function for black_box_op
pub(crate) fn black_box_op_instruction(&self, op: BlackBoxOp) {
match op {
Expand Down

0 comments on commit 3b6f123

Please sign in to comment.