LLVM_FALLTHROUGH => [[fallthrough]]. NFC
authorFangrui Song <i@maskray.me>
Tue, 9 Aug 2022 04:06:52 +0000 (04:06 +0000)
committerFangrui Song <i@maskray.me>
Tue, 9 Aug 2022 04:06:52 +0000 (04:06 +0000)
15 files changed:
bolt/lib/Passes/FrameAnalysis.cpp
bolt/lib/Passes/RegReAssign.cpp
bolt/lib/Passes/ShrinkWrapping.cpp
bolt/lib/Target/X86/X86MCPlusBuilder.cpp
clang-tools-extra/clang-include-fixer/FuzzySymbolIndex.cpp
clang-tools-extra/clang-tidy/google/AvoidCStyleCastsCheck.cpp
clang-tools-extra/clang-tidy/modernize/AvoidBindCheck.cpp
clang-tools-extra/clang-tidy/readability/FunctionSizeCheck.cpp
clang-tools-extra/clangd/CodeComplete.cpp
clang-tools-extra/clangd/SourceCode.cpp
openmp/libomptarget/plugins/cuda/src/rtl.cpp
polly/lib/Analysis/ScopBuilder.cpp
polly/lib/Analysis/ScopDetection.cpp
polly/lib/Support/VirtualInstruction.cpp
polly/lib/Transform/ForwardOpTree.cpp

index 391b210..933fa42 100644 (file)
@@ -193,7 +193,7 @@ public:
       switch (CFI->getOperation()) {
       case MCCFIInstruction::OpDefCfa:
         CfaOffset = CFI->getOffset();
-        LLVM_FALLTHROUGH;
+        [[fallthrough]];
       case MCCFIInstruction::OpDefCfaRegister:
         CfaReg = CFI->getRegister();
         break;
index a376ef8..4f2cd33 100644 (file)
@@ -95,7 +95,7 @@ void RegReAssign::swap(BinaryFunction &Function, MCPhysReg A, MCPhysReg B) {
                             false)));
         }
       }
-      LLVM_FALLTHROUGH;
+      [[fallthrough]];
       case MCCFIInstruction::OpUndefined:
       case MCCFIInstruction::OpDefCfa:
       case MCCFIInstruction::OpOffset:
index d4ac26f..284c65f 100644 (file)
@@ -388,7 +388,7 @@ void StackLayoutModifier::classifyCFIs() {
       case MCCFIInstruction::OpDefCfa:
         CfaOffset = -CFI->getOffset();
         recordAccess(&Inst, CfaOffset);
-        LLVM_FALLTHROUGH;
+        [[fallthrough]];
       case MCCFIInstruction::OpDefCfaRegister:
         CfaReg = CFI->getRegister();
         break;
index c9a9228..c210c71 100644 (file)
@@ -1002,7 +1002,7 @@ public:
         if (isUpper8BitReg(Operand.getReg()))
           return true;
       }
-      LLVM_FALLTHROUGH;
+      [[fallthrough]];
     default:
       return false;
     }
