Use unreachable post switch rather than default case.

Prefer to enumerate all cases in the switch instead of using default to allow
compiler to flag missing cases. This also avoids -Wcovered-switch-default
warning.

PiperOrigin-RevId: 262935972
This commit is contained in:
Jacques Pienaar 2019-08-12 09:02:07 -07:00 committed by A. Unique TensorFlower
parent 77ed5247bf
commit e6365f3d02
1 changed files with 2 additions and 4 deletions

View File

@ -135,9 +135,8 @@ static llvm::CmpInst::Predicate getLLVMCmpPredicate(ICmpPredicate p) {
return llvm::CmpInst::Predicate::ICMP_UGT;
case LLVM::ICmpPredicate::uge:
return llvm::CmpInst::Predicate::ICMP_UGE;
default:
llvm_unreachable("incorrect comparison predicate");
}
llvm_unreachable("incorrect comparison predicate");
}
static llvm::CmpInst::Predicate getLLVMCmpPredicate(FCmpPredicate p) {
@ -174,9 +173,8 @@ static llvm::CmpInst::Predicate getLLVMCmpPredicate(FCmpPredicate p) {
return llvm::CmpInst::Predicate::FCMP_UNO;
case LLVM::FCmpPredicate::_true:
return llvm::CmpInst::Predicate::FCMP_TRUE;
default:
llvm_unreachable("incorrect comparison predicate");
}
llvm_unreachable("incorrect comparison predicate");
}
// A helper to look up remapped operands in the value remapping table.