[Openmp-commits] [openmp] 0972a39 - LLVM_FALLTHROUGH => [[fallthrough]]. NFC
Fangrui Song via Openmp-commits
openmp-commits at lists.llvm.org
Mon Aug 8 21:06:58 PDT 2022
Author: Fangrui Song
Date: 2022-08-09T04:06:52Z
New Revision: 0972a390b9c74cd994ad0250cf392aecb67502a3
URL: https://github.com/llvm/llvm-project/commit/0972a390b9c74cd994ad0250cf392aecb67502a3
DIFF: https://github.com/llvm/llvm-project/commit/0972a390b9c74cd994ad0250cf392aecb67502a3.diff
LOG: LLVM_FALLTHROUGH => [[fallthrough]]. NFC
Added:
Modified:
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
Removed:
################################################################################
diff --git a/bolt/lib/Passes/FrameAnalysis.cpp b/bolt/lib/Passes/FrameAnalysis.cpp
index 391b210057ce5..933fa42fb3b76 100644
--- a/bolt/lib/Passes/FrameAnalysis.cpp
+++ b/bolt/lib/Passes/FrameAnalysis.cpp
@@ -193,7 +193,7 @@ class FrameAccessAnalysis {
switch (CFI->getOperation()) {
case MCCFIInstruction::OpDefCfa:
CfaOffset = CFI->getOffset();
- LLVM_FALLTHROUGH;
+ [[fallthrough]];
case MCCFIInstruction::OpDefCfaRegister:
CfaReg = CFI->getRegister();
break;
diff --git a/bolt/lib/Passes/RegReAssign.cpp b/bolt/lib/Passes/RegReAssign.cpp
index a376ef87bfe3b..4f2cd3326a1c4 100644
--- a/bolt/lib/Passes/RegReAssign.cpp
+++ b/bolt/lib/Passes/RegReAssign.cpp
@@ -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:
diff --git a/bolt/lib/Passes/ShrinkWrapping.cpp b/bolt/lib/Passes/ShrinkWrapping.cpp
index d4ac26f472dd3..284c65f1ee7d0 100644
--- a/bolt/lib/Passes/ShrinkWrapping.cpp
+++ b/bolt/lib/Passes/ShrinkWrapping.cpp
@@ -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;
diff --git a/bolt/lib/Target/X86/X86MCPlusBuilder.cpp b/bolt/lib/Target/X86/X86MCPlusBuilder.cpp
index c9a9228be99fa..c210c71abe0c1 100644
--- a/bolt/lib/Target/X86/X86MCPlusBuilder.cpp
+++ b/bolt/lib/Target/X86/X86MCPlusBuilder.cpp
@@ -1002,7 +1002,7 @@ class X86MCPlusBuilder : public MCPlusBuilder {
if (isUpper8BitReg(Operand.getReg()))
return true;
}
- LLVM_FALLTHROUGH;
+ [[fallthrough]];
default:
return false;
}
diff --git a/clang-tools-extra/clang-include-fixer/FuzzySymbolIndex.cpp b/clang-tools-extra/clang-include-fixer/FuzzySymbolIndex.cpp
index 58a320eea3180..91e2a9396a559 100644
--- a/clang-tools-extra/clang-include-fixer/FuzzySymbolIndex.cpp
+++ b/clang-tools-extra/clang-include-fixer/FuzzySymbolIndex.cpp
@@ -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:
diff --git a/clang-tools-extra/clang-tidy/google/AvoidCStyleCastsCheck.cpp b/clang-tools-extra/clang-tidy/google/AvoidCStyleCastsCheck.cpp
index f1514c868f857..f74d947e5e714 100644
--- a/clang-tools-extra/clang-tidy/google/AvoidCStyleCastsCheck.cpp
+++ b/clang-tools-extra/clang-tidy/google/AvoidCStyleCastsCheck.cpp
@@ -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
diff --git a/clang-tools-extra/clang-tidy/modernize/AvoidBindCheck.cpp b/clang-tools-extra/clang-tidy/modernize/AvoidBindCheck.cpp
index 8b7373b3d932a..1a82c5fc290ae 100644
--- a/clang-tools-extra/clang-tidy/modernize/AvoidBindCheck.cpp
+++ b/clang-tools-extra/clang-tidy/modernize/AvoidBindCheck.cpp
@@ -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;
diff --git a/clang-tools-extra/clang-tidy/readability/FunctionSizeCheck.cpp b/clang-tools-extra/clang-tidy/readability/FunctionSizeCheck.cpp
index 9d3300d2787ca..96b81235eee85 100644
--- a/clang-tools-extra/clang-tidy/readability/FunctionSizeCheck.cpp
+++ b/clang-tools-extra/clang-tidy/readability/FunctionSizeCheck.cpp
@@ -52,7 +52,7 @@ class FunctionASTVisitor : public RecursiveASTVisitor<FunctionASTVisitor> {
case Stmt::ForStmtClass:
case Stmt::SwitchStmtClass:
++Info.Branches;
- LLVM_FALLTHROUGH;
+ [[fallthrough]];
case Stmt::CompoundStmtClass:
TrackedParent.push_back(true);
break;
diff --git a/clang-tools-extra/clangd/CodeComplete.cpp b/clang-tools-extra/clangd/CodeComplete.cpp
index edbb1722ae38e..f102358941901 100644
--- a/clang-tools-extra/clangd/CodeComplete.cpp
+++ b/clang-tools-extra/clangd/CodeComplete.cpp
@@ -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
diff erent #includes.
diff --git a/clang-tools-extra/clangd/SourceCode.cpp b/clang-tools-extra/clangd/SourceCode.cpp
index 68594c21eccb9..670289eb37a5e 100644
--- a/clang-tools-extra/clangd/SourceCode.cpp
+++ b/clang-tools-extra/clangd/SourceCode.cpp
@@ -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;
diff --git a/openmp/libomptarget/plugins/cuda/src/rtl.cpp b/openmp/libomptarget/plugins/cuda/src/rtl.cpp
index 97fc3e9908eea..2b83878fba0ef 100644
--- a/openmp/libomptarget/plugins/cuda/src/rtl.cpp
+++ b/openmp/libomptarget/plugins/cuda/src/rtl.cpp
@@ -1075,7 +1075,7 @@ class DeviceRTLTy {
PeerAccessMatrix[SrcDevId][DstDevId] = PeerAccessState::Yes;
- LLVM_FALLTHROUGH;
+ [[fallthrough]];
}
case PeerAccessState::Yes: {
Err = cuMemcpyPeerAsync(
diff --git a/polly/lib/Analysis/ScopBuilder.cpp b/polly/lib/Analysis/ScopBuilder.cpp
index ab8e5adc23971..1817797fc579f 100644
--- a/polly/lib/Analysis/ScopBuilder.cpp
+++ b/polly/lib/Analysis/ScopBuilder.cpp
@@ -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;
diff --git a/polly/lib/Analysis/ScopDetection.cpp b/polly/lib/Analysis/ScopDetection.cpp
index e22f8bd41a1bf..99e93966b21e8 100644
--- a/polly/lib/Analysis/ScopDetection.cpp
+++ b/polly/lib/Analysis/ScopDetection.cpp
@@ -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()) {
diff --git a/polly/lib/Support/VirtualInstruction.cpp b/polly/lib/Support/VirtualInstruction.cpp
index 07f8ff54324b6..e570d8d546494 100644
--- a/polly/lib/Support/VirtualInstruction.cpp
+++ b/polly/lib/Support/VirtualInstruction.cpp
@@ -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());
diff --git a/polly/lib/Transform/ForwardOpTree.cpp b/polly/lib/Transform/ForwardOpTree.cpp
index fd4052f57a437..2bed3e35412d7 100644
--- a/polly/lib/Transform/ForwardOpTree.cpp
+++ b/polly/lib/Transform/ForwardOpTree.cpp
@@ -801,7 +801,7 @@ class ForwardOpTreeImpl final : ZoneAlgorithm {
// reuse the information about UseStmt for DefStmt
DefStmt = UseStmt;
- LLVM_FALLTHROUGH;
+ [[fallthrough]];
case VirtualUse::Inter:
Instruction *Inst = cast<Instruction>(UseVal);
More information about the Openmp-commits
mailing list