From 66ea2ee772ae6aa07b9ce3e84968fa5af69fe9cb Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?L=C3=A9lio=20Brun?= <lb@leliobrun.net> Date: Tue, 14 Mar 2023 13:14:01 +0900 Subject: [PATCH] only print unused vars in log if there actually are unused vars --- src/optimize_machine.ml | 15 ++++++++------- 1 file changed, 8 insertions(+), 7 deletions(-) diff --git a/src/optimize_machine.ml b/src/optimize_machine.ml index ce4120fc..c5056c3e 100644 --- a/src/optimize_machine.ml +++ b/src/optimize_machine.ml @@ -1280,13 +1280,14 @@ let machine_clean (vars, m) = unused m.mstep.step_instrs in - Log.report ~level:1 (fun fmt -> - Format.fprintf - fmt - "@[<v 2>.. machine %s unused variables:@,%a@]@," - m.mname.node_id - ISet.pp - unused); + if not (ISet.is_empty unused) then + Log.report ~level:1 (fun fmt -> + Format.fprintf + fmt + "@[<v 2>.. machine %s unused variables:@,%a@]@," + m.mname.node_id + ISet.pp + unused); let is_unused = is_unused unused in let is_used v = not (ISet.mem v.var_id unused) in let step_locals = List.filter is_used m.mstep.step_locals in -- GitLab