Skip to content

Commit 0c15503

Browse files
authored
Add comments to dataflow.h after #8282 [NFC] (#8299)
1 parent 4f9f76e commit 0c15503

1 file changed

Lines changed: 9 additions & 6 deletions

File tree

src/dataflow/graph.h

Lines changed: 9 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -615,8 +615,11 @@ struct Graph : public UnifiedExpressionVisitor<Graph, Node*> {
615615
}
616616

617617
// Merge local state for an if, also creating a block and conditions.
618-
void mergeIf(Locals& aState,
619-
Locals& bState,
618+
// ifTrueState is the state if the condition is true, while otherState is
619+
// the state otherwise (either from before the if, if there is no other arm,
620+
// or the else arm if there is).
621+
void mergeIf(Locals& ifTrueState,
622+
Locals& otherState,
620623
Node* condition,
621624
Expression* expr,
622625
Locals& out) {
@@ -635,11 +638,11 @@ struct Graph : public UnifiedExpressionVisitor<Graph, Node*> {
635638
}
636639
// Finally, merge the state with that block. TODO optimize
637640
std::vector<FlowState> states;
638-
if (!isInUnreachable(aState)) {
639-
states.emplace_back(aState, ifTrue);
641+
if (!isInUnreachable(ifTrueState)) {
642+
states.emplace_back(ifTrueState, ifTrue);
640643
}
641-
if (!isInUnreachable(bState)) {
642-
states.emplace_back(bState, ifFalse);
644+
if (!isInUnreachable(otherState)) {
645+
states.emplace_back(otherState, ifFalse);
643646
}
644647
merge(states, out);
645648
}

0 commit comments

Comments
 (0)