Skip to content

Commit f29533b

Browse files
committed
Small documentation changes
1 parent efc7ca8 commit f29533b

File tree

1 file changed

+7
-1
lines changed

1 file changed

+7
-1
lines changed

compiler/rustc_mir_transform/src/dataflow_const_prop.rs

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
//! A constant propagation optimization pass based on dataflow analysis.
22
//!
3-
//! Tracks places that have a scalar type.
3+
//! Currently, this pass only propagates scalar values.
44
55
use rustc_const_eval::interpret::{ConstValue, ImmTy, Immediate, InterpCx, Scalar};
66
use rustc_data_structures::fx::FxHashMap;
@@ -289,7 +289,13 @@ impl<'tcx> ConstAnalysis<'tcx> {
289289
struct CollectAndPatch<'tcx, 'map> {
290290
tcx: TyCtxt<'tcx>,
291291
map: &'map Map,
292+
293+
/// For a given MIR location, this stores the values of the operands used by that location. In
294+
/// particular, this is before the effect, such that the operands of `_1 = _1 + _2` are
295+
/// properly captured.
292296
before_effect: FxHashMap<(Location, Place<'tcx>), ScalarTy<'tcx>>,
297+
298+
/// Stores the assigned values for assignments where the Rvalue is constant.
293299
assignments: FxHashMap<Location, ScalarTy<'tcx>>,
294300
}
295301

0 commit comments

Comments
 (0)