[PATCH] D130181: [clang-tidy] Add readability-use-early-exits check

Nathan James via Phabricator via cfe-commits cfe-commits at lists.llvm.org
Wed Jul 20 09:32:49 PDT 2022


njames93 created this revision.
njames93 added reviewers: alexfh, aaron.ballman.
Herald added subscribers: carlosgalvezp, xazax.hun, mgorny.
Herald added a project: All.
njames93 requested review of this revision.
Herald added a project: clang-tools-extra.
Herald added a subscriber: cfe-commits.

Add a check to flag loops and functions where an `if` at the end of the body could be negated and made into an early exit.


Repository:
  rG LLVM Github Monorepo

https://reviews.llvm.org/D130181

Files:
  clang-tools-extra/clang-tidy/readability/CMakeLists.txt
  clang-tools-extra/clang-tidy/readability/ReadabilityTidyModule.cpp
  clang-tools-extra/clang-tidy/readability/UseEarlyExitsCheck.cpp
  clang-tools-extra/clang-tidy/readability/UseEarlyExitsCheck.h
  clang-tools-extra/docs/ReleaseNotes.rst
  clang-tools-extra/docs/clang-tidy/checks/list.rst
  clang-tools-extra/docs/clang-tidy/checks/readability/use-early-exits.rst
  clang-tools-extra/test/clang-tidy/checkers/readability/use-early-exits.cpp

-------------- next part --------------
A non-text attachment was scrubbed...
Name: D130181.446180.patch
Type: text/x-patch
Size: 17992 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/cfe-commits/attachments/20220720/3cfee4d8/attachment.bin>


More information about the cfe-commits mailing list