[PATCH] D40937: [clang-tidy] Infinite loop checker

Peter Szecsi via Phabricator via cfe-commits cfe-commits at lists.llvm.org
Wed Dec 6 17:49:20 PST 2017


szepet created this revision.
Herald added subscribers: rnkovacs, baloghadamsoftware, whisperity, mgorny.

The checker aims to find loops where none of the condition variables are updated in the body. 
In this version it only works on integer types but the final aim is to make it work for objects as well. (via checking non-const method calls, etc)

Note: this kind of check is supported by clang warning as well (-Wfor-loop-analysis), however, it only works on for-loops and not investigate escape statements (modification via alias generates false positives e.g.  `escape_before1()` test case).

Any suggestions on the checker are welcome!


https://reviews.llvm.org/D40937

Files:
  clang-tidy/misc/CMakeLists.txt
  clang-tidy/misc/InfiniteLoopCheck.cpp
  clang-tidy/misc/InfiniteLoopCheck.h
  clang-tidy/misc/MiscTidyModule.cpp
  docs/ReleaseNotes.rst
  docs/clang-tidy/checks/list.rst
  docs/clang-tidy/checks/misc-infinite-loop.rst
  test/clang-tidy/misc-infinite-loop.cpp

-------------- next part --------------
A non-text attachment was scrubbed...
Name: D40937.125862.patch
Type: text/x-patch
Size: 15154 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/cfe-commits/attachments/20171207/b303d956/attachment.bin>


More information about the cfe-commits mailing list