clang-tools 19.0.0git
Public Member Functions | List of all members
clang::tidy::bugprone::filter::relatedness_heuristic::AppearsInSameExpr Class Reference

Implements the heuristic that marks two parameters related if there is a usage for both in the same strict expression subtree. More...

Inheritance diagram for clang::tidy::bugprone::filter::relatedness_heuristic::AppearsInSameExpr:
Inheritance graph
[legend]

Public Member Functions

void setup (const FunctionDecl *FD)
 
bool operator() (const ParmVarDecl *Param1, const ParmVarDecl *Param2) const
 
bool TraverseDecl (Decl *D)
 
bool TraverseStmt (Stmt *S, DataRecursionQueue *Queue=nullptr)
 
bool VisitDeclRefExpr (DeclRefExpr *DRE)
 

Detailed Description

Implements the heuristic that marks two parameters related if there is a usage for both in the same strict expression subtree.

A strict expression subtree is a tree which only includes Expr nodes, i.e. no Stmts and no Decls.

Definition at line 1594 of file EasilySwappableParametersCheck.cpp.

Member Function Documentation

◆ operator()()

bool clang::tidy::bugprone::filter::relatedness_heuristic::AppearsInSameExpr::operator() ( const ParmVarDecl *  Param1,
const ParmVarDecl *  Param2 
) const
inline

◆ setup()

void clang::tidy::bugprone::filter::relatedness_heuristic::AppearsInSameExpr::setup ( const FunctionDecl *  FD)
inline

◆ TraverseDecl()

bool clang::tidy::bugprone::filter::relatedness_heuristic::AppearsInSameExpr::TraverseDecl ( Decl D)
inline

Definition at line 1614 of file EasilySwappableParametersCheck.cpp.

◆ TraverseStmt()

bool clang::tidy::bugprone::filter::relatedness_heuristic::AppearsInSameExpr::TraverseStmt ( Stmt *  S,
DataRecursionQueue *  Queue = nullptr 
)
inline

Definition at line 1619 of file EasilySwappableParametersCheck.cpp.

References E.

◆ VisitDeclRefExpr()

bool clang::tidy::bugprone::filter::relatedness_heuristic::AppearsInSameExpr::VisitDeclRefExpr ( DeclRefExpr *  DRE)
inline

Definition at line 1640 of file EasilySwappableParametersCheck.cpp.


The documentation for this class was generated from the following file: