clang-tools 22.0.0git
|
A check for detecting if/else if/else chains where two or more branches are Type I clones of each other (that is, they contain identical code), for detecting switch statements where two or more consecutive branches are Type I clones of each other, and for detecting conditional operators where the true and false expressions are Type I clones of each other. More...
#include <BranchCloneCheck.h>
Public Member Functions | |
BranchCloneCheck (StringRef Name, ClangTidyContext *Context) | |
void | registerMatchers (ast_matchers::MatchFinder *Finder) override |
void | check (const ast_matchers::MatchFinder::MatchResult &Result) override |
std::optional< TraversalKind > | getCheckTraversalKind () const override |
A check for detecting if/else if/else chains where two or more branches are Type I clones of each other (that is, they contain identical code), for detecting switch statements where two or more consecutive branches are Type I clones of each other, and for detecting conditional operators where the true and false expressions are Type I clones of each other.
For the user-facing documentation see: https://clang.llvm.org/extra/clang-tidy/checks/bugprone/branch-clone.html
Definition at line 24 of file BranchCloneCheck.h.
|
inline |
Definition at line 26 of file BranchCloneCheck.h.
|
override |
Definition at line 313 of file BranchCloneCheck.cpp.
References clang::tidy::utils::areStatementsIdentical(), areSwitchBranchesIdentical(), isFallthroughSwitchBranch(), and clang::tidy::bugprone::isIdenticalStmt().
|
inlineoverride |
Definition at line 30 of file BranchCloneCheck.h.
|
override |
Definition at line 96 of file BranchCloneCheck.cpp.