Skip to content

Commit

Permalink
Add comment about static_cast
Browse files Browse the repository at this point in the history
  • Loading branch information
kfcripps committed May 15, 2024
1 parent 6dc682d commit ae30ee0
Showing 1 changed file with 1 addition and 0 deletions.
1 change: 1 addition & 0 deletions frontends/common/constantFolding.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -265,6 +265,7 @@ const IR::Node *DoConstantFolding::preorder(IR::SwitchCase *c) {
// Action enum switch case labels must be action names.
// Do not fold the switch case's 'label' expression so that it can be inspected by the
// TypeInference pass.
// Note: static_cast is used as a SwitchCase's parent is always SwitchStatement.
const auto *parent = static_cast<const IR::SwitchStatement *>(getContext()->node);
if (isActionRun(parent->expression, refMap)) {
visit(c->statement);
Expand Down

0 comments on commit ae30ee0

Please sign in to comment.