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

Peter Szecsi via Phabricator via cfe-commits cfe-commits at lists.llvm.org
Wed Apr 25 09:34:41 PDT 2018


szepet updated this revision to Diff 143949.
szepet marked 2 inline comments as done.
szepet added a comment.

Changes made based on comments.
The CFG recreating problem is handled the following (only for this check):
Always store the last visited function and its CFG* (in form of the Sequence*) and check if we are visiting it again. If so, then the check reuses the previous one, if not, then replaces them. As far as I know the AST traverse done by the tidy fits this model (at least for this check, since it not uses narrowing matchers to other functions).
Sure, it would be better to find a general solution to this problem, and make the CFG reusable by every check which needs it, but I would left it for a follow-up (and a change like this probably would worth an own patch/review anyway).


https://reviews.llvm.org/D40937

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

-------------- next part --------------
A non-text attachment was scrubbed...
Name: D40937.143949.patch
Type: text/x-patch
Size: 15946 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/cfe-commits/attachments/20180425/1718c822/attachment-0001.bin>


More information about the cfe-commits mailing list