Improve docs for FunctionInfo::process_expression.

This commit is contained in:
Jim Blandy
2023-10-05 18:15:26 -07:00
committed by Teodor Tanasoaia
parent 31f547580c
commit c6716033da

View File

@@ -421,8 +421,25 @@ impl FunctionInfo {
})
}
/// Computes the expression info and stores it in `self.expressions`.
/// Also, bumps the reference counts on dependent expressions.
/// Compute the [`ExpressionInfo`] for `handle`.
///
/// Replace the dummy entry in [`self.expressions`] for `handle`
/// with a real `ExpressionInfo` value describing that expression.
///
/// This function is called as part of a forward sweep through the
/// arena, so we can assume that all earlier expressions in the
/// arena already have valid info. Since expressions only depend
/// on earlier expressions, this includes all our subexpressions.
///
/// Adjust the reference counts on all expressions we use.
///
/// Also populate the [`sampling_set`], [`sampling`] and
/// [`global_uses`] fields of `self`.
///
/// [`self.expressions`]: FunctionInfo::expressions
/// [`sampling_set`]: FunctionInfo::sampling_set
/// [`sampling`]: FunctionInfo::sampling
/// [`global_uses`]: FunctionInfo::global_uses
#[allow(clippy::or_fun_call)]
fn process_expression(
&mut self,