clang-tools 18.0.0git
|
Classes | |
class | AvoidConstParamsInDecls |
class | AvoidUnconditionalPreprocessorIfCheck |
Finds code blocks that are constantly enabled or disabled in preprocessor directives by analyzing #if conditions, such as #if 0 and #if 1 , etc. More... | |
class | BracesAroundStatementsCheck |
Checks that bodies of if statements and loops (for , range-for , do-while , and while ) are inside braces. More... | |
class | ConstReturnTypeCheck |
For any function whose return type is const-qualified, suggests removal of the const qualifier from that return type. More... | |
class | ContainerContainsCheck |
Finds usages of container.count() and find() == end() which should be replaced by a call to the container.contains() method introduced in C++20. More... | |
class | ContainerDataPointerCheck |
Checks whether a call to operator[] and & can be replaced with a call to data() . More... | |
class | ContainerSizeEmptyCheck |
Checks whether a call to the size() /length() method can be replaced with a call to empty() . More... | |
class | ConvertMemberFunctionsToStatic |
This check finds C++ class methods than can be made static because they don't use the 'this' pointer. More... | |
class | DeleteNullPointerCheck |
Check whether the 'if' statement is unnecessary before calling 'delete' on a pointer. More... | |
class | DuplicateIncludeCheck |
Find and remove duplicate #include directives. More... | |
class | ElseAfterReturnCheck |
Flags the usages of else after return . More... | |
class | FindUsageOfThis |
class | FunctionCognitiveComplexityCheck |
Checks function Cognitive Complexity metric. More... | |
class | FunctionSizeCheck |
Checks for large functions based on various metrics. More... | |
class | IdentifierLengthCheck |
Warns about identifiers names whose length is too short. More... | |
class | IdentifierNamingCheck |
Checks for identifiers naming style mismatch. More... | |
class | ImplicitBoolConversionCheck |
Checks for use of implicit bool conversions in expressions. More... | |
class | InconsistentDeclarationParameterNameCheck |
Checks for declarations of functions which differ in parameter names. More... | |
class | IsolateDeclarationCheck |
This check diagnoses all DeclStmt's declaring more than one variable and tries to refactor the code to one statement per declaration. More... | |
class | MagicNumbersCheck |
Detects magic numbers, integer and floating point literals embedded in code. More... | |
class | MakeMemberFunctionConstCheck |
Finds non-static member functions that can be made 'const'. More... | |
class | MisleadingIndentationCheck |
Checks the code for dangling else, and possible misleading indentations due to missing braces. More... | |
class | MisplacedArrayIndexCheck |
Warn about unusual array index syntax (index[array] instead of array[index] ). More... | |
class | NamedParameterCheck |
Find functions with unnamed arguments. More... | |
class | NamespaceCommentCheck |
Checks that long namespaces have a closing comment. More... | |
class | NonConstParameterCheck |
Warn when a pointer function parameter can be const. More... | |
class | OperatorsRepresentationCheck |
Enforces consistent token representation for invoked binary, unary and overloaded operators in C++ code. More... | |
class | QualifiedAutoCheck |
Finds variables declared as auto that could be declared as: 'auto*' or 'const auto *' and reference variables declared as: 'const auto &'. More... | |
class | ReadabilityModule |
class | RedundantAccessSpecifiersCheck |
Detects redundant access specifiers inside classes, structs, and unions. More... | |
class | RedundantControlFlowCheck |
Eliminates redundant return statements at the end of a function that returns void . More... | |
class | RedundantDeclarationCheck |
Find redundant variable declarations. More... | |
class | RedundantFunctionPtrDereferenceCheck |
Eliminate redundant dereferences of a function pointer. More... | |
class | RedundantMemberInitCheck |
Finds member initializations that are unnecessary because the same default constructor would be called if they were not present. More... | |
class | RedundantPreprocessorCheck |
This check flags redundant preprocessor directives: nested directives with the same condition. More... | |
class | RedundantSmartptrGetCheck |
Find and remove redundant calls to smart pointer's .get() method. More... | |
class | RedundantStringCStrCheck |
Finds unnecessary calls to std::string::c_str() . More... | |
class | RedundantStringInitCheck |
Finds unnecessary string initializations. More... | |
class | ReferenceToConstructedTemporaryCheck |
Detects C++ code where a reference variable is used to extend the lifetime of a temporary object that has just been constructed. More... | |
class | SimplifyBooleanExprCheck |
Looks for boolean expressions involving boolean constants and simplifies them to use the appropriate boolean expression directly. More... | |
class | SimplifySubscriptExprCheck |
Simplifies subscript expressions. More... | |
class | StaticAccessedThroughInstanceCheck |
Checks for member expressions that access static members through instances and replaces them with uses of the appropriate qualified-id. More... | |
class | StaticDefinitionInAnonymousNamespaceCheck |
Finds static function and variable definitions in anonymous namespace. More... | |
class | StringCompareCheck |
This check flags all calls compare when used to check for string equality or inequality. More... | |
class | SuspiciousCallArgumentCheck |
Finds function calls where the arguments passed are provided out of order, based on the difference between the argument name and the parameter names of the function. More... | |
class | UniqueptrDeleteReleaseCheck |
Flags statements of the form delete <unique_ptr expr>.release(); and replaces them with: <unique_ptr expr> = nullptr; More... | |
class | UppercaseLiteralSuffixCheck |
Detects when the integral literal or floating point literal has non-uppercase suffix, and suggests to make the suffix uppercase. More... | |
class | UseAnyOfAllOfCheck |
Finds ranged-based for loops that can be replaced by a call to std::any_of or std::all_of. More... | |
Enumerations | |
enum | StyleKind : int { SK_Count , SK_Invalid } |
enum | UsageKind { Unused , Const , NonConst } |
Functions | |
static tok::TokenKind | getTokenKind (SourceLocation Loc, const SourceManager &SM, const ASTContext *Context) |
static SourceLocation | forwardSkipWhitespaceAndComments (SourceLocation Loc, const SourceManager &SM, const ASTContext *Context) |
static SourceLocation | findEndLocation (const Stmt &S, const SourceManager &SM, const ASTContext *Context) |
static std::optional< Token > | findConstToRemove (const FunctionDecl *Def, const MatchFinder::MatchResult &Result) |
static CheckResult | checkDef (const clang::FunctionDecl *Def, const MatchFinder::MatchResult &MatchResult) |
AST_MATCHER (CXXMethodDecl, isStatic) | |
AST_MATCHER (CXXMethodDecl, hasTrivialBody) | |
AST_MATCHER (CXXMethodDecl, isOverloadedOperator) | |
AST_MATCHER (CXXRecordDecl, hasAnyDependentBases) | |
AST_MATCHER (CXXMethodDecl, isTemplate) | |
AST_MATCHER (CXXMethodDecl, isDependentContext) | |
AST_MATCHER (CXXMethodDecl, isInsideMacroDefinition) | |
AST_MATCHER_P (CXXMethodDecl, hasCanonicalDecl, ast_matchers::internal::Matcher< CXXMethodDecl >, InnerMatcher) | |
AST_MATCHER (CXXMethodDecl, usesThis) | |
static StringRef | getStringFromRange (SourceManager &SourceMgr, const LangOptions &LangOpts, SourceRange Range) |
Obtain the original source code text from a SourceRange. | |
static SourceRange | getLocationOfConst (const TypeSourceInfo *TSI, SourceManager &SourceMgr, const LangOptions &LangOpts) |
static SourceLocation | advanceBeyondCurrentLine (const SourceManager &SM, SourceLocation Start, int Offset) |
static const DeclRefExpr * | findUsage (const Stmt *Node, int64_t DeclIdentifier) |
static const DeclRefExpr * | findUsageRange (const Stmt *Node, const llvm::ArrayRef< int64_t > &DeclIdentifiers) |
static const DeclRefExpr * | checkInitDeclUsageInElse (const IfStmt *If) |
static const DeclRefExpr * | checkConditionVarUsageInElse (const IfStmt *If) |
static bool | containsDeclInScope (const Stmt *Node) |
static void | removeElseAndBrackets (DiagnosticBuilder &Diag, ASTContext &Context, const Stmt *Else, SourceLocation ElseLoc) |
static bool | hasPreprocessorBranchEndBetweenLocations (const ElseAfterReturnCheck::ConditionalBranchMap &ConditionalBranchMap, const SourceManager &SM, SourceLocation StartLoc, SourceLocation EndLoc) |
static StringRef | getControlFlowString (const Stmt &Stmt) |
static SourceLocation | findStartOfIndirection (SourceLocation Start, int Indirections, const SourceManager &SM, const LangOptions &LangOpts) |
static bool | isMacroID (SourceRange R) |
static int | countIndirections (const Type *T, int Indirections=0) |
This function counts the number of written indirections for the given Type T . | |
static bool | typeIsMemberPointer (const Type *T) |
static std::optional< std::vector< SourceRange > > | declRanges (const DeclStmt *DS, const SourceManager &SM, const LangOptions &LangOpts) |
This function tries to extract the SourceRanges that make up all declarations in this DeclStmt . | |
static std::optional< std::vector< StringRef > > | collectSourceRanges (llvm::ArrayRef< SourceRange > Ranges, const SourceManager &SM, const LangOptions &LangOpts) |
static std::vector< std::string > | createIsolatedDecls (llvm::ArrayRef< StringRef > Snippets) |
Expects a vector {TypeSnippet, Firstdecl, SecondDecl, ...}. | |
AST_MATCHER (CXXMethodDecl, usesThisAsConst) | |
static SourceLocation | getConstInsertionPoint (const CXXMethodDecl *M) |
static const IfStmt * | getPrecedingIf (const SourceManager &SM, ASTContext *Context, const IfStmt *If) |
static bool | locationsInSameFile (const SourceManager &Sources, SourceLocation Loc1, SourceLocation Loc2) |
static std::optional< std::string > | getNamespaceNameAsWritten (SourceLocation &Loc, const SourceManager &Sources, const LangOptions &LangOpts) |
static StringRef | getOperatorSpelling (SourceLocation Loc, ASTContext &Context) |
static llvm::StringRef | translate (llvm::StringRef Value) |
static bool | isNotOperatorStr (llvm::StringRef Value) |
static bool | isSeparator (char C) noexcept |
static bool | needEscaping (llvm::StringRef Operator) |
static llvm::StringRef | getRepresentation (const std::vector< llvm::StringRef > &Config, llvm::StringRef Traditional, llvm::StringRef Alternative) |
template<typename T > | |
static bool | isAnyOperatorEnabled (const std::vector< llvm::StringRef > &Config, const T &Operators) |
static ClangTidyModuleRegistry::Add< ReadabilityModule > | X ("readability-module", "Adds readability-related checks.") |
AST_MATCHER (FunctionDecl, doesDeclarationForceExternallyVisibleDefinition) | |
static std::vector< StringRef > | removeNamespaces (ArrayRef< StringRef > Names) |
static const CXXConstructExpr * | getConstructExpr (const CXXCtorInitializer &CtorInit) |
static std::optional< SourceRange > | getConstructExprArgRange (const CXXConstructExpr &Construct) |
static bool | needsParensAfterUnaryNegation (const Expr *E) |
static StringRef | negatedOperator (const BinaryOperator *BinOp) |
static StringRef | getOperatorName (OverloadedOperatorKind OpKind) |
static StringRef | negatedOperator (const CXXOperatorCallExpr *OpCall) |
static std::string | asBool (StringRef Text, bool NeedsStaticCast) |
static bool | needsNullPtrComparison (const Expr *E) |
static bool | needsZeroComparison (const Expr *E) |
static bool | needsStaticCast (const Expr *E) |
static std::string | compareExpressionToConstant (const ASTContext &Context, const Expr *E, bool Negated, const char *Constant) |
static std::string | compareExpressionToNullPtr (const ASTContext &Context, const Expr *E, bool Negated) |
static std::string | compareExpressionToZero (const ASTContext &Context, const Expr *E, bool Negated) |
static std::string | replacementExpression (const ASTContext &Context, bool Negated, const Expr *E) |
static bool | containsDiscardedTokens (const ASTContext &Context, CharSourceRange CharRange) |
static bool | containsBoolLiteral (const Expr *E) |
static bool | flipDemorganOperator (llvm::SmallVectorImpl< FixItHint > &Output, const BinaryOperator *BO) |
Swaps a BinaryOperator opcode from && to || or vice-versa. | |
static BinaryOperatorKind | getDemorganFlippedOperator (BinaryOperatorKind BO) |
static bool | flipDemorganSide (SmallVectorImpl< FixItHint > &Fixes, const ASTContext &Ctx, const Expr *E, std::optional< BinaryOperatorKind > OuterBO) |
static bool | flipDemorganBinaryOperator (SmallVectorImpl< FixItHint > &Fixes, const ASTContext &Ctx, const BinaryOperator *BinOp, std::optional< BinaryOperatorKind > OuterBO, const ParenExpr *Parens=nullptr) |
Inverts BinOp , Removing Parens if they exist and are safe to remove. | |
static bool | shouldRemoveParens (const Stmt *Parent, BinaryOperatorKind NewOuterBinary, const ParenExpr *Parens) |
static unsigned | getNameSpecifierNestingLevel (const QualType &QType) |
static double | percentage (double X, double Y) |
Returns how many % X is of Y. | |
static bool | applyEqualityHeuristic (StringRef Arg, StringRef Param) |
static bool | applyAbbreviationHeuristic (const llvm::StringMap< std::string > &AbbreviationDictionary, StringRef Arg, StringRef Param) |
static bool | applyPrefixHeuristic (StringRef Arg, StringRef Param, int8_t Threshold) |
Check whether the shorter String is a prefix of the longer String. | |
static bool | applySuffixHeuristic (StringRef Arg, StringRef Param, int8_t Threshold) |
Check whether the shorter String is a suffix of the longer String. | |
static bool | applySubstringHeuristic (StringRef Arg, StringRef Param, int8_t Threshold) |
static bool | applyLevenshteinHeuristic (StringRef Arg, StringRef Param, int8_t Threshold) |
static bool | applyJaroWinklerHeuristic (StringRef Arg, StringRef Param, int8_t Threshold) |
static bool | applyDiceHeuristic (StringRef Arg, StringRef Param, int8_t Threshold) |
static bool | areRefAndQualCompatible (QualType ArgType, QualType ParamType) |
Checks if ArgType binds to ParamType regarding reference-ness and cv-qualifiers. | |
static bool | isPointerOrArray (QualType TypeToCheck) |
static bool | isCompatibleWithArrayReference (QualType ArgType, QualType ParamType) |
Checks whether ArgType is an array type identical to ParamType's array type. | |
static QualType | convertToPointeeOrArrayElementQualType (QualType TypeToConvert) |
static bool | arePointersStillQualCompatible (QualType ArgType, QualType ParamType, bool &IsParamContinuouslyConst) |
Checks if multilevel pointers' qualifiers compatibility continues on the current pointer level. | |
static bool | arePointerTypesCompatible (QualType ArgType, QualType ParamType, bool IsParamContinuouslyConst) |
Checks whether multilevel pointers are compatible in terms of levels, qualifiers and pointee type. | |
static bool | areTypesCompatible (QualType ArgType, QualType ParamType, const ASTContext &Ctx) |
Checks whether ArgType converts implicitly to ParamType. | |
static bool | isOverloadedUnaryOrBinarySymbolOperator (const FunctionDecl *FD) |
static bool | isViableLoop (const CXXForRangeStmt &S, ASTContext &Context) |
Variables | |
constexpr llvm::StringLiteral | ContainerExprName = "container-expr" |
constexpr llvm::StringLiteral | DerefContainerExprName = "deref-container-expr" |
constexpr llvm::StringLiteral | AddrOfContainerExprName |
constexpr llvm::StringLiteral | AddressOfName = "address-of" |
static const char | InterruptingStr [] = "interrupting" |
static const char | WarningMessage [] = "do not use 'else' after '%0'" |
static const char | WarnOnUnfixableStr [] = "WarnOnUnfixable" |
static const char | WarnOnConditionVariablesStr [] = "WarnOnConditionVariables" |
const unsigned | DefaultMinimumVariableNameLength = 3 |
const unsigned | DefaultMinimumLoopCounterNameLength = 2 |
const unsigned | DefaultMinimumExceptionNameLength = 2 |
const unsigned | DefaultMinimumParameterNameLength = 3 |
const char | DefaultIgnoredLoopCounterNames [] = "^[ijk_]$" |
const char | DefaultIgnoredVariableNames [] = "" |
const char | DefaultIgnoredExceptionVariableNames [] = "^[e]$" |
const char | DefaultIgnoredParameterNames [] = "^[n]$" |
const char | ErrorMessage [] |
static StringRef const | StyleNames [] |
static StringRef const | HungarainNotationPrimitiveTypes [] |
static StringRef const | HungarainNotationUserDefinedTypes [] |
const char | DefaultIgnoredIntegerValues [] = "1;2;3;4;" |
const char | DefaultIgnoredFloatingPointValues [] = "1.0;100.0;" |
constexpr std::array< std::pair< llvm::StringRef, llvm::StringRef >, 2U > | UnaryRepresentation {{{"!", "not"}, {"~", "compl"}}} |
constexpr std::array< std::pair< llvm::StringRef, llvm::StringRef >, 9U > | OperatorsRepresentation |
const char | DefaultStringNames [] |
static constexpr char | SimplifyOperatorDiagnostic [] |
static constexpr char | SimplifyConditionDiagnostic [] |
static constexpr char | SimplifyConditionalReturnDiagnostic [] |
static std::pair< BinaryOperatorKind, BinaryOperatorKind > | Opposites [] |
static std::pair< OverloadedOperatorKind, StringRef > | OperatorNames [] |
static std::pair< OverloadedOperatorKind, OverloadedOperatorKind > | OppositeOverloads [] |
static const char | KDefaultTypes [] |
static const StringRef | CompareMessage |
static constexpr std::size_t | DefaultMinimumIdentifierNameLength = 3 |
static constexpr StringRef | HeuristicToString [] |
static constexpr DefaultHeuristicConfiguration | Defaults [] |
static constexpr llvm::StringLiteral | DefaultAbbreviations |
static constexpr std::size_t | SmallVectorSize |
enum clang::tidy::readability::StyleKind : int |
Enumerator | |
---|---|
SK_Count | |
SK_Invalid |
Definition at line 129 of file IdentifierNamingCheck.cpp.
Enumerator | |
---|---|
Unused | |
Const | |
NonConst |
Definition at line 50 of file MakeMemberFunctionConstCheck.cpp.
|
static |
Definition at line 18 of file DuplicateIncludeCheck.cpp.
|
static |
Definition at line 137 of file SuspiciousCallArgumentCheck.cpp.
|
static |
Definition at line 274 of file SuspiciousCallArgumentCheck.cpp.
References percentage().
|
static |
Definition at line 133 of file SuspiciousCallArgumentCheck.cpp.
|
static |
Definition at line 213 of file SuspiciousCallArgumentCheck.cpp.
|
static |
Definition at line 204 of file SuspiciousCallArgumentCheck.cpp.
References Dist.
|
static |
Check whether the shorter String is a prefix of the longer String.
Definition at line 152 of file SuspiciousCallArgumentCheck.cpp.
References percentage().
|
static |
Definition at line 175 of file SuspiciousCallArgumentCheck.cpp.
References percentage().
|
static |
Check whether the shorter String is a suffix of the longer String.
Definition at line 164 of file SuspiciousCallArgumentCheck.cpp.
References percentage().
|
static |
Checks if multilevel pointers' qualifiers compatibility continues on the current pointer level.
For multilevel pointers, C++ permits conversion, if every cv-qualifier in ArgType also appears in the corresponding position in ParamType, and if PramType has a cv-qualifier that's not in ArgType, then every * in ParamType to the right of that cv-qualifier, except the last one, must also be const-qualified.
Definition at line 344 of file SuspiciousCallArgumentCheck.cpp.
Referenced by arePointerTypesCompatible().
|
static |
Checks whether multilevel pointers are compatible in terms of levels, qualifiers and pointee type.
Definition at line 361 of file SuspiciousCallArgumentCheck.cpp.
References arePointersStillQualCompatible(), and convertToPointeeOrArrayElementQualType().
Referenced by areTypesCompatible().
|
static |
Checks if ArgType binds to ParamType regarding reference-ness and cv-qualifiers.
Definition at line 302 of file SuspiciousCallArgumentCheck.cpp.
Referenced by areTypesCompatible().
|
static |
Checks whether ArgType converts implicitly to ParamType.
Definition at line 387 of file SuspiciousCallArgumentCheck.cpp.
References arePointerTypesCompatible(), areRefAndQualCompatible(), convertToPointeeOrArrayElementQualType(), isCompatibleWithArrayReference(), and isPointerOrArray().
|
static |
Definition at line 98 of file SimplifyBooleanExprCheck.cpp.
References Text.
Referenced by replacementExpression().
clang::tidy::readability::AST_MATCHER | ( | CXXMethodDecl | , |
hasTrivialBody | |||
) |
Definition at line 23 of file ConvertMemberFunctionsToStatic.cpp.
References Node.
clang::tidy::readability::AST_MATCHER | ( | CXXMethodDecl | , |
isDependentContext | |||
) |
Definition at line 37 of file ConvertMemberFunctionsToStatic.cpp.
References Node.
clang::tidy::readability::AST_MATCHER | ( | CXXMethodDecl | , |
isInsideMacroDefinition | |||
) |
Definition at line 41 of file ConvertMemberFunctionsToStatic.cpp.
References Node.
clang::tidy::readability::AST_MATCHER | ( | CXXMethodDecl | , |
isOverloadedOperator | |||
) |
Definition at line 25 of file ConvertMemberFunctionsToStatic.cpp.
References Node.
clang::tidy::readability::AST_MATCHER | ( | CXXMethodDecl | , |
isStatic | |||
) |
Definition at line 21 of file ConvertMemberFunctionsToStatic.cpp.
References Node.
clang::tidy::readability::AST_MATCHER | ( | CXXMethodDecl | , |
isTemplate | |||
) |
Definition at line 33 of file ConvertMemberFunctionsToStatic.cpp.
References Node.
clang::tidy::readability::AST_MATCHER | ( | CXXMethodDecl | , |
usesThis | |||
) |
Definition at line 55 of file ConvertMemberFunctionsToStatic.cpp.
References E, Node, and clang::tidy::readability::FindUsageOfThis::VisitCXXThisExpr().
clang::tidy::readability::AST_MATCHER | ( | CXXMethodDecl | , |
usesThisAsConst | |||
) |
Definition at line 208 of file MakeMemberFunctionConstCheck.cpp.
References Const, Node, and clang::tidy::readability::FindUsageOfThis::Usage.
clang::tidy::readability::AST_MATCHER | ( | CXXRecordDecl | , |
hasAnyDependentBases | |||
) |
Definition at line 29 of file ConvertMemberFunctionsToStatic.cpp.
References Node.
clang::tidy::readability::AST_MATCHER | ( | FunctionDecl | , |
doesDeclarationForceExternallyVisibleDefinition | |||
) |
Definition at line 18 of file RedundantDeclarationCheck.cpp.
References Node.
clang::tidy::readability::AST_MATCHER_P | ( | CXXMethodDecl | , |
hasCanonicalDecl | , | ||
ast_matchers::internal::Matcher< CXXMethodDecl > | , | ||
InnerMatcher | |||
) |
Definition at line 50 of file ConvertMemberFunctionsToStatic.cpp.
|
static |
Definition at line 99 of file ElseAfterReturnCheck.cpp.
References findUsage().
Referenced by clang::tidy::readability::ElseAfterReturnCheck::check().
|
static |
Definition at line 80 of file ConstReturnTypeCheck.cpp.
References Decl, and findConstToRemove().
Referenced by clang::tidy::readability::ConstReturnTypeCheck::check().
|
static |
Definition at line 82 of file ElseAfterReturnCheck.cpp.
References Decl, findUsage(), and findUsageRange().
Referenced by clang::tidy::readability::ElseAfterReturnCheck::check().
|
static |
Definition at line 203 of file IsolateDeclarationCheck.cpp.
References Range, and Snippet.
Referenced by clang::tidy::readability::IsolateDeclarationCheck::check().
|
static |
Definition at line 139 of file SimplifyBooleanExprCheck.cpp.
References E.
Referenced by compareExpressionToNullPtr(), and compareExpressionToZero().
|
static |
Definition at line 150 of file SimplifyBooleanExprCheck.cpp.
References compareExpressionToConstant(), and E.
Referenced by replacementExpression().
|
static |
Definition at line 156 of file SimplifyBooleanExprCheck.cpp.
References compareExpressionToConstant(), and E.
Referenced by replacementExpression().
|
static |
Definition at line 597 of file SimplifyBooleanExprCheck.cpp.
References containsBoolLiteral(), and E.
Referenced by containsBoolLiteral().
|
static |
Definition at line 105 of file ElseAfterReturnCheck.cpp.
References Node.
Referenced by clang::tidy::readability::ElseAfterReturnCheck::check().
|
static |
Definition at line 239 of file SimplifyBooleanExprCheck.cpp.
|
static |
Definition at line 325 of file SuspiciousCallArgumentCheck.cpp.
Referenced by arePointerTypesCompatible(), and areTypesCompatible().
|
static |
This function counts the number of written indirections for the given Type T
.
It does NOT resolve typedefs as it's a helper for lexing the source code.
Definition at line 59 of file IsolateDeclarationCheck.cpp.
References countIndirections().
Referenced by countIndirections(), and declRanges().
|
static |
Expects a vector {TypeSnippet, Firstdecl, SecondDecl, ...}.
Definition at line 231 of file IsolateDeclarationCheck.cpp.
Referenced by clang::tidy::readability::IsolateDeclarationCheck::check().
|
static |
This function tries to extract the SourceRanges that make up all declarations in this DeclStmt
.
The resulting vector has the structure {UnderlyingType, Decl1, Decl2, ...}. Each SourceRange
is of the form [Begin, End). If any of the create ranges is invalid or in a macro the result will be None
. If the DeclStmt
contains only one declaration, the result is None
. If the DeclStmt
contains declarations other than VarDecl
the result is None
.
VarDecl
. Definition at line 108 of file IsolateDeclarationCheck.cpp.
References countIndirections(), Decl, clang::tidy::utils::lexer::findNextTerminator(), clang::tidy::utils::lexer::findPreviousTokenKind(), clang::tidy::utils::lexer::findPreviousTokenStart(), findStartOfIndirection(), clang::tidy::utils::lexer::getPreviousToken(), isMacroID(), clang::tidy::utils::lexer::rangeContainsExpansionsOrDirectives(), and typeIsMemberPointer().
Referenced by clang::tidy::readability::IsolateDeclarationCheck::check().
|
static |
Definition at line 26 of file ConstReturnTypeCheck.cpp.
References clang::tidy::utils::lexer::getQualifyingToken().
Referenced by clang::tidy::readability::AvoidConstParamsInDecls::check(), and checkDef().
|
static |
Definition at line 51 of file BracesAroundStatementsCheck.cpp.
References getTokenKind(), clang::tidy::utils::lexer::getUnifiedEndLoc(), and Loc.
|
static |
Definition at line 33 of file IsolateDeclarationCheck.cpp.
References clang::tidy::utils::lexer::findPreviousAnyTokenKind().
Referenced by declRanges().
|
static |
Definition at line 49 of file ElseAfterReturnCheck.cpp.
References DeclRef, findUsage(), and Node.
Referenced by checkConditionVarUsageInElse(), checkInitDeclUsageInElse(), and findUsage().
|
static |
Definition at line 65 of file ElseAfterReturnCheck.cpp.
References DeclRef, findUsageRange(), and Node.
Referenced by checkInitDeclUsageInElse(), and findUsageRange().
|
static |
Inverts BinOp
, Removing Parens
if they exist and are safe to remove.
returns true
if there is any issue building the Fixes, false
otherwise.
Definition at line 792 of file SimplifyBooleanExprCheck.cpp.
References flipDemorganOperator(), flipDemorganSide(), and getDemorganFlippedOperator().
Referenced by flipDemorganSide().
|
static |
Swaps a BinaryOperator
opcode from &&
to ||
or vice-versa.
Definition at line 769 of file SimplifyBooleanExprCheck.cpp.
References Output.
Referenced by flipDemorganBinaryOperator().
|
static |
Definition at line 870 of file SimplifyBooleanExprCheck.cpp.
References E, flipDemorganBinaryOperator(), and isMacroID().
Referenced by flipDemorganBinaryOperator().
|
static |
Definition at line 35 of file BracesAroundStatementsCheck.cpp.
References getTokenKind(), and Loc.
|
static |
Definition at line 239 of file MakeMemberFunctionConstCheck.cpp.
References M.
Referenced by clang::tidy::readability::MakeMemberFunctionConstCheck::check().
|
static |
Definition at line 35 of file RedundantStringInitCheck.cpp.
Referenced by clang::tidy::readability::RedundantStringInitCheck::check().
|
static |
Definition at line 43 of file RedundantStringInitCheck.cpp.
References E.
Referenced by clang::tidy::readability::RedundantStringInitCheck::check().
|
static |
Definition at line 225 of file ElseAfterReturnCheck.cpp.
Referenced by clang::tidy::readability::ElseAfterReturnCheck::check().
|
static |
Definition at line 779 of file SimplifyBooleanExprCheck.cpp.
Referenced by flipDemorganBinaryOperator().
|
static |
Definition at line 109 of file ConvertMemberFunctionsToStatic.cpp.
References getStringFromRange(), Offset, Range, and Text.
Referenced by clang::tidy::readability::ConvertMemberFunctionsToStatic::check().
|
static |
Definition at line 49 of file NamespaceCommentCheck.cpp.
References clang::tidy::utils::lexer::findNextTokenSkippingComments(), ID, Loc, and Nesting.
Referenced by clang::tidy::readability::NamespaceCommentCheck::check().
|
static |
Definition at line 22 of file StaticAccessedThroughInstanceCheck.cpp.
Referenced by clang::tidy::readability::StaticAccessedThroughInstanceCheck::check().
|
static |
Definition at line 73 of file SimplifyBooleanExprCheck.cpp.
References Name, and OperatorNames.
Referenced by negatedOperator().
|
static |
Definition at line 23 of file OperatorsRepresentationCheck.cpp.
References Loc.
|
static |
Definition at line 17 of file MisleadingIndentationCheck.cpp.
|
static |
Definition at line 128 of file OperatorsRepresentationCheck.cpp.
References Config().
Referenced by isAnyOperatorEnabled().
|
static |
Obtain the original source code text from a SourceRange.
Definition at line 98 of file ConvertMemberFunctionsToStatic.cpp.
References Range.
Referenced by getLocationOfConst().
|
static |
Definition at line 19 of file BracesAroundStatementsCheck.cpp.
References Loc.
Referenced by findEndLocation(), and forwardSkipWhitespaceAndComments().
|
static |
Definition at line 185 of file ElseAfterReturnCheck.cpp.
Referenced by clang::tidy::readability::ElseAfterReturnCheck::check().
|
static |
Definition at line 138 of file OperatorsRepresentationCheck.cpp.
References Config(), and getRepresentation().
|
static |
Checks whether ArgType is an array type identical to ParamType's array type.
Enforces array elements' qualifier compatibility as well.
Definition at line 314 of file SuspiciousCallArgumentCheck.cpp.
Referenced by areTypesCompatible().
|
static |
Definition at line 51 of file IsolateDeclarationCheck.cpp.
Referenced by declRanges(), and flipDemorganSide().
|
static |
Definition at line 105 of file OperatorsRepresentationCheck.cpp.
References translate().
Referenced by clang::tidy::readability::OperatorsRepresentationCheck::OperatorsRepresentationCheck().
|
static |
Definition at line 479 of file SuspiciousCallArgumentCheck.cpp.
Referenced by clang::tidy::readability::SuspiciousCallArgumentCheck::check().
|
static |
Definition at line 308 of file SuspiciousCallArgumentCheck.cpp.
Referenced by areTypesCompatible().
|
staticnoexcept |
Definition at line 109 of file OperatorsRepresentationCheck.cpp.
References C.
Referenced by clang::tidy::readability::OperatorsRepresentationCheck::check().
|
static |
Definition at line 73 of file UseAnyOfAllOfCheck.cpp.
References DeclRef.
Referenced by clang::tidy::readability::UseAnyOfAllOfCheck::check().
|
static |
Definition at line 42 of file NamespaceCommentCheck.cpp.
Referenced by clang::tidy::readability::NamespaceCommentCheck::check().
|
static |
Definition at line 114 of file OperatorsRepresentationCheck.cpp.
Referenced by clang::tidy::readability::OperatorsRepresentationCheck::check().
|
static |
Definition at line 105 of file SimplifyBooleanExprCheck.cpp.
References E.
Referenced by replacementExpression().
|
static |
Definition at line 43 of file SimplifyBooleanExprCheck.cpp.
References E.
Referenced by replacementExpression().
|
static |
Definition at line 120 of file SimplifyBooleanExprCheck.cpp.
References E.
Referenced by replacementExpression().
|
static |
Definition at line 113 of file SimplifyBooleanExprCheck.cpp.
References E.
Referenced by replacementExpression().
|
static |
Definition at line 58 of file SimplifyBooleanExprCheck.cpp.
References Opposites.
Referenced by replacementExpression().
|
static |
Definition at line 87 of file SimplifyBooleanExprCheck.cpp.
References getOperatorName(), and OppositeOverloads.
|
inlinestatic |
Returns how many % X is of Y.
Definition at line 131 of file SuspiciousCallArgumentCheck.cpp.
References X.
Referenced by applyDiceHeuristic(), applyPrefixHeuristic(), applySubstringHeuristic(), and applySuffixHeuristic().
|
static |
Definition at line 115 of file ElseAfterReturnCheck.cpp.
References Loc.
Referenced by clang::tidy::readability::ElseAfterReturnCheck::check().
|
static |
Definition at line 23 of file RedundantStringInitCheck.cpp.
References Name.
Referenced by clang::tidy::readability::RedundantStringInitCheck::registerMatchers().
|
static |
Definition at line 161 of file SimplifyBooleanExprCheck.cpp.
References asBool(), compareExpressionToNullPtr(), compareExpressionToZero(), E, needsNullPtrComparison(), needsParensAfterUnaryNegation(), needsStaticCast(), needsZeroComparison(), negatedOperator(), replacementExpression(), and Text.
Referenced by replacementExpression().
|
static |
Definition at line 896 of file SimplifyBooleanExprCheck.cpp.
References Parent.
|
static |
Definition at line 88 of file OperatorsRepresentationCheck.cpp.
References OperatorsRepresentation, and UnaryRepresentation.
Referenced by clang::tidy::readability::OperatorsRepresentationCheck::check(), and isNotOperatorStr().
|
static |
Definition at line 80 of file IsolateDeclarationCheck.cpp.
References typeIsMemberPointer().
Referenced by declRanges(), and typeIsMemberPointer().
|
static |
|
constexpr |
Definition at line 24 of file ContainerDataPointerCheck.cpp.
Referenced by clang::tidy::readability::ContainerDataPointerCheck::check(), and clang::tidy::readability::ContainerDataPointerCheck::registerMatchers().
|
constexpr |
Definition at line 22 of file ContainerDataPointerCheck.cpp.
Referenced by clang::tidy::readability::ContainerDataPointerCheck::check(), and clang::tidy::readability::ContainerDataPointerCheck::registerMatchers().
|
static |
Definition at line 19 of file StringCompareCheck.cpp.
Referenced by clang::tidy::readability::StringCompareCheck::check().
|
constexpr |
Definition at line 20 of file ContainerDataPointerCheck.cpp.
Referenced by clang::tidy::readability::ContainerDataPointerCheck::check(), and clang::tidy::readability::ContainerDataPointerCheck::registerMatchers().
|
staticconstexpr |
Definition at line 95 of file SuspiciousCallArgumentCheck.cpp.
Referenced by clang::tidy::readability::SuspiciousCallArgumentCheck::SuspiciousCallArgumentCheck().
const char clang::tidy::readability::DefaultIgnoredExceptionVariableNames[] = "^[e]$" |
Definition at line 25 of file IdentifierLengthCheck.cpp.
const char clang::tidy::readability::DefaultIgnoredFloatingPointValues[] = "1.0;100.0;" |
Definition at line 74 of file MagicNumbersCheck.cpp.
const char clang::tidy::readability::DefaultIgnoredIntegerValues[] = "1;2;3;4;" |
Definition at line 73 of file MagicNumbersCheck.cpp.
const char clang::tidy::readability::DefaultIgnoredLoopCounterNames[] = "^[ijk_]$" |
Definition at line 23 of file IdentifierLengthCheck.cpp.
const char clang::tidy::readability::DefaultIgnoredParameterNames[] = "^[n]$" |
Definition at line 26 of file IdentifierLengthCheck.cpp.
const char clang::tidy::readability::DefaultIgnoredVariableNames[] = "" |
Definition at line 24 of file IdentifierLengthCheck.cpp.
const unsigned clang::tidy::readability::DefaultMinimumExceptionNameLength = 2 |
Definition at line 21 of file IdentifierLengthCheck.cpp.
|
staticconstexpr |
Definition at line 44 of file SuspiciousCallArgumentCheck.cpp.
const unsigned clang::tidy::readability::DefaultMinimumLoopCounterNameLength = 2 |
Definition at line 20 of file IdentifierLengthCheck.cpp.
const unsigned clang::tidy::readability::DefaultMinimumParameterNameLength = 3 |
Definition at line 22 of file IdentifierLengthCheck.cpp.
const unsigned clang::tidy::readability::DefaultMinimumVariableNameLength = 3 |
Definition at line 19 of file IdentifierLengthCheck.cpp.
|
staticconstexpr |
Definition at line 50 of file SuspiciousCallArgumentCheck.cpp.
Referenced by clang::tidy::readability::SuspiciousCallArgumentCheck::storeOptions(), and clang::tidy::readability::SuspiciousCallArgumentCheck::SuspiciousCallArgumentCheck().
const char clang::tidy::readability::DefaultStringNames[] |
Definition at line 20 of file RedundantStringInitCheck.cpp.
Referenced by clang::tidy::readability::RedundantStringInitCheck::storeOptions().
|
constexpr |
Definition at line 21 of file ContainerDataPointerCheck.cpp.
Referenced by clang::tidy::readability::ContainerDataPointerCheck::check(), and clang::tidy::readability::ContainerDataPointerCheck::registerMatchers().
const char clang::tidy::readability::ErrorMessage[] |
Definition at line 28 of file IdentifierLengthCheck.cpp.
Referenced by clang::tidy::readability::IdentifierLengthCheck::check().
|
staticconstexpr |
Definition at line 46 of file SuspiciousCallArgumentCheck.cpp.
Referenced by clang::tidy::readability::SuspiciousCallArgumentCheck::storeOptions(), and clang::tidy::readability::SuspiciousCallArgumentCheck::SuspiciousCallArgumentCheck().
|
static |
Definition at line 190 of file IdentifierNamingCheck.cpp.
Referenced by clang::tidy::readability::IdentifierNamingCheck::HungarianNotation::loadFileConfig().
|
static |
Definition at line 226 of file IdentifierNamingCheck.cpp.
Referenced by clang::tidy::readability::IdentifierNamingCheck::HungarianNotation::loadFileConfig().
|
static |
Definition at line 44 of file ElseAfterReturnCheck.cpp.
Referenced by clang::tidy::readability::ElseAfterReturnCheck::check(), and clang::tidy::readability::ElseAfterReturnCheck::registerMatchers().
|
static |
Definition at line 18 of file SimplifySubscriptExprCheck.cpp.
|
static |
Definition at line 69 of file SimplifyBooleanExprCheck.cpp.
Referenced by getOperatorName().
|
constexpr |
Definition at line 78 of file OperatorsRepresentationCheck.cpp.
Referenced by translate().
|
static |
Definition at line 83 of file SimplifyBooleanExprCheck.cpp.
Referenced by negatedOperator().
|
static |
Definition at line 55 of file SimplifyBooleanExprCheck.cpp.
Referenced by negatedOperator().
|
staticconstexpr |
Definition at line 40 of file SimplifyBooleanExprCheck.cpp.
|
staticconstexpr |
Definition at line 38 of file SimplifyBooleanExprCheck.cpp.
|
staticconstexpr |
Definition at line 36 of file SimplifyBooleanExprCheck.cpp.
|
staticconstexpr |
Definition at line 127 of file SuspiciousCallArgumentCheck.cpp.
|
static |
Definition at line 137 of file IdentifierNamingCheck.cpp.
Referenced by clang::tidy::readability::IdentifierNamingCheck::getFailureInfo(), clang::tidy::readability::IdentifierNamingCheck::getFileStyleFromOptions(), and clang::tidy::readability::IdentifierNamingCheck::storeOptions().
|
constexpr |
Definition at line 75 of file OperatorsRepresentationCheck.cpp.
Referenced by translate().
|
static |
Definition at line 45 of file ElseAfterReturnCheck.cpp.
Referenced by clang::tidy::readability::ElseAfterReturnCheck::check().
|
static |
Definition at line 47 of file ElseAfterReturnCheck.cpp.
Referenced by clang::tidy::readability::ElseAfterReturnCheck::storeOptions().
|
static |
Definition at line 46 of file ElseAfterReturnCheck.cpp.
Referenced by clang::tidy::readability::ElseAfterReturnCheck::storeOptions().