Comment logic around worklist.

This commit is contained in:
Camille GILLOT 2023-04-04 17:14:53 +00:00
parent 7d47a910eb
commit 98255cc242

View File

@ -675,10 +675,13 @@ fn visit_terminator(&mut self, terminator: &Terminator<'tcx>, location: Location
&& let Ok(constant) = value_const.try_to_int()
&& let Ok(constant) = constant.to_bits(constant.size())
{
// We managed to evaluate the discriminant, so we know we only need to visit
// one target.
let target = targets.target_for_value(constant);
self.worklist.push(target);
return;
}
// We failed to evaluate the discriminant, fallback to visiting all successors.
}
// None of these have Operands to const-propagate.
TerminatorKind::Goto { .. }