Page MenuHomePhabricator

Fix a warning about an unreachable default in a switch statement.
ClosedPublic

Authored by lattner on Mar 4 2020, 10:07 PM.

Diff Detail

Event Timeline

lattner created this revision.Mar 4 2020, 10:07 PM
lattner edited reviewers, added: rriddle; removed: jahira8434.
mehdi_amini accepted this revision.Mar 4 2020, 11:47 PM
mehdi_amini added inline comments.
mlir/lib/Dialect/StandardOps/IR/Ops.cpp
625

(like here)

699

I have vague memory that another compiler would warn if the function does not return after the switch if you remove this. I see other cases in the codebase where we don't provide the default (I assume to not hit the fully covered warning you hit) but the unreachable is still present after the switch.

This revision is now accepted and ready to land.Mar 4 2020, 11:47 PM
lattner updated this revision to Diff 248486.Mar 5 2020, 8:35 AM

Avoid warning for other compilers.

This revision was automatically updated to reflect the committed changes.