From: Craig Topper Date: Tue, 2 Apr 2019 20:52:16 +0000 (+0000) Subject: [X86] Mark the default case of the X86InstrInfo::convertToThreeAddress switch as... X-Git-Url: https://granicus.if.org/sourcecode?a=commitdiff_plain;h=4babc48b059062f4ae8082f2d7a5f58d66505551;p=llvm [X86] Mark the default case of the X86InstrInfo::convertToThreeAddress switch as unreachable. This function should only be called with instructions that are really convertible. And all convertible instructions need to be handled by the switch. So nothing should use the default. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@357529 91177308-0d34-0410-b5e6-96231b3b80d8 --- diff --git a/lib/Target/X86/X86InstrInfo.cpp b/lib/Target/X86/X86InstrInfo.cpp index e157bc13ec2..4aa365cf8fe 100644 --- a/lib/Target/X86/X86InstrInfo.cpp +++ b/lib/Target/X86/X86InstrInfo.cpp @@ -869,7 +869,7 @@ X86InstrInfo::convertToThreeAddress(MachineFunction::iterator &MFI, bool Is8BitOp = false; unsigned MIOpc = MI.getOpcode(); switch (MIOpc) { - default: return nullptr; + default: llvm_unreachable("Unreachable!"); case X86::SHL64ri: { assert(MI.getNumOperands() >= 3 && "Unknown shift instruction!"); unsigned ShAmt = getTruncatedShiftCount(MI, 2);