Skip to content

Commit

Permalink
Add a bit of logging to ConstantEvaluator. (#2488)
Browse files Browse the repository at this point in the history
  • Loading branch information
jimblandy authored and teoxoy committed Sep 22, 2023
1 parent 34ca5d8 commit 8192899
Showing 1 changed file with 9 additions and 2 deletions.
11 changes: 9 additions & 2 deletions src/proc/constant_evaluator.rs
Original file line number Diff line number Diff line change
Expand Up @@ -123,7 +123,10 @@ impl ConstantEvaluator<'_> {
Ok(self.constants[c].init)
}
}
_ => Err(ConstantEvaluatorError::SubexpressionsAreNotConstant),
_ => {
log::debug!("check_and_get: SubexpressionsAreNotConstant");
Err(ConstantEvaluatorError::SubexpressionsAreNotConstant)
}
}
}

Expand All @@ -132,6 +135,7 @@ impl ConstantEvaluator<'_> {
expr: &Expression,
span: Span,
) -> Result<Handle<Expression>, ConstantEvaluatorError> {
log::trace!("try_eval_and_append: {:?}", expr);
match *expr {
Expression::Literal(_) | Expression::ZeroValue(_) | Expression::Constant(_) => {
Ok(self.register_evaluated_expr(expr.clone(), span))
Expand Down Expand Up @@ -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)
}
}
}

Expand Down

0 comments on commit 8192899

Please sign in to comment.