gribozavr2 accepted this revision. gribozavr2 added inline comments. This revision is now accepted and ready to land.
================ Comment at: clang-tools-extra/clang-tidy/bugprone/InfiniteLoopCheck.cpp:159 + llvm::SmallSet<const Decl *, 16> &Callees) { + if (const CallExpr *Call = dyn_cast<CallExpr>(StmtNode)) { + const Decl *Callee = Call->getDirectCallee(); ---------------- Eugene.Zelenko wrote: > `auto` could be used, because type is spelled in same statement. Please clang-format before submitting (it looks like this block is indented 4 instead of 2). ================ Comment at: clang-tools-extra/clang-tidy/bugprone/InfiniteLoopCheck.cpp:184-185 + const Decl *Func) { + bool containsFunc = false; + bool overlap = false; + ---------------- ================ Comment at: clang-tools-extra/clang-tidy/bugprone/InfiniteLoopCheck.cpp:188-191 + const Decl *CanoDecl = GNode->getDecl()->getCanonicalDecl(); + + containsFunc |= (CanoDecl == Func); + overlap |= Callees.contains(CanoDecl); ---------------- Canonical => Can is the usual abbreviation, if you want to use one (e.g., see CanQualType) ================ Comment at: clang-tools-extra/clang-tidy/bugprone/InfiniteLoopCheck.cpp:198-199 + +/// returns true iff `Cond` involves at least one static local variable. +static bool hasStaticLocalVariable(const Stmt *Cond) { + if (const DeclRefExpr *DRE = dyn_cast<DeclRefExpr>(Cond)) ---------------- ================ Comment at: clang-tools-extra/clang-tidy/bugprone/InfiniteLoopCheck.cpp:210 + +/// Tests if the loop `Cond` involves static local variables and +/// the enclosing function `Func` is recursive. ---------------- `Cond` is not the loop itself. Repository: rG LLVM Github Monorepo CHANGES SINCE LAST ACTION https://reviews.llvm.org/D128401/new/ https://reviews.llvm.org/D128401 _______________________________________________ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits