clang-tools 19.0.0git
Classes | Typedefs | Functions | Variables
clang::tidy::bugprone::filter::relatedness_heuristic Namespace Reference

This namespace contains the implementations for the suppression of diagnostics from similarly-used ("related") parameters. More...

Classes

class  AccessedSameMemberOf
 Implements the heuristic that marks two parameters related if the same member is accessed (referred to) inside the current function's body. More...
 
class  AppearsInSameExpr
 Implements the heuristic that marks two parameters related if there is a usage for both in the same strict expression subtree. More...
 
class  PassedToSameFunction
 Implements the heuristic that marks two parameters related if there are two separate calls to the same function (overload) and the parameters are passed to the same index in both calls, i.e f(a, b) and f(a, c) passes b and c to the same index (2) of f(), marking them related. More...
 
class  Returned
 Implements the heuristic that marks two parameters related if different ReturnStmts return them from the function. More...
 

Typedefs

template<typename T , std::size_t N = SmallDataStructureSize>
using ParamToSmallSetMap = llvm::DenseMap< const ParmVarDecl *, llvm::SmallSet< T, N > >
 

Functions

template<typename MapTy , typename ElemTy >
bool lazyMapOfSetsIntersectionExists (const MapTy &Map, const ElemTy &E1, const ElemTy &E2)
 Returns whether the sets mapped to the two elements in the map have at least one element in common.
 

Variables

static constexpr std::size_t SmallDataStructureSize = 4
 

Detailed Description

This namespace contains the implementations for the suppression of diagnostics from similarly-used ("related") parameters.

Typedef Documentation

◆ ParamToSmallSetMap

template<typename T , std::size_t N = SmallDataStructureSize>
using clang::tidy::bugprone::filter::relatedness_heuristic::ParamToSmallSetMap = typedef llvm::DenseMap<const ParmVarDecl *, llvm::SmallSet<T, N> >

Definition at line 1570 of file EasilySwappableParametersCheck.cpp.

Function Documentation

◆ lazyMapOfSetsIntersectionExists()

template<typename MapTy , typename ElemTy >
bool clang::tidy::bugprone::filter::relatedness_heuristic::lazyMapOfSetsIntersectionExists ( const MapTy &  Map,
const ElemTy &  E1,
const ElemTy &  E2 
)

Variable Documentation

◆ SmallDataStructureSize

constexpr std::size_t clang::tidy::bugprone::filter::relatedness_heuristic::SmallDataStructureSize = 4
staticconstexpr

Definition at line 1567 of file EasilySwappableParametersCheck.cpp.