index 58a320e..91e2a93 100644 (file)
@@ -84,10 +84,10 @@ std::vector<std::string> FuzzySymbolIndex::tokenize(StringRef Text) {
       switch (State) {
       case BIG_WORD:
         Flush(I - 1); // FOOBar: first token is FOO, not FOOB.
-        LLVM_FALLTHROUGH;
+        [[fallthrough]];
       case ONE_BIG:
         State = SMALL_WORD;
-        LLVM_FALLTHROUGH;
+        [[fallthrough]];
       case SMALL_WORD:
         break;
       default:
@@ -98,7 +98,7 @@ std::vector<std::string> FuzzySymbolIndex::tokenize(StringRef Text) {
       switch (State) {
       case ONE_BIG:
         State = BIG_WORD;
-        LLVM_FALLTHROUGH;
+        [[fallthrough]];
       case BIG_WORD:
         break;
       default:
index f1514c8..f74d947 100644 (file)
@@ -230,7 +230,7 @@ void AvoidCStyleCastsCheck::check(const MatchFinder::MatchResult &Result) {
       }
       break;
     }
-    LLVM_FALLTHROUGH;
+    [[fallthrough]];
   case clang::CK_IntegralCast:
     // Convert integral and no-op casts between builtin types and enums to
     // static_cast. A cast from enum to integer may be unnecessary, but it's
index 8b7373b..1a82c5f 100644 (file)
@@ -699,7 +699,7 @@ void AvoidBindCheck::check(const MatchFinder::MatchResult &Result) {
         Stream << "(" << LP.Callable.UsageIdentifier << ")";
         break;
       }
-      LLVM_FALLTHROUGH;
+      [[fallthrough]];
     case CE_InitExpression:
       Stream << LP.Callable.UsageIdentifier;
       break;
index 9d3300d..96b8123 100644 (file)
@@ -52,7 +52,7 @@ public:
     case Stmt::ForStmtClass:
     case Stmt::SwitchStmtClass:
       ++Info.Branches;
-      LLVM_FALLTHROUGH;
+      [[fallthrough]];
     case Stmt::CompoundStmtClass:
       TrackedParent.push_back(true);
       break;
index edbb172..f102358 100644 (file)
@@ -221,7 +221,7 @@ struct CompletionCandidate {
 #ifndef NDEBUG
         llvm_unreachable("Don't expect members from index in code completion");
 #else
-        LLVM_FALLTHROUGH;
+        [[fallthrough]];
 #endif
       case index::SymbolKind::Function:
         // We can't group overloads together that need different #includes.
index 68594c2..670289e 100644 (file)
@@ -696,14 +696,14 @@ void parseNamespaceEvents(llvm::StringRef Code, const LangOptions &LangOpts,
       switch (State) {
       case UsingNamespace:
         NSName.clear();
-        LLVM_FALLTHROUGH;
+        [[fallthrough]];
       case UsingNamespaceName:
         NSName.append(Tok.text(SM).str());
         State = UsingNamespaceName;
         break;
       case Namespace:
         NSName.clear();
-        LLVM_FALLTHROUGH;
+        [[fallthrough]];
       case NamespaceName:
         NSName.append(Tok.text(SM).str());
         State = NamespaceName;
@@ -720,7 +720,7 @@ void parseNamespaceEvents(llvm::StringRef Code, const LangOptions &LangOpts,
       switch (State) {
       case UsingNamespace:
         NSName.clear();
-        LLVM_FALLTHROUGH;
+        [[fallthrough]];
       case UsingNamespaceName:
         NSName.append("::");
         State = UsingNamespaceName;
@@ -865,7 +865,7 @@ llvm::StringSet<> collectWords(llvm::StringRef Content) {
     switch (Roles[I]) {
     case Head:
       Flush();
-      LLVM_FALLTHROUGH;
+      [[fallthrough]];
     case Tail:
       Word.push_back(Content[I]);
       break;
index 97fc3e9..2b83878 100644 (file)
@@ -1075,7 +1075,7 @@ public:
 
         PeerAccessMatrix[SrcDevId][DstDevId] = PeerAccessState::Yes;
 
-        LLVM_FALLTHROUGH;
+        [[fallthrough]];
       }
       case PeerAccessState::Yes: {
         Err = cuMemcpyPeerAsync(
index ab8e5ad..1817797 100644 (file)
@@ -1655,7 +1655,7 @@ bool ScopBuilder::buildAccessCallInst(MemAccInst Inst, ScopStmt *Stmt) {
     return true;
   case FMRB_OnlyReadsArgumentPointees:
     ReadOnly = true;
-    LLVM_FALLTHROUGH;
+    [[fallthrough]];
   case FMRB_OnlyWritesArgumentPointees:
   case FMRB_OnlyAccessesArgumentPointees: {
     auto AccType = ReadOnly ? MemoryAccess::READ : MemoryAccess::MAY_WRITE;
@@ -2385,7 +2385,7 @@ void ScopBuilder::ensureValueRead(Value *V, ScopStmt *UserStmt) {
     if (!ModelReadOnlyScalars)
       break;
 
-    LLVM_FALLTHROUGH;
+    [[fallthrough]];
   case VirtualUse::Inter:
 
     // Do not create another MemoryAccess for reloading the value if one already
@@ -2482,7 +2482,7 @@ static MemoryAccess::ReductionType getReductionType(const BinaryOperator *BinOp,
   case Instruction::FAdd:
     if (!BinOp->isFast())
       return MemoryAccess::RT_NONE;
-    LLVM_FALLTHROUGH;
+    [[fallthrough]];
   case Instruction::Add:
     return MemoryAccess::RT_ADD;
   case Instruction::Or:
@@ -2494,7 +2494,7 @@ static MemoryAccess::ReductionType getReductionType(const BinaryOperator *BinOp,
   case Instruction::FMul:
     if (!BinOp->isFast())
       return MemoryAccess::RT_NONE;
-    LLVM_FALLTHROUGH;
+    [[fallthrough]];
   case Instruction::Mul:
     if (DisableMultiplicativeReductions)
       return MemoryAccess::RT_NONE;
index e22f8bd..99e9396 100644 (file)
@@ -783,7 +783,7 @@ bool ScopDetection::isValidIntrinsicInst(IntrinsicInst &II,
       if (!isValidAccess(&II, AF, BP, Context))
         return false;
     }
-    LLVM_FALLTHROUGH;
+    [[fallthrough]];
   case Intrinsic::memset:
     AF = SE.getSCEVAtScope(cast<MemIntrinsic>(II).getDest(), L);
     if (!AF->isZero()) {
index 07f8ff5..e570d8d 100644 (file)
@@ -300,7 +300,7 @@ static void walkReachable(Scop *S, LoopInfo *LI,
       // enabled.
       if (!VUse.getMemoryAccess())
         break;
-      LLVM_FALLTHROUGH;
+      [[fallthrough]];
     case VirtualUse::Inter:
       assert(VUse.getMemoryAccess());
       WorklistAccs.push_back(VUse.getMemoryAccess());
index fd4052f..2bed3e3 100644 (file)
@@ -801,7 +801,7 @@ public:
       // reuse the information about UseStmt for DefStmt
       DefStmt = UseStmt;
 
-      LLVM_FALLTHROUGH;
+      [[fallthrough]];
     case VirtualUse::Inter:
       Instruction *Inst = cast<Instruction>(UseVal);