diff options
| author | Nemanja Ivanovic <nemanja.i.ibm@gmail.com> | 2017-09-22 12:26:00 +0000 |
|---|---|---|
| committer | Nemanja Ivanovic <nemanja.i.ibm@gmail.com> | 2017-09-22 12:26:00 +0000 |
| commit | cea42b7fff23a7637a641cb62666ca0756b9b81d (patch) | |
| tree | d999c865692caa43cda1bc2040223b39f4d11d4c /llvm/lib | |
| parent | 640527f7f13bdb654c7ca32abb06521aa2a1d542 (diff) | |
| download | bcm5719-llvm-cea42b7fff23a7637a641cb62666ca0756b9b81d.tar.gz bcm5719-llvm-cea42b7fff23a7637a641cb62666ca0756b9b81d.zip | |
Remove the default clause from a fully-covering switch
to appease bots that use a compiler that warns about this
and use -Werror.
llvm-svn: 313980
Diffstat (limited to 'llvm/lib')
| -rw-r--r-- | llvm/lib/Target/PowerPC/PPCISelDAGToDAG.cpp | 14 |
1 files changed, 10 insertions, 4 deletions
diff --git a/llvm/lib/Target/PowerPC/PPCISelDAGToDAG.cpp b/llvm/lib/Target/PowerPC/PPCISelDAGToDAG.cpp index f794312e39b..dbe4269f004 100644 --- a/llvm/lib/Target/PowerPC/PPCISelDAGToDAG.cpp +++ b/llvm/lib/Target/PowerPC/PPCISelDAGToDAG.cpp @@ -2801,11 +2801,11 @@ SDValue PPCDAGToDAGISel::getCompoundZeroComparisonInGPR(SDValue LHS, SDLoc dl, // Produce the value that needs to be either zero or sign extended. switch (CmpTy) { - default: llvm_unreachable("Unknown Zero-comparison type."); case ZeroCompare::GEZExt: case ZeroCompare::GESExt: ToExtend = SDValue(CurDAG->getMachineNode(Is32Bit ? PPC::NOR : PPC::NOR8, dl, InVT, LHS, LHS), 0); + break; case ZeroCompare::LEZExt: case ZeroCompare::LESExt: { if (Is32Bit) { @@ -2824,22 +2824,24 @@ SDValue PPCDAGToDAGISel::getCompoundZeroComparisonInGPR(SDValue LHS, SDLoc dl, ToExtend = SDValue(CurDAG->getMachineNode(PPC::OR8, dl, MVT::i64, Addi, LHS), 0); } + break; } } // For 64-bit sequences, the extensions are the same for the GE/LE cases. - if (!Is32Bit && (CmpTy == ZeroCompare::GEZExt || ZeroCompare::LEZExt)) + if (!Is32Bit && + (CmpTy == ZeroCompare::GEZExt || CmpTy == ZeroCompare::LEZExt)) return SDValue(CurDAG->getMachineNode(PPC::RLDICL, dl, MVT::i64, ToExtend, getI64Imm(1, dl), getI64Imm(63, dl)), 0); - if (!Is32Bit && (CmpTy == ZeroCompare::GESExt || ZeroCompare::LESExt)) + if (!Is32Bit && + (CmpTy == ZeroCompare::GESExt || CmpTy == ZeroCompare::LESExt)) return SDValue(CurDAG->getMachineNode(PPC::SRADI, dl, MVT::i64, ToExtend, getI64Imm(63, dl)), 0); assert(Is32Bit && "Should have handled the 32-bit sequences above."); // For 32-bit sequences, the extensions differ between GE/LE cases. switch (CmpTy) { - default: llvm_unreachable("Unknown Zero-comparison type."); case ZeroCompare::GEZExt: { SDValue ShiftOps[] = { ToExtend, getI32Imm(1, dl), getI32Imm(31, dl), getI32Imm(31, dl) }; @@ -2856,6 +2858,10 @@ SDValue PPCDAGToDAGISel::getCompoundZeroComparisonInGPR(SDValue LHS, SDLoc dl, return SDValue(CurDAG->getMachineNode(PPC::ADDI8, dl, MVT::i64, ToExtend, getI32Imm(-1, dl)), 0); } + + // The above case covers all the enumerators so it can't have a default clause + // to avoid compiler warnings. + llvm_unreachable("Unknown zero-comparison type."); } /// Produces a zero-extended result of comparing two 32-bit values according to |

