clang-tools 20.0.0git
|
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... | |
struct | ClassifiedToken |
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... | |
struct | ContainerCall |
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... | |
struct | EnableIfData |
class | ForLoopIndexUseVisitor |
Discover usages of expressions consisting of index or iterator access. More... | |
class | IntegralLiteralExpressionMatcher |
class | LoopConvertCheck |
class | MacroToEnumCallbacks |
class | MacroToEnumCheck |
Replaces groups of related macros with an unscoped anonymous enum. More... | |
class | MakeSharedCheck |
Replace the pattern: More... | |
class | MakeSmartPtrCheck |
Base class for MakeSharedCheck and MakeUniqueCheck. More... | |
class | MakeUniqueCheck |
Replace the pattern: More... | |
class | MinMaxUseInitializerListCheck |
Replaces nested std::min and std::max calls with an initializer list where applicable. More... | |
class | ModernizeModule |
struct | NotLengthExprForStringNode |
class | NS |
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 | ReplaceDisallowCopyAndAssignMacroCheck |
This check finds macro expansions of DISALLOW_COPY_AND_ASSIGN(Type) and replaces them with a deleted copy constructor and a deleted assignment operator. 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 | TypeTraitsCheck |
Converts standard library type traits of the form traits<...>::type and traits<...>::value into traits_t<...> and traits_v<...> respectively. More... | |
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 | UseConstraintsCheck |
Replace enable_if with C++20 requires clauses. More... | |
class | UseDefaultMemberInitCheck |
Convert a default constructor's member initializers into default member initializers. More... | |
class | UseDesignatedInitializersCheck |
Finds initializer lists for aggregate type that could be written as designated initializers instead. 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 |
Identifies unimplemented private special member functions, and recommends using = delete for them. More... | |
class | UseIntegerSignComparisonCheck |
Replace comparisons between signed and unsigned integers with their safe C++20 std::cmp_* alternative, if available. 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 | UseRangesCheck |
Detects calls to standard library iterator algorithms that could be replaced with a ranges version instead. More... | |
class | UseStartsEndsWithCheck |
Checks for common roundabout ways to express starts_with and ends_with and suggests replacing with the simpler method when it is available. More... | |
class | UseStdFormatCheck |
Converts calls to absl::StrFormat, or other functions via configuration options, to C++20's std::format, or another function via a configuration option, modifying the format string appropriately and removing now-unnecessary calls to std::string::c_str() and std::string::data(). More... | |
class | UseStdNumbersCheck |
Finds constants and function calls to math functions that can be replaced with c++20's mathematical constants from the numbers header and offers fix-it hints. More... | |
class | UseStdPrintCheck |
Convert calls to printf-like functions to std::print and std::println. More... | |
class | UseTrailingReturnTypeCheck |
Rewrites function signatures to use a trailing return type. 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 | |
using | NamespaceName = llvm::SmallString< 40 > |
using | StmtParentMap = llvm::DenseMap< const clang::Stmt *, const clang::Stmt * > |
A map used to walk the AST in reverse: maps child Stmt to parent Stmt. | |
using | DeclParentMap = llvm::DenseMap< const clang::VarDecl *, const clang::DeclStmt * > |
A map used to walk the AST in reverse: maps VarDecl to the to parent DeclStmt. | |
using | ReplacedVarsMap = llvm::DenseMap< const clang::ForStmt *, const clang::VarDecl * > |
A map used to track which variables have been removed by a refactoring pass. | |
using | StmtGeneratedVarNameMap = llvm::DenseMap< const clang::Stmt *, std::string > |
A map used to remember the variable names generated in a Stmt. | |
using | ComponentVector = llvm::SmallVector< const clang::Expr *, 16 > |
A vector used to store the AST subtrees of an Expr. | |
using | UsageResult = llvm::SmallVector< Usage, 8 > |
using | CharsBitSet = std::bitset< 1<< CHAR_BIT > |
Enumerations | |
enum class | LiteralSize { Unknown = 0 , Int , UnsignedInt , Long , UnsignedLong , LongLong , UnsignedLongLong } |
enum class | IteratorCallKind { ICK_Member , ICK_ADL , ICK_Std } |
enum | LoopFixerKind { LFK_Array , LFK_Iterator , LFK_ReverseIterator , LFK_PseudoArray } |
Functions | |
static bool | tryCaptureAsLocalVariable (const MatchFinder::MatchResult &Result, BindArgument &B, const Expr *E) |
static bool | tryCaptureAsMemberVariable (const MatchFinder::MatchResult &Result, BindArgument &B, const Expr *E) |
static const Expr * | ignoreTemporariesAndPointers (const Expr *E) |
static const Expr * | ignoreTemporariesAndConstructors (const Expr *E) |
static StringRef | getSourceTextForExpr (const MatchFinder::MatchResult &Result, const Expr *E) |
static bool | isCallExprNamed (const Expr *E, StringRef Name) |
static void | initializeBindArgumentForCallExpr (const MatchFinder::MatchResult &Result, BindArgument &B, const CallExpr *CE, unsigned &CaptureIndex) |
static bool | anyDescendantIsLocal (const Stmt *Statement) |
static SmallVector< BindArgument, 4 > | buildBindArguments (const MatchFinder::MatchResult &Result, const CallableInfo &Callable) |
static int | findPositionOfPlaceholderUse (ArrayRef< BindArgument > Args, size_t PlaceholderIndex) |
static void | addPlaceholderArgs (const LambdaProperties &LP, llvm::raw_ostream &Stream, bool PermissiveParameterList) |
static void | addFunctionCallArgs (ArrayRef< BindArgument > Args, llvm::raw_ostream &Stream) |
static bool | isPlaceHolderIndexRepeated (const ArrayRef< BindArgument > Args) |
static std::vector< const FunctionDecl * > | findCandidateCallOperators (const CXXRecordDecl *RecordDecl, size_t NumArgs) |
static bool | isFixitSupported (const CallableInfo &Callee, ArrayRef< BindArgument > Args) |
const FunctionDecl * | getCallOperator (const CXXRecordDecl *Callable, size_t NumArgs) |
const FunctionDecl * | getCallMethodDecl (const MatchFinder::MatchResult &Result, CallableType Type, CallableMaterializationKind Materialization) |
static CallableType | getCallableType (const MatchFinder::MatchResult &Result) |
static CallableMaterializationKind | getCallableMaterialization (const MatchFinder::MatchResult &Result) |
static LambdaProperties | getLambdaProperties (const MatchFinder::MatchResult &Result) |
static bool | emitCapture (llvm::StringSet<> &CaptureSet, StringRef Delimiter, CaptureMode CM, CaptureExpr CE, StringRef Identifier, StringRef InitExpression, raw_ostream &Stream) |
static void | emitCaptureList (const LambdaProperties &LP, const MatchFinder::MatchResult &Result, raw_ostream &Stream) |
static ArrayRef< BindArgument > | getForwardedArgumentList (const LambdaProperties &P) |
static bool | locationsInSameFile (const SourceManager &Sources, SourceLocation Loc1, SourceLocation Loc2) |
static StringRef | getRawStringRef (const SourceRange &Range, const SourceManager &Sources, const LangOptions &LangOpts) |
static std::optional< const char * > | getReplacementType (StringRef Type) |
static bool | isIntegralConstant (const Token &Token) |
static LiteralSize | literalTokenSize (const Token &Tok) |
static bool | operator< (LiteralSize LHS, LiteralSize RHS) |
static StatementMatcher | integerComparisonMatcher () |
static DeclarationMatcher | initToZeroMatcher () |
static StatementMatcher | incrementVarMatcher () |
static StatementMatcher | arrayConditionMatcher (internal::Matcher< Expr > LimitExpr) |
StatementMatcher | makeArrayLoopMatcher () |
The matcher for loops over arrays. | |
StatementMatcher | makeIteratorLoopMatcher (bool IsReverse) |
The matcher used for iterator-based for loops. | |
StatementMatcher | makePseudoArrayLoopMatcher () |
The matcher used for array-like containers (pseudoarrays). | |
static std::optional< ContainerCall > | getContainerExpr (const Expr *Call) |
static std::pair< const Expr *, IteratorCallKind > | getContainerFromBeginEndCall (const Expr *Init, bool IsBegin, bool *IsArrow, bool IsReverse) |
Determine whether Init appears to be an initializing an iterator. | |
static const Expr * | findContainer (ASTContext *Context, const Expr *BeginExpr, const Expr *EndExpr, bool *ContainerNeedsDereference, bool IsReverse) |
Determines the container whose begin() and end() functions are called for an iterator-based loop. | |
static StringRef | getStringFromRange (SourceManager &SourceMgr, const LangOptions &LangOpts, SourceRange Range) |
Obtain the original source code text from a SourceRange. | |
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. | |
static bool | isDirectMemberExpr (const Expr *E) |
Returns true when the given expression is a member expression whose base is this (implicitly or not). | |
static bool | canBeModified (ASTContext *Context, const Expr *E) |
Given an expression that represents an usage of an element from the container that we are iterating over, returns false when it can be guaranteed this element cannot be modified as a result of this usage. | |
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. | |
static bool | usagesReturnRValues (const UsageResult &Usages) |
Returns true if the elements of the container are never accessed by reference. | |
static bool | containerIsConst (const Expr *ContainerExpr, bool Dereference) |
Returns true if the container is const-qualified. | |
const Expr * | digThroughConstructorsConversions (const Expr *E) |
Look through conversion/copy constructors and member functions to find the explicit initialization expression, returning it is found. | |
bool | areSameExpr (ASTContext *Context, const Expr *First, const Expr *Second) |
Returns true when two Exprs are equivalent. | |
const DeclRefExpr * | getDeclRef (const Expr *E) |
Returns the DeclRefExpr represented by E, or NULL if there isn't one. | |
bool | areSameVariable (const ValueDecl *First, const ValueDecl *Second) |
Returns true when two ValueDecls are the same variable. | |
static bool | exprReferencesVariable (const ValueDecl *Target, const Expr *E) |
Determines if an expression is a declaration reference to a particular variable. | |
static const Expr * | getDereferenceOperand (const Expr *E) |
If the expression is a dereference or call to operator*(), return the operand. | |
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. | |
static bool | isIndexInSubscriptExpr (const Expr *IndexExpr, const VarDecl *IndexVar) |
Returns true when the index expression is a declaration reference to IndexVar. | |
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. | |
static bool | isDereferenceOfOpCall (const CXXOperatorCallExpr *OpCall, const VarDecl *IndexVar) |
Returns true when Opcall is a call a one-parameter dereference of IndexVar. | |
static bool | isDereferenceOfUop (const UnaryOperator *Uop, const VarDecl *IndexVar) |
Returns true when Uop is a dereference of IndexVar. | |
static bool | isAliasDecl (ASTContext *Context, const Decl *TheDecl, const VarDecl *IndexVar) |
Determines whether the given Decl defines a variable initialized to the loop object. | |
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. | |
static bool | hasOnlyComments (SourceLocation Loc, const LangOptions &Options, StringRef Text) |
static StringRef | getTokenName (const Token &Tok) |
static bool | isValid (SourceRange Range) |
static bool | empty (SourceRange Range) |
static FindArgsResult | findArgs (const CallExpr *Call) |
static std::pair< bool, SmallVector< FixItHint > > | generateReplacements (const MatchFinder::MatchResult &Match, const CallExpr *TopCall, const FindArgsResult &Result, const bool IgnoreNonTrivialTypes, const std::uint64_t IgnoreTrivialTypesOfSizeAbove) |
static ClangTidyModuleRegistry::Add< ModernizeModule > | X ("modernize-module", "Add modernize checks.") |
static TypeMatcher | notTemplateSpecConstRefType () |
static TypeMatcher | nonConstValueType () |
static bool | paramReferredExactlyOnce (const CXXConstructorDecl *Ctor, const ParmVarDecl *ParamDecl) |
Whether or not ParamDecl is used exactly one time in Ctor . | |
static bool | hasRValueOverload (const CXXConstructorDecl *Ctor, const ParmVarDecl *Param) |
Returns true if the given constructor is part of a lvalue/rvalue reference pair, i.e. | |
static SmallVector< const ParmVarDecl *, 2 > | collectParamDecls (const CXXConstructorDecl *Ctor, const ParmVarDecl *ParamDecl) |
Find all references to ParamDecl across all of the redeclarations of Ctor . | |
bool | isMacroIdentifier (const IdentifierTable &Idents, const Token &ProtoToken) |
static DeclarationName | getName (const DependentScopeDeclRefExpr &D) |
static DeclarationName | getName (const DeclRefExpr &D) |
static bool | isNamedType (const ElaboratedTypeLoc &ETL) |
static bool | isNamedType (const DependentNameTypeLoc &DTL) |
static bool | isNamedDeclInStdTraitsSet (const NamedDecl *ND, const llvm::StringSet<> &Set) |
static bool | checkTemplatedDecl (const NestedNameSpecifier *NNS, const llvm::StringSet<> &Set) |
static void | ignoreTypeLocClasses (TypeLoc &Loc, std::initializer_list< TypeLoc::TypeLocClass > const &LocClasses) |
static bool | isMutliLevelPointerToTypeLocClasses (TypeLoc Loc, std::initializer_list< TypeLoc::TypeLocClass > const &LocClasses) |
static std::optional< TemplateSpecializationTypeLoc > | matchEnableIfSpecializationImplTypename (TypeLoc TheType) |
static std::optional< TemplateSpecializationTypeLoc > | matchEnableIfSpecializationImplTrait (TypeLoc TheType) |
static std::optional< TemplateSpecializationTypeLoc > | matchEnableIfSpecializationImpl (TypeLoc TheType) |
static std::optional< EnableIfData > | matchEnableIfSpecialization (TypeLoc TheType) |
static std::pair< std::optional< EnableIfData >, const Decl * > | matchTrailingTemplateParam (const FunctionTemplateDecl *FunctionTemplate) |
template<typename T > | |
static SourceLocation | getRAngleFileLoc (const SourceManager &SM, const T &Element) |
static SourceRange | getConditionRange (ASTContext &Context, const TemplateSpecializationTypeLoc &EnableIf) |
static SourceRange | getTypeRange (ASTContext &Context, const TemplateSpecializationTypeLoc &EnableIf) |
static std::optional< StringRef > | getTypeText (ASTContext &Context, const TemplateSpecializationTypeLoc &EnableIf) |
static std::optional< SourceLocation > | findInsertionForConstraint (const FunctionDecl *Function, ASTContext &Context) |
bool | isPrimaryExpression (const Expr *Expression) |
static std::optional< std::string > | getConditionText (const Expr *ConditionExpr, SourceRange ConditionRange, ASTContext &Context) |
static std::vector< FixItHint > | handleReturnType (const FunctionDecl *Function, const TypeLoc &ReturnType, const EnableIfData &EnableIf, ASTContext &Context) |
static std::vector< FixItHint > | handleTrailingTemplateType (const FunctionTemplateDecl *FunctionTemplate, const FunctionDecl *Function, const Decl *LastTemplateParam, const EnableIfData &EnableIf, ASTContext &Context) |
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 . | |
static std::set< const Type * > | getAllDirectBases (const CXXRecordDecl *Record) |
Returns the names of the direct bases of Record , both virtual and non-virtual. | |
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 . | |
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. | |
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. | |
static bool | bodyEmpty (const ASTContext *Context, const CompoundStmt *Body) |
Returns false if the body has any non-whitespace character. | |
static bool | isActualCharType (const clang::QualType &Ty) |
Find if the passed type is the actual "char" type, not applicable to explicit "signed char" or "unsigned char" types. | |
static BindableMatcher< clang::Stmt > | intCastExpression (bool IsSigned, const std::string &CastBindName=std::string()) |
static StringRef | parseOpCode (BinaryOperator::Opcode Code) |
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) |
static bool | isNegativeComparison (const Expr *ComparisonExpr) |
AST_MATCHER_P (Expr, lengthExprForStringNode, std::string, ID) | |
static clang::ast_matchers::StatementMatcher | unusedReturnValue (clang::ast_matchers::StatementMatcher MatchedCallExpr) |
static SourceLocation | expandIfMacroId (SourceLocation Loc, const SourceManager &SM) |
static bool | isCvr (Token T) |
static bool | isSpecifier (Token T) |
static std::optional< ClassifiedToken > | classifyToken (const FunctionDecl &F, Preprocessor &PP, Token Tok) |
static bool | hasAnyNestedLocalQualifiers (QualType Type) |
template<typename T > | |
static T | getInnerTypeLocAs (TypeLoc Loc) |
Variables | |
static constexpr std::array< StringRef, 5 > | DeprecatedTypes |
static const char | LoopNameArray [] = "forLoopArray" |
static const char | LoopNameIterator [] = "forLoopIterator" |
static const char | LoopNameReverseIterator [] = "forLoopReverseIterator" |
static const char | LoopNamePseudoArray [] = "forLoopPseudoArray" |
static const char | ConditionBoundName [] = "conditionBound" |
static const char | InitVarName [] = "initVar" |
static const char | BeginCallName [] = "beginCall" |
static const char | EndCallName [] = "endCall" |
static const char | EndVarName [] = "endVar" |
static const char | DerefByValueResultName [] = "derefByValueResult" |
static const char | DerefByRefResultName [] = "derefByRefResult" |
static const llvm::StringSet | MemberNames |
static const llvm::StringSet | ADLNames |
static const llvm::StringSet | StdNames |
static const llvm::StringSet | ValueTraits |
static const llvm::StringSet | TypeTraits |
static constexpr char | Bind [] = "" |
static constexpr char | IgnoreSingleElementAggregatesName [] |
static constexpr bool | IgnoreSingleElementAggregatesDefault = true |
static constexpr char | RestrictToPODTypesName [] = "RestrictToPODTypes" |
static constexpr bool | RestrictToPODTypesDefault = false |
static constexpr char | IgnoreMacrosName [] = "IgnoreMacros" |
static constexpr bool | IgnoreMacrosDefault = true |
static constexpr char | StrictCStandardComplianceName [] |
static constexpr bool | StrictCStandardComplianceDefault = true |
static constexpr char | StrictCppStandardComplianceName [] |
static constexpr bool | StrictCppStandardComplianceDefault = true |
static const char | SpecialFunction [] = "SpecialFunction" |
static const char | SpecialFunction [] = "SpecialFunction" |
static const char | DeletedNotPublic [] = "DeletedNotPublic" |
static constexpr const char * | SingleRangeNames [] |
static constexpr const char * | TwoRangeNames [] |
static constexpr const char * | SinglePivotRangeNames [] |
constexpr llvm::StringLiteral | Message |
static constexpr llvm::StringLiteral | ExternCDeclName = "extern-c-decl" |
static constexpr llvm::StringLiteral | ParentDeclName = "parent-decl" |
static constexpr llvm::StringLiteral | TagDeclName = "tag-decl" |
static constexpr llvm::StringLiteral | TypedefName = "typedef" |
static constexpr llvm::StringLiteral | DeclStmtName = "decl-stmt" |
using clang::tidy::modernize::CharsBitSet = typedef std::bitset<1 << CHAR_BIT> |
Definition at line 17 of file RawStringLiteralCheck.h.
using clang::tidy::modernize::ComponentVector = typedef llvm::SmallVector<const clang::Expr *, 16> |
A vector used to store the AST subtrees of an Expr.
Definition at line 52 of file LoopConvertUtils.h.
using clang::tidy::modernize::DeclParentMap = typedef llvm::DenseMap<const clang::VarDecl *, const clang::DeclStmt *> |
A map used to walk the AST in reverse: maps VarDecl to the to parent DeclStmt.
Definition at line 39 of file LoopConvertUtils.h.
using clang::tidy::modernize::NamespaceName = typedef llvm::SmallString<40> |
Definition at line 18 of file ConcatNestedNamespacesCheck.h.
using clang::tidy::modernize::ReplacedVarsMap = typedef llvm::DenseMap<const clang::ForStmt *, const clang::VarDecl *> |
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 44 of file LoopConvertUtils.h.
using clang::tidy::modernize::StmtGeneratedVarNameMap = typedef llvm::DenseMap<const clang::Stmt *, std::string> |
A map used to remember the variable names generated in a Stmt.
Definition at line 48 of file LoopConvertUtils.h.
using clang::tidy::modernize::StmtParentMap = typedef llvm::DenseMap<const clang::Stmt *, const clang::Stmt *> |
A map used to walk the AST in reverse: maps child Stmt to parent Stmt.
Definition at line 35 of file LoopConvertUtils.h.
using clang::tidy::modernize::UsageResult = typedef llvm::SmallVector<Usage, 8> |
Definition at line 273 of file LoopConvertUtils.h.
|
strong |
Enumerator | |
---|---|
ICK_Member | |
ICK_ADL | |
ICK_Std |
Definition at line 336 of file LoopConvertCheck.cpp.
|
strong |
Enumerator | |
---|---|
Unknown | |
Int | |
UnsignedInt | |
Long | |
UnsignedLong | |
LongLong | |
UnsignedLongLong |
Definition at line 17 of file IntegralLiteralExpressionMatcher.h.
Enumerator | |
---|---|
LFK_Array | |
LFK_Iterator | |
LFK_ReverseIterator | |
LFK_PseudoArray |
Definition at line 27 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.
References Field.
Referenced by isCopyAssignmentAndCanBeDefaulted(), and isCopyConstructorAndCanBeDefaulted().
|
static |
Definition at line 364 of file AvoidBindCheck.cpp.
References Args.
Referenced by clang::tidy::modernize::AvoidBindCheck::check().
|
static |
Definition at line 330 of file AvoidBindCheck.cpp.
References Args, findPositionOfPlaceholderUse(), and IsUsed.
Referenced by clang::tidy::modernize::AvoidBindCheck::check().
|
static |
Definition at line 184 of file AvoidBindCheck.cpp.
References anyDescendantIsLocal(), Decl, and DeclRef.
Referenced by anyDescendantIsLocal(), and buildBindArguments().
bool clang::tidy::modernize::areSameExpr | ( | ASTContext * | Context, |
const Expr * | First, | ||
const Expr * | Second | ||
) |
Returns true when two Exprs are equivalent.
Definition at line 193 of file LoopConvertUtils.cpp.
References clang::tidy::utils::areStatementsIdentical().
Referenced by findContainer(), and isIndexInSubscriptExpr().
bool clang::tidy::modernize::areSameVariable | ( | const ValueDecl * | First, |
const ValueDecl * | Second | ||
) |
Returns true when two ValueDecls are the same variable.
Definition at line 203 of file LoopConvertUtils.cpp.
Referenced by exprReferencesVariable(), and isIndexInSubscriptExpr().
|
static |
Definition at line 97 of file LoopConvertCheck.cpp.
References integerComparisonMatcher().
Referenced by makeArrayLoopMatcher(), and makePseudoArrayLoopMatcher().
|
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 432 of file LoopConvertUtils.cpp.
clang::tidy::modernize::AST_MATCHER_P | ( | Expr | , |
lengthExprForStringNode | , | ||
std::string | , | ||
ID | |||
) |
Definition at line 89 of file UseStartsEndsWithCheck.cpp.
|
static |
Returns false if the body has any non-whitespace character.
Definition at line 201 of file UseEqualsDefaultCheck.cpp.
References Text.
Referenced by clang::tidy::modernize::UseEqualsDefaultCheck::check().
|
static |
Definition at line 255 of file AvoidBindCheck.cpp.
References anyDescendantIsLocal(), BindArguments, Callable, CE, E, getSourceTextForExpr(), ignoreTemporariesAndConstructors(), initializeBindArgumentForCallExpr(), tryCaptureAsLocalVariable(), and tryCaptureAsMemberVariable().
Referenced by getLambdaProperties().
|
static |
Given an expression that represents an usage of an element from the container 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 496 of file LoopConvertCheck.cpp.
References E.
Referenced by usagesAreConst().
|
static |
Definition at line 201 of file TypeTraitsCheck.cpp.
References isNamedDeclInStdTraitsSet(), and Type.
Referenced by clang::tidy::modernize::TypeTraitsCheck::check().
|
static |
Definition at line 181 of file UseTrailingReturnTypeCheck.cpp.
References isCvr(), clang::tidy::modernize::ClassifiedToken::IsQualifier, isSpecifier(), clang::tidy::modernize::ClassifiedToken::IsSpecifier, and clang::tidy::modernize::ClassifiedToken::T.
|
static |
Find all references to ParamDecl
across all of the redeclarations of Ctor
.
Definition at line 179 of file PassByValueCheck.cpp.
References Results.
Referenced by clang::tidy::modernize::PassByValueCheck::check().
|
static |
Returns true if the container is const-qualified.
Definition at line 540 of file LoopConvertCheck.cpp.
References getReferencedVariable().
|
static |
Returns true when the Container contains an Expr equivalent to E.
Definition at line 234 of file LoopConvertUtils.cpp.
const Expr * clang::tidy::modernize::digThroughConstructorsConversions | ( | const Expr * | E | ) |
Look through conversion/copy constructors and member functions 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()); vector<int>::const_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.
References digThroughConstructorsConversions(), and E.
Referenced by digThroughConstructorsConversions(), getContainerExpr(), and isAliasDecl().
|
static |
Definition at line 19 of file UseNodiscardCheck.cpp.
Referenced by clang::tidy::modernize::UseNodiscardCheck::check().
|
static |
Definition at line 585 of file AvoidBindCheck.cpp.
Referenced by emitCaptureList().
|
static |
Definition at line 607 of file AvoidBindCheck.cpp.
References emitCapture().
Referenced by clang::tidy::modernize::AvoidBindCheck::check().
|
static |
Definition at line 536 of file MacroToEnumCheck.cpp.
References Range.
Referenced by clang::tidy::modernize::MacroToEnumCheck::check(), isCopyAssignmentAndCanBeDefaulted(), and isCopyConstructorAndCanBeDefaulted().
|
static |
Definition at line 119 of file UseTrailingReturnTypeCheck.cpp.
References expandIfMacroId(), and Loc.
Referenced by expandIfMacroId().
|
static |
Determines if an expression is a declaration reference to a particular variable.
Definition at line 210 of file LoopConvertUtils.cpp.
References areSameVariable(), Decl, E, and getDeclRef().
Referenced by isDereferenceOfOpCall(), and isDereferenceOfUop().
|
static |
Definition at line 33 of file MinMaxUseInitializerListCheck.cpp.
Referenced by clang::tidy::modernize::MinMaxUseInitializerListCheck::check(), and generateReplacements().
|
static |
Definition at line 395 of file AvoidBindCheck.cpp.
Referenced by getCallOperator().
|
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 434 of file LoopConvertCheck.cpp.
References areSameExpr(), and getContainerFromBeginEndCall().
Referenced by clang::tidy::modernize::LoopConvertCheck::check().
|
static |
Definition at line 253 of file UseConstraintsCheck.cpp.
References clang::tidy::utils::lexer::findNextAnyTokenKind(), and clang::tidy::utils::lexer::findPreviousTokenKind().
Referenced by handleReturnType(), and handleTrailingTemplateType().
|
static |
Definition at line 321 of file AvoidBindCheck.cpp.
References Args, and PlaceHolderIndex.
Referenced by addPlaceholderArgs().
|
static |
Definition at line 80 of file MinMaxUseInitializerListCheck.cpp.
References clang::tidy::utils::areStatementsIdentical(), findArgs(), clang::tidy::utils::lexer::findNextTokenSkippingComments(), and generateReplacements().
Referenced by clang::tidy::modernize::MinMaxUseInitializerListCheck::check(), and generateReplacements().
|
static |
Returns the names of the direct bases of Record
, both virtual and non-virtual.
Definition at line 38 of file UseEqualsDefaultCheck.cpp.
Referenced by isCopyAssignmentAndCanBeDefaulted(), and isCopyConstructorAndCanBeDefaulted().
|
static |
Finds all the named non-static fields of Record
.
Definition at line 25 of file UseEqualsDefaultCheck.cpp.
References Field.
Referenced by isCopyAssignmentAndCanBeDefaulted(), and isCopyConstructorAndCanBeDefaulted().
|
static |
Definition at line 515 of file AvoidBindCheck.cpp.
References CE, and ignoreTemporariesAndPointers().
Referenced by getLambdaProperties().
|
static |
Definition at line 492 of file AvoidBindCheck.cpp.
References Decl.
Referenced by getLambdaProperties().
const FunctionDecl * clang::tidy::modernize::getCallMethodDecl | ( | const MatchFinder::MatchResult & | Result, |
CallableType | Type, | ||
CallableMaterializationKind | Materialization | ||
) |
Definition at line 470 of file AvoidBindCheck.cpp.
References getCallOperator(), ignoreTemporariesAndPointers(), Materialization, and Type.
Referenced by getLambdaProperties().
const FunctionDecl * clang::tidy::modernize::getCallOperator | ( | const CXXRecordDecl * | Callable, |
size_t | NumArgs | ||
) |
Definition at line 459 of file AvoidBindCheck.cpp.
References Callable, and findCandidateCallOperators().
Referenced by getCallMethodDecl().
|
static |
Definition at line 200 of file UseConstraintsCheck.cpp.
References clang::tidy::utils::lexer::findPreviousTokenKind(), and getRAngleFileLoc().
Referenced by handleReturnType(), and handleTrailingTemplateType().
|
static |
Definition at line 296 of file UseConstraintsCheck.cpp.
References clang::tidy::utils::lexer::getPreviousTokenAndStart(), isPrimaryExpression(), and Text.
Referenced by handleReturnType(), and handleTrailingTemplateType().
|
static |
Definition at line 357 of file LoopConvertCheck.cpp.
References ADLNames, digThroughConstructorsConversions(), ICK_ADL, ICK_Member, ICK_Std, MemberNames, and StdNames.
Referenced by clang::tidy::modernize::LoopConvertCheck::check(), and getContainerFromBeginEndCall().
|
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 411 of file LoopConvertCheck.cpp.
References getContainerExpr().
Referenced by findContainer().
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 198 of file LoopConvertUtils.cpp.
References E.
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 219 of file LoopConvertUtils.cpp.
References E.
Referenced by isIndexInSubscriptExpr().
|
static |
Definition at line 630 of file AvoidBindCheck.cpp.
References Args.
Referenced by clang::tidy::modernize::AvoidBindCheck::check().
|
static |
Definition at line 141 of file UseDefaultMemberInitCheck.cpp.
References E.
Referenced by sameValue().
|
static |
Definition at line 67 of file UseTransparentFunctorsCheck.cpp.
References Loc.
|
static |
Definition at line 542 of file AvoidBindCheck.cpp.
References Bind, buildBindArguments(), Decl, getCallableMaterialization(), getCallableType(), getCallMethodDecl(), getSourceTextForExpr(), ignoreTemporariesAndPointers(), isFixitSupported(), ReturnType, and Type.
Referenced by clang::tidy::modernize::AvoidBindCheck::check().
|
static |
Definition at line 139 of file TypeTraitsCheck.cpp.
|
static |
Definition at line 135 of file TypeTraitsCheck.cpp.
Referenced by clang::tidy::modernize::NS::appendCloseComment().
|
static |
Definition at line 191 of file UseConstraintsCheck.cpp.
Referenced by getConditionRange(), getTypeRange(), and handleTrailingTemplateType().
|
static |
Definition at line 26 of file ConcatNestedNamespacesCheck.cpp.
References Range.
Referenced by clang::tidy::modernize::NS::getNamespaceBackRange().
|
static |
If the given expression is actually a DeclRefExpr or a MemberExpr, find and return the underlying ValueDecl; otherwise, return NULL.
Definition at line 477 of file LoopConvertCheck.cpp.
References E, and getDeclRef().
Referenced by clang::tidy::modernize::LoopConvertCheck::check(), and containerIsConst().
|
static |
Definition at line 23 of file DeprecatedIosBaseAliasesCheck.cpp.
References Type.
Referenced by clang::tidy::modernize::DeprecatedIosBaseAliasesCheck::check().
|
static |
Definition at line 139 of file AvoidBindCheck.cpp.
References E.
Referenced by buildBindArguments(), clang::tidy::modernize::AvoidBindCheck::check(), getLambdaProperties(), initializeBindArgumentForCallExpr(), tryCaptureAsLocalVariable(), and tryCaptureAsMemberVariable().
|
static |
Obtain the original source code text from a SourceRange.
Definition at line 463 of file LoopConvertCheck.cpp.
References Range.
|
static |
Definition at line 88 of file UseOverrideCheck.cpp.
Referenced by clang::tidy::modernize::UseOverrideCheck::check().
|
static |
Definition at line 76 of file MacroToEnumCheck.cpp.
Referenced by clang::tidy::modernize::MacroToEnumCallbacks::MacroUndefined().
|
static |
Definition at line 218 of file UseConstraintsCheck.cpp.
References clang::tidy::utils::lexer::findPreviousTokenKind(), and getRAngleFileLoc().
Referenced by getTypeText().
|
static |
Definition at line 233 of file UseConstraintsCheck.cpp.
References getTypeRange(), and Text.
Referenced by handleReturnType().
|
static |
Definition at line 24 of file UseDefaultMemberInitCheck.cpp.
References getValueOfValueInit().
Referenced by getValueOfValueInit().
|
static |
Definition at line 342 of file UseConstraintsCheck.cpp.
References findInsertionForConstraint(), getConditionRange(), getConditionText(), getTypeText(), clang::tidy::modernize::EnableIfData::Loc, and clang::tidy::modernize::EnableIfData::Outer.
Referenced by clang::tidy::modernize::UseConstraintsCheck::check().
|
static |
Definition at line 391 of file UseConstraintsCheck.cpp.
References findInsertionForConstraint(), clang::tidy::utils::lexer::findPreviousTokenKind(), getConditionRange(), getConditionText(), getRAngleFileLoc(), and clang::tidy::modernize::EnableIfData::Loc.
Referenced by clang::tidy::modernize::UseConstraintsCheck::check().
|
static |
Definition at line 265 of file UseTrailingReturnTypeCheck.cpp.
References hasAnyNestedLocalQualifiers(), and Type.
Referenced by clang::tidy::modernize::UseTrailingReturnTypeCheck::check(), and hasAnyNestedLocalQualifiers().
|
static |
Definition at line 23 of file MacroToEnumCheck.cpp.
|
static |
Returns true if the given constructor is part of a lvalue/rvalue reference pair, i.e.
Param
is of lvalue reference type, and there exists another constructor such that:
Ctor
.Param
is an rvalue reference of the same pointee typeCtor
or are rvalue references with the same pointee type. Examples: A::A(const B& Param) A::A(B&&)A::A(const B& Param, const C&) A::A(B&& Param, C&&)
A::A(const B&, const C& Param) A::A(B&&, C&& Param)
A::A(const B&, const C& Param) A::A(const B&, C&& Param)
A::A(const B& Param, int) A::A(B&& Param, int)
Definition at line 130 of file PassByValueCheck.cpp.
References C, Candidate, and E.
Referenced by clang::tidy::modernize::PassByValueCheck::check().
|
static |
Definition at line 128 of file AvoidBindCheck.cpp.
References E, ignoreTemporariesAndConstructors(), and ignoreTemporariesAndPointers().
Referenced by buildBindArguments(), and ignoreTemporariesAndConstructors().
|
static |
Definition at line 117 of file AvoidBindCheck.cpp.
References E, and ignoreTemporariesAndPointers().
Referenced by clang::tidy::modernize::AvoidBindCheck::check(), getCallableMaterialization(), getCallMethodDecl(), getLambdaProperties(), ignoreTemporariesAndConstructors(), and ignoreTemporariesAndPointers().
|
static |
Definition at line 338 of file UseAutoCheck.cpp.
References Loc.
Referenced by isMutliLevelPointerToTypeLocClasses().
|
static |
Definition at line 134 of file UseDefaultMemberInitCheck.cpp.
References E.
Referenced by sameValue().
|
static |
Definition at line 92 of file LoopConvertCheck.cpp.
References InitVarName.
Referenced by makeArrayLoopMatcher(), and makePseudoArrayLoopMatcher().
|
static |
Definition at line 157 of file AvoidBindCheck.cpp.
References CE, getSourceTextForExpr(), isCallExprNamed(), tryCaptureAsLocalVariable(), and tryCaptureAsMemberVariable().
Referenced by buildBindArguments().
|
static |
Definition at line 86 of file LoopConvertCheck.cpp.
References InitVarName.
Referenced by makeArrayLoopMatcher(), and makePseudoArrayLoopMatcher().
|
static |
Definition at line 37 of file UseIntegerSignComparisonCheck.cpp.
Referenced by clang::tidy::modernize::UseIntegerSignComparisonCheck::registerMatchers().
|
static |
Definition at line 81 of file LoopConvertCheck.cpp.
References InitVarName.
Referenced by arrayConditionMatcher().
|
static |
Find if the passed type is the actual "char" type, not applicable to explicit "signed char" or "unsigned char" types.
Definition at line 21 of file UseIntegerSignComparisonCheck.cpp.
References Type.
|
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 349 of file LoopConvertUtils.cpp.
References digThroughConstructorsConversions(), E, isDereferenceOfOpCall(), isDereferenceOfUop(), isIndexInSubscriptExpr(), and TheDecl.
|
static |
Definition at line 146 of file AvoidBindCheck.cpp.
Referenced by initializeBindArgumentForCallExpr(), and isFixitSupported().
|
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 124 of file UseEqualsDefaultCheck.cpp.
References accessToFieldInVar(), empty(), Field, getAllDirectBases(), and getAllNamedFields().
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.
References accessToFieldInVar(), empty(), Field, getAllDirectBases(), and getAllNamedFields().
Referenced by clang::tidy::modernize::UseEqualsDefaultCheck::check().
|
static |
Definition at line 171 of file UseTrailingReturnTypeCheck.cpp.
Referenced by classifyToken().
|
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 313 of file LoopConvertUtils.cpp.
References exprReferencesVariable().
Referenced by isAliasDecl().
|
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 326 of file LoopConvertUtils.cpp.
References exprReferencesVariable().
Referenced by isAliasDecl().
|
static |
Returns true when the given expression is a member expression whose base is this
(implicitly or not).
Definition at line 487 of file LoopConvertCheck.cpp.
References E.
Referenced by clang::tidy::modernize::LoopConvertCheck::check().
|
static |
Definition at line 430 of file AvoidBindCheck.cpp.
References Args, isCallExprNamed(), and isPlaceHolderIndexRepeated().
Referenced by getLambdaProperties().
|
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 287 of file LoopConvertUtils.cpp.
References areSameExpr(), getDereferenceOperand(), and isIndexInSubscriptExpr().
|
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 253 of file LoopConvertUtils.cpp.
References areSameVariable(), and getDeclRef().
Referenced by isAliasDecl(), and isIndexInSubscriptExpr().
|
static |
Definition at line 20 of file IntegralLiteralExpressionMatcher.cpp.
References C.
bool clang::tidy::modernize::isMacroIdentifier | ( | const IdentifierTable & | Idents, |
const Token & | ProtoToken | ||
) |
Definition at line 115 of file RedundantVoidArgCheck.cpp.
|
static |
Definition at line 345 of file UseAutoCheck.cpp.
References ignoreTypeLocClasses(), and Loc.
|
static |
Definition at line 195 of file TypeTraitsCheck.cpp.
Referenced by clang::tidy::modernize::TypeTraitsCheck::check(), and checkTemplatedDecl().
|
static |
Definition at line 152 of file TypeTraitsCheck.cpp.
|
static |
Definition at line 143 of file TypeTraitsCheck.cpp.
References Decl.
|
static |
Definition at line 22 of file UseStartsEndsWithCheck.cpp.
Referenced by clang::tidy::modernize::UseStartsEndsWithCheck::check().
|
static |
Definition at line 383 of file AvoidBindCheck.cpp.
References Args.
Referenced by isFixitSupported().
bool clang::tidy::modernize::isPrimaryExpression | ( | const Expr * | Expression | ) |
Definition at line 278 of file UseConstraintsCheck.cpp.
Referenced by getConditionText().
|
static |
Definition at line 175 of file UseTrailingReturnTypeCheck.cpp.
Referenced by classifyToken().
|
static |
Definition at line 532 of file MacroToEnumCheck.cpp.
References Range.
Referenced by clang::tidy::modernize::MacroToEnumCheck::check(), and clang::tidy::modernize::UseNoexceptCheck::registerMatchers().
|
static |
Definition at line 112 of file UseDefaultMemberInitCheck.cpp.
References E.
Referenced by sameValue().
|
static |
Definition at line 97 of file IntegralLiteralExpressionMatcher.cpp.
References Int, Length, Long, LongLong, Text, UnsignedInt, UnsignedLong, and UnsignedLongLong.
|
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.
The following string identifiers are bound to these parts of the AST: ConditionBoundName: '3 + 2' (as an Expr) InitVarName: 'i' (as a VarDecl) LoopName: The entire for loop (as a ForStmt)
Client code will need to make sure that:
Definition at line 119 of file LoopConvertCheck.cpp.
References arrayConditionMatcher(), ConditionBoundName, incrementVarMatcher(), initToZeroMatcher(), and LoopNameArray.
Referenced by clang::tidy::modernize::LoopConvertCheck::registerMatchers().
StatementMatcher clang::tidy::modernize::makeIteratorLoopMatcher | ( | bool | IsReverse | ) |
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):
The following string identifiers are bound to the parts of the AST: InitVarName: 'it' (as a VarDecl) LoopName: The entire for loop (as a ForStmt) In the first example only: EndVarName: 'e' (as a VarDecl) In the second example only: EndCallName: 'container.end()' (as a CXXMemberCallExpr) In the third/fourth examples: 'end(container)' or 'std::end(container)' (as a CallExpr)
Client code will need to make sure that:
Definition at line 160 of file LoopConvertCheck.cpp.
References BeginCallName, DerefByRefResultName, DerefByValueResultName, EndCallName, EndVarName, InitVarName, LoopNameIterator, and LoopNameReverseIterator.
Referenced by clang::tidy::modernize::LoopConvertCheck::registerMatchers().
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):
The following string identifiers are bound to the parts of the AST: InitVarName: 'i' (as a VarDecl) LoopName: The entire for loop (as a ForStmt) In the first example only: EndVarName: 'j' (as a VarDecl) In the second example only: EndCallName: 'container.size()' (as a CXXMemberCallExpr) or 'size(container)' (as a CallExpr)
Client code will need to make sure that:
Definition at line 272 of file LoopConvertCheck.cpp.
References arrayConditionMatcher(), EndCallName, EndVarName, incrementVarMatcher(), initToZeroMatcher(), and LoopNamePseudoArray.
Referenced by clang::tidy::modernize::LoopConvertCheck::registerMatchers().
|
static |
Definition at line 135 of file UseConstraintsCheck.cpp.
References matchEnableIfSpecializationImpl().
Referenced by clang::tidy::modernize::UseConstraintsCheck::check(), and matchTrailingTemplateParam().
|
static |
Definition at line 128 of file UseConstraintsCheck.cpp.
References matchEnableIfSpecializationImplTrait(), and matchEnableIfSpecializationImplTypename().
Referenced by matchEnableIfSpecialization().
|
static |
Definition at line 89 of file UseConstraintsCheck.cpp.
Referenced by matchEnableIfSpecializationImpl().
|
static |
Definition at line 54 of file UseConstraintsCheck.cpp.
Referenced by matchEnableIfSpecializationImpl().
|
static |
Definition at line 149 of file UseConstraintsCheck.cpp.
References matchEnableIfSpecialization().
Referenced by clang::tidy::modernize::UseConstraintsCheck::check().
|
static |
Definition at line 53 of file PassByValueCheck.cpp.
Referenced by clang::tidy::modernize::PassByValueCheck::registerMatchers().
|
static |
Definition at line 47 of file PassByValueCheck.cpp.
Referenced by clang::tidy::modernize::PassByValueCheck::registerMatchers().
|
static |
Definition at line 137 of file IntegralLiteralExpressionMatcher.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 60 of file PassByValueCheck.cpp.
Referenced by clang::tidy::modernize::PassByValueCheck::check().
|
static |
Definition at line 59 of file UseIntegerSignComparisonCheck.cpp.
Referenced by clang::tidy::modernize::UseIntegerSignComparisonCheck::check().
|
static |
Definition at line 56 of file UseOverrideCheck.cpp.
Referenced by clang::tidy::modernize::UseOverrideCheck::check().
|
static |
Definition at line 148 of file UseDefaultMemberInitCheck.cpp.
References getInitializer(), ignoreUnaryPlus(), isZero(), and sameValue().
Referenced by sameValue().
|
static |
Definition at line 197 of file AvoidBindCheck.cpp.
References CE, E, getSourceTextForExpr(), and tryCaptureAsLocalVariable().
Referenced by buildBindArguments(), initializeBindArgumentForCallExpr(), and tryCaptureAsLocalVariable().
|
static |
Definition at line 219 of file AvoidBindCheck.cpp.
References CE, E, getSourceTextForExpr(), and tryCaptureAsMemberVariable().
Referenced by buildBindArguments(), initializeBindArgumentForCallExpr(), and tryCaptureAsMemberVariable().
|
static |
Definition at line 75 of file UseStdPrintCheck.cpp.
Referenced by clang::tidy::modernize::UseStdPrintCheck::registerMatchers().
|
static |
Returns true when it can be guaranteed that the elements of the container are not being modified.
Definition at line 515 of file LoopConvertCheck.cpp.
References canBeModified(), clang::tidy::modernize::Usage::UK_CaptureByCopy, and clang::tidy::modernize::Usage::UK_CaptureByRef.
|
static |
Returns true if the elements of the container are never accessed by reference.
Definition at line 531 of file LoopConvertCheck.cpp.
|
static |
|
static |
Definition at line 74 of file LoopConvertCheck.cpp.
Referenced by getContainerExpr().
|
static |
Definition at line 66 of file LoopConvertCheck.cpp.
Referenced by makeIteratorLoopMatcher().
|
staticconstexpr |
Definition at line 170 of file TypeTraitsCheck.cpp.
Referenced by clang::tidy::modernize::TypeTraitsCheck::check(), getLambdaProperties(), and clang::tidy::modernize::TypeTraitsCheck::registerMatchers().
|
static |
Definition at line 64 of file LoopConvertCheck.cpp.
Referenced by clang::tidy::modernize::LoopConvertCheck::check(), and makeArrayLoopMatcher().
|
staticconstexpr |
Definition at line 28 of file UseUsingCheck.cpp.
Referenced by clang::tidy::modernize::UseUsingCheck::check(), and clang::tidy::modernize::UseUsingCheck::registerMatchers().
|
static |
Definition at line 45 of file UseEqualsDeleteCheck.cpp.
Referenced by clang::tidy::modernize::UseEqualsDeleteCheck::check(), and clang::tidy::modernize::UseEqualsDeleteCheck::registerMatchers().
|
staticconstexpr |
Definition at line 18 of file DeprecatedIosBaseAliasesCheck.cpp.
Referenced by clang::tidy::modernize::DeprecatedIosBaseAliasesCheck::registerMatchers().
|
static |
Definition at line 70 of file LoopConvertCheck.cpp.
Referenced by makeIteratorLoopMatcher().
|
static |
Definition at line 69 of file LoopConvertCheck.cpp.
Referenced by makeIteratorLoopMatcher().
|
static |
Definition at line 67 of file LoopConvertCheck.cpp.
Referenced by clang::tidy::modernize::LoopConvertCheck::check(), makeIteratorLoopMatcher(), and makePseudoArrayLoopMatcher().
|
static |
Definition at line 68 of file LoopConvertCheck.cpp.
Referenced by clang::tidy::modernize::LoopConvertCheck::check(), makeIteratorLoopMatcher(), and makePseudoArrayLoopMatcher().
|
staticconstexpr |
Definition at line 24 of file UseUsingCheck.cpp.
Referenced by clang::tidy::modernize::UseUsingCheck::check(), and clang::tidy::modernize::UseUsingCheck::registerMatchers().
|
staticconstexpr |
Definition at line 33 of file UseDesignatedInitializersCheck.cpp.
|
staticconstexpr |
Definition at line 32 of file UseDesignatedInitializersCheck.cpp.
Referenced by clang::tidy::modernize::UseDesignatedInitializersCheck::storeOptions().
|
staticconstexpr |
Definition at line 27 of file UseDesignatedInitializersCheck.cpp.
|
staticconstexpr |
Definition at line 25 of file UseDesignatedInitializersCheck.cpp.
Referenced by clang::tidy::modernize::UseDesignatedInitializersCheck::storeOptions().
|
static |
Definition at line 65 of file LoopConvertCheck.cpp.
Referenced by clang::tidy::modernize::LoopConvertCheck::check(), incrementVarMatcher(), initToZeroMatcher(), integerComparisonMatcher(), and makeIteratorLoopMatcher().
|
static |
Definition at line 60 of file LoopConvertCheck.cpp.
Referenced by clang::tidy::modernize::LoopConvertCheck::check(), and makeArrayLoopMatcher().
|
static |
Definition at line 61 of file LoopConvertCheck.cpp.
Referenced by clang::tidy::modernize::LoopConvertCheck::check(), and makeIteratorLoopMatcher().
|
static |
Definition at line 63 of file LoopConvertCheck.cpp.
Referenced by clang::tidy::modernize::LoopConvertCheck::check(), and makePseudoArrayLoopMatcher().
|
static |
Definition at line 62 of file LoopConvertCheck.cpp.
Referenced by clang::tidy::modernize::LoopConvertCheck::check(), and makeIteratorLoopMatcher().
|
static |
Definition at line 71 of file LoopConvertCheck.cpp.
Referenced by getContainerExpr().
|
constexpr |
Definition at line 116 of file UseTrailingReturnTypeCheck.cpp.
Referenced by clang::tidy::modernize::UseOverrideCheck::check(), clang::tidy::modernize::UseTrailingReturnTypeCheck::check(), and clang::tidy::modernize::UseTransparentFunctorsCheck::check().
|
staticconstexpr |
Definition at line 25 of file UseUsingCheck.cpp.
Referenced by clang::tidy::modernize::UseUsingCheck::check(), and clang::tidy::modernize::UseUsingCheck::registerMatchers().
|
staticconstexpr |
Definition at line 30 of file UseDesignatedInitializersCheck.cpp.
|
staticconstexpr |
Definition at line 29 of file UseDesignatedInitializersCheck.cpp.
Referenced by clang::tidy::modernize::UseDesignatedInitializersCheck::storeOptions().
|
staticconstexpr |
Definition at line 99 of file modernize/UseRangesCheck.cpp.
Referenced by clang::tidy::modernize::UseRangesCheck::getReplacerMap().
|
staticconstexpr |
Definition at line 21 of file modernize/UseRangesCheck.cpp.
Referenced by clang::tidy::modernize::UseRangesCheck::getReplacerMap().
|
static |
Definition at line 21 of file UseEqualsDefaultCheck.cpp.
Referenced by clang::tidy::modernize::UseEqualsDefaultCheck::check(), clang::tidy::modernize::UseEqualsDeleteCheck::check(), clang::tidy::modernize::UseEqualsDefaultCheck::registerMatchers(), and clang::tidy::modernize::UseEqualsDeleteCheck::registerMatchers().
|
static |
Definition at line 44 of file UseEqualsDeleteCheck.cpp.
|
static |
Definition at line 77 of file LoopConvertCheck.cpp.
Referenced by getContainerExpr().
|
staticconstexpr |
Definition at line 41 of file UseDesignatedInitializersCheck.cpp.
|
staticconstexpr |
Definition at line 39 of file UseDesignatedInitializersCheck.cpp.
Referenced by clang::tidy::modernize::UseDesignatedInitializersCheck::storeOptions().
|
staticconstexpr |
Definition at line 37 of file UseDesignatedInitializersCheck.cpp.
|
staticconstexpr |
Definition at line 35 of file UseDesignatedInitializersCheck.cpp.
Referenced by clang::tidy::modernize::UseDesignatedInitializersCheck::storeOptions().
|
staticconstexpr |
Definition at line 26 of file UseUsingCheck.cpp.
Referenced by clang::tidy::modernize::UseUsingCheck::check(), and clang::tidy::modernize::UseUsingCheck::registerMatchers().
|
staticconstexpr |
Definition at line 83 of file modernize/UseRangesCheck.cpp.
Referenced by clang::tidy::modernize::UseRangesCheck::getReplacerMap().
|
staticconstexpr |
Definition at line 27 of file UseUsingCheck.cpp.
Referenced by clang::tidy::modernize::RedundantVoidArgCheck::check(), clang::tidy::modernize::UseUsingCheck::check(), and clang::tidy::modernize::UseUsingCheck::registerMatchers().
|
static |
Definition at line 105 of file TypeTraitsCheck.cpp.
Referenced by clang::tidy::modernize::TypeTraitsCheck::check().
|
static |
Definition at line 18 of file TypeTraitsCheck.cpp.
Referenced by clang::tidy::modernize::TypeTraitsCheck::check().