From 7b80f0e0d0748489b955054bd34b85e16dae95fe Mon Sep 17 00:00:00 2001 From: Tom French <15848336+TomAFrench@users.noreply.github.com> Date: Fri, 22 Sep 2023 17:56:55 +0100 Subject: [PATCH] chore: force compilation if debug flags are set (#2797) Co-authored-by: jfecher --- compiler/noirc_driver/src/lib.rs | 11 ++++++++--- 1 file changed, 8 insertions(+), 3 deletions(-) diff --git a/compiler/noirc_driver/src/lib.rs b/compiler/noirc_driver/src/lib.rs index 8d74825a9b6..14be5a9f4aa 100644 --- a/compiler/noirc_driver/src/lib.rs +++ b/compiler/noirc_driver/src/lib.rs @@ -301,9 +301,14 @@ pub fn compile_no_check( let program = monomorphize(main_function, &context.def_interner); let hash = fxhash::hash64(&program); - if let Some(cached_program) = cached_program { - if hash == cached_program.hash { - return Ok(cached_program); + + // If user has specified that they want to see intermediate steps printed then we should + // force compilation even if the program hasn't changed. + if !(options.print_acir || options.show_brillig || options.show_ssa) { + if let Some(cached_program) = cached_program { + if hash == cached_program.hash { + return Ok(cached_program); + } } }