clang-tools  14.0.0git
Namespaces | Functions
BranchCloneCheck.cpp File Reference
#include "BranchCloneCheck.h"
#include "clang/AST/ASTContext.h"
#include "clang/ASTMatchers/ASTMatchFinder.h"
#include "clang/Analysis/CloneDetection.h"
#include "clang/Lex/Lexer.h"
#include "llvm/Support/Casting.h"
Include dependency graph for BranchCloneCheck.cpp:

Go to the source code of this file.

Namespaces

 clang
 ===– Representation.cpp - ClangDoc Representation --------—*- C++ -*-===//
 
 clang::tidy
 
 clang::tidy::bugprone
 

Functions

static bool areStatementsIdentical (const Stmt *LHS, const Stmt *RHS, const ASTContext &Context)
 Returns true when the statements are Type I clones of each other. More...
 
static bool areSwitchBranchesIdentical (const SwitchBranch LHS, const SwitchBranch RHS, const ASTContext &Context)
 Determines if the bodies of two branches in a switch statements are Type I clones of each other. More...
 

Function Documentation

◆ areStatementsIdentical()

static bool areStatementsIdentical ( const Stmt *  LHS,
const Stmt *  RHS,
const ASTContext &  Context 
)
static

Returns true when the statements are Type I clones of each other.

Definition at line 20 of file BranchCloneCheck.cpp.

◆ areSwitchBranchesIdentical()

static bool areSwitchBranchesIdentical ( const SwitchBranch  LHS,
const SwitchBranch  RHS,
const ASTContext &  Context 
)
static

Determines if the bodies of two branches in a switch statements are Type I clones of each other.

This function only examines the body of the branch and ignores the case X: or default: at the start of the branch.

Definition at line 37 of file BranchCloneCheck.cpp.