Skip to content

Commit 8ba3b79

Browse files
committed
Mention why we fixup definitions after the loop walk
1 parent 3a03879 commit 8ba3b79

1 file changed

Lines changed: 5 additions & 0 deletions

File tree

crates/oak_index/src/use_def_map.rs

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -285,6 +285,11 @@ impl UseDefMapBuilder {
285285
/// created inside the body). Those new definitions are added to all
286286
/// uses of that symbol from `first_use` onwards, which covers exactly
287287
/// the uses recorded during the body.
288+
///
289+
/// This runs after the body (not eagerly at each definition) because
290+
/// the body may contain branches. A diff at the end captures the
291+
/// converged state after all snapshot/restore/merge within the body
292+
/// has resolved.
288293
pub(crate) fn finish_loop_defs(&mut self, pre_loop: &FlowSnapshot, first_use: UseId) {
289294
for i in 0..self.symbol_states.len() {
290295
let symbol_id = SymbolId::new(i);

0 commit comments

Comments
 (0)