clang-tools 20.0.0git
Namespaces | Classes | Functions
clang::tidy::bugprone::filter Namespace Reference

Namespaces

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

Classes

class  SimilarlyUsedParameterPairSuppressor
 Helper class that is used to detect if two parameters of the same function are used in a similar fashion, to suppress the result. More...
 

Functions

static bool isIgnoredParameter (const TheCheck &Check, const ParmVarDecl *Node)
 Returns whether the parameter's name or the parameter's type's name is configured by the user to be ignored from analysis and diagnostic.
 
static bool isSimilarlyUsedParameter (const SimilarlyUsedParameterPairSuppressor &Suppressor, const ParmVarDecl *Param1, const ParmVarDecl *Param2)
 
static bool prefixSuffixCoverUnderThreshold (std::size_t Threshold, StringRef Str1, StringRef Str2)
 Returns whether the two strings are prefixes or suffixes of each other with at most Threshold characters differing on the non-common end.
 
static void padStringAtEnd (SmallVectorImpl< char > &Str, std::size_t ToLen)
 
static void padStringAtBegin (SmallVectorImpl< char > &Str, std::size_t ToLen)
 
static bool isCommonPrefixWithoutSomeCharacters (std::size_t N, StringRef S1, StringRef S2)
 
static bool isCommonSuffixWithoutSomeCharacters (std::size_t N, StringRef S1, StringRef S2)
 

Function Documentation

◆ isCommonPrefixWithoutSomeCharacters()

static bool clang::tidy::bugprone::filter::isCommonPrefixWithoutSomeCharacters ( std::size_t  N,
StringRef  S1,
StringRef  S2 
)
static

◆ isCommonSuffixWithoutSomeCharacters()

static bool clang::tidy::bugprone::filter::isCommonSuffixWithoutSomeCharacters ( std::size_t  N,
StringRef  S1,
StringRef  S2 
)
static

◆ isIgnoredParameter()

static bool clang::tidy::bugprone::filter::isIgnoredParameter ( const TheCheck Check,
const ParmVarDecl *  Node 
)
static

Returns whether the parameter's name or the parameter's type's name is configured by the user to be ignored from analysis and diagnostic.

Definition at line 1510 of file EasilySwappableParametersCheck.cpp.

References E, and Node.

Referenced by clang::tidy::bugprone::model::modelMixingRange().

◆ isSimilarlyUsedParameter()

static bool clang::tidy::bugprone::filter::isSimilarlyUsedParameter ( const SimilarlyUsedParameterPairSuppressor Suppressor,
const ParmVarDecl *  Param1,
const ParmVarDecl *  Param2 
)
inlinestatic

Definition at line 1814 of file EasilySwappableParametersCheck.cpp.

◆ padStringAtBegin()

static void clang::tidy::bugprone::filter::padStringAtBegin ( SmallVectorImpl< char > &  Str,
std::size_t  ToLen 
)
static

◆ padStringAtEnd()

static void clang::tidy::bugprone::filter::padStringAtEnd ( SmallVectorImpl< char > &  Str,
std::size_t  ToLen 
)
static

◆ prefixSuffixCoverUnderThreshold()

static bool clang::tidy::bugprone::filter::prefixSuffixCoverUnderThreshold ( std::size_t  Threshold,
StringRef  Str1,
StringRef  Str2 
)
static

Returns whether the two strings are prefixes or suffixes of each other with at most Threshold characters differing on the non-common end.

Definition at line 1847 of file EasilySwappableParametersCheck.cpp.

References isCommonPrefixWithoutSomeCharacters(), isCommonSuffixWithoutSomeCharacters(), padStringAtBegin(), and padStringAtEnd().

Referenced by clang::tidy::bugprone::model::modelMixingRange().