From: Craig Topper Date: Sat, 28 Oct 2017 19:56:56 +0000 (+0000) Subject: [X86] Replace some default cases in X86SelectShift with llvm_unreachable. X-Git-Url: https://granicus.if.org/sourcecode?a=commitdiff_plain;h=4a6c7d6ea22e2cf284f93e7681ab3a2381b5dcb4;p=llvm [X86] Replace some default cases in X86SelectShift with llvm_unreachable. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@316839 91177308-0d34-0410-b5e6-96231b3b80d8 --- diff --git a/lib/Target/X86/X86FastISel.cpp b/lib/Target/X86/X86FastISel.cpp index 32f03998a60..30cdb36ab8b 100644 --- a/lib/Target/X86/X86FastISel.cpp +++ b/lib/Target/X86/X86FastISel.cpp @@ -1791,28 +1791,28 @@ bool X86FastISel::X86SelectShift(const Instruction *I) { CReg = X86::CX; RC = &X86::GR16RegClass; switch (I->getOpcode()) { + default: llvm_unreachable("Unexpected shift opcode"); case Instruction::LShr: OpReg = X86::SHR16rCL; break; case Instruction::AShr: OpReg = X86::SAR16rCL; break; case Instruction::Shl: OpReg = X86::SHL16rCL; break; - default: return false; } } else if (I->getType()->isIntegerTy(32)) { CReg = X86::ECX; RC = &X86::GR32RegClass; switch (I->getOpcode()) { + default: llvm_unreachable("Unexpected shift opcode"); case Instruction::LShr: OpReg = X86::SHR32rCL; break; case Instruction::AShr: OpReg = X86::SAR32rCL; break; case Instruction::Shl: OpReg = X86::SHL32rCL; break; - default: return false; } } else if (I->getType()->isIntegerTy(64)) { CReg = X86::RCX; RC = &X86::GR64RegClass; switch (I->getOpcode()) { + default: llvm_unreachable("Unexpected shift opcode"); case Instruction::LShr: OpReg = X86::SHR64rCL; break; case Instruction::AShr: OpReg = X86::SAR64rCL; break; case Instruction::Shl: OpReg = X86::SHL64rCL; break; - default: return false; } } else { return false;