HomePhabricator

[clang-tidy] new check: bugprone-branch-clone

Authored by JonasToth on Dec 5 2018, 1:16 AM.

Description

[clang-tidy] new check: bugprone-branch-clone

Summary:
Implement 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)
and for detecting switch statements where two or more consecutive branches are
Type I clones of each other.

Patch by donat.nagy.

Reviewers: alexfh, hokein, aaron.ballman, JonasToth

Reviewed By: JonasToth

Subscribers: MTC, lebedev.ri, whisperity, xazax.hun, Eugene.Zelenko, mgorny, rnkovacs, dkrupp, Szelethus, gamesh411, cfe-commits

Tags: #clang-tools-extra

Differential Revision: https://reviews.llvm.org/D54757

llvm-svn: 348343

Details

Committed
JonasTothDec 5 2018, 1:16 AM
Reviewer
JonasToth
Differential Revision
D54757: [clang-tidy] new check: bugprone-branch-clone
Parents
rG45562a3aba4e: HowToBuildWithPGO.rst: Fix a few details in the manual steps
Branches
Unknown
Tags
Unknown