LLVM_FALLTHROUGH => [[fallthrough]]. NFC

This commit is contained in:
Fangrui Song 2022-08-09 04:06:52 +00:00
parent fc63c0542c
commit 0972a390b9
15 changed files with 23 additions and 23 deletions

View 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;

View 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:

View 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;

View File

@ -1002,7 +1002,7 @@ public:
if (isUpper8BitReg(Operand.getReg()))
return true;
}
LLVM_FALLTHROUGH;
[[fallthrough]];
default:
return false;
}

View 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:

View 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

View 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;

View 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;

View 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.

View 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;

View File

@ -1075,7 +1075,7 @@ public:
PeerAccessMatrix[SrcDevId][DstDevId] = PeerAccessState::Yes;
LLVM_FALLTHROUGH;
[[fallthrough]];
}
case PeerAccessState::Yes: {
Err = cuMemcpyPeerAsync(

View 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;

View 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()) {

View 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());

View 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);