diff options
Diffstat (limited to 'src/passes')
-rw-r--r-- | src/passes/RemoveUnusedBrs.cpp | 4 | ||||
-rw-r--r-- | src/passes/SimplifyLocals.cpp | 2 |
2 files changed, 3 insertions, 3 deletions
diff --git a/src/passes/RemoveUnusedBrs.cpp b/src/passes/RemoveUnusedBrs.cpp index ec7809f48..7e122b806 100644 --- a/src/passes/RemoveUnusedBrs.cpp +++ b/src/passes/RemoveUnusedBrs.cpp @@ -31,7 +31,7 @@ namespace wasm { // condition and possible value, and the possible value must // not have side effects (as they would run unconditionally) static bool canTurnIfIntoBrIf(Expression* ifCondition, Expression* brValue, PassOptions& options) { - // if the if isn't even taken, this is all dead code anyhow + // if the if isn't even reached, this is all dead code anyhow if (ifCondition->type == unreachable) return false; if (!brValue) return true; EffectAnalyzer value(options, brValue); @@ -512,7 +512,7 @@ struct RemoveUnusedBrs : public WalkerPass<PostWalker<RemoveUnusedBrs>> { if (curr->name.is()) { auto* br = list[0]->dynCast<Break>(); // we seek a regular br_if; if the type is unreachable that means it is not - // actually taken, so ignore + // actually reached, so ignore if (br && br->condition && br->name == curr->name && br->type != unreachable) { assert(!br->value); // can't, it would be dropped or last in the block if (BranchUtils::BranchSeeker::countNamed(curr, curr->name) == 1) { diff --git a/src/passes/SimplifyLocals.cpp b/src/passes/SimplifyLocals.cpp index 919784cdf..618f8dead 100644 --- a/src/passes/SimplifyLocals.cpp +++ b/src/passes/SimplifyLocals.cpp @@ -348,7 +348,7 @@ struct SimplifyLocals : public WalkerPass<LinearExecutionWalker<SimplifyLocals>> auto* brp = breaks[j].brp; auto* br = (*brp)->cast<Break>(); assert(!br->value); - // if the break is conditional, then we must set the value here - if the break is not taken, we must still have the new value in the local + // if the break is conditional, then we must set the value here - if the break is not reached, we must still have the new value in the local auto* set = (*breakSetLocalPointer)->cast<SetLocal>(); if (br->condition) { br->value = set; |