|
clang-tools 22.0.0git
|
Functions | |
| LLVM_ENABLE_BITMASK_ENUMS_IN_NAMESPACE () | |
| static bool | hasFlag (MixFlags Data, MixFlags SearchedFlag) |
| Returns whether the SearchedFlag is turned on in the Data. | |
| static std::string | formatMixFlags (MixFlags F) |
| Formats the MixFlags enum into a useful, user-readable representation. | |
| static MixData | isLRefEquallyBindingToType (const TheCheck &Check, const LValueReferenceType *LRef, QualType Ty, const ASTContext &Ctx, bool IsRefRHS, ImplicitConversionModellingMode ImplicitMode) |
| Calculates if the reference binds an expression of the given type. | |
| static MixData | approximateImplicitConversion (const TheCheck &Check, QualType LType, QualType RType, const ASTContext &Ctx, ImplicitConversionModellingMode ImplicitMode) |
| Returns whether an expression of LType can be used in an RType context, as per the implicit conversion rules. | |
| static bool | isUselessSugar (const Type *T) |
| static NonCVRQualifiersResult | getNonCVRQualifiers (const ASTContext &Ctx, QualType LType, QualType RType) |
| Returns if the two types are qualified in a way that ever after equating or removing local CVR qualification, even if the unqualified types would mix, the qualified ones don't, because there are some other local qualifiers that aren't equal. | |
| static MixData | calculateMixability (const TheCheck &Check, QualType LType, QualType RType, const ASTContext &Ctx, ImplicitConversionModellingMode ImplicitMode) |
| Approximate the way how LType and RType might refer to "essentially the
same" type, in a sense that at a particular call site, an expression of type LType and RType might be successfully passed to a variable (in our specific case, a parameter) of type RType and LType, respectively. | |
| static bool | isDerivedToBase (const CXXRecordDecl *Derived, const CXXRecordDecl *Base) |
| static std::optional< QualType > | approximateStandardConversionSequence (const TheCheck &Check, QualType From, QualType To, const ASTContext &Ctx) |
| static std::optional< ConversionSequence > | tryConversionOperators (const TheCheck &Check, const CXXRecordDecl *RD, QualType ToType) |
| static std::optional< ConversionSequence > | tryConvertingConstructors (const TheCheck &Check, QualType FromType, const CXXRecordDecl *RD) |
| static MixableParameterRange | modelMixingRange (const TheCheck &Check, const FunctionDecl *FD, std::size_t StartIndex, const filter::SimilarlyUsedParameterPairSuppressor &UsageBasedSuppressor) |
|
static |
Returns whether an expression of LType can be used in an RType context, as per the implicit conversion rules.
Note: the result of this operation, unlike that of calculateMixability, is NOT symmetric.
Definition at line 1310 of file EasilySwappableParametersCheck.cpp.
References approximateImplicitConversion(), approximateStandardConversionSequence(), tryConversionOperators(), and tryConvertingConstructors().
Referenced by approximateImplicitConversion(), and calculateMixability().
|
static |
Definition at line 964 of file EasilySwappableParametersCheck.cpp.
References calculateMixability(), hasFlag(), and isDerivedToBase().
Referenced by approximateImplicitConversion().
|
static |
Approximate the way how LType and RType might refer to "essentially the same" type, in a sense that at a particular call site, an expression of type LType and RType might be successfully passed to a variable (in our specific case, a parameter) of type RType and LType, respectively.
Note the swapped order!
The returned data structure is not guaranteed to be properly set, as this function is potentially recursive. It is the caller's responsibility to call sanitize() on the result once the recursion is over.
Definition at line 653 of file EasilySwappableParametersCheck.cpp.
References approximateImplicitConversion(), calculateMixability(), getNonCVRQualifiers(), hasFlag(), isLRefEquallyBindingToType(), isUselessSugar(), and clang::tidy::bugprone::EasilySwappableParametersCheck::QualifiersMix.
Referenced by approximateStandardConversionSequence(), calculateMixability(), isLRefEquallyBindingToType(), and modelMixingRange().
|
inlinestatic |
Formats the MixFlags enum into a useful, user-readable representation.
Definition at line 156 of file EasilySwappableParametersCheck.cpp.
References hasFlag().
Referenced by modelMixingRange().
|
static |
Returns if the two types are qualified in a way that ever after equating or removing local CVR qualification, even if the unqualified types would mix, the qualified ones don't, because there are some other local qualifiers that aren't equal.
Definition at line 612 of file EasilySwappableParametersCheck.cpp.
Referenced by calculateMixability().
|
inlinestatic |
Returns whether the SearchedFlag is turned on in the Data.
Definition at line 140 of file EasilySwappableParametersCheck.cpp.
Referenced by approximateStandardConversionSequence(), calculateMixability(), formatMixFlags(), and clang::tidy::bugprone::needsToElaborateImplicitConversion().
|
inlinestatic |
Definition at line 957 of file EasilySwappableParametersCheck.cpp.
Referenced by approximateStandardConversionSequence().
|
static |
Calculates if the reference binds an expression of the given type.
This is true iff 'LRef' is some 'const T &' type, and the 'Ty' is 'T' or 'const T'.
| ImplicitMode | is forwarded in the possible recursive call to calculateMixability. |
Definition at line 901 of file EasilySwappableParametersCheck.cpp.
References calculateMixability().
Referenced by calculateMixability().
|
inlinestatic |
Definition at line 588 of file EasilySwappableParametersCheck.cpp.
Referenced by calculateMixability().
| clang::tidy::bugprone::model::LLVM_ENABLE_BITMASK_ENUMS_IN_NAMESPACE | ( | ) |
|
static |
Definition at line 1423 of file EasilySwappableParametersCheck.cpp.
References calculateMixability(), formatMixFlags(), clang::tidy::bugprone::filter::isIgnoredParameter(), clang::tidy::bugprone::EasilySwappableParametersCheck::ModelImplicitConversions, clang::tidy::bugprone::EasilySwappableParametersCheck::NamePrefixSuffixSilenceDissimilarityThreshold, and clang::tidy::bugprone::filter::prefixSuffixCoverUnderThreshold().
|
static |
Definition at line 1206 of file EasilySwappableParametersCheck.cpp.
Referenced by approximateImplicitConversion().
|
static |
Definition at line 1257 of file EasilySwappableParametersCheck.cpp.
Referenced by approximateImplicitConversion().