Skip to content

Commit 5bcc747

Browse files
committed
Fix "use of uninitialized variable" static analyzer warnings. NFCI.
Add "unreachable" default cases like we do for the other switch()s in X86MCInstLower::Lower
1 parent ea5abf1 commit 5bcc747

File tree

1 file changed

+2
-0
lines changed

1 file changed

+2
-0
lines changed

llvm/lib/Target/X86/X86MCInstLower.cpp

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -569,6 +569,7 @@ void X86MCInstLower::Lower(const MachineInstr *MI, MCInst &OutMI) const {
569569
if (OutMI.getOperand(OutMI.getNumOperands() - 1).getImm() == 0) {
570570
unsigned NewOpc;
571571
switch (OutMI.getOpcode()) {
572+
default: llvm_unreachable("Invalid opcode");
572573
case X86::VPCMPBZ128rmi: NewOpc = X86::VPCMPEQBZ128rm; break;
573574
case X86::VPCMPBZ128rmik: NewOpc = X86::VPCMPEQBZ128rmk; break;
574575
case X86::VPCMPBZ128rri: NewOpc = X86::VPCMPEQBZ128rr; break;
@@ -640,6 +641,7 @@ void X86MCInstLower::Lower(const MachineInstr *MI, MCInst &OutMI) const {
640641
if (OutMI.getOperand(OutMI.getNumOperands() - 1).getImm() == 6) {
641642
unsigned NewOpc;
642643
switch (OutMI.getOpcode()) {
644+
default: llvm_unreachable("Invalid opcode");
643645
case X86::VPCMPBZ128rmi: NewOpc = X86::VPCMPGTBZ128rm; break;
644646
case X86::VPCMPBZ128rmik: NewOpc = X86::VPCMPGTBZ128rmk; break;
645647
case X86::VPCMPBZ128rri: NewOpc = X86::VPCMPGTBZ128rr; break;

0 commit comments

Comments
 (0)