From e2a764ead3e0b3d3c431cd9afc4ce6e522722812 Mon Sep 17 00:00:00 2001 From: Jim Blandy Date: Tue, 19 Sep 2023 06:36:50 -0700 Subject: [PATCH] Add a bit of logging to `ConstantEvaluator`. (#2488) --- src/proc/constant_evaluator.rs | 11 +++++++++-- 1 file changed, 9 insertions(+), 2 deletions(-) diff --git a/src/proc/constant_evaluator.rs b/src/proc/constant_evaluator.rs index 2580cadf2d..249b365c59 100644 --- a/src/proc/constant_evaluator.rs +++ b/src/proc/constant_evaluator.rs @@ -123,7 +123,10 @@ impl ConstantEvaluator<'_> { Ok(self.constants[c].init) } } - _ => Err(ConstantEvaluatorError::SubexpressionsAreNotConstant), + _ => { + log::debug!("check_and_get: SubexpressionsAreNotConstant"); + Err(ConstantEvaluatorError::SubexpressionsAreNotConstant) + } } } @@ -132,6 +135,7 @@ impl ConstantEvaluator<'_> { expr: &Expression, span: Span, ) -> Result, ConstantEvaluatorError> { + log::trace!("try_eval_and_append: {:?}", expr); match *expr { Expression::Literal(_) | Expression::ZeroValue(_) | Expression::Constant(_) => { Ok(self.register_evaluated_expr(expr.clone(), span)) @@ -800,7 +804,10 @@ impl ConstantEvaluator<'_> { let value = self.copy_from(value, expressions)?; Ok(self.register_evaluated_expr(Expression::Splat { size, value }, span)) } - _ => Err(ConstantEvaluatorError::SubexpressionsAreNotConstant), + _ => { + log::debug!("copy_from: SubexpressionsAreNotConstant"); + Err(ConstantEvaluatorError::SubexpressionsAreNotConstant) + } } }