Silence a bunch of implicit fallthrough warnings
authorAdrian Prantl <aprantl@apple.com>
Tue, 19 Dec 2017 22:05:25 +0000 (22:05 +0000)
committerAdrian Prantl <aprantl@apple.com>
Tue, 19 Dec 2017 22:05:25 +0000 (22:05 +0000)
llvm-svn: 321114

17 files changed:
llvm/lib/Analysis/ScalarEvolution.cpp
llvm/lib/CodeGen/AsmPrinter/AsmPrinter.cpp
llvm/lib/CodeGen/SelectionDAG/DAGCombiner.cpp
llvm/lib/CodeGen/SelectionDAG/ResourcePriorityQueue.cpp
llvm/lib/DebugInfo/DWARF/DWARFAcceleratorTable.cpp
llvm/lib/Demangle/ItaniumDemangle.cpp
llvm/lib/IR/ConstantFold.cpp
llvm/lib/Object/ELF.cpp
llvm/lib/Support/TargetParser.cpp
llvm/lib/Target/AArch64/AArch64FastISel.cpp
llvm/lib/Target/ARM/ARMFastISel.cpp
llvm/lib/Target/ARM/ARMISelLowering.cpp
llvm/lib/Target/ARM/Disassembler/ARMDisassembler.cpp
llvm/lib/Transforms/IPO/PartialInlining.cpp
llvm/lib/Transforms/IPO/WholeProgramDevirt.cpp
llvm/lib/Transforms/Vectorize/SLPVectorizer.cpp
llvm/utils/TableGen/IntrinsicEmitter.cpp

index 0b8604187121f0d5e8ae43c5b32ce06be8200ca8..2a8088dc44528e1e195a825e0a0c323654a75976 100644 (file)
@@ -4368,6 +4368,7 @@ static Optional<BinaryOp> MatchBinaryOp(Value *V, DominatorTree &DT) {
       default:
         break;
       }
+    break;
   }
 
   default:
index 31037095aa2bb951de08fc48bd7fa2c988c70b13..d7995447592cca2487aa635c55f2f2046bad57f3 100644 (file)
@@ -2033,6 +2033,7 @@ const MCExpr *AsmPrinter::lowerConstant(const Constant *CV) {
     }
   }
   // else fallthrough
+  LLVM_FALLTHROUGH;
 
   // The MC library also has a right-shift operator, but it isn't consistently
   // signed or unsigned between different targets.
index 0917342d3ba39d7a10fe95d1fef1d0a57ed6f83a..2dbcc1f8fa5b9fb6e5d7f12080a1f1d682e4dfa4 100644 (file)
@@ -10201,7 +10201,7 @@ SDValue DAGCombiner::visitFMUL(SDNode *N) {
       case ISD::SETLT:
       case ISD::SETLE:
         std::swap(TrueOpnd, FalseOpnd);
-        // Fall through
+        LLVM_FALLTHROUGH;
       case ISD::SETOGT:
       case ISD::SETUGT:
       case ISD::SETOGE:
index 379f0dcef513dc034a054f9f600732ff04f5497f..7f369c746d24e555608ac84c283af8223c76efdb 100644 (file)
@@ -252,6 +252,7 @@ bool ResourcePriorityQueue::isResourceAvailable(SUnit *SU) {
       if (!ResourcesModel->canReserveResources(&TII->get(
           SU->getNode()->getMachineOpcode())))
            return false;
+      break;
     case TargetOpcode::EXTRACT_SUBREG:
     case TargetOpcode::INSERT_SUBREG:
     case TargetOpcode::SUBREG_TO_REG:
index 17f29737bf93be84d411de65be7564e9a235c14a..6a6b7fc6fc20360dea06d9aa7a02154eda5a7f46 100644 (file)
@@ -83,6 +83,7 @@ bool DWARFAcceleratorTable::validateForms() {
            !FormValue.isFormClass(DWARFFormValue::FC_Flag)) ||
           FormValue.getForm() == dwarf::DW_FORM_sdata)
         return false;
+      break;
     default:
       break;
     }
