Lines Matching +full:use +full:- +full:sw +full:- +full:pm

1 //=== AnalysisBasedWarnings.cpp - Sema warnings based on libAnalysis ------===//
5 // SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception
7 //===----------------------------------------------------------------------===//
13 //===----------------------------------------------------------------------===//
62 //===----------------------------------------------------------------------===//
64 //===----------------------------------------------------------------------===//
78 // `-Wunreachable-code-fallthrough` is enabled, suppress `code will never
124 /// CheckUnreachable - Check for unreachable code.
133 if (!S.getSourceManager().isInMainFile(AC.getDecl()->getBeginLoc()))
149 if (E->getExprLoc().isMacroID())
153 for (const Stmt *SubStmt : E->children())
168 SourceRange DiagRange = B->getSourceRange();
169 S.Diag(B->getExprLoc(), DiagID) << DiagRange;
176 SourceRange DiagRange = B->getSourceRange();
177 S.Diag(B->getExprLoc(), diag::warn_tautological_overlap_comparison)
186 SourceRange DiagRange = B->getSourceRange();
187 S.Diag(B->getExprLoc(), diag::warn_comparison_bitwise_always)
195 SourceRange DiagRange = B->getSourceRange();
196 S.Diag(B->getExprLoc(), diag::warn_comparison_bitwise_or) << DiagRange;
208 //===----------------------------------------------------------------------===//
209 // Check for infinite self-recursion in functions
210 //===----------------------------------------------------------------------===//
221 const CallExpr *CE = dyn_cast<CallExpr>(B.getAs<CFGStmt>()->getStmt());
222 if (!CE || !CE->getCalleeDecl() ||
223 CE->getCalleeDecl()->getCanonicalDecl() != FD)
228 dyn_cast<DeclRefExpr>(CE->getCallee()->IgnoreParenImpCasts())) {
229 if (NestedNameSpecifier *NNS = DRE->getQualifier()) {
230 if (NNS->getKind() == NestedNameSpecifier::TypeSpec &&
231 isa<TemplateSpecializationType>(NNS->getAsType())) {
238 if (!MCE || isa<CXXThisExpr>(MCE->getImplicitObjectArgument()) ||
239 !MCE->getMethodDecl()->isVirtual())
252 const unsigned ExitID = cfg->getExit().getBlockID();
255 WorkList.push_back(&cfg->getEntry());
260 for (auto I = Block->succ_begin(), E = Block->succ_end(); I != E; ++I) {
266 if (ExitID == SuccBlock->getBlockID())
284 FD = FD->getCanonicalDecl();
286 // Only run on non-templated functions and non-templated members of
288 if (FD->getTemplatedKind() != FunctionDecl::TK_NonTemplate &&
289 FD->getTemplatedKind() != FunctionDecl::TK_MemberSpecialization)
296 if (cfg->getExit().pred_empty())
301 S.Diag(Body->getBeginLoc(), diag::warn_infinite_recursive_function);
304 //===----------------------------------------------------------------------===//
305 // Check for throw in a non-throwing function.
306 //===----------------------------------------------------------------------===//
313 llvm::BitVector Queued(Body->getNumBlockIDs());
323 if (!Succ.isReachable() || Queued[Succ->getBlockID()])
326 if (Succ->getBlockID() == Body->getExit().getBlockID())
330 dyn_cast_or_null<CXXCatchStmt>(Succ->getLabel())) {
331 QualType Caught = Catch->getCaughtType();
333 !E->getSubExpr() || // throw; is considered cuaght by any handler
334 S.handlerCanCatch(Caught, E->getSubExpr()->getType()))
339 Queued[Succ->getBlockID()] = true;
350 llvm::BitVector Reachable(BodyCFG->getNumBlockIDs());
351 clang::reachable_code::ScanReachableFromBlock(&BodyCFG->getEntry(), Reachable);
353 if (!Reachable[B->getBlockID()])
359 if (auto *Throw = dyn_cast<CXXThrowExpr>(S->getStmt()))
368 FD->getTypeSourceInfo()) {
372 FD->getDeclName().getCXXOverloadedOperator() == OO_Delete ||
373 FD->getDeclName().getCXXOverloadedOperator() == OO_Array_Delete)) {
374 if (const auto *Ty = FD->getTypeSourceInfo()->getType()->
376 S.Diag(FD->getLocation(), diag::note_throw_in_dtor)
377 << !isa<CXXDestructorDecl>(FD) << !Ty->hasExceptionSpec()
378 << FD->getExceptionSpecSourceRange();
380 S.Diag(FD->getLocation(), diag::note_throw_in_function)
381 << FD->getExceptionSpecSourceRange();
390 if (BodyCFG->getExit().pred_empty())
394 EmitDiagForCXXThrowInNonThrowingFunc(S, Throw->getThrowLoc(), FD);
399 const auto *FPT = FD->getType()->castAs<FunctionProtoType>();
400 if (FPT->isNothrow() || FD->hasAttr<NoThrowAttr>())
405 //===----------------------------------------------------------------------===//
407 //===----------------------------------------------------------------------===//
417 /// CheckFallThrough - Check that we don't fall off the end of a
432 llvm::BitVector live(cfg->getNumBlockIDs());
433 unsigned count = reachable_code::ScanReachableFromBlock(&cfg->getEntry(),
437 if (!AddEHEdges && count != cfg->getNumBlockIDs())
442 if (!live[B->getBlockID()]) {
443 if (B->pred_begin() == B->pred_end()) {
444 const Stmt *Term = B->getTerminatorStmt();
468 cfg->getExit().filtered_pred_start_end(FO);
474 // Skip blocks which contain an element marked as no-return. They don't
488 if (ri->getAs<CFGStmt>())
503 CFGStmt CS = ri->castAs<CFGStmt>();
527 if (!llvm::is_contained(B.succs(), &cfg->getExit())) {
560 D.FuncLoc = Func->getLocation();
571 // might be overridden by non-noreturn functions.
574 isVirtualMethod = Method->isVirtual();
579 isTemplateInstantiation = Function->isTemplateInstantiation();
593 D.FuncLoc = Func->getLocation();
661 /// CheckFallThroughForBody - Check that we don't fall off the end of a
673 bool IsCoroutine = FSI->isCoroutine();
677 ReturnsVoid = CBody->getFallthroughHandler() != nullptr;
679 ReturnsVoid = FD->getReturnType()->isVoidType();
680 HasNoReturn = FD->isNoReturn();
683 ReturnsVoid = MD->getReturnType()->isVoidType();
684 HasNoReturn = MD->hasAttr<NoReturnAttr>();
688 BlockType->getPointeeType()->getAs<FunctionType>()) {
689 if (FT->getReturnType()->isVoidType())
691 if (FT->getNoReturnAttr())
701 SourceLocation LBrace = Body->getBeginLoc(), RBrace = Body->getEndLoc();
704 S.Diag(Loc, DiagID) << FSI->CoroutinePromise->getType();
710 if (D->getAsFunction() && D->getAsFunction()->isCPUDispatchMultiVersion())
713 // Either in a function body compound statement, or a function-try-block.
746 //===----------------------------------------------------------------------===//
747 // -Wuninitialized
748 //===----------------------------------------------------------------------===//
751 /// ContainsReference - A visitor class to search for references to
784 QualType VariableTy = VD->getType().getCanonicalType();
785 if (VariableTy->isBlockPointerType() &&
786 !VD->hasAttr<BlocksAttr>()) {
787 S.Diag(VD->getLocation(), diag::note_block_var_fixit_add_initialization)
788 << VD->getDeclName()
789 << FixItHint::CreateInsertion(VD->getLocation(), "__block ");
794 if (VD->getInit())
798 if (VD->getEndLoc().isMacroID())
801 SourceLocation Loc = S.getLocForEndOfToken(VD->getEndLoc());
808 S.Diag(Loc, diag::note_var_fixit_add_initialization) << VD->getDeclName()
813 /// Create a fixit to remove an if-like statement, on the assumption that its
821 CharSourceRange::getCharRange(If->getBeginLoc(), Then->getBeginLoc()));
823 SourceLocation ElseKwLoc = S.getLocForEndOfToken(Then->getEndLoc());
825 FixItHint::CreateRemoval(SourceRange(ElseKwLoc, Else->getEndLoc()));
831 If->getBeginLoc(), Else->getBeginLoc()));
833 Fixit1 = FixItHint::CreateRemoval(If->getSourceRange());
837 /// DiagUninitUse -- Helper function to produce a diagnostic for an
838 /// uninitialized use of a variable.
839 static void DiagUninitUse(Sema &S, const VarDecl *VD, const UninitUse &Use,
843 switch (Use.getKind()) {
845 S.Diag(Use.getUser()->getBeginLoc(), diag::warn_uninit_var)
846 << VD->getDeclName() << IsCapturedByBlock
847 << Use.getUser()->getSourceRange();
852 S.Diag(VD->getLocation(), diag::warn_sometimes_uninit_var)
853 << VD->getDeclName() << IsCapturedByBlock
854 << (Use.getKind() == UninitUse::AfterDecl ? 4 : 5)
855 << const_cast<DeclContext*>(VD->getLexicalDeclContext())
856 << VD->getSourceRange();
857 S.Diag(Use.getUser()->getBeginLoc(), diag::note_uninit_var_use)
858 << IsCapturedByBlock << Use.getUser()->getSourceRange();
863 // Carry on to report sometimes-uninitialized branches, if possible,
868 // Diagnose each branch which leads to a sometimes-uninitialized use.
869 for (UninitUse::branch_iterator I = Use.branch_begin(), E = Use.branch_end();
871 assert(Use.getKind() == UninitUse::Sometimes);
873 const Expr *User = Use.getUser();
874 const Stmt *Term = I->Terminator;
884 int RemoveDiagKind = -1;
886 S.getLangOpts().CPlusPlus ? (I->Output ? "true" : "false")
887 : (I->Output ? "1" : "0");
890 switch (Term ? Term->getStmtClass() : Stmt::DeclStmtClass) {
901 Range = IS->getCond()->getSourceRange();
903 CreateIfFixit(S, IS, IS->getThen(), IS->getElse(),
904 I->Output, Fixit1, Fixit2);
911 Range = CO->getCond()->getSourceRange();
913 CreateIfFixit(S, CO, CO->getTrueExpr(), CO->getFalseExpr(),
914 I->Output, Fixit1, Fixit2);
919 if (!BO->isLogicalOp())
922 Str = BO->getOpcodeStr();
923 Range = BO->getLHS()->getSourceRange();
925 if ((BO->getOpcode() == BO_LAnd && I->Output) ||
926 (BO->getOpcode() == BO_LOr && !I->Output))
927 // true && y -> y, false || y -> y.
929 SourceRange(BO->getBeginLoc(), BO->getOperatorLoc()));
931 // false && y -> false, true || y -> true.
932 Fixit1 = FixItHint::CreateReplacement(BO->getSourceRange(), FixitStr);
940 Range = cast<WhileStmt>(Term)->getCond()->getSourceRange();
947 Range = cast<ForStmt>(Term)->getCond()->getSourceRange();
949 if (I->Output)
955 if (I->Output == 1) {
956 // The use occurs if a range-based for loop's body never executes.
963 Range = cast<CXXForRangeStmt>(Term)->getRangeInit()->getSourceRange();
970 Range = cast<DoStmt>(Term)->getCond()->getSourceRange();
979 Range = cast<CaseStmt>(Term)->getLHS()->getSourceRange();
984 Range = cast<DefaultStmt>(Term)->getDefaultLoc();
989 << VD->getDeclName() << IsCapturedByBlock << DiagKind
990 << Str << I->Output << Range;
991 S.Diag(User->getBeginLoc(), diag::note_uninit_var_use)
992 << IsCapturedByBlock << User->getSourceRange();
993 if (RemoveDiagKind != -1)
995 << RemoveDiagKind << Str << I->Output << Fixit1 << Fixit2;
1001 S.Diag(Use.getUser()->getBeginLoc(), diag::warn_maybe_uninit_var)
1002 << VD->getDeclName() << IsCapturedByBlock
1003 << Use.getUser()->getSourceRange();
1008 const UninitUse &Use) {
1009 S.Diag(Use.getUser()->getBeginLoc(), diag::warn_uninit_const_reference)
1010 << VD->getDeclName() << Use.getUser()->getSourceRange();
1014 /// DiagnoseUninitializedUse -- Helper function for diagnosing uses of an
1016 /// emitted for particular types of uses. Returns true if the use was diagnosed
1017 /// as a warning. If a particular use is one we omit warnings for, returns
1020 const UninitUse &Use,
1022 if (const DeclRefExpr *DRE = dyn_cast<DeclRefExpr>(Use.getUser())) {
1025 // specialized diagnostics for self-initialization, and we
1034 if (const Expr *Initializer = VD->getInit()) {
1035 if (!alwaysReportSelfInit && DRE == Initializer->IgnoreParenImpCasts())
1041 S.Diag(DRE->getBeginLoc(), diag::warn_uninit_self_reference_in_init)
1042 << VD->getDeclName() << VD->getLocation() << DRE->getSourceRange();
1047 DiagUninitUse(S, VD, Use, false);
1049 const BlockExpr *BE = cast<BlockExpr>(Use.getUser());
1050 if (VD->getType()->isBlockPointerType() && !VD->hasAttr<BlocksAttr>())
1051 S.Diag(BE->getBeginLoc(),
1053 << VD->getDeclName()
1054 << VD->getType().getQualifiers().hasObjCLifetime();
1056 DiagUninitUse(S, VD, Use, true);
1059 // Report where the variable was declared when the use wasn't within
1063 S.Diag(VD->getBeginLoc(), diag::note_var_declared_here)
1064 << VD->getDeclName();
1095 ReachableBlocks.insert(&Cfg->getEntry());
1096 BlockQueue.push_back(&Cfg->getEntry());
1099 // These blocks can contain fall-through annotations, and we don't want to
1102 const Stmt *L = B->getLabel();
1110 for (const CFGBlock *B : P->succs()) {
1130 const Stmt *Term = P->getTerminatorStmt();
1134 const SwitchCase *SW = dyn_cast_or_null<SwitchCase>(P->getLabel());
1135 if (SW && SW->getSubStmt() == B.getLabel() && P->begin() == P->end())
1138 const LabelStmt *L = dyn_cast_or_null<LabelStmt>(P->getLabel());
1139 if (L && L->getSubStmt() == B.getLabel() && P->begin() == P->end())
1145 if (const AttributedStmt *AS = asFallThroughAttr(CS->getStmt())) {
1150 S.Diag(AS->getBeginLoc(),
1179 std::copy(P->pred_begin(), P->pred_end(),
1210 for (const auto C : zip(LE->captures(), LE->capture_inits()))
1219 if (hasSpecificAttr<FallThroughAttr>(AS->getAttrs()))
1230 return CS->getStmt();
1234 if (const SwitchCase *SW = dyn_cast_or_null<SwitchCase>(B.getLabel()))
1235 if (!isa<SwitchCase>(SW->getSubStmt()))
1236 return SW->getSubStmt();
1301 const Stmt *Label = B->getLabel();
1310 IsTemplateInstantiation = Function->isTemplateInstantiation();
1315 S.Diag(Label->getBeginLoc(),
1320 SourceLocation L = Label->getBeginLoc();
1324 const Stmt *Term = B->getTerminatorStmt();
1326 while (B->empty() && !Term && B->succ_size() == 1) {
1327 B = *B->succ_begin();
1328 Term = B->getTerminatorStmt();
1330 if (!(B->empty() && isa_and_nonnull<BreakStmt>(Term))) {
1345 S.Diag(F->getBeginLoc(), diag::err_fallthrough_attr_invalid_placement);
1348 static bool isInLoop(const ASTContext &Ctx, const ParentMap &PM,
1353 switch (S->getStmtClass()) {
1361 if (!cast<DoStmt>(S)->getCond()->EvaluateAsInt(Result, Ctx))
1368 } while ((S = PM.getParent(S)));
1376 const ParentMap &PM) {
1385 const WeakObjectUseMap &WeakMap = CurFn->getWeakObjectUses();
1391 const WeakUseVector &Uses = I->second;
1396 if (UI->isUnsafe())
1406 // loop if the base object is a local variable -- local variables are often
1411 if (UI2->isUnsafe())
1415 if (!isInLoop(Ctx, PM, UI->getUseExpr()))
1418 const WeakObjectProfileTy &Profile = I->first;
1428 if (BaseVar->hasLocalStorage() && !isa<ParmVarDecl>(Base))
1433 UsesByStmt.push_back(StmtUsesPair(UI->getUseExpr(), I));
1439 // Sort by first use so that we emit the warnings in a deterministic order.
1443 return SM.isBeforeInTranslationUnit(LHS.first->getBeginLoc(),
1444 RHS.first->getBeginLoc());
1450 // FIXME: Should we use a common classification enum and the same set of
1471 const WeakObjectProfileTy &Key = P.second->first;
1472 const WeakUseVector &Uses = P.second->second;
1476 // properties. We can only be 100% sure of a repeated use in certain cases,
1510 if (Prop->hasAttr<IBOutletAttr>())
1514 S.Diag(FirstRead->getBeginLoc(), DiagKind)
1516 << FirstRead->getSourceRange();
1519 for (const auto &Use : Uses) {
1520 if (Use.getUseExpr() == FirstRead)
1522 S.Diag(Use.getUseExpr()->getBeginLoc(),
1524 << Use.getUseExpr()->getSourceRange();
1572 const UninitUse &use) override {
1573 getUses(uses, vd).getPointer()->push_back(use);
1577 const UninitUse &use) override {
1578 getUses(constRefUses, vd).getPointer()->push_back(use);
1595 // variable, but the root cause is an idiomatic self-init. We want
1596 // to report the diagnostic at the self-init since that is the root cause.
1597 if (!vec->empty() && hasSelfInit && hasAlwaysUninitializedUse(vec))
1599 UninitUse(vd->getInit()->IgnoreParenCasts(),
1610 return a.getUser()->getBeginLoc() < b.getUser()->getBeginLoc();
1614 // If we have self-init, downgrade all uses to 'may be uninitialized'.
1615 UninitUse Use = hasSelfInit ? UninitUse(U.getUser(), false) : U;
1617 if (DiagnoseUninitializedUse(S, vd, Use))
1638 if (!vec->empty() && hasSelfInit && hasAlwaysUninitializedUse(vec))
1640 UninitUse(vd->getInit()->IgnoreParenCasts(),
1667 /// Inter-procedural data for the called-once checker.
1702 S.Diag(Call->getBeginLoc(), DiagToReport) << Parameter;
1703 S.Diag(PrevCall->getBeginLoc(), diag::note_called_once_gets_called_twice)
1712 S.Diag(Parameter->getBeginLoc(), DiagToReport)
1723 PartialDiagnosticAt Warning(Where->getBeginLoc(), S.PDiag(DiagToReport)
1742 S.Diag(Where->getBeginLoc(), DiagToReport)
1790 //===----------------------------------------------------------------------===//
1791 // -Wthread-safety
1792 //===----------------------------------------------------------------------===//
1806 PartialDiagnosticAt FNote(CurrentFunction->getBody()->getBeginLoc(),
1817 PartialDiagnosticAt FNote(CurrentFunction->getBody()->getBeginLoc(),
1831 PartialDiagnosticAt FNote(CurrentFunction->getBody()->getBeginLoc(),
1999 PartialDiagnosticAt VNote(D->getLocation(),
2001 << D->getDeclName());
2033 PartialDiagnosticAt Note(D->getLocation(),
2088 //===----------------------------------------------------------------------===//
2089 // -Wconsumed
2090 //===----------------------------------------------------------------------===//
2181 //===----------------------------------------------------------------------===//
2183 //===----------------------------------------------------------------------===//
2188 bool SuggestSuggestions; // Recommend -fsafe-buffer-usage-suggestions?
2198 auto PutInQuotes = [](StringRef S) -> std::string {
2205 VarNames.push_back(V->getName());
2214 const unsigned N = VarNames.size() -
2235 Loc = ASE->getBase()->getExprLoc();
2236 Range = ASE->getBase()->getSourceRange();
2239 BinaryOperator::Opcode Op = BO->getOpcode();
2242 if (BO->getRHS()->getType()->isIntegerType()) {
2243 Loc = BO->getLHS()->getExprLoc();
2244 Range = BO->getLHS()->getSourceRange();
2246 Loc = BO->getRHS()->getExprLoc();
2247 Range = BO->getRHS()->getSourceRange();
2252 UnaryOperator::Opcode Op = UO->getOpcode();
2255 Loc = UO->getSubExpr()->getExprLoc();
2256 Range = UO->getSubExpr()->getSourceRange();
2265 QualType destType = ECE->getType();
2270 Ctx.getTypeSize(destType.getTypePtr()->getPointeeType());
2272 QualType srcType = ECE->getSubExpr()->getType();
2274 Ctx.getTypeSize(srcType.getTypePtr()->getPointeeType());
2280 Loc = Operation->getBeginLoc();
2281 Range = Operation->getSourceRange();
2305 Loc = CtorExpr->getLocation();
2321 S.Diag(Variable->getLocation(), diag::warn_unsafe_buffer_variable)
2322 << Variable << (Variable->getType()->isPointerType() ? 0 : 1)
2323 << Variable->getSourceRange();
2326 "Fix-its are generated only for `NamedDecl`s");
2330 // NOT explain how the variables are grouped as the reason is non-trivial
2346 S.Diag(Variable->getLocation(),
2374 // `WSSuffix` holds customized "white-space"s, e.g., newline or whilespace
2391 // The returned macro (it returns) is guaranteed not to be function-like:
2400 //===----------------------------------------------------------------------===//
2401 // AnalysisBasedWarnings - Worker object used by Sema to execute analysis-based
2403 //===----------------------------------------------------------------------===//
2420 /// re-building CFG for blocks and re-analyzing them when we do have all the
2422 /// ill-designed.
2460 for (const auto &D : fscope->PossiblyUnreachableDiags)
2475 if (cast<DeclContext>(Node)->isDependentContext())
2477 // `FunctionDecl->hasBody()` returns true if the function has a body
2479 // child. So we use `doesThisDeclarationHaveABody`:
2480 if (Node->doesThisDeclarationHaveABody())
2486 if (cast<DeclContext>(Node)->isDependentContext())
2493 if (cast<DeclContext>(Node)->isDependentContext())
2495 if (Node->hasBody())
2501 return VisitFunctionDecl(Node->getCallOperator());
2532 auto CallAnalyzers = [&](const Decl *Node) -> void {
2535 Node->getBeginLoc()) ||
2537 Node->getBeginLoc()) ||
2539 Node->getBeginLoc())) {
2546 // Emit per-function analysis-based warnings that require the whole-TU
2560 // We avoid doing analysis-based warnings when there are errors for
2571 S.SourceMgr.isInSystemHeader(D->getLocation())))
2575 if (cast<DeclContext>(D)->isDependentContext())
2584 const Stmt *Body = D->getBody();
2624 if (LogicalErrorHandler::hasActiveDiagnostics(Diags, D->getBeginLoc())) {
2630 if (!fscope->PossiblyUnreachableDiags.empty()) {
2634 for (const auto &D : fscope->PossiblyUnreachableDiags) {
2641 for (const auto &D : fscope->PossiblyUnreachableDiags) {
2647 // FIXME: We should be able to assert that block is non-null, but
2648 // the CFG analysis can skip potentially-evaluated expressions in
2649 // edge cases; see test/Sema/vla-2.c.
2652 if (!cra->isReachable(&AC.getCFG()->getEntry(), block)) {
2676 cast<CXXMethodDecl>(D)->getOverloadedOperator() == OO_Call &&
2677 cast<CXXMethodDecl>(D)->getParent()->isLambda())
2679 : (fscope->isCoroutine()
2687 // Only check for unreachable code on non-template instantiations.
2688 // Different template instantiations can effectively change the control-flow
2693 isTemplateInstantiation = Function->isTemplateInstantiation();
2700 SourceLocation FL = AC.getDecl()->getLocation();
2701 SourceLocation FEL = AC.getDecl()->getEndLoc();
2703 if (!Diags.isIgnored(diag::warn_thread_safety_beta, D->getBeginLoc()))
2705 if (!Diags.isIgnored(diag::warn_thread_safety_verbose, D->getBeginLoc()))
2720 if (!Diags.isIgnored(diag::warn_uninit_var, D->getBeginLoc()) ||
2721 !Diags.isIgnored(diag::warn_sometimes_uninit_var, D->getBeginLoc()) ||
2722 !Diags.isIgnored(diag::warn_maybe_uninit_var, D->getBeginLoc()) ||
2723 !Diags.isIgnored(diag::warn_uninit_const_reference, D->getBeginLoc())) {
2747 shouldAnalyzeCalledOnceParameters(Diags, D->getBeginLoc())) {
2749 CalledOnceCheckReporter Reporter(S, IPData->CalledOnceData);
2752 shouldAnalyzeCalledOnceConventions(Diags, D->getBeginLoc()));
2757 !Diags.isIgnored(diag::warn_unannotated_fallthrough, D->getBeginLoc());
2759 diag::warn_unannotated_fallthrough_per_function, D->getBeginLoc());
2761 fscope->HasFallthroughStmt) {
2766 !Diags.isIgnored(diag::warn_arc_repeated_use_of_weak, D->getBeginLoc()))
2770 // Check for infinite self-recursion in functions
2772 D->getBeginLoc())) {
2778 // Check for throw out of non-throwing function.
2779 if (!Diags.isIgnored(diag::warn_throw_in_noexcept_func, D->getBeginLoc()))
2781 if (S.getLangOpts().CPlusPlus && !fscope->isCoroutine() && isNoexcept(FD))
2786 if (LogicalErrorHandler::hasActiveDiagnostics(Diags, D->getBeginLoc())) {
2796 NumCFGBlocks += cfg->getNumBlockIDs();
2798 cfg->getNumBlockIDs());
2808 unsigned NumCFGsBuilt = NumFunctionsAnalyzed - NumFunctionsWithBadCFGs;