Fix a -Wcovered-switch-default warning by moving the unreachable out of the
authorEric Christopher <echristo@gmail.com>
Fri, 27 Dec 2019 02:29:54 +0000 (18:29 -0800)
committerEric Christopher <echristo@gmail.com>
Fri, 27 Dec 2019 02:29:54 +0000 (18:29 -0800)
covered switch.

mlir/lib/Dialect/StandardOps/Ops.cpp

index 831c78a..93c501e 100644 (file)
@@ -696,9 +696,8 @@ static bool applyCmpPredicate(CmpIPredicate predicate, const APInt &lhs,
     return lhs.ugt(rhs);
   case CmpIPredicate::uge:
     return lhs.uge(rhs);
-  default:
-    llvm_unreachable("unknown comparison predicate");
   }
+  llvm_unreachable("unknown comparison predicate");
 }
 
 // Constant folding hook for comparisons.