Index: B/llvm/tools/clang/lib/Sema/AnalysisBasedWarnings.cpp =================================================================== --- B/llvm/tools/clang/lib/Sema/AnalysisBasedWarnings.cpp +++ B/llvm/tools/clang/lib/Sema/AnalysisBasedWarnings.cpp @@ -509,8 +509,7 @@ bool HasNoReturnAttr = FT->getNoReturnAttr(); // Short circuit for compilation speed. - if (!ReturnsValue && !HasNoReturnAttr) - return; + if (!ReturnsValue && !HasNoReturnAttr) return; SourceLocation RBrace = Body->getEndLoc(); switch (CheckFallThrough(AC)) { @@ -535,25 +534,20 @@ } } -static void CheckFallThroughForLambda( - Sema &S, const Decl *D, const Stmt *Body, AnalysisDeclContext &AC, - sema::FunctionScopeInfo *FSI) { +static void CheckFallThroughForLambda(Sema &S, const Decl *D, const Stmt *Body, + AnalysisDeclContext &AC, + sema::FunctionScopeInfo *FSI) { const auto *FD = dyn_cast(D); if (FD == nullptr) return; - // cpu_dispatch functions permit empty function bodies for ICC compatibility. - if (FD->isCPUDispatchMultiVersion()) - return; - auto *LSI = cast(FSI); bool ReturnsValue = LSI->WrappedReturnType.isNull() - ? !FD->getReturnType()->isVoidType() - : LSI->CoroutineHasNonVoidReturn; + ? !FD->getReturnType()->isVoidType() + : LSI->CoroutineHasNonVoidReturn; bool HasNoReturnAttr = FD->isNoReturn(); // Short circuit for compilation speed. - if (!ReturnsValue && !HasNoReturnAttr) - return; + if (!ReturnsValue && !HasNoReturnAttr) return; SourceLocation RBrace = Body->getEndLoc(); switch (CheckFallThrough(AC)) { @@ -576,9 +570,10 @@ } } -static void CheckFallThroughForCoroutine( - Sema &S, const Decl *D, const Stmt *Body, - AnalysisDeclContext &AC, sema::FunctionScopeInfo *FSI) { +static void CheckFallThroughForCoroutine(Sema &S, const Decl *D, + const Stmt *Body, + AnalysisDeclContext &AC, + sema::FunctionScopeInfo *FSI) { const auto *FD = dyn_cast(D); if (FD == nullptr) return; @@ -597,8 +592,8 @@ D->getLocation()) || Diags.isIgnored(diag::warn_maybe_falloff_nonvoid_coroutine, D->getLocation())) && - (!HasNoReturnAttr)) - return; + !HasNoReturnAttr) + return; SourceLocation RBrace = Body->getEndLoc(); switch (CheckFallThrough(AC)) { @@ -619,9 +614,9 @@ } } -static void CheckFallThroughForFunction( - Sema &S, const Decl *D, const Stmt *Body, - AnalysisDeclContext &AC) { +static void CheckFallThroughForFunction(Sema &S, const Decl *D, + const Stmt *Body, + AnalysisDeclContext &AC) { bool ReturnsVoid = false; bool HasNoReturnAttr = false; bool SuggestNoReturn = true; @@ -642,8 +637,7 @@ isTemplateInstantiation = Function->isTemplateInstantiation(); SuggestNoReturn = !isVirtualMethod && !isTemplateInstantiation; - } - else if (const auto *MD = dyn_cast(D)) { + } else if (const auto *MD = dyn_cast(D)) { ReturnsVoid = MD->getReturnType()->isVoidType(); HasNoReturnAttr = MD->hasAttr(); } @@ -654,9 +648,8 @@ // Short circuit for compilation speed. DiagnosticsEngine &Diags = S.getDiagnostics(); - if ((ReturnsVoid || - Diags.isIgnored(diag::warn_maybe_falloff_nonvoid_function, - D->getLocation())) && + if ((ReturnsVoid || Diags.isIgnored(diag::warn_maybe_falloff_nonvoid_function, + D->getLocation())) && (!HasNoReturnAttr || Diags.isIgnored(diag::warn_noreturn_function_has_return_expr, D->getLocation())) &&