From 89d52b310c491891ed97b8adea4d9f9442e10858 Mon Sep 17 00:00:00 2001 From: David Mak Date: Mon, 12 Aug 2024 15:06:12 +0800 Subject: [PATCH] WIP10 - Debug statements again --- nac3artiq/src/codegen.rs | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/nac3artiq/src/codegen.rs b/nac3artiq/src/codegen.rs index f84db0a8..e76ef31c 100644 --- a/nac3artiq/src/codegen.rs +++ b/nac3artiq/src/codegen.rs @@ -761,6 +761,8 @@ fn polymorphic_print<'ctx>( ctx.module.add_function(fn_name, fn_t, None) }); + println!("printf({fmt}, [{}])", args.iter().map(|arg| arg.to_string()).join(", ")); + let fmt = ctx.gen_string(generator, fmt); let fmt = unsafe { fmt.get_field_at_index_unchecked(0) }.into_pointer_value(); @@ -780,7 +782,7 @@ fn polymorphic_print<'ctx>( let suffix = suffix.unwrap_or_default(); let mut fmt = String::new(); - let mut args = Vec::>::new(); + let mut args = Vec::new(); let flush = |ctx: &mut CodeGenContext<'ctx, '_>, generator: &mut dyn CodeGenerator,