index 34f4017d98283dd0d9cdea53daba73730d77d708..9c2258f5b9331bd33486615da31eb311f27c9cc4 100644 (file)
@@ -8,6 +8,7 @@
 //===----------------------------------------------------------------------===//
 
 #include "llvm/Demangle/Demangle.h"
+#include "llvm/Support/Compiler.h"
 
 // This file exports a single function: llvm::itanium_demangle.
 // It also has no dependencies on the rest of llvm. It is implemented this way
@@ -1947,7 +1948,7 @@ static const char *parse_type(const char *first, const char *last, C &db) {
               break;
             }
           }
-        // falls through
+          LLVM_FALLTHROUGH;
         default:
           // must check for builtin-types before class-enum-types to avoid
           // ambiguities with operator-names
index 90b10309b58bdf07f167dc7218399d4d9ba70c78..59818a1425f1b36c12e2a1d1118c1628673fc850 100644 (file)
@@ -1674,6 +1674,7 @@ static ICmpInst::Predicate evaluateICmpRelation(Constant *V1, Constant *V2,
           }
         }
       }
+      break;
     }
     default:
       break;
index c72a1258c1eef872b4e40528548fa6819cb32233..5906dc5f5307b11c733a9c8d18f8232482feeba5 100644 (file)
@@ -138,6 +138,7 @@ StringRef llvm::object::getELFRelocationTypeName(uint32_t Machine,
     default:
       break;
     }
