clang-tools
8.0.0
|
Classes | |
class | AvoidBindCheck |
Replace simple uses of std::bind with a lambda. More... | |
class | AvoidCArraysCheck |
Find C-style array types and recommend to use std::array<> / std::vector<>. More... | |
class | ComponentFinderASTVisitor |
Class used to find the variables and member expressions on which an arbitrary expression depends. More... | |
class | ConcatNestedNamespacesCheck |
class | Confidence |
A class to encapsulate lowering of the tool's confidence level. More... | |
class | DeclFinderASTVisitor |
Class used to determine if any declarations used in a Stmt would conflict with a particular identifier. More... | |
class | DependencyFinderASTVisitor |
Class used to determine if an expression is dependent on a variable declared inside of the loop where it would be used. More... | |
class | DeprecatedHeadersCheck |
This check replaces deprecated C library headers with their C++ STL alternatives. More... | |
class | DeprecatedIosBaseAliasesCheck |
This check warns the uses of the deprecated member types of std::ios_base and replaces those that have a non-deprecated equivalent. More... | |
class | ForLoopIndexUseVisitor |
Discover usages of expressions consisting of index or iterator access. More... | |
class | LoopConvertCheck |
class | MakeSharedCheck |
Replace the pattern: More... | |
class | MakeSmartPtrCheck |
Base class for MakeSharedCheck and MakeUniqueCheck. More... | |
class | MakeUniqueCheck |
Replace the pattern: More... | |
class | ModernizeModule |
class | PassByValueCheck |
class | RawStringLiteralCheck |
This check replaces string literals with escaped characters to raw string literals. More... | |
class | RedundantVoidArgCheck |
Find and remove redundant void argument lists. More... | |
class | ReplaceAutoPtrCheck |
Transforms the deprecated std::auto_ptr into the C++11 std::unique_ptr . More... | |
class | ReplaceRandomShuffleCheck |
std::random_shuffle will be removed as of C++17. More... | |
class | ReturnBracedInitListCheck |
Use a braced init list for return statements rather than unnecessary repeating the return type name. More... | |
class | ShrinkToFitCheck |
Replace copy and swap tricks on shrinkable containers with the shrink_to_fit() method call. More... | |
class | StmtAncestorASTVisitor |
Class used build the reverse AST properties needed to detect name conflicts and free variables. More... | |
struct | TUTrackingInfo |
class | UnaryStaticAssertCheck |
Replaces a static_assert declaration with an empty message with the unary version. More... | |
struct | Usage |
The information needed to describe a valid convertible usage of an array index or iterator. More... | |
class | UseAutoCheck |
class | UseBoolLiteralsCheck |
Finds integer literals which are cast to bool. More... | |
class | UseDefaultMemberInitCheck |
Convert a default constructor's member initializers into default member initializers. More... | |
class | UseEmplaceCheck |
This check looks for cases when inserting new element into std::vector but the element is constructed temporarily. More... | |
class | UseEqualsDefaultCheck |
Replace default bodies of special member functions with '= default;'. More... | |
class | UseEqualsDeleteCheck |
Mark unimplemented private special member functions with '= delete'. More... | |
class | UseNodiscardCheck |
Add [[nodiscard]] to non-void const-member functions with no arguments or pass-by-value or pass by const-reference arguments. More... | |
class | UseNoexceptCheck |
Replace dynamic exception specifications, with noexcept (or user-defined macro) or noexcept(false) . More... | |
class | UseNullptrCheck |
class | UseOverrideCheck |
Use C++11's override and remove virtual where applicable. More... | |
class | UseTransparentFunctorsCheck |
Prefer using transparent functors to non-transparent ones. More... | |
class | UseUncaughtExceptionsCheck |
This check will warn on calls to std::uncaught_exception and replace them with calls to std::uncaught_exceptions, since std::uncaught_exception was deprecated in C++17. More... | |
class | UseUsingCheck |
Check finds typedefs and replaces it with usings. More... | |
class | VariableNamer |
Create names for generated variables within a particular statement. More... | |
Typedefs | |
typedef llvm::DenseMap< const clang::Stmt *, const clang::Stmt * > | StmtParentMap |
A map used to walk the AST in reverse: maps child Stmt to parent Stmt. More... | |
typedef llvm::DenseMap< const clang::VarDecl *, const clang::DeclStmt * > | DeclParentMap |
A map used to walk the AST in reverse: maps VarDecl to the to parent DeclStmt. More... | |
typedef llvm::DenseMap< const clang::ForStmt *, const clang::VarDecl * > | ReplacedVarsMap |
A map used to track which variables have been removed by a refactoring pass. More... | |
typedef llvm::DenseMap< const clang::Stmt *, std::string > | StmtGeneratedVarNameMap |
A map used to remember the variable names generated in a Stmt. More... | |
typedef llvm::SmallVector< const clang::Expr *, 16 > | ComponentVector |
A vector used to store the AST subtrees of an Expr. More... | |
typedef llvm::SmallVector< Usage, 8 > | UsageResult |
using | CharsBitSet = std::bitset< 1<< CHAR_BIT > |
Enumerations | |
enum | LoopFixerKind { LFK_Array, LFK_Iterator, LFK_PseudoArray } |
Functions | |
static SmallVector< BindArgument, 4 > | buildBindArguments (const MatchFinder::MatchResult &Result, const CallExpr *C) |
static void | addPlaceholderArgs (const ArrayRef< BindArgument > Args, llvm::raw_ostream &Stream) |
static void | addFunctionCallArgs (const ArrayRef< BindArgument > Args, llvm::raw_ostream &Stream) |
static bool | isPlaceHolderIndexRepeated (const ArrayRef< BindArgument > Args) |
static bool | locationsInSameFile (const SourceManager &Sources, SourceLocation Loc1, SourceLocation Loc2) |
static bool | anonymousOrInlineNamespace (const NamespaceDecl &ND) |
static bool | singleNamedNamespaceChild (const NamespaceDecl &ND) |
static bool | alreadyConcatenated (std::size_t NumCandidates, const SourceRange &ReplacementRange, const SourceManager &Sources, const LangOptions &LangOpts) |
StatementMatcher | makeArrayLoopMatcher () |
The matcher for loops over arrays. More... | |
StatementMatcher | makeIteratorLoopMatcher () |
The matcher used for iterator-based for loops. More... | |
StatementMatcher | makePseudoArrayLoopMatcher () |
The matcher used for array-like containers (pseudoarrays). More... | |
static const Expr * | getContainerFromBeginEndCall (const Expr *Init, bool IsBegin, bool *IsArrow) |
Determine whether Init appears to be an initializing an iterator. More... | |
static const Expr * | findContainer (ASTContext *Context, const Expr *BeginExpr, const Expr *EndExpr, bool *ContainerNeedsDereference) |
Determines the container whose begin() and end() functions are called for an iterator-based loop. More... | |
static StringRef | getStringFromRange (SourceManager &SourceMgr, const LangOptions &LangOpts, SourceRange Range) |
Obtain the original source code text from a SourceRange. More... | |
static const ValueDecl * | getReferencedVariable (const Expr *E) |
If the given expression is actually a DeclRefExpr or a MemberExpr, find and return the underlying ValueDecl; otherwise, return NULL. More... | |
static bool | isDirectMemberExpr (const Expr *E) |
Returns true when the given expression is a member expression whose base is this (implicitly or not). More... | |
static bool | canBeModified (ASTContext *Context, const Expr *E) |
Given an expression that represents an usage of an element from the containter that we are iterating over, returns false when it can be guaranteed this element cannot be modified as a result of this usage. More... | |
static bool | usagesAreConst (ASTContext *Context, const UsageResult &Usages) |
Returns true when it can be guaranteed that the elements of the container are not being modified. More... | |
static bool | usagesReturnRValues (const UsageResult &Usages) |
Returns true if the elements of the container are never accessed by reference. More... | |
static bool | containerIsConst (const Expr *ContainerExpr, bool Dereference) |
Returns true if the container is const-qualified. More... | |
const Expr * | digThroughConstructors (const Expr *E) |
Look through conversion/copy constructors to find the explicit initialization expression, returning it is found. More... | |
bool | areSameExpr (ASTContext *Context, const Expr *First, const Expr *Second) |
Returns true when two Exprs are equivalent. More... | |
const DeclRefExpr * | getDeclRef (const Expr *E) |
Returns the DeclRefExpr represented by E, or NULL if there isn't one. More... | |
bool | areSameVariable (const ValueDecl *First, const ValueDecl *Second) |
Returns true when two ValueDecls are the same variable. More... | |
static bool | exprReferencesVariable (const ValueDecl *Target, const Expr *E) |
Determines if an expression is a declaration reference to a particular variable. More... | |
static const Expr * | getDereferenceOperand (const Expr *E) |
If the expression is a dereference or call to operator*(), return the operand. More... | |
template<typename ContainerT > | |
static bool | containsExpr (ASTContext *Context, const ContainerT *Container, const Expr *E) |
Returns true when the Container contains an Expr equivalent to E. More... | |
static bool | isIndexInSubscriptExpr (const Expr *IndexExpr, const VarDecl *IndexVar) |
Returns true when the index expression is a declaration reference to IndexVar. More... | |
static bool | isIndexInSubscriptExpr (ASTContext *Context, const Expr *IndexExpr, const VarDecl *IndexVar, const Expr *Obj, const Expr *SourceExpr, bool PermitDeref) |
Returns true when the index expression is a declaration reference to IndexVar, Obj is the same expression as SourceExpr after all parens and implicit casts are stripped off. More... | |
static bool | isDereferenceOfOpCall (const CXXOperatorCallExpr *OpCall, const VarDecl *IndexVar) |
Returns true when Opcall is a call a one-parameter dereference of IndexVar. More... | |
static bool | isDereferenceOfUop (const UnaryOperator *Uop, const VarDecl *IndexVar) |
Returns true when Uop is a dereference of IndexVar. More... | |
static bool | isAliasDecl (ASTContext *Context, const Decl *TheDecl, const VarDecl *IndexVar) |
Determines whether the given Decl defines a variable initialized to the loop object. More... | |
static bool | arrayMatchesBoundExpr (ASTContext *Context, const QualType &ArrayType, const Expr *ConditionExpr) |
Determines whether the bound of a for loop condition expression is the same as the statically computable size of ArrayType. More... | |
static ClangTidyModuleRegistry::Add< ModernizeModule > | X ("modernize-module", "Add modernize checks.") |
static TypeMatcher | constRefType () |
static TypeMatcher | nonConstValueType () |
static bool | paramReferredExactlyOnce (const CXXConstructorDecl *Ctor, const ParmVarDecl *ParamDecl) |
Whether or not ParamDecl is used exactly one time in Ctor . More... | |
static SmallVector< const ParmVarDecl *, 2 > | collectParamDecls (const CXXConstructorDecl *Ctor, const ParmVarDecl *ParamDecl) |
Find all references to ParamDecl across all of the redeclarations of Ctor . More... | |
static StringRef | getValueOfValueInit (const QualType InitType) |
static bool | isZero (const Expr *E) |
static const Expr * | ignoreUnaryPlus (const Expr *E) |
static const Expr * | getInitializer (const Expr *E) |
static bool | sameValue (const Expr *E1, const Expr *E2) |
static std::set< const FieldDecl * > | getAllNamedFields (const CXXRecordDecl *Record) |
Finds all the named non-static fields of Record . More... | |
static std::set< const Type * > | getAllDirectBases (const CXXRecordDecl *Record) |
Returns the names of the direct bases of Record , both virtual and non-virtual. More... | |
internal::Matcher< Expr > | accessToFieldInVar (const FieldDecl *Field, const ValueDecl *Var) |
Returns a matcher that matches member expressions where the base is the variable declared as Var and the accessed member is the one declared as Field . More... | |
static bool | isCopyConstructorAndCanBeDefaulted (ASTContext *Context, const CXXConstructorDecl *Ctor) |
Check that the given constructor has copy signature and that it copy-initializes all its bases and members. More... | |
static bool | isCopyAssignmentAndCanBeDefaulted (ASTContext *Context, const CXXMethodDecl *Operator) |
Checks that the given method is an overloading of the assignment operator, has copy signature, returns a reference to "*this" and copies all its members and subobjects. More... | |
static bool | bodyEmpty (const ASTContext *Context, const CompoundStmt *Body) |
Returns false if the body has any non-whitespace character. More... | |
static bool | doesNoDiscardMacroExist (ASTContext &Context, const llvm::StringRef &MacroId) |
static SmallVector< Token, 16 > | ParseTokens (CharSourceRange Range, const MatchFinder::MatchResult &Result) |
static StringRef | GetText (const Token &Tok, const SourceManager &Sources) |
template<typename T > | |
static T | getInnerTypeLocAs (TypeLoc Loc) |
static bool | CheckRemoval (SourceManager &SM, SourceLocation StartLoc, ASTContext &Context) |
Variables | |
static const llvm::SmallVector< StringRef, 5 > | DeprecatedTypes |
static const llvm::StringMap< StringRef > | ReplacementTypes |
static const char | LoopNameArray [] = "forLoopArray" |
static const char | LoopNameIterator [] = "forLoopIterator" |
static const char | LoopNamePseudoArray [] = "forLoopPseudoArray" |
static const char | ConditionBoundName [] = "conditionBound" |
static const char | ConditionVarName [] = "conditionVar" |
static const char | IncrementVarName [] = "incrementVar" |
static const char | InitVarName [] = "initVar" |
static const char | BeginCallName [] = "beginCall" |
static const char | EndCallName [] = "endCall" |
static const char | ConditionEndVarName [] = "conditionEndVar" |
static const char | EndVarName [] = "endVar" |
static const char | DerefByValueResultName [] = "derefByValueResult" |
static const char | DerefByRefResultName [] = "derefByRefResult" |
static const TypeMatcher | AnyType = anything() |
static const StatementMatcher | IntegerComparisonMatcher |
static const DeclarationMatcher | InitToZeroMatcher |
static const StatementMatcher | IncrementVarMatcher |
static const char | SpecialFunction [] = "SpecialFunction" |
static const char | SpecialFunction [] = "SpecialFunction" |
static const char | DeletedNotPublic [] = "DeletedNotPublic" |
static const StringRef | Message = "prefer transparent functors '%0'" |
using clang::tidy::modernize::CharsBitSet = typedef std::bitset<1 << CHAR_BIT> |
Definition at line 20 of file RawStringLiteralCheck.h.
typedef llvm::SmallVector<const clang::Expr *, 16> clang::tidy::modernize::ComponentVector |
A vector used to store the AST subtrees of an Expr.
Definition at line 50 of file LoopConvertUtils.h.
typedef llvm::DenseMap<const clang::VarDecl *, const clang::DeclStmt *> clang::tidy::modernize::DeclParentMap |
A map used to walk the AST in reverse: maps VarDecl to the to parent DeclStmt.
Definition at line 38 of file LoopConvertUtils.h.
typedef llvm::DenseMap<const clang::ForStmt *, const clang::VarDecl *> clang::tidy::modernize::ReplacedVarsMap |
A map used to track which variables have been removed by a refactoring pass.
It maps the parent ForStmt to the removed index variable's VarDecl.
Definition at line 43 of file LoopConvertUtils.h.
typedef llvm::DenseMap<const clang::Stmt *, std::string> clang::tidy::modernize::StmtGeneratedVarNameMap |
A map used to remember the variable names generated in a Stmt.
Definition at line 47 of file LoopConvertUtils.h.
typedef llvm::DenseMap<const clang::Stmt *, const clang::Stmt *> clang::tidy::modernize::StmtParentMap |
A map used to walk the AST in reverse: maps child Stmt to parent Stmt.
Definition at line 33 of file LoopConvertUtils.h.
typedef llvm::SmallVector<Usage, 8> clang::tidy::modernize::UsageResult |
Definition at line 271 of file LoopConvertUtils.h.
Enumerator | |
---|---|
LFK_Array | |
LFK_Iterator | |
LFK_PseudoArray |
Definition at line 30 of file LoopConvertUtils.h.
internal::Matcher<Expr> clang::tidy::modernize::accessToFieldInVar | ( | const FieldDecl * | Field, |
const ValueDecl * | Var | ||
) |
Returns a matcher that matches member expressions where the base is the variable declared as Var
and the accessed member is the one declared as Field
.
Definition at line 51 of file UseEqualsDefaultCheck.cpp.
|
static |
Definition at line 97 of file AvoidBindCheck.cpp.
|
static |
Definition at line 75 of file AvoidBindCheck.cpp.
|
static |
Definition at line 39 of file ConcatNestedNamespacesCheck.cpp.
Referenced by clang::tidy::modernize::ConcatNestedNamespacesCheck::check().
|
static |
Definition at line 26 of file ConcatNestedNamespacesCheck.cpp.
Referenced by clang::tidy::modernize::ConcatNestedNamespacesCheck::check().
bool clang::tidy::modernize::areSameExpr | ( | ASTContext * | Context, |
const Expr * | First, | ||
const Expr * | Second | ||
) |
Returns true when two Exprs are equivalent.
Definition at line 188 of file LoopConvertUtils.cpp.
bool clang::tidy::modernize::areSameVariable | ( | const ValueDecl * | First, |
const ValueDecl * | Second | ||
) |
Returns true when two ValueDecls are the same variable.
Definition at line 204 of file LoopConvertUtils.cpp.
Referenced by exprReferencesVariable(), and isIndexInSubscriptExpr().
|
static |
Determines whether the bound of a for loop condition expression is the same as the statically computable size of ArrayType.
Given
This is intended to permit
Definition at line 433 of file LoopConvertUtils.cpp.
|
static |
Returns false if the body has any non-whitespace character.
Definition at line 192 of file UseEqualsDefaultCheck.cpp.
Referenced by clang::tidy::modernize::UseEqualsDefaultCheck::check().
|
static |
Definition at line 48 of file AvoidBindCheck.cpp.
|
static |
Given an expression that represents an usage of an element from the containter that we are iterating over, returns false when it can be guaranteed this element cannot be modified as a result of this usage.
Definition at line 389 of file LoopConvertCheck.cpp.
|
static |
Definition at line 33 of file UseUsingCheck.cpp.
|
static |
Find all references to ParamDecl
across all of the redeclarations of Ctor
.
Definition at line 111 of file PassByValueCheck.cpp.
References Results.
|
static |
Definition at line 50 of file PassByValueCheck.cpp.
|
static |
Returns true if the container is const-qualified.
Definition at line 433 of file LoopConvertCheck.cpp.
References getReferencedVariable().
|
static |
Returns true when the Container contains an Expr equivalent to E.
Definition at line 235 of file LoopConvertUtils.cpp.
const Expr * clang::tidy::modernize::digThroughConstructors | ( | const Expr * | E | ) |
Look through conversion/copy constructors to find the explicit initialization expression, returning it is found.
The main idea is that given vector<int> v; we consider either of these initializations vector<int>::iterator it = v.begin(); vector<int>::iterator it(v.begin()); and retrieve v.begin()
as the expression used to initialize it
but do not include vector<int>::iterator it; vector<int>::iterator it(v.begin(), 0); // if this constructor existed as being initialized from v.begin()
Definition at line 169 of file LoopConvertUtils.cpp.
Referenced by getContainerFromBeginEndCall().
|
static |
Definition at line 22 of file UseNodiscardCheck.cpp.
Referenced by clang::tidy::modernize::UseNodiscardCheck::check().
|
static |
Determines if an expression is a declaration reference to a particular variable.
Definition at line 211 of file LoopConvertUtils.cpp.
References areSameVariable(), and getDeclRef().
Referenced by isDereferenceOfOpCall(), and isDereferenceOfUop().
|
static |
Determines the container whose begin() and end() functions are called for an iterator-based loop.
BeginExpr must be a member call to a function named "begin()", and EndExpr must be a member.
Definition at line 331 of file LoopConvertCheck.cpp.
Referenced by clang::tidy::modernize::LoopConvertCheck::check().
|
static |
Returns the names of the direct bases of Record
, both virtual and non-virtual.
Definition at line 38 of file UseEqualsDefaultCheck.cpp.
References Result.
|
static |
Finds all the named non-static fields of Record
.
Definition at line 25 of file UseEqualsDefaultCheck.cpp.
References Result.
|
static |
Determine whether Init appears to be an initializing an iterator.
If it is, returns the object whose begin() or end() method is called, and the output parameter isArrow is set to indicate whether the initialization is called via . or ->.
Definition at line 301 of file LoopConvertCheck.cpp.
References digThroughConstructors(), and Name.
const DeclRefExpr * clang::tidy::modernize::getDeclRef | ( | const Expr * | E | ) |
Returns the DeclRefExpr represented by E, or NULL if there isn't one.
Definition at line 199 of file LoopConvertUtils.cpp.
Referenced by exprReferencesVariable(), getReferencedVariable(), and isIndexInSubscriptExpr().
|
static |
If the expression is a dereference or call to operator*(), return the operand.
Otherwise, return NULL.
Definition at line 220 of file LoopConvertUtils.cpp.
|
static |
Definition at line 138 of file UseDefaultMemberInitCheck.cpp.
Referenced by sameValue().
|
static |
Definition at line 73 of file UseTransparentFunctorsCheck.cpp.
References Result.
|
static |
If the given expression is actually a DeclRefExpr or a MemberExpr, find and return the underlying ValueDecl; otherwise, return NULL.
Definition at line 370 of file LoopConvertCheck.cpp.
References getDeclRef().
Referenced by containerIsConst().
|
static |
Obtain the original source code text from a SourceRange.
Definition at line 356 of file LoopConvertCheck.cpp.
|
static |
Definition at line 62 of file UseOverrideCheck.cpp.
Referenced by clang::tidy::modernize::UseOverrideCheck::check().
|
static |
Definition at line 21 of file UseDefaultMemberInitCheck.cpp.
Referenced by clang::tidy::modernize::UseDefaultMemberInitCheck::check().
|
static |
Definition at line 131 of file UseDefaultMemberInitCheck.cpp.
Referenced by sameValue().
|
static |
Determines whether the given Decl defines a variable initialized to the loop object.
This is intended to find cases such as
and
Definition at line 350 of file LoopConvertUtils.cpp.
|
static |
Checks that the given method is an overloading of the assignment operator, has copy signature, returns a reference to "*this" and copies all its members and subobjects.
Definition at line 118 of file UseEqualsDefaultCheck.cpp.
Referenced by clang::tidy::modernize::UseEqualsDefaultCheck::check().
|
static |
Check that the given constructor has copy signature and that it copy-initializes all its bases and members.
Definition at line 60 of file UseEqualsDefaultCheck.cpp.
Referenced by clang::tidy::modernize::UseEqualsDefaultCheck::check().
|
static |
Returns true when Opcall is a call a one-parameter dereference of IndexVar.
For example, if the index variable is index
, returns true for *index but not index *notIndex
Definition at line 314 of file LoopConvertUtils.cpp.
References exprReferencesVariable().
|
static |
Returns true when Uop is a dereference of IndexVar.
For example, if the index variable is index
, returns true for *index but not index *notIndex
Definition at line 327 of file LoopConvertUtils.cpp.
References exprReferencesVariable().
|
static |
Returns true when the given expression is a member expression whose base is this
(implicitly or not).
Definition at line 380 of file LoopConvertCheck.cpp.
|
static |
Returns true when the index expression is a declaration reference to IndexVar.
If the index variable is index
, this function returns true on arrayExpression[index]; containerExpression[index]; but not containerExpression[notIndex];
Definition at line 254 of file LoopConvertUtils.cpp.
References areSameVariable(), and getDeclRef().
|
static |
Returns true when the index expression is a declaration reference to IndexVar, Obj is the same expression as SourceExpr after all parens and implicit casts are stripped off.
If PermitDeref is true, IndexExpression may be a dereference (overloaded or builtin operator*).
This function is intended for array-like containers, as it makes sure that both the container and the index match. If the loop has index variable index
and iterates over container
, then isIndexInSubscriptExpr returns true for
but not for
If PermitDeref is true, then isIndexInSubscriptExpr additionally returns true on these expressions:
Definition at line 288 of file LoopConvertUtils.cpp.
|
static |
Definition at line 109 of file AvoidBindCheck.cpp.
|
static |
Definition at line 109 of file UseDefaultMemberInitCheck.cpp.
Referenced by sameValue().
|
static |
Definition at line 20 of file ConcatNestedNamespacesCheck.cpp.
Referenced by clang::tidy::modernize::ConcatNestedNamespacesCheck::check().
StatementMatcher clang::tidy::modernize::makeArrayLoopMatcher | ( | ) |
The matcher for loops over arrays.
In this general example, assuming 'j' and 'k' are of integral type:
The following string identifiers are bound to these parts of the AST: ConditionVarName: 'j' (as a VarDecl) ConditionBoundName: '3 + 2' (as an Expr) InitVarName: 'i' (as a VarDecl) IncrementVarName: 'k' (as a VarDecl) LoopName: The entire for loop (as a ForStmt)
Client code will need to make sure that:
Definition at line 79 of file LoopConvertCheck.cpp.
StatementMatcher clang::tidy::modernize::makeIteratorLoopMatcher | ( | ) |
The matcher used for iterator-based for loops.
This matcher is more flexible than array-based loops. It will match catch loops of the following textual forms (regardless of whether the iterator type is actually a pointer type or a class type):
Assuming f, g, and h are of type containerType::iterator,
The following string identifiers are bound to the parts of the AST: InitVarName: 'it' (as a VarDecl) ConditionVarName: 'f' (as a VarDecl) LoopName: The entire for loop (as a ForStmt) In the first example only: EndVarName: 'e' (as a VarDecl) ConditionEndVarName: 'g' (as a VarDecl) In the second example only: EndCallName: 'container.end()' (as a CXXMemberCallExpr)
Client code will need to make sure that:
Definition at line 124 of file LoopConvertCheck.cpp.
StatementMatcher clang::tidy::modernize::makePseudoArrayLoopMatcher | ( | ) |
The matcher used for array-like containers (pseudoarrays).
This matcher is more flexible than array-based loops. It will match loops of the following textual forms (regardless of whether the iterator type is actually a pointer type or a class type):
Assuming f, g, and h are of type containerType::iterator,
The following string identifiers are bound to the parts of the AST: InitVarName: 'i' (as a VarDecl) ConditionVarName: 'f' (as a VarDecl) LoopName: The entire for loop (as a ForStmt) In the first example only: EndVarName: 'j' (as a VarDecl) ConditionEndVarName: 'g' (as a VarDecl) In the second example only: EndCallName: 'container.size()' (as a CXXMemberCallExpr)
Client code will need to make sure that:
Definition at line 232 of file LoopConvertCheck.cpp.
|
static |
Definition at line 54 of file PassByValueCheck.cpp.
|
static |
Whether or not ParamDecl
is used exactly one time in Ctor
.
Checks both in the init-list and the body of the constructor.
clang::RecursiveASTVisitor
that checks that the given ParmVarDecl
is used exactly one time.
Whether or not the parameter variable is referred only once in the given constructor.
Counts the number of references to a variable.
Stops the AST traversal if more than one usage is found.
Definition at line 61 of file PassByValueCheck.cpp.
References D.
|
static |
Definition at line 30 of file UseOverrideCheck.cpp.
References Tokens.
Referenced by clang::tidy::modernize::UseOverrideCheck::check().
|
static |
Definition at line 145 of file UseDefaultMemberInitCheck.cpp.
References getInitializer(), ignoreUnaryPlus(), and isZero().
Referenced by clang::tidy::modernize::UseDefaultMemberInitCheck::check().
|
static |
Definition at line 30 of file ConcatNestedNamespacesCheck.cpp.
Referenced by clang::tidy::modernize::ConcatNestedNamespacesCheck::check().
|
static |
Returns true when it can be guaranteed that the elements of the container are not being modified.
Definition at line 408 of file LoopConvertCheck.cpp.
|
static |
Returns true if the elements of the container are never accessed by reference.
Definition at line 424 of file LoopConvertCheck.cpp.
|
static |
|
static |
Definition at line 48 of file LoopConvertCheck.cpp.
|
static |
Definition at line 40 of file LoopConvertCheck.cpp.
|
static |
Definition at line 36 of file LoopConvertCheck.cpp.
Referenced by clang::tidy::modernize::LoopConvertCheck::check().
|
static |
Definition at line 42 of file LoopConvertCheck.cpp.
|
static |
Definition at line 37 of file LoopConvertCheck.cpp.
|
static |
Definition at line 22 of file UseEqualsDeleteCheck.cpp.
|
static |
Definition at line 20 of file DeprecatedIosBaseAliasesCheck.cpp.
|
static |
Definition at line 45 of file LoopConvertCheck.cpp.
|
static |
Definition at line 44 of file LoopConvertCheck.cpp.
|
static |
Definition at line 41 of file LoopConvertCheck.cpp.
Referenced by clang::tidy::modernize::LoopConvertCheck::check().
|
static |
Definition at line 43 of file LoopConvertCheck.cpp.
Referenced by clang::tidy::modernize::LoopConvertCheck::check().
|
static |
Definition at line 58 of file LoopConvertCheck.cpp.
|
static |
Definition at line 38 of file LoopConvertCheck.cpp.
Referenced by clang::tidy::modernize::LoopConvertCheck::check().
|
static |
Definition at line 54 of file LoopConvertCheck.cpp.
|
static |
Definition at line 39 of file LoopConvertCheck.cpp.
|
static |
Definition at line 50 of file LoopConvertCheck.cpp.
|
static |
Definition at line 33 of file LoopConvertCheck.cpp.
|
static |
Definition at line 34 of file LoopConvertCheck.cpp.
|
static |
Definition at line 35 of file LoopConvertCheck.cpp.
Referenced by clang::tidy::modernize::LoopConvertCheck::check().
|
static |
Definition at line 71 of file UseTransparentFunctorsCheck.cpp.
Referenced by clang::tidy::modernize::UseOverrideCheck::check(), clang::tidy::modernize::UseTransparentFunctorsCheck::check(), clang::tidy::readability::DeletedDefaultCheck::check(), clang::tidy::abseil::UpgradeDurationConversionsCheck::check(), clang::tidy::portability::SIMDIntrinsicsCheck::check(), clang::tidy::misc::UnconventionalAssignOperatorCheck::check(), clang::clangd::StoreDiags::HandleDiagnostic(), clang::tidy::ClangTidyDiagnosticConsumer::HandleDiagnostic(), clang::clangd::Logger::indicator(), clang::clangd::IgnoreDiagnostics::log(), clang::clangd::LSPError::log(), clang::tidy::ClangTidyContext::setDiagnosticsEngine(), clang::clangd::StreamLogger::StreamLogger(), and clang::tidy::cppcoreguidelines::MacroUsageCheck::warnMacro().
|
static |
Definition at line 27 of file DeprecatedIosBaseAliasesCheck.cpp.
|
static |
Definition at line 21 of file UseEqualsDefaultCheck.cpp.
Referenced by clang::tidy::modernize::UseEqualsDefaultCheck::check().
|
static |
Definition at line 21 of file UseEqualsDeleteCheck.cpp.