Skip to content

Commit

Permalink
Improve docs for FunctionInfo::process_expression.
Browse files Browse the repository at this point in the history
  • Loading branch information
jimblandy authored and teoxoy committed Oct 6, 2023
1 parent 31f5475 commit c671603
Showing 1 changed file with 19 additions and 2 deletions.
21 changes: 19 additions & 2 deletions src/valid/analyzer.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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,
Expand Down

0 comments on commit c671603

Please sign in to comment.