[clang] LLVM_FALLTHROUGH => [[fallthrough]]. NFC

With C++17 there is no Clang pedantic warning or MSVC C5051.

Reviewed By: aaron.ballman

Differential Revision: https://reviews.llvm.org/D131346
This commit is contained in:
Fangrui Song 2022-08-08 09:12:46 -07:00
parent 521a5c11ac
commit 3f18f7c007
108 changed files with 301 additions and 301 deletions

View File

@ -380,7 +380,7 @@ class JSONDumper : public ASTNodeTraverser<JSONDumper, JSONNodeDumper> {
case TSK_ExplicitInstantiationDefinition:
if (!DumpExplicitInst)
break;
LLVM_FALLTHROUGH;
[[fallthrough]];
case TSK_Undeclared:
case TSK_ImplicitInstantiation:
if (DumpRefOnly)

View File

@ -78,7 +78,7 @@ public:
}
}
// Pass through.
LLVM_FALLTHROUGH;
[[fallthrough]];
case OMF_retain:
case OMF_release:
if (E->getReceiverKind() == ObjCMessageExpr::Instance)

View File

@ -540,7 +540,7 @@ void TransformActionsImpl::addRemoval(CharSourceRange range) {
return;
case Range_Contains:
RI->End = newRange.End;
LLVM_FALLTHROUGH;
[[fallthrough]];
case Range_ExtendsBegin:
newRange.End = RI->End;
Removals.erase(RI);

View File

@ -871,7 +871,7 @@ void APValue::printPretty(raw_ostream &Out, const PrintingPolicy &Policy,
Out << "...}";
return;
}
LLVM_FALLTHROUGH;
[[fallthrough]];
default:
getArrayInitializedElt(I).printPretty(Out, Policy, ElemTy, Ctx);
}

View File

