[PATCH] D75663: Fix a warning about an unreachable default in a switch statement.

Mehdi AMINI via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Thu Mar 5 00:03:19 PST 2020


mehdi_amini accepted this revision.
mehdi_amini added inline comments.
This revision is now accepted and ready to land.


================
Comment at: mlir/lib/Dialect/StandardOps/IR/Ops.cpp:625
   }
   llvm_unreachable("unknown comparison predicate");
 }
----------------
(like here)


================
Comment at: mlir/lib/Dialect/StandardOps/IR/Ops.cpp:699
-  default:
-    llvm_unreachable("unknown comparison predicate");
   }
----------------
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.


Repository:
  rG LLVM Github Monorepo

CHANGES SINCE LAST ACTION
  https://reviews.llvm.org/D75663/new/

https://reviews.llvm.org/D75663





More information about the llvm-commits mailing list