+    break;
   case ELF::EM_BPF:
     switch (Type) {
 #include "llvm/BinaryFormat/ELFRelocs/BPF.def"
index c59068cb3550b8693f16d6a3e2501dbc2d2beaa2..ea12d8001a39be360bab973c0bf1ead86be2804d 100644 (file)
@@ -739,7 +739,6 @@ ARM::ProfileKind ARM::parseArchProfile(StringRef Arch) {
   case ARM::ArchKind::ARMV8_2A:
   case ARM::ArchKind::ARMV8_3A:
     return ARM::ProfileKind::A;
-    LLVM_FALLTHROUGH;
   case ARM::ArchKind::ARMV2:
   case ARM::ArchKind::ARMV2A:
   case ARM::ArchKind::ARMV3:
index fd1699fd363d0b586e00aa39655c0845a54e8004..022200986d2bfe6e90db5339a20603a3a07bad09 100644 (file)
@@ -5135,11 +5135,12 @@ bool AArch64FastISel::fastSelectInstruction(const Instruction *I) {
     return selectAtomicCmpXchg(cast<AtomicCmpXchgInst>(I));
   }
 
-  // fall-back to target-independent instruction selection.
-  return selectOperator(I, I->getOpcode());
   // Silence warnings.
   (void)&CC_AArch64_DarwinPCS_VarArg;
   (void)&CC_AArch64_Win64_VarArg;
+
+  // fall-back to target-independent instruction selection.
+  return selectOperator(I, I->getOpcode());
 }
 
 namespace llvm {
index 0ea435062ec038ad93cf0c8d50d8de8126b95d8a..60048d4453d8926a42564cda5d2a0a0c2401c4bd 100644 (file)
@@ -1416,7 +1416,7 @@ bool ARMFastISel::ARMEmitCmp(const Value *Src1Value, const Value *Src2Value,
     case MVT::i8:
     case MVT::i16:
       needsExt = true;
-    // Intentional fall-through.
+      LLVM_FALLTHROUGH;
     case MVT::i32:
       if (isThumb2) {
         if (!UseImm)
index 5e7599b7baef5d9d19d4194e0dbd9cbbb076a5da..7fca0472d78b045a62d3c8f930a64a1b305cbb5c 100644 (file)
@@ -13741,7 +13741,7 @@ Instruction *ARMTargetLowering::emitLeadingFence(IRBuilder<> &Builder,
   case AtomicOrdering::SequentiallyConsistent:
     if (!Inst->hasAtomicStore())
       return nullptr; // Nothing to do
-    /*FALLTHROUGH*/
+    LLVM_FALLTHROUGH;
   case AtomicOrdering::Release:
   case AtomicOrdering::AcquireRelease:
     if (Subtarget->preferISHSTBarriers())
index a29a2eeccfe878822438302f1dd8e28875385bc5..53c6358776753a0fd7487aff19dcfc24d0042d9c 100644 (file)
@@ -2386,6 +2386,7 @@ static DecodeStatus DecodeVLDInstruction(MCInst &Inst, unsigned Insn,
     case ARM::VLD4q32_UPD:
       if (!Check(S, DecodeDPRRegisterClass(Inst, (Rd+2)%32, Address, Decoder)))
         return MCDisassembler::Fail;
+      break;
     default:
       break;
   }
@@ -3326,6 +3327,7 @@ static DecodeStatus DecodeT2AddrModeSOReg(MCInst &Inst, unsigned Val,
   case ARM::t2STRs:
     if (Rn == 15)
       return MCDisassembler::Fail;
+    break;
   default:
     break;
   }
@@ -3391,6 +3393,7 @@ static DecodeStatus DecodeT2LoadShift(MCInst &Inst, unsigned Insn,
       break;
     case ARM::t2LDRSBs:
       Inst.setOpcode(ARM::t2PLIs);
+      break;
     default:
       break;
     }
@@ -3854,6 +3857,7 @@ static DecodeStatus DecodeT2AddrModeImm12(MCInst &Inst, unsigned Val,
   case ARM::t2STRHi12:
     if (Rn == 15)
       return MCDisassembler::Fail;
+    break;
   default:
     break;
   }
index 683655f1f68bb2c7a26cba0f14e6a1caf360a040..5f5b7be3c209c6be66a75b29903d5ee613997f63 100644 (file)
@@ -863,6 +863,7 @@ int PartialInlinerImpl::computeBBInlineCost(BasicBlock *BB) {
     case Instruction::GetElementPtr:
       if (cast<GetElementPtrInst>(I)->hasAllZeroIndices())
         continue;
+      break;
     default:
       break;
     }
index ec56f0cde25d730e8eceb2549e72bb1e479ee7ef..5fbb001216a315b873722226cae30e0ea09389d3 100644 (file)
@@ -1346,6 +1346,7 @@ void DevirtModule::importResolution(VTableSlot Slot, VTableSlotInfo &SlotInfo) {
       Constant *Bit = importConstant(Slot, CSByConstantArg.first, "bit", Int8Ty,
                                      ResByArg.Bit);
       applyVirtualConstProp(CSByConstantArg.second, "", Byte, Bit);
+      break;
     }
     default:
       break;
index 76ba62f5d59666bceb84f070221f029b44fb1edc..7eab9e92ceba3a3e4fb4566e68c3a88a8a4c55ba 100644 (file)
@@ -4017,6 +4017,7 @@ static bool collectValuesToDemote(Value *V, SmallPtrSetImpl<Value *> &Expr,
   // seed additional demotion, we save the truncated value.
   case Instruction::Trunc:
     Roots.push_back(I->getOperand(0));
+    break;
   case Instruction::ZExt:
   case Instruction::SExt:
     break;
index b4e61ec53c1990aece06fdc8a79e2bbd49b1202c..37e024b1665ed1c656c8a008a85ae0f6e37d8d99 100644 (file)
@@ -717,6 +717,7 @@ void IntrinsicEmitter::EmitAttributes(const CodeGenIntrinsicTable &Ints,
         if (addComma)
           OS << ",";
         OS << "Attribute::InaccessibleMemOrArgMemOnly";
+        break;
       case CodeGenIntrinsic::ReadWriteMem:
         break;
       }