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

Namespaces

 relatedness_heuristic
 This namespace contains the implementations for the suppression of diagnostics from similaly 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. More...
 
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. More...
 
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 1499 of file EasilySwappableParametersCheck.cpp.

◆ isSimilarlyUsedParameter()

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

Definition at line 1805 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 1838 of file EasilySwappableParametersCheck.cpp.

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