@ -4420,7 +4420,7 @@ QualType ASTContext::getFunctionTypeInternal(
case EST_Unparsed: case EST_Unevaluated: case EST_Uninstantiated:
// We don't know yet. It shouldn't matter what we pick here; no-one
// should ever look at this.
LLVM_FALLTHROUGH;
[[fallthrough]];
case EST_None: case EST_MSAny: case EST_NoexceptFalse:
CanonicalEPI.ExceptionSpec.Type = EST_None;
break;
@ -8286,7 +8286,7 @@ void ASTContext::getObjCEncodingForTypeImpl(QualType T, std::string &S,
return;
}
// TODO: Double check to make sure this intentionally falls through.
LLVM_FALLTHROUGH;
[[fallthrough]];
}
case Type::ObjCInterface: {

View File

@ -425,7 +425,7 @@ void clang::FormatASTNodeDiagnosticArgument(
Modifier = StringRef();
Argument = StringRef();
// Fall through
LLVM_FALLTHROUGH;
[[fallthrough]];
}
case DiagnosticsEngine::ak_qualtype: {
assert(Modifier.empty() && Argument.empty() &&

View File

@ -96,7 +96,7 @@ void ASTDumper::dumpTemplateDeclSpecialization(const SpecializationDecl *D,
case TSK_ExplicitInstantiationDefinition:
if (!DumpExplicitInst)
break;
LLVM_FALLTHROUGH;
[[fallthrough]];
case TSK_Undeclared:
case TSK_ImplicitInstantiation:
if (DumpRefOnly)

View File

@ -900,7 +900,7 @@ static bool IsStructurallyEquivalent(StructuralEquivalenceContext &Context,
return false;
// Fall through to check the bits common with FunctionNoProtoType.
LLVM_FALLTHROUGH;
[[fallthrough]];
}
case Type::FunctionNoProto: {

View File

@ -301,7 +301,7 @@ void DeclInfo::fill() {
TemplateKind = TemplateSpecialization;
TemplateParameters = VTD->getTemplateParameters();
}
LLVM_FALLTHROUGH;
[[fallthrough]];
case Decl::Field:
case Decl::EnumConstant:
case Decl::ObjCIvar:

View File

@ -277,7 +277,7 @@ ConstantExpr::getStorageKind(const APValue &Value) {
case APValue::Int:
if (!Value.getInt().needsCleanup())
return ConstantExpr::RSK_Int64;
LLVM_FALLTHROUGH;
[[fallthrough]];
default:
return ConstantExpr::RSK_APValue;
}
@ -2633,7 +2633,7 @@ bool Expr::isUnusedResultAWarning(const Expr *&WarnE, SourceLocation &Loc,
}
// Fallthrough for generic call handling.
LLVM_FALLTHROUGH;
[[fallthrough]];
}
case CallExprClass:
case CXXMemberCallExprClass:
@ -3609,7 +3609,7 @@ bool Expr::HasSideEffects(const ASTContext &Ctx,
DCE->getCastKind() == CK_Dynamic)
return true;
}
LLVM_FALLTHROUGH;
[[fallthrough]];
case ImplicitCastExprClass:
case CStyleCastExprClass:
case CXXStaticCastExprClass:

View File

@ -1097,7 +1097,7 @@ LambdaCapture::LambdaCapture(SourceLocation Loc, bool Implicit,
switch (Kind) {
case LCK_StarThis:
Bits |= Capture_ByCopy;
LLVM_FALLTHROUGH;
[[fallthrough]];
case LCK_This:
assert(!Var && "'this' capture cannot have a variable!");
Bits |= Capture_This;
@ -1105,7 +1105,7 @@ LambdaCapture::LambdaCapture(SourceLocation Loc, bool Implicit,
case LCK_ByCopy:
Bits |= Capture_ByCopy;
LLVM_FALLTHROUGH;
[[fallthrough]];
case LCK_ByRef:
assert(Var && "capture must have a variable!");
break;

View File

@ -1132,7 +1132,7 @@ namespace {
if (!HasFoldFailureDiagnostic)
break;
// We've already failed to fold something. Keep that diagnostic.
LLVM_FALLTHROUGH;
[[fallthrough]];
case EM_ConstantExpression:
case EM_ConstantExpressionUnevaluated:
setActiveDiagnostic(false);
@ -9217,7 +9217,7 @@ bool PointerExprEvaluator::VisitBuiltinCallExpr(const CallExpr *E,
<< (std::string("'") + Info.Ctx.BuiltinInfo.getName(BuiltinOp) + "'");
else
Info.CCEDiag(E, diag::note_invalid_subexpr_in_const_expr);
LLVM_FALLTHROUGH;
[[fallthrough]];
case Builtin::BI__builtin_strchr:
case Builtin::BI__builtin_wcschr:
case Builtin::BI__builtin_memchr:
@ -9278,7 +9278,7 @@ bool PointerExprEvaluator::VisitBuiltinCallExpr(const CallExpr *E,
Desired))
return ZeroInitialization(E);
StopAtNull = true;
LLVM_FALLTHROUGH;
[[fallthrough]];
case Builtin::BImemchr:
case Builtin::BI__builtin_memchr:
case Builtin::BI__builtin_char_memchr:
@ -9291,7 +9291,7 @@ bool PointerExprEvaluator::VisitBuiltinCallExpr(const CallExpr *E,
case Builtin::BIwcschr:
case Builtin::BI__builtin_wcschr:
StopAtNull = true;
LLVM_FALLTHROUGH;
[[fallthrough]];
case Builtin::BIwmemchr:
case Builtin::BI__builtin_wmemchr:
// wcschr and wmemchr are given a wchar_t to look for. Just use it.
@ -9325,7 +9325,7 @@ bool PointerExprEvaluator::VisitBuiltinCallExpr(const CallExpr *E,
<< (std::string("'") + Info.Ctx.BuiltinInfo.getName(BuiltinOp) + "'");
else
Info.CCEDiag(E, diag::note_invalid_subexpr_in_const_expr);
LLVM_FALLTHROUGH;
[[fallthrough]];
case Builtin::BI__builtin_memcpy:
case Builtin::BI__builtin_memmove:
case Builtin::BI__builtin_wmemcpy:
@ -12122,7 +12122,7 @@ bool IntExprEvaluator::VisitBuiltinCallExpr(const CallExpr *E,
<< (std::string("'") + Info.Ctx.BuiltinInfo.getName(BuiltinOp) + "'");
else
Info.CCEDiag(E, diag::note_invalid_subexpr_in_const_expr);
LLVM_FALLTHROUGH;
[[fallthrough]];
case Builtin::BI__builtin_strlen:
case Builtin::BI__builtin_wcslen: {
// As an extension, we support __builtin_strlen() as a constant expression,
@ -12147,7 +12147,7 @@ bool IntExprEvaluator::VisitBuiltinCallExpr(const CallExpr *E,
<< (std::string("'") + Info.Ctx.BuiltinInfo.getName(BuiltinOp) + "'");
else
Info.CCEDiag(E, diag::note_invalid_subexpr_in_const_expr);
LLVM_FALLTHROUGH;
[[fallthrough]];
case Builtin::BI__builtin_strcmp:
case Builtin::BI__builtin_wcscmp:
case Builtin::BI__builtin_strncmp:

View File

@ -747,7 +747,7 @@ bool FormatSpecifier::hasValidLengthModifier(const TargetInfo &Target,
break;
}
}
LLVM_FALLTHROUGH;
[[fallthrough]];
case LengthModifier::AsChar:
case LengthModifier::AsLongLong:
case LengthModifier::AsQuad:

View File

@ -1659,7 +1659,7 @@ void CXXNameMangler::mangleUnqualifiedName(
if (!MD->isStatic())
Arity++;
}
LLVM_FALLTHROUGH;
[[fallthrough]];
case DeclarationName::CXXConversionFunctionName:
case DeclarationName::CXXLiteralOperatorName:
mangleOperatorName(Name, Arity);
@ -4671,7 +4671,7 @@ recurse:
Out << 'E';
break;
}
LLVM_FALLTHROUGH;
[[fallthrough]];
case UETT_AlignOf:
Out << 'a';
MangleAlignofSizeofArg();

View File

@ -280,7 +280,7 @@ void NestedNameSpecifier::print(raw_ostream &OS, const PrintingPolicy &Policy,
case TypeSpecWithTemplate:
OS << "template ";
// Fall through to print the type.
LLVM_FALLTHROUGH;
[[fallthrough]];
case TypeSpec: {
const auto *Record =

View File

@ -500,7 +500,7 @@ ArgType PrintfSpecifier::getScalarArgType(ASTContext &Ctx,
case LengthModifier::AsShort:
if (Ctx.getTargetInfo().getTriple().isOSMSVCRT())
return Ctx.IntTy;
LLVM_FALLTHROUGH;
[[fallthrough]];
default:
return ArgType::Invalid();
}

View File

@ -345,7 +345,7 @@ ArgType ScanfSpecifier::getArgType(ASTContext &Ctx) const {
case LengthModifier::AsShort:
if (Ctx.getTargetInfo().getTriple().isOSMSVCRT())
return ArgType::PtrTo(ArgType::AnyCharTy);
LLVM_FALLTHROUGH;
[[fallthrough]];
default:
return ArgType::Invalid();
}
@ -362,7 +362,7 @@ ArgType ScanfSpecifier::getArgType(ASTContext &Ctx) const {
case LengthModifier::AsShort:
if (Ctx.getTargetInfo().getTriple().isOSMSVCRT())
return ArgType::PtrTo(ArgType::AnyCharTy);
LLVM_FALLTHROUGH;
[[fallthrough]];
default:
return ArgType::Invalid();
}

View File

@ -208,7 +208,7 @@ SourceLocation TypeLoc::getBeginLoc() const {
LeftMost = Cur;
break;
}
LLVM_FALLTHROUGH;
[[fallthrough]];
case FunctionNoProto:
case ConstantArray:
case DependentSizedArray:
@ -260,7 +260,7 @@ SourceLocation TypeLoc::getEndLoc() const {
// `id` and `id<...>` have no star location.
if (Cur.castAs<ObjCObjectPointerTypeLoc>().getStarLoc().isInvalid())
break;
LLVM_FALLTHROUGH;
[[fallthrough]];
case Pointer:
case BlockPointer:
case MemberPointer:

View File

@ -262,7 +262,7 @@ bool TypePrinter::canPrefixQualifiers(const Type *T,
case Type::VariableArray:
case Type::DependentSizedArray:
NeedARCStrongQualifier = true;
LLVM_FALLTHROUGH;
[[fallthrough]];
case Type::ConstantArray:
case Type::IncompleteArray:

View File

@ -319,7 +319,7 @@ public:
// We care about logical not only if we care about comparisons.
if (!ShouldRetrieveFromComparisons)
return nullptr;
LLVM_FALLTHROUGH;
[[fallthrough]];
// Function pointer/references can be dereferenced before a call.
// That doesn't make it, however, any different from a regular call.
// For this reason, dereference operation is a "no-op".

View File

@ -218,7 +218,7 @@ static bool isConfigurationValue(const Stmt *S,
return isConfigurationValue(cast<DeclRefExpr>(S)->getDecl(), PP);
case Stmt::ObjCBoolLiteralExprClass:
IgnoreYES_NO = true;
LLVM_FALLTHROUGH;
[[fallthrough]];
case Stmt::CXXBoolLiteralExprClass:
case Stmt::IntegerLiteralClass: {
const Expr *E = cast<Expr>(S);

View File

@ -2013,7 +2013,7 @@ void BuildLockset::VisitCallExpr(const CallExpr *Exp) {
case OO_LessLessEqual:
case OO_GreaterGreaterEqual:
checkAccess(OE->getArg(1), AK_Read);
LLVM_FALLTHROUGH;
[[fallthrough]];
case OO_PlusPlus:
case OO_MinusMinus:
checkAccess(OE->getArg(0), AK_Written);
@ -2026,7 +2026,7 @@ void BuildLockset::VisitCallExpr(const CallExpr *Exp) {
// Grrr. operator* can be multiplication...
checkPtAccess(OE->getArg(0), AK_Read);
}
LLVM_FALLTHROUGH;
[[fallthrough]];
default: {
// TODO: get rid of this, and rely on pass-by-ref instead.
const Expr *Obj = OE->getArg(0);

View File

@ -54,7 +54,7 @@ class TargetFeatures {
case ')':
--InParentheses;
assert(InParentheses >= 0 && "Parentheses are not in pair");
LLVM_FALLTHROUGH;
[[fallthrough]];
case '|':
case ',':
if (InParentheses == 0) {

View File

@ -208,11 +208,11 @@ const char *TargetInfo::getTypeConstantSuffix(IntType T) const {
case UnsignedChar:
if (getCharWidth() < getIntWidth())
return "";
LLVM_FALLTHROUGH;
[[fallthrough]];
case UnsignedShort:
if (getShortWidth() < getIntWidth())
return "";
LLVM_FALLTHROUGH;
[[fallthrough]];
case UnsignedInt: return "U";
case UnsignedLong: return "UL";
case UnsignedLongLong: return "ULL";

View File

@ -234,7 +234,7 @@ bool AMDGPUTargetInfo::initFeatureMap(
Features["dot5-insts"] = true;
Features["dot6-insts"] = true;
Features["dot7-insts"] = true;
LLVM_FALLTHROUGH;
[[fallthrough]];
case GK_GFX1013:
case GK_GFX1010:
Features["dl-insts"] = true;
@ -251,30 +251,30 @@ bool AMDGPUTargetInfo::initFeatureMap(
case GK_GFX940:
Features["gfx940-insts"] = true;
Features["fp8-insts"] = true;
LLVM_FALLTHROUGH;
[[fallthrough]];
case GK_GFX90A:
Features["gfx90a-insts"] = true;
LLVM_FALLTHROUGH;
[[fallthrough]];
case GK_GFX908:
Features["dot3-insts"] = true;
Features["dot4-insts"] = true;
Features["dot5-insts"] = true;
Features["dot6-insts"] = true;
Features["mai-insts"] = true;
LLVM_FALLTHROUGH;
[[fallthrough]];
case GK_GFX906:
Features["dl-insts"] = true;
Features["dot1-insts"] = true;
Features["dot2-insts"] = true;
Features["dot7-insts"] = true;
LLVM_FALLTHROUGH;
[[fallthrough]];
case GK_GFX90C:
case GK_GFX909:
case GK_GFX904:
case GK_GFX902:
case GK_GFX900:
Features["gfx9-insts"] = true;
LLVM_FALLTHROUGH;
[[fallthrough]];
case GK_GFX810:
case GK_GFX805:
case GK_GFX803:
@ -284,7 +284,7 @@ bool AMDGPUTargetInfo::initFeatureMap(
Features["16-bit-insts"] = true;
Features["dpp"] = true;
Features["s-memrealtime"] = true;
LLVM_FALLTHROUGH;
[[fallthrough]];
case GK_GFX705:
case GK_GFX704:
case GK_GFX703:
@ -293,7 +293,7 @@ bool AMDGPUTargetInfo::initFeatureMap(
case GK_GFX700:
Features["ci-insts"] = true;
Features["flat-address-space"] = true;
LLVM_FALLTHROUGH;
[[fallthrough]];
case GK_GFX602:
case GK_GFX601:
case GK_GFX600:

View File

@ -477,7 +477,7 @@ public:
case llvm::Triple::x86:
case llvm::Triple::x86_64:
this->HasFloat128 = true;
LLVM_FALLTHROUGH;
[[fallthrough]];
default:
this->MCountName = "__mcount";
break;

View File

@ -216,7 +216,7 @@ public:
// Don't use floating point registers on soft float ABI.
if (FloatABI == SoftFloat)
return false;
LLVM_FALLTHROUGH;
[[fallthrough]];
case 'b': // Base register
Info.setAllowsRegister();
break;
@ -295,7 +295,7 @@ public:
case 'Q': // Memory operand that is an offset from a register (it is
// usually better to use `m' or `es' in asm statements)
Info.setAllowsRegister();
LLVM_FALLTHROUGH;
[[fallthrough]];
case 'Z': // Memory operand that is an indexed or indirect from a
// register (it is usually better to use `m' or `es' in
// asm statements)

View File

@ -69,7 +69,7 @@ bool SystemZTargetInfo::validateAsmConstraint(
case 'T': // Likewise, plus an index
break;
}
LLVM_FALLTHROUGH;
[[fallthrough]];
case 'a': // Address register
case 'd': // Data register (equivalent to 'r')
case 'f': // Floating-point register

View File

@ -104,10 +104,10 @@ void WebAssemblyTargetInfo::setSIMDLevel(llvm::StringMap<bool> &Features,
switch (Level) {
case RelaxedSIMD:
Features["relaxed-simd"] = true;
LLVM_FALLTHROUGH;
[[fallthrough]];
case SIMD128:
Features["simd128"] = true;
LLVM_FALLTHROUGH;
[[fallthrough]];
case NoSIMD:
break;
}
@ -118,7 +118,7 @@ void WebAssemblyTargetInfo::setSIMDLevel(llvm::StringMap<bool> &Features,
case NoSIMD:
case SIMD128:
Features["simd128"] = false;
LLVM_FALLTHROUGH;
[[fallthrough]];
case RelaxedSIMD:
Features["relaxed-simd"] = false;
break;

View File

@ -444,7 +444,7 @@ void X86TargetInfo::getTargetDefines(const LangOptions &Opts,
case CK_PentiumMMX:
Builder.defineMacro("__pentium_mmx__");
Builder.defineMacro("__tune_pentium_mmx__");
LLVM_FALLTHROUGH;
[[fallthrough]];
case CK_i586:
case CK_Pentium:
defineCPUMacros(Builder, "i586");
@ -453,11 +453,11 @@ void X86TargetInfo::getTargetDefines(const LangOptions &Opts,
case CK_Pentium3:
case CK_PentiumM:
Builder.defineMacro("__tune_pentium3__");
LLVM_FALLTHROUGH;
[[fallthrough]];
case CK_Pentium2:
case CK_C3_2:
Builder.defineMacro("__tune_pentium2__");
LLVM_FALLTHROUGH;
[[fallthrough]];
case CK_PentiumPro:
case CK_i686:
defineCPUMacros(Builder, "i686");
@ -525,7 +525,7 @@ void X86TargetInfo::getTargetDefines(const LangOptions &Opts,
case CK_K6_2:
Builder.defineMacro("__k6_2__");
Builder.defineMacro("__tune_k6_2__");
LLVM_FALLTHROUGH;
[[fallthrough]];
case CK_K6_3:
if (CPU != CK_K6_2) { // In case of fallthrough
// FIXME: GCC may be enabling these in cases where some other k6
@ -534,7 +534,7 @@ void X86TargetInfo::getTargetDefines(const LangOptions &Opts,
Builder.defineMacro("__k6_3__");
Builder.defineMacro("__tune_k6_3__");
}
LLVM_FALLTHROUGH;
[[fallthrough]];
case CK_K6:
defineCPUMacros(Builder, "k6");
break;
@ -660,13 +660,13 @@ void X86TargetInfo::getTargetDefines(const LangOptions &Opts,
switch (XOPLevel) {
case XOP:
Builder.defineMacro("__XOP__");
LLVM_FALLTHROUGH;
[[fallthrough]];
case FMA4:
Builder.defineMacro("__FMA4__");
LLVM_FALLTHROUGH;
[[fallthrough]];
case SSE4A:
Builder.defineMacro("__SSE4A__");
LLVM_FALLTHROUGH;
[[fallthrough]];
case NoXOP:
break;
}
@ -786,33 +786,33 @@ void X86TargetInfo::getTargetDefines(const LangOptions &Opts,
switch (SSELevel) {
case AVX512F:
Builder.defineMacro("__AVX512F__");
LLVM_FALLTHROUGH;
[[fallthrough]];
case AVX2:
Builder.defineMacro("__AVX2__");
LLVM_FALLTHROUGH;
[[fallthrough]];
case AVX:
Builder.defineMacro("__AVX__");
LLVM_FALLTHROUGH;
[[fallthrough]];
case SSE42:
Builder.defineMacro("__SSE4_2__");
LLVM_FALLTHROUGH;
[[fallthrough]];
case SSE41:
Builder.defineMacro("__SSE4_1__");
LLVM_FALLTHROUGH;
[[fallthrough]];
case SSSE3:
Builder.defineMacro("__SSSE3__");
LLVM_FALLTHROUGH;
[[fallthrough]];
case SSE3:
Builder.defineMacro("__SSE3__");
LLVM_FALLTHROUGH;
[[fallthrough]];
case SSE2:
Builder.defineMacro("__SSE2__");
Builder.defineMacro("__SSE2_MATH__"); // -mfp-math=sse always implied.
LLVM_FALLTHROUGH;
[[fallthrough]];
case SSE1:
Builder.defineMacro("__SSE__");
Builder.defineMacro("__SSE_MATH__"); // -mfp-math=sse always implied.
LLVM_FALLTHROUGH;
[[fallthrough]];
case NoSSE:
break;
}
@ -842,13 +842,13 @@ void X86TargetInfo::getTargetDefines(const LangOptions &Opts,
switch (MMX3DNowLevel) {
case AMD3DNowAthlon:
Builder.defineMacro("__3dNOW_A__");
LLVM_FALLTHROUGH;
[[fallthrough]];
case AMD3DNow:
Builder.defineMacro("__3dNOW__");
LLVM_FALLTHROUGH;
[[fallthrough]];
case MMX:
Builder.defineMacro("__MMX__");
LLVM_FALLTHROUGH;
[[fallthrough]];
case NoMMX3DNow:
break;
}
@ -1521,7 +1521,7 @@ std::string X86TargetInfo::convertConstraint(const char *&Constraint) const {
// to the next constraint.
return std::string("^") + std::string(Constraint++, 2);
}
LLVM_FALLTHROUGH;
[[fallthrough]];
default:
return std::string(1, *Constraint);
}

View File

@ -609,7 +609,7 @@ static void EmitAtomicOp(CodeGenFunction &CGF, AtomicExpr *E, Address Dest,
case AtomicExpr::AO__atomic_add_fetch:
PostOp = E->getValueType()->isFloatingType() ? llvm::Instruction::FAdd
: llvm::Instruction::Add;
LLVM_FALLTHROUGH;
[[fallthrough]];
case AtomicExpr::AO__c11_atomic_fetch_add:
case AtomicExpr::AO__hip_atomic_fetch_add:
case AtomicExpr::AO__opencl_atomic_fetch_add:
@ -621,7 +621,7 @@ static void EmitAtomicOp(CodeGenFunction &CGF, AtomicExpr *E, Address Dest,
case AtomicExpr::AO__atomic_sub_fetch:
PostOp = E->getValueType()->isFloatingType() ? llvm::Instruction::FSub
: llvm::Instruction::Sub;
LLVM_FALLTHROUGH;
[[fallthrough]];
case AtomicExpr::AO__c11_atomic_fetch_sub:
case AtomicExpr::AO__opencl_atomic_fetch_sub:
case AtomicExpr::AO__atomic_fetch_sub:
@ -631,7 +631,7 @@ static void EmitAtomicOp(CodeGenFunction &CGF, AtomicExpr *E, Address Dest,
case AtomicExpr::AO__atomic_min_fetch:
PostOpMinMax = true;
LLVM_FALLTHROUGH;
[[fallthrough]];
case AtomicExpr::AO__c11_atomic_fetch_min:
case AtomicExpr::AO__hip_atomic_fetch_min:
case AtomicExpr::AO__opencl_atomic_fetch_min:
@ -642,7 +642,7 @@ static void EmitAtomicOp(CodeGenFunction &CGF, AtomicExpr *E, Address Dest,
case AtomicExpr::AO__atomic_max_fetch:
PostOpMinMax = true;
LLVM_FALLTHROUGH;
[[fallthrough]];
case AtomicExpr::AO__c11_atomic_fetch_max:
case AtomicExpr::AO__hip_atomic_fetch_max:
case AtomicExpr::AO__opencl_atomic_fetch_max:
@ -653,7 +653,7 @@ static void EmitAtomicOp(CodeGenFunction &CGF, AtomicExpr *E, Address Dest,
case AtomicExpr::AO__atomic_and_fetch:
PostOp = llvm::Instruction::And;
LLVM_FALLTHROUGH;
[[fallthrough]];
case AtomicExpr::AO__c11_atomic_fetch_and:
case AtomicExpr::AO__hip_atomic_fetch_and:
case AtomicExpr::AO__opencl_atomic_fetch_and:
@ -663,7 +663,7 @@ static void EmitAtomicOp(CodeGenFunction &CGF, AtomicExpr *E, Address Dest,
case AtomicExpr::AO__atomic_or_fetch:
PostOp = llvm::Instruction::Or;
LLVM_FALLTHROUGH;
[[fallthrough]];
case AtomicExpr::AO__c11_atomic_fetch_or:
case AtomicExpr::AO__hip_atomic_fetch_or:
case AtomicExpr::AO__opencl_atomic_fetch_or:
@ -673,7 +673,7 @@ static void EmitAtomicOp(CodeGenFunction &CGF, AtomicExpr *E, Address Dest,
case AtomicExpr::AO__atomic_xor_fetch:
PostOp = llvm::Instruction::Xor;
LLVM_FALLTHROUGH;
[[fallthrough]];
case AtomicExpr::AO__c11_atomic_fetch_xor:
case AtomicExpr::AO__hip_atomic_fetch_xor:
case AtomicExpr::AO__opencl_atomic_fetch_xor:
@ -683,7 +683,7 @@ static void EmitAtomicOp(CodeGenFunction &CGF, AtomicExpr *E, Address Dest,
case AtomicExpr::AO__atomic_nand_fetch:
PostOp = llvm::Instruction::And; // the NOT is special cased below
LLVM_FALLTHROUGH;
[[fallthrough]];
case AtomicExpr::AO__c11_atomic_fetch_nand:
case AtomicExpr::AO__atomic_fetch_nand:
Op = llvm::AtomicRMWInst::Nand;
@ -914,13 +914,13 @@ RValue CodeGenFunction::EmitAtomicExpr(AtomicExpr *E) {
EmitStoreOfScalar(Val1Scalar, MakeAddrLValue(Temp, Val1Ty));
break;
}
LLVM_FALLTHROUGH;
[[fallthrough]];
case AtomicExpr::AO__atomic_fetch_add:
case AtomicExpr::AO__atomic_fetch_sub:
case AtomicExpr::AO__atomic_add_fetch:
case AtomicExpr::AO__atomic_sub_fetch:
ShouldCastToIntPtrTy = !MemTy->isFloatingType();
LLVM_FALLTHROUGH;
[[fallthrough]];
case AtomicExpr::AO__c11_atomic_store:
case AtomicExpr::AO__c11_atomic_exchange:
@ -1045,7 +1045,7 @@ RValue CodeGenFunction::EmitAtomicExpr(AtomicExpr *E) {
// suitably aligned for the optimized version.
if (Misaligned)
break;
LLVM_FALLTHROUGH;
[[fallthrough]];
case AtomicExpr::AO__c11_atomic_load:
case AtomicExpr::AO__c11_atomic_store:
case AtomicExpr::AO__c11_atomic_exchange:
@ -1176,7 +1176,7 @@ RValue CodeGenFunction::EmitAtomicExpr(AtomicExpr *E) {
// T __atomic_fetch_add_N(T *mem, T val, int order)
case AtomicExpr::AO__atomic_add_fetch:
PostOp = llvm::Instruction::Add;
LLVM_FALLTHROUGH;
[[fallthrough]];
case AtomicExpr::AO__c11_atomic_fetch_add:
case AtomicExpr::AO__opencl_atomic_fetch_add:
case AtomicExpr::AO__atomic_fetch_add:
@ -1189,7 +1189,7 @@ RValue CodeGenFunction::EmitAtomicExpr(AtomicExpr *E) {
// T __atomic_fetch_and_N(T *mem, T val, int order)
case AtomicExpr::AO__atomic_and_fetch:
PostOp = llvm::Instruction::And;
LLVM_FALLTHROUGH;
[[fallthrough]];
case AtomicExpr::AO__c11_atomic_fetch_and:
case AtomicExpr::AO__opencl_atomic_fetch_and:
case AtomicExpr::AO__hip_atomic_fetch_and:
@ -1202,7 +1202,7 @@ RValue CodeGenFunction::EmitAtomicExpr(AtomicExpr *E) {
// T __atomic_fetch_or_N(T *mem, T val, int order)
case AtomicExpr::AO__atomic_or_fetch:
PostOp = llvm::Instruction::Or;
LLVM_FALLTHROUGH;
[[fallthrough]];
case AtomicExpr::AO__c11_atomic_fetch_or:
case AtomicExpr::AO__opencl_atomic_fetch_or:
case AtomicExpr::AO__hip_atomic_fetch_or:
@ -1215,7 +1215,7 @@ RValue CodeGenFunction::EmitAtomicExpr(AtomicExpr *E) {
// T __atomic_fetch_sub_N(T *mem, T val, int order)
case AtomicExpr::AO__atomic_sub_fetch:
PostOp = llvm::Instruction::Sub;
LLVM_FALLTHROUGH;
[[fallthrough]];
case AtomicExpr::AO__c11_atomic_fetch_sub:
case AtomicExpr::AO__opencl_atomic_fetch_sub:
case AtomicExpr::AO__atomic_fetch_sub:
@ -1227,7 +1227,7 @@ RValue CodeGenFunction::EmitAtomicExpr(AtomicExpr *E) {
// T __atomic_fetch_xor_N(T *mem, T val, int order)
case AtomicExpr::AO__atomic_xor_fetch:
PostOp = llvm::Instruction::Xor;
LLVM_FALLTHROUGH;
[[fallthrough]];
case AtomicExpr::AO__c11_atomic_fetch_xor:
case AtomicExpr::AO__opencl_atomic_fetch_xor:
case AtomicExpr::AO__hip_atomic_fetch_xor:
@ -1238,7 +1238,7 @@ RValue CodeGenFunction::EmitAtomicExpr(AtomicExpr *E) {
break;
case AtomicExpr::AO__atomic_min_fetch:
PostOpMinMax = true;
LLVM_FALLTHROUGH;
[[fallthrough]];
case AtomicExpr::AO__c11_atomic_fetch_min:
case AtomicExpr::AO__atomic_fetch_min:
case AtomicExpr::AO__hip_atomic_fetch_min:
@ -1251,7 +1251,7 @@ RValue CodeGenFunction::EmitAtomicExpr(AtomicExpr *E) {
break;
case AtomicExpr::AO__atomic_max_fetch:
PostOpMinMax = true;
LLVM_FALLTHROUGH;
[[fallthrough]];
case AtomicExpr::AO__c11_atomic_fetch_max:
case AtomicExpr::AO__atomic_fetch_max:
case AtomicExpr::AO__hip_atomic_fetch_max:
@ -1266,7 +1266,7 @@ RValue CodeGenFunction::EmitAtomicExpr(AtomicExpr *E) {
// T __atomic_fetch_nand_N(T *mem, T val, int order)
case AtomicExpr::AO__atomic_nand_fetch:
PostOp = llvm::Instruction::And; // the NOT is special cased below
LLVM_FALLTHROUGH;
[[fallthrough]];
case AtomicExpr::AO__c11_atomic_fetch_nand:
case AtomicExpr::AO__atomic_fetch_nand:
LibCallName = "__atomic_fetch_nand";

View File

@ -5034,7 +5034,7 @@ RValue CodeGenFunction::EmitBuiltinExpr(const GlobalDecl GD, unsigned BuiltinID,
EmitLifetimeEnd(TmpSize, TmpPtr);
return Call;
}
LLVM_FALLTHROUGH;
[[fallthrough]];
}
// OpenCL v2.0 s6.13.17.6 - Kernel query functions need bitcast of block
// parameter.
@ -6634,7 +6634,7 @@ Value *CodeGenFunction::EmitCommonNeonBuiltinExpr(
case NEON::BI__builtin_neon_vcalt_v:
case NEON::BI__builtin_neon_vcaltq_v:
std::swap(Ops[0], Ops[1]);
LLVM_FALLTHROUGH;
[[fallthrough]];
case NEON::BI__builtin_neon_vcage_v:
case NEON::BI__builtin_neon_vcageq_v:
case NEON::BI__builtin_neon_vcagt_v:
@ -8037,7 +8037,7 @@ Value *CodeGenFunction::EmitARMBuiltinExpr(unsigned BuiltinID,
int Indices[] = {1 - Lane, Lane};
return Builder.CreateShuffleVector(Ops[1], Ld, Indices, "vld1q_lane");
}
LLVM_FALLTHROUGH;
[[fallthrough]];
case NEON::BI__builtin_neon_vld1_lane_v: {
Ops[1] = Builder.CreateBitCast(Ops[1], Ty);
PtrOp0 = Builder.CreateElementBitCast(PtrOp0, VTy->getElementType());
@ -8077,7 +8077,7 @@ Value *CodeGenFunction::EmitARMBuiltinExpr(unsigned BuiltinID,
case NEON::BI__builtin_neon_vsri_n_v:
case NEON::BI__builtin_neon_vsriq_n_v:
rightShift = true;
LLVM_FALLTHROUGH;
[[fallthrough]];
case NEON::BI__builtin_neon_vsli_n_v:
case NEON::BI__builtin_neon_vsliq_n_v:
Ops[2] = EmitNeonShiftVector(Ops[2], Ty, rightShift);
@ -8100,7 +8100,7 @@ Value *CodeGenFunction::EmitARMBuiltinExpr(unsigned BuiltinID,
return Builder.CreateCall(CGM.getIntrinsic(Intrinsic::arm_neon_vst1,
Tys), Ops);
}
LLVM_FALLTHROUGH;
[[fallthrough]];
case NEON::BI__builtin_neon_vst1_lane_v: {
Ops[1] = Builder.CreateBitCast(Ops[1], Ty);
Ops[1] = Builder.CreateExtractElement(Ops[1], Ops[2]);
@ -10119,7 +10119,7 @@ Value *CodeGenFunction::EmitAArch64BuiltinExpr(unsigned BuiltinID,
case NEON::BI__builtin_neon_vcvts_f32_u32:
case NEON::BI__builtin_neon_vcvtd_f64_u64:
usgn = true;
LLVM_FALLTHROUGH;
[[fallthrough]];
case NEON::BI__builtin_neon_vcvts_f32_s32:
case NEON::BI__builtin_neon_vcvtd_f64_s64: {
Ops.push_back(EmitScalarExpr(E->getArg(0)));
@ -10135,7 +10135,7 @@ Value *CodeGenFunction::EmitAArch64BuiltinExpr(unsigned BuiltinID,
case NEON::BI__builtin_neon_vcvth_f16_u32:
case NEON::BI__builtin_neon_vcvth_f16_u64:
usgn = true;
LLVM_FALLTHROUGH;
[[fallthrough]];
case NEON::BI__builtin_neon_vcvth_f16_s16:
case NEON::BI__builtin_neon_vcvth_f16_s32:
case NEON::BI__builtin_neon_vcvth_f16_s64: {
@ -11268,7 +11268,7 @@ Value *CodeGenFunction::EmitAArch64BuiltinExpr(unsigned BuiltinID,
case NEON::BI__builtin_neon_vaddv_u8:
// FIXME: These are handled by the AArch64 scalar code.
usgn = true;
LLVM_FALLTHROUGH;
[[fallthrough]];
case NEON::BI__builtin_neon_vaddv_s8: {
Int = usgn ? Intrinsic::aarch64_neon_uaddv : Intrinsic::aarch64_neon_saddv;
Ty = Int32Ty;
@ -11280,7 +11280,7 @@ Value *CodeGenFunction::EmitAArch64BuiltinExpr(unsigned BuiltinID,
}
case NEON::BI__builtin_neon_vaddv_u16:
usgn = true;
LLVM_FALLTHROUGH;
[[fallthrough]];
case NEON::BI__builtin_neon_vaddv_s16: {
Int = usgn ? Intrinsic::aarch64_neon_uaddv : Intrinsic::aarch64_neon_saddv;
Ty = Int32Ty;
@ -11292,7 +11292,7 @@ Value *CodeGenFunction::EmitAArch64BuiltinExpr(unsigned BuiltinID,
}
case NEON::BI__builtin_neon_vaddvq_u8:
usgn = true;
LLVM_FALLTHROUGH;
[[fallthrough]];
case NEON::BI__builtin_neon_vaddvq_s8: {
Int = usgn ? Intrinsic::aarch64_neon_uaddv : Intrinsic::aarch64_neon_saddv;
Ty = Int32Ty;
@ -11304,7 +11304,7 @@ Value *CodeGenFunction::EmitAArch64BuiltinExpr(unsigned BuiltinID,
}
case NEON::BI__builtin_neon_vaddvq_u16:
usgn = true;
LLVM_FALLTHROUGH;
[[fallthrough]];
case NEON::BI__builtin_neon_vaddvq_s16: {
Int = usgn ? Intrinsic::aarch64_neon_uaddv : Intrinsic::aarch64_neon_saddv;
Ty = Int32Ty;
@ -12347,7 +12347,7 @@ static Value *EmitX86FMAExpr(CodeGenFunction &CGF, const CallExpr *E,
default: break;
case clang::X86::BI__builtin_ia32_vfmsubph512_mask3:
Subtract = true;
LLVM_FALLTHROUGH;
[[fallthrough]];
case clang::X86::BI__builtin_ia32_vfmaddph512_mask:
case clang::X86::BI__builtin_ia32_vfmaddph512_maskz:
case clang::X86::BI__builtin_ia32_vfmaddph512_mask3:
@ -12355,7 +12355,7 @@ static Value *EmitX86FMAExpr(CodeGenFunction &CGF, const CallExpr *E,
break;
case clang::X86::BI__builtin_ia32_vfmsubaddph512_mask3:
Subtract = true;
LLVM_FALLTHROUGH;
[[fallthrough]];
case clang::X86::BI__builtin_ia32_vfmaddsubph512_mask:
case clang::X86::BI__builtin_ia32_vfmaddsubph512_maskz:
case clang::X86::BI__builtin_ia32_vfmaddsubph512_mask3:
@ -12363,21 +12363,21 @@ static Value *EmitX86FMAExpr(CodeGenFunction &CGF, const CallExpr *E,
break;
case clang::X86::BI__builtin_ia32_vfmsubps512_mask3:
Subtract = true;
LLVM_FALLTHROUGH;
[[fallthrough]];
case clang::X86::BI__builtin_ia32_vfmaddps512_mask:
case clang::X86::BI__builtin_ia32_vfmaddps512_maskz:
case clang::X86::BI__builtin_ia32_vfmaddps512_mask3:
IID = llvm::Intrinsic::x86_avx512_vfmadd_ps_512; break;
case clang::X86::BI__builtin_ia32_vfmsubpd512_mask3:
Subtract = true;
LLVM_FALLTHROUGH;
[[fallthrough]];
case clang::X86::BI__builtin_ia32_vfmaddpd512_mask:
case clang::X86::BI__builtin_ia32_vfmaddpd512_maskz:
case clang::X86::BI__builtin_ia32_vfmaddpd512_mask3:
IID = llvm::Intrinsic::x86_avx512_vfmadd_pd_512; break;
case clang::X86::BI__builtin_ia32_vfmsubaddps512_mask3:
Subtract = true;
LLVM_FALLTHROUGH;
[[fallthrough]];
case clang::X86::BI__builtin_ia32_vfmaddsubps512_mask:
case clang::X86::BI__builtin_ia32_vfmaddsubps512_maskz:
case clang::X86::BI__builtin_ia32_vfmaddsubps512_mask3:
@ -12385,7 +12385,7 @@ static Value *EmitX86FMAExpr(CodeGenFunction &CGF, const CallExpr *E,
break;
case clang::X86::BI__builtin_ia32_vfmsubaddpd512_mask3:
Subtract = true;
LLVM_FALLTHROUGH;
[[fallthrough]];
case clang::X86::BI__builtin_ia32_vfmaddsubpd512_mask:
case clang::X86::BI__builtin_ia32_vfmaddsubpd512_maskz:
case clang::X86::BI__builtin_ia32_vfmaddsubpd512_mask3:
@ -14725,7 +14725,7 @@ Value *CodeGenFunction::EmitX86BuiltinExpr(unsigned BuiltinID,
case X86::BI__builtin_ia32_cmppd256_mask:
case X86::BI__builtin_ia32_cmppd512_mask:
IsMaskFCmp = true;
LLVM_FALLTHROUGH;
[[fallthrough]];
case X86::BI__builtin_ia32_cmpps:
case X86::BI__builtin_ia32_cmpps256:
case X86::BI__builtin_ia32_cmppd:
@ -15214,7 +15214,7 @@ Value *CodeGenFunction::EmitX86BuiltinExpr(unsigned BuiltinID,
}
case X86::BI__builtin_ia32_vfcmaddcph512_mask:
IsConjFMA = true;
LLVM_FALLTHROUGH;
[[fallthrough]];
case X86::BI__builtin_ia32_vfmaddcph512_mask: {
Intrinsic::ID IID = IsConjFMA
? Intrinsic::x86_avx512fp16_mask_vfcmadd_cph_512
@ -15224,7 +15224,7 @@ Value *CodeGenFunction::EmitX86BuiltinExpr(unsigned BuiltinID,
}
case X86::BI__builtin_ia32_vfcmaddcsh_round_mask:
IsConjFMA = true;
LLVM_FALLTHROUGH;
[[fallthrough]];
case X86::BI__builtin_ia32_vfmaddcsh_round_mask: {
Intrinsic::ID IID = IsConjFMA ? Intrinsic::x86_avx512fp16_mask_vfcmadd_csh
: Intrinsic::x86_avx512fp16_mask_vfmadd_csh;
@ -15234,7 +15234,7 @@ Value *CodeGenFunction::EmitX86BuiltinExpr(unsigned BuiltinID,
}
case X86::BI__builtin_ia32_vfcmaddcsh_round_mask3:
IsConjFMA = true;
LLVM_FALLTHROUGH;
[[fallthrough]];
case X86::BI__builtin_ia32_vfmaddcsh_round_mask3: {
Intrinsic::ID IID = IsConjFMA ? Intrinsic::x86_avx512fp16_mask_vfcmadd_csh
: Intrinsic::x86_avx512fp16_mask_vfmadd_csh;

View File

@ -2340,7 +2340,7 @@ void CodeGenModule::ConstructAttributeList(StringRef Name,
RetAttrs.addAttribute(llvm::Attribute::SExt);
else
RetAttrs.addAttribute(llvm::Attribute::ZExt);
LLVM_FALLTHROUGH;
[[fallthrough]];
case ABIArgInfo::Direct:
if (RetAI.getInReg())
RetAttrs.addAttribute(llvm::Attribute::InReg);
@ -2476,7 +2476,7 @@ void CodeGenModule::ConstructAttributeList(StringRef Name,
Attrs.addAttribute(llvm::Attribute::SExt);
else
Attrs.addAttribute(llvm::Attribute::ZExt);
LLVM_FALLTHROUGH;
[[fallthrough]];
case ABIArgInfo::Direct:
if (ArgNo == 0 && FI.isChainCall())
Attrs.addAttribute(llvm::Attribute::Nest);
@ -5550,7 +5550,7 @@ RValue CodeGenFunction::EmitCall(const CGFunctionInfo &CallInfo,
Builder.CreateStore(elt, eltAddr);
}
// FALLTHROUGH
LLVM_FALLTHROUGH;
[[fallthrough]];
}
case ABIArgInfo::InAlloca:

View File

@ -1505,7 +1505,7 @@ void CodeGenFunction::EmitDestructorBody(FunctionArgList &Args) {
}
// Fallthrough: act like we're in the base variant.
LLVM_FALLTHROUGH;
[[fallthrough]];
case Dtor_Base:
assert(Body);

View File

@ -689,7 +689,7 @@ RValue CodeGenFunction::EmitCoroutineIntrinsic(const CallExpr *E,
CGM.Error(E->getBeginLoc(), "this builtin expect that __builtin_coro_id has"
" been used earlier in this function");
// Fallthrough to the next case to add TokenNone as the first argument.
LLVM_FALLTHROUGH;
[[fallthrough]];
}
// @llvm.coro.suspend takes a token parameter. Add token 'none' as the first
// argument.

View File

@ -3613,7 +3613,7 @@ llvm::DICompositeType *CGDebugInfo::CreateLimitedType(const RecordType *Ty) {
// them distinct if they are ODR-uniqued.
if (Identifier.empty())
break;
LLVM_FALLTHROUGH;
[[fallthrough]];
case llvm::dwarf::DW_TAG_structure_type:
case llvm::dwarf::DW_TAG_union_type:

View File

@ -839,7 +839,7 @@ void CodeGenFunction::EmitScalarInit(const Expr *init, const ValueDecl *D,
// If D is pseudo-strong, treat it like __unsafe_unretained here. This means
// that we omit the retain, and causes non-autoreleased return values to be
// immediately released.
LLVM_FALLTHROUGH;
[[fallthrough]];
}
case Qualifiers::OCL_ExplicitNone:

View File

@ -158,7 +158,7 @@ static const EHPersonality &getObjCPersonality(const TargetInfo &Target,
case ObjCRuntime::GNUstep:
if (L.ObjCRuntime.getVersion() >= VersionTuple(1, 7))
return EHPersonality::GNUstep_ObjC;
LLVM_FALLTHROUGH;
[[fallthrough]];
case ObjCRuntime::GCC:
case ObjCRuntime::ObjFW:
if (L.hasSjLjExceptions())

View File

@ -850,7 +850,7 @@ void AggExprEmitter::VisitCastExpr(CastExpr *E) {
return;
}
LLVM_FALLTHROUGH;
[[fallthrough]];
case CK_NoOp:

View File

@ -646,7 +646,7 @@ CodeGenFunction::EmitCXXConstructExpr(const CXXConstructExpr *E,
case CXXConstructExpr::CK_VirtualBase:
ForVirtualBase = true;
LLVM_FALLTHROUGH;
[[fallthrough]];
case CXXConstructExpr::CK_NonVirtualBase:
Type = Ctor_Base;

View File

@ -718,7 +718,7 @@ public:
case LangOptions::SOB_Undefined:
if (!CGF.SanOpts.has(SanitizerKind::SignedIntegerOverflow))
return Builder.CreateNSWMul(Ops.LHS, Ops.RHS, "mul");
LLVM_FALLTHROUGH;
[[fallthrough]];
case LangOptions::SOB_Trapping:
if (CanElideOverflowCheck(CGF.getContext(), Ops))
return Builder.CreateNSWMul(Ops.LHS, Ops.RHS, "mul");
@ -2478,7 +2478,7 @@ llvm::Value *ScalarExprEmitter::EmitIncDecConsiderOverflowBehavior(
case LangOptions::SOB_Undefined:
if (!CGF.SanOpts.has(SanitizerKind::SignedIntegerOverflow))
return Builder.CreateNSWAdd(InVal, Amount, Name);
LLVM_FALLTHROUGH;
[[fallthrough]];
case LangOptions::SOB_Trapping:
if (!E->canOverflow())
return Builder.CreateNSWAdd(InVal, Amount, Name);
@ -3650,7 +3650,7 @@ Value *ScalarExprEmitter::EmitAdd(const BinOpInfo &op) {
case LangOptions::SOB_Undefined:
if (!CGF.SanOpts.has(SanitizerKind::SignedIntegerOverflow))
return Builder.CreateNSWAdd(op.LHS, op.RHS, "add");
LLVM_FALLTHROUGH;
[[fallthrough]];
case LangOptions::SOB_Trapping:
if (CanElideOverflowCheck(CGF.getContext(), op))
return Builder.CreateNSWAdd(op.LHS, op.RHS, "add");
@ -3800,7 +3800,7 @@ Value *ScalarExprEmitter::EmitSub(const BinOpInfo &op) {
case LangOptions::SOB_Undefined:
if (!CGF.SanOpts.has(SanitizerKind::SignedIntegerOverflow))
return Builder.CreateNSWSub(op.LHS, op.RHS, "sub");
LLVM_FALLTHROUGH;
[[fallthrough]];
case LangOptions::SOB_Trapping:
if (CanElideOverflowCheck(CGF.getContext(), op))
return Builder.CreateNSWSub(op.LHS, op.RHS, "sub");

View File

@ -293,7 +293,7 @@ void CGObjCRuntime::EmitInitOfCatchParam(CodeGenFunction &CGF,
switch (paramDecl->getType().getQualifiers().getObjCLifetime()) {
case Qualifiers::OCL_Strong:
exn = CGF.EmitARCRetainNonBlock(exn);
LLVM_FALLTHROUGH;
[[fallthrough]];
case Qualifiers::OCL_None:
case Qualifiers::OCL_ExplicitNone:

View File

@ -5475,7 +5475,7 @@ CodeGenModule::GetAddrOfConstantCFString(const StringLiteral *Literal) {
switch (CFRuntime) {
default: break;
case LangOptions::CoreFoundationABI::Swift: LLVM_FALLTHROUGH;
case LangOptions::CoreFoundationABI::Swift: [[fallthrough]];
case LangOptions::CoreFoundationABI::Swift5_0:
CFConstantStringClassName =
Triple.isOSDarwin() ? "$s15SwiftFoundation19_NSCFConstantStringCN"
@ -6132,7 +6132,7 @@ void CodeGenModule::EmitTopLevelDecl(Decl *D) {
TSK_ExplicitInstantiationDefinition &&
Spec->hasDefinition())
DI->completeTemplateDefinition(*Spec);
} LLVM_FALLTHROUGH;
} [[fallthrough]];
case Decl::CXXRecord: {
CXXRecordDecl *CRD = cast<CXXRecordDecl>(D);
if (CGDebugInfo *DI = getModuleDebugInfo()) {

View File

@ -3542,7 +3542,7 @@ void ItaniumRTTIBuilder::BuildVTablePointer(const Type *Ty) {
}
assert(isa<ObjCInterfaceType>(Ty));
LLVM_FALLTHROUGH;
[[fallthrough]];
case Type::ObjCInterface:
if (cast<ObjCInterfaceType>(Ty)->getDecl()->getSuperClass()) {
@ -4515,7 +4515,7 @@ static void InitCatchParam(CodeGenFunction &CGF,
switch (CatchType.getQualifiers().getObjCLifetime()) {
case Qualifiers::OCL_Strong:
CastExn = CGF.EmitARCRetainNonBlock(CastExn);
LLVM_FALLTHROUGH;
[[fallthrough]];
case Qualifiers::OCL_None:
case Qualifiers::OCL_ExplicitNone:

View File

@ -120,7 +120,7 @@ void MacroPPCallbacks::FileEntered(SourceLocation Loc) {
if (PP.getSourceManager().isWrittenInCommandLineFile(Loc))
return;
updateStatusToNextScope();
LLVM_FALLTHROUGH;
[[fallthrough]];
case CommandLineIncludeScope:
EnteredCommandLineIncludeFiles++;
break;

View File

@ -77,7 +77,7 @@ bool VarBypassDetector::BuildScopeInformation(const Stmt *S,
return false;
++StmtsToSkip;
}
LLVM_FALLTHROUGH;
[[fallthrough]];
case Stmt::GotoStmtClass:
FromScopes.push_back({S, ParentScope});

View File

@ -555,7 +555,7 @@ static bool useFramePointerForTargetByDefault(const ArgList &Args,
case llvm::Triple::thumbeb:
if (Triple.isAndroid())
return true;
LLVM_FALLTHROUGH;
[[fallthrough]];
case llvm::Triple::mips64:
case llvm::Triple::mips64el:
case llvm::Triple::mips:
@ -3010,7 +3010,7 @@ static void RenderFloatingPointOptions(const ToolChain &TC, const Driver &D,
// If -Ofast is the optimization level, then -ffast-math should be enabled
if (!OFastEnabled)
continue;
LLVM_FALLTHROUGH;
[[fallthrough]];
case options::OPT_ffast_math:
HonorINFs = false;
HonorNaNs = false;

View File

@ -227,7 +227,7 @@ static bool isArmBigEndian(const llvm::Triple &Triple,
case llvm::Triple::armeb:
case llvm::Triple::thumbeb:
IsBigEndian = true;
LLVM_FALLTHROUGH;
[[fallthrough]];
case llvm::Triple::arm:
case llvm::Triple::thumb:
if (Arg *A = Args.getLastArg(options::OPT_mlittle_endian,

View File

@ -218,7 +218,7 @@ MyriadToolChain::MyriadToolChain(const Driver &D, const llvm::Triple &Triple,
default:
D.Diag(clang::diag::err_target_unsupported_arch)
<< Triple.getArchName() << "myriad";
LLVM_FALLTHROUGH;
[[fallthrough]];
case llvm::Triple::shave:
return;
case llvm::Triple::sparc:

View File

@ -796,28 +796,28 @@ static bool rewriteToNumberLiteral(const ObjCMessageExpr *Msg,
case NSAPI::NSNumberWithUnsignedInt:
case NSAPI::NSNumberWithUnsignedInteger:
CallIsUnsigned = true;
LLVM_FALLTHROUGH;
[[fallthrough]];
case NSAPI::NSNumberWithInt:
case NSAPI::NSNumberWithInteger:
break;
case NSAPI::NSNumberWithUnsignedLong:
CallIsUnsigned = true;
LLVM_FALLTHROUGH;
[[fallthrough]];
case NSAPI::NSNumberWithLong:
CallIsLong = true;
break;
case NSAPI::NSNumberWithUnsignedLongLong:
CallIsUnsigned = true;
LLVM_FALLTHROUGH;
[[fallthrough]];
case NSAPI::NSNumberWithLongLong:
CallIsLongLong = true;
break;
case NSAPI::NSNumberWithDouble:
CallIsDouble = true;
LLVM_FALLTHROUGH;
[[fallthrough]];
case NSAPI::NSNumberWithFloat:
CallIsFloating = true;
break;

View File

@ -136,7 +136,7 @@ DeclarationFragmentsBuilder::getFragmentsForNNS(const NestedNameSpecifier *NNS,
Fragments.append("template", DeclarationFragments::FragmentKind::Keyword);
Fragments.appendSpace();
// Fallthrough after adding the keyword to handle the actual type.
LLVM_FALLTHROUGH;
[[fallthrough]];
case NestedNameSpecifier::TypeSpec: {
const Type *T = NNS->getAsType();

View File

@ -1027,7 +1027,7 @@ FormatToken *FormatTokenLexer::getNextToken() {
// the same as a single LF.
if (i + 1 < e && Text[i + 1] == '\n')
break;
LLVM_FALLTHROUGH;
[[fallthrough]];
case '\n':
++FormatTok->NewlinesBefore;
if (!InEscape)

View File

@ -1061,7 +1061,7 @@ private:
CurrentToken->isOneOf(tok::kw_constexpr, tok::identifier)) {
next();
}
LLVM_FALLTHROUGH;
[[fallthrough]];
case tok::kw_while:
if (CurrentToken && CurrentToken->is(tok::l_paren)) {
next();

View File

@ -573,7 +573,7 @@ bool UnwrappedLineParser::parseLevel(const FormatToken *OpeningBrace,
break;
}
// Else, if it is 'default:', fall through to the case handling.
LLVM_FALLTHROUGH;
[[fallthrough]];
}
case tok::kw_case:
if (Style.isVerilog() ||
@ -600,7 +600,7 @@ bool UnwrappedLineParser::parseLevel(const FormatToken *OpeningBrace,
}
if (handleCppAttributes())
break;
LLVM_FALLTHROUGH;
[[fallthrough]];
default:
ParseDefault();
break;
@ -736,7 +736,7 @@ void UnwrappedLineParser::calculateBraceTypes(bool ExpectClassBody) {
case tok::identifier:
if (!Tok->is(TT_StatementMacro))
break;
LLVM_FALLTHROUGH;
[[fallthrough]];
case tok::at:
case tok::semi:
case tok::kw_if:
@ -1627,7 +1627,7 @@ void UnwrappedLineParser::parseStructuralElement(
if (!Style.isCpp())
break;
// Handle C++ "(inline|export) namespace".
LLVM_FALLTHROUGH;
[[fallthrough]];
case tok::kw_inline:
nextToken();
if (FormatTok->is(tok::kw_namespace)) {
@ -1804,7 +1804,7 @@ void UnwrappedLineParser::parseStructuralElement(
addUnwrappedLine();
return;
}
LLVM_FALLTHROUGH;
[[fallthrough]];
case tok::kw_struct:
case tok::kw_union:
if (parseStructLike())
@ -2531,7 +2531,7 @@ void UnwrappedLineParser::parseParens(TokenType AmpAmpTokenType) {
case tok::ampamp:
if (AmpAmpTokenType != TT_Unknown)
FormatTok->setFinalizedType(AmpAmpTokenType);
LLVM_FALLTHROUGH;
[[fallthrough]];
default:
nextToken();
break;

View File

@ -1441,7 +1441,7 @@ static bool compileModuleAndReadASTBehindLock(
<< Module->Name << Locked.getErrorMessage();
// Clear out any potential leftover.
Locked.unsafeRemoveLockFile();
LLVM_FALLTHROUGH;
[[fallthrough]];
case llvm::LockFileManager::LFS_Owned:
// We're responsible for building the module ourselves.
return compileModuleAndReadASTImpl(ImportingInstance, ImportLoc,
@ -1879,7 +1879,7 @@ ModuleLoadResult CompilerInstance::findOrCompileModuleAndReadAST(
diag::warn_module_config_mismatch)
<< ModuleFilename;
// Fall through to error out.
LLVM_FALLTHROUGH;
[[fallthrough]];
case ASTReader::VersionMismatch:
case ASTReader::HadErrors:
ModuleLoader::HadFatalFailure = true;

View File

@ -184,7 +184,7 @@ SerializedDiagnosticReader::readMetaBlock(llvm::BitstreamCursor &Stream) {
consumeError(std::move(Err));
return SDError::MalformedMetadataBlock;
}
LLVM_FALLTHROUGH;
[[fallthrough]];
case Cursor::BlockEnd:
if (!VersionChecked)
return SDError::MissingVersion;

View File

@ -963,7 +963,7 @@ void USRGenerator::VisitTemplateArgument(const TemplateArgument &Arg) {
case TemplateArgument::TemplateExpansion:
Out << 'P'; // pack expansion of...
LLVM_FALLTHROUGH;
[[fallthrough]];
case TemplateArgument::Template:
VisitTemplateName(Arg.getAsTemplateOrTemplatePattern());
break;

View File

@ -59,22 +59,22 @@ public:
CI.getFrontendOpts().ProgramAction);
return Act;
case frontend::ASTDump:
LLVM_FALLTHROUGH;
[[fallthrough]];
case frontend::ASTPrint:
LLVM_FALLTHROUGH;
[[fallthrough]];
case frontend::ParseSyntaxOnly:
Act = CreateFrontendAction(CI);
break;
case frontend::PluginAction:
LLVM_FALLTHROUGH;
[[fallthrough]];
case frontend::EmitAssembly:
LLVM_FALLTHROUGH;
[[fallthrough]];
case frontend::EmitBC:
LLVM_FALLTHROUGH;
[[fallthrough]];
case frontend::EmitObj:
LLVM_FALLTHROUGH;
[[fallthrough]];
case frontend::PrintPreprocessedInput:
LLVM_FALLTHROUGH;
[[fallthrough]];
case frontend::EmitLLVMOnly:
Act.reset(new EmitLLVMOnlyAction(&LLVMCtx));
break;

View File

@ -246,7 +246,7 @@ void InitHeaderSearch::AddDefaultCIncludePaths(const llvm::Triple &triple,
case llvm::Triple::Win32:
if (triple.getEnvironment() != llvm::Triple::Cygnus)
break;
LLVM_FALLTHROUGH;
[[fallthrough]];
default:
// FIXME: temporary hack: hard-coded paths.
AddPath("/usr/local/include", System, false);

View File

@ -2905,7 +2905,7 @@ void Lexer::ReadToEndOfLine(SmallVectorImpl<char> *Result) {
break;
}
// FALL THROUGH.
LLVM_FALLTHROUGH;
[[fallthrough]];
case '\r':
case '\n':
// Okay, we found the end of the line. First, back up past the \0, \r, \n.
@ -3591,7 +3591,7 @@ LexNextToken:
case '\r':
if (CurPtr[0] == '\n')
(void)getAndAdvanceChar(CurPtr, Result);
LLVM_FALLTHROUGH;
[[fallthrough]];
case '\n':
// If we are inside a preprocessor directive and we see the end of line,
// we know we are done with the directive, so return an EOD token.
@ -3788,7 +3788,7 @@ LexNextToken:
return LexCharConstant(Result, ConsumeChar(CurPtr, SizeTmp, Result),
tok::wide_char_constant);
// FALL THROUGH, treating L like the start of an identifier.
LLVM_FALLTHROUGH;
[[fallthrough]];
// C99 6.4.2: Identifiers.
case 'A': case 'B': case 'C': case 'D': case 'E': case 'F': case 'G':

View File

@ -766,13 +766,13 @@ static void EncodeUCNEscape(const char *ThisTokBegin, const char *&ThisTokBuf,
switch (bytesToWrite) { // note: everything falls through.
case 4:
*--ResultBuf = (UTF8)((UcnVal | byteMark) & byteMask); UcnVal >>= 6;
LLVM_FALLTHROUGH;
[[fallthrough]];
case 3:
*--ResultBuf = (UTF8)((UcnVal | byteMark) & byteMask); UcnVal >>= 6;
LLVM_FALLTHROUGH;
[[fallthrough]];
case 2:
*--ResultBuf = (UTF8)((UcnVal | byteMark) & byteMask); UcnVal >>= 6;
LLVM_FALLTHROUGH;
[[fallthrough]];
case 1:
*--ResultBuf = (UTF8) (UcnVal | firstByteMark[bytesToWrite]);
}
@ -1037,7 +1037,7 @@ NumericLiteralParser::NumericLiteralParser(StringRef TokSpelling,
break;
}
}
LLVM_FALLTHROUGH;
[[fallthrough]];
case 'j':
case 'J':
if (isImaginary) break; // Cannot be repeated.

View File

@ -1668,7 +1668,7 @@ retry:
break;
}
}
LLVM_FALLTHROUGH;
[[fallthrough]];
default:
Diags.Report(Tok.getLocation(), diag::err_mmap_unknown_token);

View File

@ -986,7 +986,7 @@ void Preprocessor::Lex(Token &Result) {
TrackGMFState.handleModule(ImportSeqState.afterTopLevelSeq());
break;
}
LLVM_FALLTHROUGH;
[[fallthrough]];
default:
TrackGMFState.handleMisc();
ImportSeqState.handleMisc();
@ -1232,7 +1232,7 @@ bool Preprocessor::LexAfterModuleImport(Token &Result) {
Suffix.back().setLocation(SemiLoc);
Suffix.back().setAnnotationEndLoc(SemiLoc);
Suffix.back().setAnnotationValue(Action.ModuleForHeader);
LLVM_FALLTHROUGH;
[[fallthrough]];
case ImportAction::ModuleImport:
case ImportAction::HeaderUnitImport:

View File

@ -240,7 +240,7 @@ bool TokenConcatenation::AvoidConcat(const Token &PrevPrevTok,
// it as an identifier.
if (!PrevTok.hasUDSuffix())
return false;
LLVM_FALLTHROUGH;
[[fallthrough]];
case tok::identifier: // id+id or id+number or id+L"foo".
// id+'.'... will not append.
if (Tok.is(tok::numeric_constant))

View File

@ -880,7 +880,7 @@ bool Parser::ConsumeAndStoreUntil(tok::TokenKind T1, tok::TokenKind T2,
case tok::semi:
if (StopAtSemi)
return false;
LLVM_FALLTHROUGH;
[[fallthrough]];
default:
// consume this token.
Toks.push_back(Tok);
@ -1258,13 +1258,13 @@ bool Parser::ConsumeAndStoreInitializer(CachedTokens &Toks,
goto consume_token;
if (AngleCount) --AngleCount;
if (KnownTemplateCount) --KnownTemplateCount;
LLVM_FALLTHROUGH;
[[fallthrough]];
case tok::greatergreater:
if (!getLangOpts().CPlusPlus11)
goto consume_token;
if (AngleCount) --AngleCount;
if (KnownTemplateCount) --KnownTemplateCount;
LLVM_FALLTHROUGH;
[[fallthrough]];
case tok::greater:
if (AngleCount) --AngleCount;
if (KnownTemplateCount) --KnownTemplateCount;
@ -1369,7 +1369,7 @@ bool Parser::ConsumeAndStoreInitializer(CachedTokens &Toks,
case tok::semi:
if (CIK == CIK_DefaultInitializer)
return true; // End of the default initializer.
LLVM_FALLTHROUGH;
[[fallthrough]];
default:
consume_token:
Toks.push_back(Tok);

View File

@ -2802,7 +2802,7 @@ bool Parser::ParseImplicitInt(DeclSpec &DS, CXXScopeSpec *SS,
}
}
// Fall through.
LLVM_FALLTHROUGH;
[[fallthrough]];
}
case tok::comma:
case tok::equal:
@ -4240,13 +4240,13 @@ void Parser::ParseDeclarationSpecifiers(DeclSpec &DS,
isInvalid = true;
break;
}
LLVM_FALLTHROUGH;
[[fallthrough]];
case tok::kw_private:
// It's fine (but redundant) to check this for __generic on the
// fallthrough path; we only form the __generic token in OpenCL mode.
if (!getLangOpts().OpenCL)
goto DoneWithDeclSpec;
LLVM_FALLTHROUGH;
[[fallthrough]];
case tok::kw___private:
case tok::kw___global:
case tok::kw___local:
@ -5161,7 +5161,7 @@ bool Parser::isTypeSpecifierQualifier() {
case tok::identifier: // foo::bar
if (TryAltiVecVectorToken())
return true;
LLVM_FALLTHROUGH;
[[fallthrough]];
case tok::kw_typename: // typename T::type
// Annotate typenames and C++ scope specifiers. If we get one, just
// recurse to handle whatever we get.
@ -5304,7 +5304,7 @@ bool Parser::isDeclarationSpecifier(bool DisambiguatingWithExpression) {
return false;
if (TryAltiVecVectorToken())
return true;
LLVM_FALLTHROUGH;
[[fallthrough]];
case tok::kw_decltype: // decltype(T())::type
case tok::kw_typename: // typename T::type
// Annotate typenames and C++ scope specifiers. If we get one, just
@ -5719,7 +5719,7 @@ void Parser::ParseTypeQualifierListOpt(
case tok::kw_private:
if (!getLangOpts().OpenCL)
goto DoneWithTypeQuals;
LLVM_FALLTHROUGH;
[[fallthrough]];
case tok::kw___private:
case tok::kw___global:
case tok::kw___local:
@ -5743,7 +5743,7 @@ void Parser::ParseTypeQualifierListOpt(
if (TryKeywordIdentFallback(false))
continue;
}
LLVM_FALLTHROUGH;
[[fallthrough]];
case tok::kw___sptr:
case tok::kw___w64:
case tok::kw___ptr64:
@ -5794,7 +5794,7 @@ void Parser::ParseTypeQualifierListOpt(
continue; // do *not* consume the next token!
}
// otherwise, FALL THROUGH!
LLVM_FALLTHROUGH;
[[fallthrough]];
default:
DoneWithTypeQuals:
// If this is not a type-qualifier token, we're done reading type

View File

@ -404,7 +404,7 @@ Decl *Parser::ParseLinkage(ParsingDeclSpec &DS, DeclaratorContext Context) {
case tok::r_brace:
if (!NestedModules)
break;
LLVM_FALLTHROUGH;
[[fallthrough]];
default:
ParsedAttributes Attrs(AttrFactory);
MaybeParseCXX11Attributes(Attrs);
@ -3242,7 +3242,7 @@ Parser::DeclGroupPtrTy Parser::ParseCXXClassMemberDeclarationWithPragmas(
// yet.
if (getLangOpts().OpenCL && !NextToken().is(tok::colon))
return ParseCXXClassMemberDeclaration(AS, AccessAttrs);
LLVM_FALLTHROUGH;
[[fallthrough]];
case tok::kw_public:
case tok::kw_protected: {
if (getLangOpts().HLSL)
@ -4717,7 +4717,7 @@ void Parser::ParseMicrosoftIfExistsClassDeclaration(
Diag(Result.KeywordLoc, diag::warn_microsoft_dependent_exists)
<< Result.IsIfExists;
// Fall through to skip.
LLVM_FALLTHROUGH;
[[fallthrough]];
case IEB_Skip:
Braces.skipToEnd();

View File

@ -945,7 +945,7 @@ ExprResult Parser::ParseCastExpression(CastParseKind ParseKind,
case CastParseKind::UnaryExprOnly:
if (!getLangOpts().CPlusPlus)
ParenExprType = CompoundLiteral;
LLVM_FALLTHROUGH;
[[fallthrough]];
case CastParseKind::AnyCastExpr:
ParenExprType = ParenParseOption::CastExpr;
break;
@ -1413,7 +1413,7 @@ ExprResult Parser::ParseCastExpression(CastParseKind ParseKind,
case tok::kw__Alignof: // unary-expression: '_Alignof' '(' type-name ')'
if (!getLangOpts().C11)
Diag(Tok, diag::ext_c11_feature) << Tok.getName();
LLVM_FALLTHROUGH;
[[fallthrough]];
case tok::kw_alignof: // unary-expression: 'alignof' '(' type-id ')'
case tok::kw___alignof: // unary-expression: '__alignof' unary-expression
// unary-expression: '__alignof' '(' type-name ')'
@ -1502,7 +1502,7 @@ ExprResult Parser::ParseCastExpression(CastParseKind ParseKind,
Ty.get(), nullptr);
break;
}
LLVM_FALLTHROUGH;
[[fallthrough]];
case tok::annot_decltype:
case tok::kw_char:
@ -1621,7 +1621,7 @@ ExprResult Parser::ParseCastExpression(CastParseKind ParseKind,
}
// Fall through to treat the template-id as an id-expression.
LLVM_FALLTHROUGH;
[[fallthrough]];
}
case tok::kw_operator: // [C++] id-expression: operator/conversion-function-id
@ -1764,7 +1764,7 @@ ExprResult Parser::ParseCastExpression(CastParseKind ParseKind,
Res = ParseObjCMessageExpression();
break;
}
LLVM_FALLTHROUGH;
[[fallthrough]];
default:
NotCastExpr = true;
return ExprError();
@ -1795,7 +1795,7 @@ ExprResult Parser::ParseCastExpression(CastParseKind ParseKind,
if (Tok.isAtStartOfLine())
return Res;
LLVM_FALLTHROUGH;
[[fallthrough]];
case tok::period:
case tok::arrow:
break;
@ -1883,7 +1883,7 @@ Parser::ParsePostfixExpressionSuffix(ExprResult LHS) {
break;
}
// Fall through; this isn't a message send.
LLVM_FALLTHROUGH;
[[fallthrough]];
default: // Not a postfix-expression suffix.
return LHS;

View File

@ -565,7 +565,7 @@ bool Parser::ParseMicrosoftIfExistsBraceInitializer(ExprVector &InitExprs,
Diag(Result.KeywordLoc, diag::warn_microsoft_dependent_exists)
<< Result.IsIfExists;
// Fall through to skip.
LLVM_FALLTHROUGH;
[[fallthrough]];
case IEB_Skip:
Braces.skipToEnd();

View File

@ -259,7 +259,7 @@ static DeclarationName parseOpenMPReductionId(Parser &P) {
case tok::identifier: // identifier
if (!WithOperator)
break;
LLVM_FALLTHROUGH;
[[fallthrough]];
default:
P.Diag(Tok.getLocation(), diag::err_omp_expected_reduction_identifier);
P.SkipUntil(tok::colon, tok::r_paren, tok::annot_pragma_openmp_end,
@ -2761,7 +2761,7 @@ StmtResult Parser::ParseOpenMPDeclarativeOrExecutableDirective(
}
HasAssociatedStatement = false;
// Fall through for further analysis.
LLVM_FALLTHROUGH;
[[fallthrough]];
case OMPD_parallel:
case OMPD_simd:
case OMPD_tile:
@ -3253,7 +3253,7 @@ OMPClause *Parser::ParseOpenMPClause(OpenMPDirectiveKind DKind,
<< getOpenMPDirectiveName(DKind) << getOpenMPClauseName(CKind) << 0;
ErrorFound = true;
}
LLVM_FALLTHROUGH;
[[fallthrough]];
case OMPC_if:
Clause = ParseOpenMPSingleExprWithArgClause(DKind, CKind, WrongDirective);
break;
@ -3351,7 +3351,7 @@ OMPClause *Parser::ParseOpenMPClause(OpenMPDirectiveKind DKind,
Clause = ParseOpenMPClause(CKind, WrongDirective);
break;
}
LLVM_FALLTHROUGH;
[[fallthrough]];
case OMPC_init:
case OMPC_use:
Clause = ParseOpenMPInteropClause(CKind, WrongDirective);

View File

@ -222,7 +222,7 @@ Retry:
}
// Fall through
LLVM_FALLTHROUGH;
[[fallthrough]];
}
default: {
@ -448,7 +448,7 @@ Retry:
// processing a #pragma omp clause.
ProhibitAttributes(CXX11Attrs);
ProhibitAttributes(GNUAttrs);
LLVM_FALLTHROUGH;
[[fallthrough]];
case tok::annot_attr_openmp:
// Do not prohibit attributes if they were OpenMP attributes.
return ParseOpenMPDeclarativeOrExecutableDirective(StmtCtx);

View File

@ -158,7 +158,7 @@ Parser::TPResult Parser::TryConsumeDeclarationSpecifier() {
ConsumeToken();
break;
}
LLVM_FALLTHROUGH;
[[fallthrough]];
case tok::kw_typeof:
case tok::kw___attribute:
case tok::kw___underlying_type: {
@ -203,7 +203,7 @@ Parser::TPResult Parser::TryConsumeDeclarationSpecifier() {
case tok::annot_cxxscope:
ConsumeAnnotationToken();
LLVM_FALLTHROUGH;
[[fallthrough]];
default:
ConsumeAnyToken();
@ -1334,7 +1334,7 @@ Parser::isCXXDeclarationSpecifier(Parser::TPResult BracedCastResult,
if (Next.isOneOf(tok::kw_new, // ::new
tok::kw_delete)) // ::delete
return TPResult::False;
LLVM_FALLTHROUGH;
[[fallthrough]];
}
case tok::kw___super:
case tok::kw_decltype:
@ -1401,7 +1401,7 @@ Parser::isCXXDeclarationSpecifier(Parser::TPResult BracedCastResult,
case tok::kw_private:
if (!getLangOpts().OpenCL)
return TPResult::False;
LLVM_FALLTHROUGH;
[[fallthrough]];
case tok::kw___private:
case tok::kw___local:
case tok::kw___global:
@ -1573,7 +1573,7 @@ Parser::isCXXDeclarationSpecifier(Parser::TPResult BracedCastResult,
return TPResult::False;
}
// If that succeeded, fallthrough into the generic simple-type-id case.
LLVM_FALLTHROUGH;
[[fallthrough]];
// The ambiguity resides in a simple-type-specifier/typename-specifier
// followed by a '('. The '(' could either be the start of:
@ -1616,7 +1616,7 @@ Parser::isCXXDeclarationSpecifier(Parser::TPResult BracedCastResult,
return TPResult::True;
}
LLVM_FALLTHROUGH;
[[fallthrough]];
case tok::kw_char:
case tok::kw_wchar_t:

View File

@ -386,7 +386,7 @@ bool Parser::SkipUntil(ArrayRef<tok::TokenKind> Toks, SkipUntilFlags Flags) {
case tok::semi:
if (HasFlagsSet(Flags, StopAtSemi))
return false;
LLVM_FALLTHROUGH;
[[fallthrough]];
default:
// Skip this token.
ConsumeAnyToken();
@ -932,7 +932,7 @@ Parser::DeclGroupPtrTy Parser::ParseExternalDeclaration(ParsedAttributes &Attrs,
}
// This must be 'export template'. Parse it so we can diagnose our lack
// of support.
LLVM_FALLTHROUGH;
[[fallthrough]];
case tok::kw_using:
case tok::kw_namespace:
case tok::kw_typedef:
@ -1830,7 +1830,7 @@ Parser::TryAnnotateName(CorrectionCandidateCallback *CCC) {
AnnotateScopeToken(SS, !WasScopeAnnotation);
return ANK_TemplateName;
}
LLVM_FALLTHROUGH;
[[fallthrough]];
case Sema::NC_VarTemplate:
case Sema::NC_FunctionTemplate:
case Sema::NC_UndeclaredTemplate: {
@ -2167,7 +2167,7 @@ bool Parser::isTokenEqualOrEqualTypo() {
Diag(Tok, diag::err_invalid_token_after_declarator_suggest_equal)
<< Kind
<< FixItHint::CreateReplacement(SourceRange(Tok.getLocation()), "=");
LLVM_FALLTHROUGH;
[[fallthrough]];
case tok::equal:
return true;
}

View File

@ -488,14 +488,14 @@ void html::SyntaxHighlight(Rewriter &R, FileID FID, const Preprocessor &PP) {
++TokOffs;
--TokLen;
// FALL THROUGH to chop the 8
LLVM_FALLTHROUGH;
[[fallthrough]];
case tok::wide_string_literal:
case tok::utf16_string_literal:
case tok::utf32_string_literal:
// Chop off the L, u, U or 8 prefix
++TokOffs;
--TokLen;
LLVM_FALLTHROUGH;
[[fallthrough]];
case tok::string_literal:
// FIXME: Exclude the optional ud-suffix from the highlighted range.
HighlightRange(RB, TokOffs, TokOffs+TokLen, BufferStart,

View File

@ -776,7 +776,7 @@ void CodeCompletionResult::computeCursorKindAndAvailability(bool Accessible) {
// Do nothing: Patterns can come with cursor kinds!
break;
}
LLVM_FALLTHROUGH;
[[fallthrough]];
case RK_Declaration: {
// Set the availability based on attributes.

View File

@ -354,7 +354,7 @@ void JumpScopeChecker::BuildScopeInformation(Stmt *S,
BuildScopeInformation(Var, ParentScope);
++StmtsToSkip;
}
LLVM_FALLTHROUGH;
[[fallthrough]];
case Stmt::GotoStmtClass:
// Remember both what scope a goto is in as well as the fact that we have

View File

@ -2108,7 +2108,7 @@ Sema::CheckBuiltinFunctionCall(FunctionDecl *FDecl, unsigned BuiltinID,
case Builtin::BI__builtin_alloca_with_align_uninitialized:
if (SemaBuiltinAllocaWithAlign(TheCall))
return ExprError();
LLVM_FALLTHROUGH;
[[fallthrough]];
case Builtin::BI__builtin_alloca:
case Builtin::BI__builtin_alloca_uninitialized:
Diag(TheCall->getBeginLoc(), diag::warn_alloca)
@ -2485,7 +2485,7 @@ Sema::CheckBuiltinFunctionCall(FunctionDecl *FDecl, unsigned BuiltinID,
break;
case Builtin::BI__builtin_os_log_format:
Cleanup.setExprNeedsCleanups(true);
LLVM_FALLTHROUGH;
[[fallthrough]];
case Builtin::BI__builtin_os_log_format_buffer_size:
if (SemaBuiltinOSLogFormat(TheCall))
return ExprError();
@ -4039,7 +4039,7 @@ bool Sema::CheckPPCBuiltinFunctionCall(const TargetInfo &TI, unsigned BuiltinID,
case PPC::BI__builtin_unpack_longdouble:
if (SemaBuiltinConstantArgRange(TheCall, 1, 0, 1))
return true;
LLVM_FALLTHROUGH;
[[fallthrough]];
case PPC::BI__builtin_pack_longdouble:
if (&TI.getLongDoubleFormat() != &llvm::APFloat::PPCDoubleDouble())
return Diag(TheCall->getBeginLoc(), diag::err_ppc_builtin_requires_abi)
@ -12322,7 +12322,7 @@ static IntRange GetExprRange(ASTContext &C, const Expr *E, unsigned MaxWidth,
return IntRange(R.Width, /*NonNegative*/ true);
}
}
LLVM_FALLTHROUGH;
[[fallthrough]];
case BO_ShlAssign:
return IntRange::forValueOfType(C, GetExprType(E));

View File

@ -1807,7 +1807,7 @@ static void AddFunctionSpecifiers(Sema::ParserCompletionContext CCC,
Results.AddResult(Result("mutable"));
Results.AddResult(Result("virtual"));
}
LLVM_FALLTHROUGH;
[[fallthrough]];
case Sema::PCC_ObjCInterface:
case Sema::PCC_ObjCImplementation:
@ -2095,7 +2095,7 @@ static void AddOrdinaryNameResults(Sema::ParserCompletionContext CCC, Scope *S,
AddObjCTopLevelResults(Results, true);
AddTypedefResult(Results);
LLVM_FALLTHROUGH;
[[fallthrough]];
case Sema::PCC_Class:
if (SemaRef.getLangOpts().CPlusPlus) {
@ -2153,7 +2153,7 @@ static void AddOrdinaryNameResults(Sema::ParserCompletionContext CCC, Scope *S,
Builder);
}
}
LLVM_FALLTHROUGH;
[[fallthrough]];
case Sema::PCC_Template:
case Sema::PCC_MemberTemplate:
@ -2423,14 +2423,14 @@ static void AddOrdinaryNameResults(Sema::ParserCompletionContext CCC, Scope *S,
AddStaticAssertResult(Builder, Results, SemaRef.getLangOpts());
}
LLVM_FALLTHROUGH;
[[fallthrough]];
// Fall through (for statement expressions).
case Sema::PCC_ForInit:
case Sema::PCC_Condition:
AddStorageSpecifiers(CCC, SemaRef.getLangOpts(), Results);
// Fall through: conditions and statements can have expressions.
LLVM_FALLTHROUGH;
[[fallthrough]];
case Sema::PCC_ParenthesizedExpression:
if (SemaRef.getLangOpts().ObjCAutoRefCount &&
@ -2460,7 +2460,7 @@ static void AddOrdinaryNameResults(Sema::ParserCompletionContext CCC, Scope *S,
Results.AddResult(Result(Builder.TakeString()));
}
// Fall through
LLVM_FALLTHROUGH;
[[fallthrough]];
case Sema::PCC_Expression: {
if (SemaRef.getLangOpts().CPlusPlus) {

View File

@ -456,7 +456,7 @@ ParsedType Sema::getTypeName(const IdentifierInfo &II, SourceLocation NameLoc,
}
}
// If typo correction failed or was not performed, fall through
LLVM_FALLTHROUGH;
[[fallthrough]];
case LookupResult::FoundOverloaded:
case LookupResult::FoundUnresolvedValue:
Result.suppressDiagnostics();
@ -7637,7 +7637,7 @@ NamedDecl *Sema::ActOnVariableDeclarator(
Diag(D.getDeclSpec().getConstexprSpecLoc(),
diag::err_constexpr_wrong_decl_kind)
<< static_cast<int>(D.getDeclSpec().getConstexprSpecifier());
LLVM_FALLTHROUGH;
[[fallthrough]];
case ConstexprSpecKind::Constexpr:
NewVD->setConstexpr(true);
@ -13292,7 +13292,7 @@ void Sema::ActOnUninitializedDecl(Decl *RealDecl) {
// that has an in-class initializer, so we type-check this like
// a declaration.
//
LLVM_FALLTHROUGH;
[[fallthrough]];
case VarDecl::DeclarationOnly:
// It's only a declaration.

View File

@ -10797,7 +10797,7 @@ void Sema::CheckConversionDeclarator(Declarator &D, QualType &R,
PastFunctionChunk = true;
break;
}
LLVM_FALLTHROUGH;
[[fallthrough]];
case DeclaratorChunk::Array:
NeedsTypedef = true;
extendRight(After, Chunk.getSourceRange());
@ -15424,7 +15424,7 @@ static bool hasOneRealArgument(MultiExprArg Args) {
if (!Args[1]->isDefaultArgument())
return false;
LLVM_FALLTHROUGH;
[[fallthrough]];
case 1:
return !Args[0]->isDefaultArgument();
}
@ -18118,7 +18118,7 @@ bool Sema::checkThisInStaticMemberFunctionExceptionSpec(CXXMethodDecl *Method) {
case EST_NoexceptTrue:
if (!Finder.TraverseStmt(Proto->getNoexceptExpr()))
return true;
LLVM_FALLTHROUGH;
[[fallthrough]];
case EST_Dynamic:
for (const auto &E : Proto->exceptions()) {

View File

@ -976,7 +976,7 @@ void Sema::checkVariadicArgument(const Expr *E, VariadicCallType CT) {
DiagRuntimeBehavior(
E->getBeginLoc(), nullptr,
PDiag(diag::warn_cxx98_compat_pass_non_pod_arg_to_vararg) << Ty << CT);
LLVM_FALLTHROUGH;
[[fallthrough]];
case VAK_Valid:
if (Ty->isRecordType()) {
// This is unlikely to be what the user intended. If the class has a
@ -3391,7 +3391,7 @@ ExprResult Sema::BuildDeclarationNameExpr(
valueKind = VK_PRValue;
break;
}
LLVM_FALLTHROUGH;
[[fallthrough]];
case Decl::ImplicitParam:
case Decl::ParmVar: {
@ -3488,7 +3488,7 @@ ExprResult Sema::BuildDeclarationNameExpr(
valueKind = VK_LValue;
break;
}
LLVM_FALLTHROUGH;
[[fallthrough]];
case Decl::CXXConversion:
case Decl::CXXDestructor:
@ -14961,7 +14961,7 @@ ExprResult Sema::CreateBuiltinBinOp(SourceLocation OpLoc,
break;
case BO_And:
checkObjCPointerIntrospection(*this, LHS, RHS, OpLoc);
LLVM_FALLTHROUGH;
[[fallthrough]];
case BO_Xor:
case BO_Or:
ResultTy = CheckBitwiseOperands(LHS, RHS, OpLoc, Opc);
@ -15013,7 +15013,7 @@ ExprResult Sema::CreateBuiltinBinOp(SourceLocation OpLoc,
case BO_AndAssign:
case BO_OrAssign: // fallthrough
DiagnoseSelfAssignment(*this, LHS.get(), RHS.get(), OpLoc, true);
LLVM_FALLTHROUGH;
[[fallthrough]];
case BO_XorAssign:
CompResultTy = CheckBitwiseOperands(LHS, RHS, OpLoc, Opc);
CompLHSTy = CompResultTy;

View File

@ -4817,7 +4817,7 @@ static bool CheckUnaryTypeTraitTypeCompleteness(Sema &S, TypeTrait UTT,
case UTT_HasTrivialDestructor:
case UTT_HasVirtualDestructor:
ArgTy = QualType(ArgTy->getBaseElementTypeUnsafe(), 0);
LLVM_FALLTHROUGH;
[[fallthrough]];
// C++1z [meta.unary.prop]:
// T shall be a complete type, cv void, or an array of unknown bound.

View File

@ -249,7 +249,7 @@ ExprResult Sema::BuildPossibleImplicitMemberExpr(
case IMA_Field_Uneval_Context:
Diag(R.getNameLoc(), diag::warn_cxx98_compat_non_static_member_use)
<< R.getLookupNameInfo().getName();
LLVM_FALLTHROUGH;
[[fallthrough]];
case IMA_Static:
case IMA_Abstract:
case IMA_Mixed_StaticContext:

View File

@ -86,7 +86,7 @@ static StringInitFailureKind IsStringInit(Expr *Init, const ArrayType *AT,
// char8_t array can be initialized with a UTF-8 string.
if (ElemTy->isChar8Type())
return SIF_None;
LLVM_FALLTHROUGH;
[[fallthrough]];
case StringLiteral::Ordinary:
// char array can be initialized with a narrow string.
// Only allow char x[] = "foo"; not char x[] = L"foo";
@ -7572,7 +7572,7 @@ static SourceRange nextPathEntryRange(const IndirectLocalPath &Path, unsigned I,
case IndirectLocalPathEntry::VarInit:
if (cast<VarDecl>(Path[I].D)->isImplicit())
return SourceRange();
LLVM_FALLTHROUGH;
[[fallthrough]];
case IndirectLocalPathEntry::DefaultInit:
return Path[I].E->getSourceRange();
@ -8739,7 +8739,7 @@ ExprResult InitializationSequence::Perform(Sema &S,
<< Step->Type << CurInit.get()->getType()
<< CurInit.get()->getSourceRange();
updateGNUCompoundLiteralRValue(CurInit.get());
LLVM_FALLTHROUGH;
[[fallthrough]];
case SK_ArrayInit:
// If the destination type is an incomplete array type, update the
// type accordingly.
@ -9201,7 +9201,7 @@ bool InitializationSequence::Diagnose(Sema &S,
<< Args[0]->getSourceRange();
break;
}
LLVM_FALLTHROUGH;
[[fallthrough]];
case FK_NonConstLValueReferenceBindingToUnrelated:
S.Diag(Kind.getLocation(),

View File

@ -335,7 +335,7 @@ Sema::getCurrentMangleNumberContext(const DeclContext *DC) {
if (!IsInNonspecializedTemplate)
return std::make_tuple(nullptr, ManglingContextDecl);
// Fall through to get the current context.
LLVM_FALLTHROUGH;
[[fallthrough]];
case DataMember:
// -- the in-class initializers of class members

View File

@ -3142,7 +3142,7 @@ addAssociatedClassesAndNamespaces(AssociatedLookup &Result, QualType Ty) {
for (const auto &Arg : Proto->param_types())
Queue.push_back(Arg.getTypePtr());
// fallthrough
LLVM_FALLTHROUGH;
[[fallthrough]];
}
case Type::FunctionNoProto: {
const FunctionType *FnType = cast<FunctionType>(T);

View File

@ -12279,7 +12279,7 @@ StmtResult Sema::ActOnOpenMPAtomicDirective(ArrayRef<OMPClause *> Clauses,
case OMPC_write:
case OMPC_update:
MutexClauseEncountered = true;
LLVM_FALLTHROUGH;
[[fallthrough]];
case OMPC_capture:
case OMPC_compare: {
if (AtomicKind != OMPC_unknown && MutexClauseEncountered) {
@ -15168,7 +15168,7 @@ static OpenMPDirectiveKind getOpenMPCaptureRegionForClause(
CaptureRegion = OMPD_parallel;
break;
}
LLVM_FALLTHROUGH;
[[fallthrough]];
case OMPD_target_parallel:
case OMPD_target_parallel_for:
case OMPD_target_parallel_loop:
@ -15183,7 +15183,7 @@ static OpenMPDirectiveKind getOpenMPCaptureRegionForClause(
CaptureRegion = OMPD_parallel;
break;
}
LLVM_FALLTHROUGH;
[[fallthrough]];
case OMPD_target_teams_distribute_parallel_for:
// If this clause applies to the nested 'parallel' region, capture within
// the 'teams' region, otherwise do not capture.
@ -15196,7 +15196,7 @@ static OpenMPDirectiveKind getOpenMPCaptureRegionForClause(
CaptureRegion = OMPD_parallel;
break;
}
LLVM_FALLTHROUGH;
[[fallthrough]];
case OMPD_teams_distribute_parallel_for:
CaptureRegion = OMPD_teams;
break;

View File

@ -6241,7 +6241,7 @@ ExprResult Sema::PerformContextualImplicitConversion(
HadMultipleCandidates,
ExplicitConversions))
return ExprError();
LLVM_FALLTHROUGH;
[[fallthrough]];
case OR_Deleted:
// We'll complain below about a non-integral condition type.
break;
@ -9311,7 +9311,7 @@ void Sema::AddBuiltinOperatorCandidates(OverloadedOperatorKind Op,
case OO_Plus: // '+' is either unary or binary
if (Args.size() == 1)
OpBuilder.addUnaryPlusPointerOverloads();
LLVM_FALLTHROUGH;
[[fallthrough]];
case OO_Minus: // '-' is either unary or binary
if (Args.size() == 1) {
@ -9386,12 +9386,12 @@ void Sema::AddBuiltinOperatorCandidates(OverloadedOperatorKind Op,
case OO_Equal:
OpBuilder.addAssignmentMemberPointerOrEnumeralOverloads();
LLVM_FALLTHROUGH;
[[fallthrough]];
case OO_PlusEqual:
case OO_MinusEqual:
OpBuilder.addAssignmentPointerOverloads(Op == OO_Equal);
LLVM_FALLTHROUGH;
[[fallthrough]];
case OO_StarEqual:
case OO_SlashEqual:

View File

@ -2660,7 +2660,7 @@ BuildNonArrayForRange(Sema &SemaRef, Expr *BeginRange, Expr *EndRange,
SemaRef.PDiag(diag::err_for_range_invalid)
<< BeginRange->getType() << BEFFound),
SemaRef, OCD_AllCandidates, BeginRange);
LLVM_FALLTHROUGH;
[[fallthrough]];
case Sema::FRS_DiagnosticIssued:
for (NamedDecl *D : OldFound) {

View File

@ -330,7 +330,7 @@ StmtResult Sema::ActOnGCCAsmStmt(SourceLocation AsmLoc, bool IsSimple,
if (RequireCompleteType(OutputExpr->getBeginLoc(), Exprs[i]->getType(),
diag::err_dereference_incomplete_type))
return StmtError();
LLVM_FALLTHROUGH;
[[fallthrough]];
default:
return StmtError(Diag(OutputExpr->getBeginLoc(),
diag::err_asm_invalid_lvalue_in_output)

View File

@ -5085,7 +5085,7 @@ bool Sema::CheckTemplateTypeArgument(TemplateTypeParmDecl *Param,
}
}
// fallthrough
LLVM_FALLTHROUGH;
[[fallthrough]];
}
default: {
// We have a template type parameter but the template argument
@ -8849,7 +8849,7 @@ Sema::CheckSpecializationInstantiationRedecl(SourceLocation NewLoc,
return false;
}
// Fall through
LLVM_FALLTHROUGH;
[[fallthrough]];
case TSK_ExplicitInstantiationDeclaration:
case TSK_ExplicitInstantiationDefinition:
@ -10750,7 +10750,7 @@ Sema::CheckTypenameType(ElaboratedTypeKeyword Keyword,
}
// Fall through to create a dependent typename type, from which we can recover
// better.
LLVM_FALLTHROUGH;
[[fallthrough]];
case LookupResult::NotFoundInCurrentInstantiation:
// Okay, it's a member of an unknown instantiation.

View File

@ -1587,7 +1587,7 @@ static Sema::TemplateDeductionResult DeduceTemplateArgumentsByTypeMatch(
// FIXME: Implement deduction in dependent case.
if (P->isDependentType())
return Sema::TDK_Success;
LLVM_FALLTHROUGH;
[[fallthrough]];
case Type::Builtin:
case Type::VariableArray:
case Type::Vector:
@ -1775,7 +1775,7 @@ static Sema::TemplateDeductionResult DeduceTemplateArgumentsByTypeMatch(
switch (FPA->canThrow()) {
case CT_Cannot:
Noexcept = 1;
LLVM_FALLTHROUGH;
[[fallthrough]];
case CT_Can:
// We give E in noexcept(E) the "deduced from array bound" treatment.
@ -5741,7 +5741,7 @@ MarkUsedTemplateParameters(ASTContext &Ctx, QualType T,
cast<DependentSizedArrayType>(T)->getSizeExpr(),
OnlyDeduced, Depth, Used);
// Fall through to check the element type
LLVM_FALLTHROUGH;
[[fallthrough]];
case Type::ConstantArray:
case Type::IncompleteArray:
@ -5851,7 +5851,7 @@ MarkUsedTemplateParameters(ASTContext &Ctx, QualType T,
case Type::InjectedClassName:
T = cast<InjectedClassNameType>(T)->getInjectedSpecializationType();
LLVM_FALLTHROUGH;
[[fallthrough]];
case Type::TemplateSpecialization: {
const TemplateSpecializationType *Spec

View File

@ -864,7 +864,7 @@ Optional<TemplateDeductionInfo *> Sema::isSFINAEContext() const {
// context, depending on what else is on the stack.
if (isa<TypeAliasTemplateDecl>(Active->Entity))
break;
LLVM_FALLTHROUGH;
[[fallthrough]];
case CodeSynthesisContext::DefaultFunctionArgumentInstantiation:
case CodeSynthesisContext::ExceptionSpecInstantiation:
case CodeSynthesisContext::ConstraintsCheck:

View File

@ -633,7 +633,7 @@ static bool isRelevantAttr(Sema &S, const Decl *D, const Attr *A) {
FD->getReturnType()->isLValueReferenceType()) {
return false;
}
LLVM_FALLTHROUGH;
[[fallthrough]];
case Builtin::BImove:
case Builtin::BImove_if_noexcept:
// HACK: Super-old versions of libc++ (3.1 and earlier) provide

View File

@ -430,7 +430,7 @@ static DeclaratorChunk *maybeMovePastReturnType(Declarator &declarator,
if (onlyBlockPointers)
continue;
LLVM_FALLTHROUGH;
[[fallthrough]];
case DeclaratorChunk::BlockPointer:
result = &ptrChunk;
@ -1369,7 +1369,7 @@ static QualType ConvertDeclSpecToType(TypeProcessingState &state) {
}
}
LLVM_FALLTHROUGH;
[[fallthrough]];
case DeclSpec::TST_int: {
if (DS.getTypeSpecSign() != TypeSpecifierSign::Unsigned) {
switch (DS.getTypeSpecWidth()) {
@ -3540,7 +3540,7 @@ static QualType GetDeclSpecTypeForDeclarator(TypeProcessingState &state,
!D.getNumTypeObjects() &&
D.getDeclSpec().getParsedSpecifiers() == DeclSpec::PQ_TypeSpecifier)
break;
LLVM_FALLTHROUGH;
[[fallthrough]];
case DeclaratorContext::TemplateTypeArg:
Error = 10; // Template type argument
break;
@ -3565,7 +3565,7 @@ static QualType GetDeclSpecTypeForDeclarator(TypeProcessingState &state,
if (SemaRef.getLangOpts().CPlusPlus2b && IsCXXAutoType &&
!Auto->isDecltypeAuto())
break; // auto(x)
LLVM_FALLTHROUGH;
[[fallthrough]];
case DeclaratorContext::TypeName:
case DeclaratorContext::Association:
Error = 15; // Generic
@ -3834,7 +3834,7 @@ static void warnAboutRedundantParens(Sema &S, Declarator &D, QualType T) {
case DeclaratorChunk::Paren:
if (&C == &Paren)
continue;
LLVM_FALLTHROUGH;
[[fallthrough]];
case DeclaratorChunk::Pointer:
StartsWithDeclaratorId = false;
continue;
@ -4674,7 +4674,7 @@ static TypeSourceInfo *GetFullTypeForDeclarator(TypeProcessingState &state,
case DeclaratorContext::TrailingReturn:
case DeclaratorContext::TrailingReturnVar:
isFunctionOrMethod = true;
LLVM_FALLTHROUGH;
[[fallthrough]];
case DeclaratorContext::Member:
if (state.getDeclarator().isObjCIvar() && !isFunctionOrMethod) {
@ -4688,7 +4688,7 @@ static TypeSourceInfo *GetFullTypeForDeclarator(TypeProcessingState &state,
break;
}
LLVM_FALLTHROUGH;
[[fallthrough]];
case DeclaratorContext::File:
case DeclaratorContext::KNRTypeList: {
@ -4843,7 +4843,7 @@ static TypeSourceInfo *GetFullTypeForDeclarator(TypeProcessingState &state,
case CAMN_InnerPointers:
if (NumPointersRemaining == 0)
break;
LLVM_FALLTHROUGH;
[[fallthrough]];
case CAMN_Yes:
checkNullabilityConsistency(S, pointerKind, pointerLoc, pointerEndLoc);
@ -7714,7 +7714,7 @@ static bool handleFunctionTypeAttr(TypeProcessingState &state, ParsedAttr &attr,
case EST_NoexceptTrue:
case EST_NoThrow:
// Exception spec doesn't conflict with nothrow, so don't warn.
LLVM_FALLTHROUGH;
[[fallthrough]];
case EST_Unparsed:
case EST_Uninstantiated:
case EST_DependentNoexcept:
@ -8443,7 +8443,7 @@ static void processTypeAttrs(TypeProcessingState &state, QualType &type,
// clang, so revert to attribute-based handling for C.
if (!state.getSema().getLangOpts().CPlusPlus)
break;
LLVM_FALLTHROUGH;
[[fallthrough]];
FUNCTION_TYPE_ATTRS_CASELIST:
attr.setUsedAsTypeAttr();

View File

@ -1275,10 +1275,10 @@ void ASTReader::Error(llvm::Error &&Err) const {
switch (NumArgs) {
case 3:
Arg3 = Diag.getStringArg(2);
LLVM_FALLTHROUGH;
[[fallthrough]];
case 2:
Arg2 = Diag.getStringArg(1);
LLVM_FALLTHROUGH;
[[fallthrough]];
case 1:
Arg1 = Diag.getStringArg(0);
}

View File

@ -240,7 +240,7 @@ public:
case DeadIncrement:
BugType = "Dead increment";
LLVM_FALLTHROUGH;
[[fallthrough]];
case Standard:
if (!BugType) BugType = "Dead assignment";
os << "Value stored to '" << *V << "' is never read";

View File

@ -309,7 +309,7 @@ MoveChecker::MovedBugVisitor::VisitNode(const ExplodedNode *N,
// If it's not a dereference, we don't care if it was reset to null
// or that it is even a smart pointer.
LLVM_FALLTHROUGH;
[[fallthrough]];
case SK_NonStd:
case SK_Safe:
OS << "Object";
@ -587,7 +587,7 @@ void MoveChecker::explainObject(llvm::raw_ostream &OS, const MemRegion *MR,
break;
// We only care about the type if it's a dereference.
LLVM_FALLTHROUGH;
[[fallthrough]];
case SK_Unsafe:
OS << " of type '" << RD->getQualifiedNameAsString() << "'";
break;

View File

@ -767,7 +767,7 @@ ProgramStateRef RetainCountChecker::updateSymbol(ProgramStateRef state,
break;
}
LLVM_FALLTHROUGH;
[[fallthrough]];
case DoNothing:
return state;

View File

@ -1793,7 +1793,7 @@ void ExprEngine::Visit(const Stmt *S, ExplodedNode *Pred,
}
}
// FALLTHROUGH
LLVM_FALLTHROUGH;
[[fallthrough]];
}
case Stmt::CallExprClass:

Some files were not shown because too many files have changed in this diff Show More