clang-tools 22.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... | |
class | AvoidSetjmpLongjmpCheck |
Guards against use of setjmp/longjmp in C++ code. More... | |
class | AvoidVariadicFunctionsCheck |
Find all function definitions of C-style variadic functions. 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 |
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 | UseScopedLockCheck |
Finds uses of std::lock_guard and suggests replacing them with C++17's / alternative std::scoped_lock. 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 |
A map used to walk the AST in reverse: maps VarDecl to the to parent DeclStmt. | |
using | ReplacedVarsMap |
A map used to track which variables have been removed by a refactoring pass. | |
using | StmtGeneratedVarNameMap |
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) |
static const FunctionDecl * | getCallOperator (const CXXRecordDecl *Callable, size_t NumArgs) |
static 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) |
static StatementMatcher | makeArrayLoopMatcher () |
The matcher for loops over arrays. | |
static StatementMatcher | makeIteratorLoopMatcher (bool IsReverse) |
The matcher used for iterator-based for loops. | |
static 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) |
template<size_t N> | |
static bool | textEquals (const char(&Needle)[N], const char *HayStack) |
template<size_t N> | |
static size_t | len (const char(&)[N]) |
static bool | isValid (SourceRange Range) |
static bool | empty (SourceRange Range) |
static std::string | getNewExprName (const CXXNewExpr *NewExpr, const SourceManager &SM, const LangOptions &Lang) |
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 bool | isFirstFriendOfSecond (const CXXRecordDecl *Friend, const CXXRecordDecl *Class) |
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 . | |
static bool | containsEscapes (StringRef HayStack, StringRef Escapes) |
static bool | isRawStringLiteral (StringRef Text) |
static bool | containsEscapedCharacters (const MatchFinder::MatchResult &Result, const StringLiteral *Literal, const CharsBitSet &DisallowedChars) |
static bool | containsDelimiter (StringRef Bytes, const std::string &Delimiter) |
static std::optional< StringRef > | createUserDefinedSuffix (const StringLiteral *Literal, const SourceManager &SM, const LangOptions &LangOpts) |
static std::string | createRawStringLiteral (const StringLiteral *Literal, const std::string &DelimiterStem, const SourceManager &SM, const LangOptions &LangOpts) |
static bool | compareStringLength (StringRef Replacement, const StringLiteral *Literal, const SourceManager &SM, const LangOptions &LangOpts) |
static bool | isMacroIdentifier (const IdentifierTable &Idents, const Token &ProtoToken) |
static DeclarationName | getName (const DependentScopeDeclRefExpr &D) |
static DeclarationName | getName (const DeclRefExpr &D) |
static bool | isNamedDeclInStdTraitsSet (const NamedDecl *ND, const llvm::StringSet<> &Set) |
static bool | checkTemplatedDecl (NestedNameSpecifier NNS, const llvm::StringSet<> &Set) |
static void | ignoreTypeLocClasses (TypeLoc &Loc, const std::initializer_list< TypeLoc::TypeLocClass > &LocClasses) |
static bool | isMultiLevelPointerToTypeLocClasses (TypeLoc Loc, const std::initializer_list< TypeLoc::TypeLocClass > &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) |
static 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 bool | isExprAllowedInMemberInit (const Expr *E) |
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. | |
static 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 | isLockGuardDecl (const NamedDecl *Decl) |
static bool | isLockGuard (const QualType &Type) |
static llvm::SmallVector< const VarDecl * > | getLockGuardsFromDecl (const DeclStmt *DS) |
static llvm::SmallVector< llvm::SmallVector< const VarDecl * > > | findLocksInCompoundStmt (const CompoundStmt *Block, const ast_matchers::MatchFinder::MatchResult &Result) |
static SourceRange | getLockGuardRange (const TypeSourceInfo *SourceInfo) |
static SourceRange | getLockGuardNameRange (const TypeSourceInfo *SourceInfo) |
static bool | isNegativeComparison (const Expr *ComparisonExpr) |
static clang::ast_matchers::StatementMatcher | unusedReturnValue (clang::ast_matchers::StatementMatcher MatchedCallExpr) |
static SourceLocation | expandIfMacroId (SourceLocation Loc, const SourceManager &SM) |
static SourceLocation | findTrailingReturnTypeSourceLocation (const FunctionDecl &F, const FunctionTypeLoc &FTL, const ASTContext &Ctx, const SourceManager &SM, const LangOptions &LangOpts) |
static bool | isCvr (Token T) |
static bool | isSpecifier (Token T) |
static std::optional< ClassifiedToken > | classifyToken (const FunctionDecl &F, Preprocessor &PP, Token Tok) |
static std::optional< SmallVector< ClassifiedToken, 8 > > | classifyTokensBeforeFunctionName (const FunctionDecl &F, const ASTContext &Ctx, const SourceManager &SM, const LangOptions &LangOpts, Preprocessor *PP) |
static bool | hasAnyNestedLocalQualifiers (QualType Type) |
static SourceRange | findReturnTypeAndCVSourceRange (const FunctionDecl &F, const TypeLoc &ReturnLoc, const ASTContext &Ctx, const SourceManager &SM, const LangOptions &LangOpts, Preprocessor *PP) |
static SourceLocation | findLambdaTrailingReturnInsertLoc (const CXXMethodDecl *Method, const SourceManager &SM, const LangOptions &LangOpts, const ASTContext &Ctx) |
static void | keepSpecifiers (std::string &ReturnType, std::string &Auto, SourceRange ReturnTypeCVRange, const FunctionDecl &F, const FriendDecl *Fr, const ASTContext &Ctx, const SourceManager &SM, const LangOptions &LangOpts, Preprocessor *PP) |
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 constexpr char | ConstructorCall [] = "constructorCall" |
static constexpr char | DirectVar [] = "directVar" |
static constexpr char | ResetCall [] = "resetCall" |
static constexpr char | NewExpression [] = "newExpression" |
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 [] |
static const StringRef | UseScopedLockMessage |
constexpr llvm::StringLiteral | ErrorMessageOnFunction |
constexpr llvm::StringLiteral | ErrorMessageOnLambda |
static const StringRef | Message = "prefer transparent functors '%0<>'" |
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 = std::bitset<1 << CHAR_BIT> |
Definition at line 17 of file RawStringLiteralCheck.h.
using clang::tidy::modernize::ComponentVector = 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.
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 = llvm::SmallString<40> |
Definition at line 18 of file ConcatNestedNamespacesCheck.h.
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.
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 = 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 = llvm::SmallVector<Usage, 8> |
Definition at line 273 of file LoopConvertUtils.h.
|
strong |
Enumerator | |
---|---|
ICK_Member | |
ICK_ADL | |
ICK_Std |
Definition at line 334 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.
|
static |
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.
Referenced by isCopyAssignmentAndCanBeDefaulted(), and isCopyConstructorAndCanBeDefaulted().
|
static |
Definition at line 360 of file AvoidBindCheck.cpp.
Referenced by clang::tidy::modernize::AvoidBindCheck::check().
|
static |
Definition at line 327 of file AvoidBindCheck.cpp.
References findPositionOfPlaceholderUse().
Referenced by clang::tidy::modernize::AvoidBindCheck::check().
|
static |
Definition at line 181 of file AvoidBindCheck.cpp.
References anyDescendantIsLocal().
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 191 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 201 of file LoopConvertUtils.cpp.
Referenced by exprReferencesVariable(), and isIndexInSubscriptExpr().
|
static |
Definition at line 95 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 430 of file LoopConvertUtils.cpp.
|
static |
Returns false if the body has any non-whitespace character.
Definition at line 201 of file UseEqualsDefaultCheck.cpp.
Referenced by clang::tidy::modernize::UseEqualsDefaultCheck::check().
|
static |
Definition at line 252 of file AvoidBindCheck.cpp.
References anyDescendantIsLocal(), 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 494 of file LoopConvertCheck.cpp.
Referenced by usagesAreConst().
|
static |
Definition at line 208 of file TypeTraitsCheck.cpp.
References isNamedDeclInStdTraitsSet().
Referenced by clang::tidy::modernize::TypeTraitsCheck::check().
|
static |
Definition at line 211 of file UseTrailingReturnTypeCheck.cpp.
References isCvr(), clang::tidy::modernize::ClassifiedToken::IsQualifier, clang::tidy::modernize::ClassifiedToken::IsSpecifier, isSpecifier(), and clang::tidy::modernize::ClassifiedToken::T.
Referenced by classifyTokensBeforeFunctionName().
|
static |
Definition at line 251 of file UseTrailingReturnTypeCheck.cpp.
References classifyToken(), and expandIfMacroId().
Referenced by findReturnTypeAndCVSourceRange(), and keepSpecifiers().
|
static |
Find all references to ParamDecl
across all of the redeclarations of Ctor
.
Definition at line 208 of file PassByValueCheck.cpp.
References collectParamDecls().
Referenced by clang::tidy::modernize::PassByValueCheck::check(), and collectParamDecls().
|
static |
Definition at line 150 of file RawStringLiteralCheck.cpp.
Referenced by clang::tidy::modernize::RawStringLiteralCheck::check().
|
static |
Returns true if the container is const-qualified.
Definition at line 538 of file LoopConvertCheck.cpp.
References getReferencedVariable().
|
static |
Definition at line 65 of file RawStringLiteralCheck.cpp.
Referenced by createRawStringLiteral().
|
static |
Definition at line 43 of file RawStringLiteralCheck.cpp.
References containsEscapes(), and isRawStringLiteral().
Referenced by clang::tidy::modernize::RawStringLiteralCheck::check().
|
static |
Definition at line 22 of file RawStringLiteralCheck.cpp.
Referenced by containsEscapedCharacters().
|
static |
Returns true when the Container contains an Expr equivalent to E.
Definition at line 232 of file LoopConvertUtils.cpp.
|
static |
Definition at line 128 of file RawStringLiteralCheck.cpp.
References containsDelimiter(), and createUserDefinedSuffix().
Referenced by clang::tidy::modernize::RawStringLiteralCheck::check().
|
static |
Definition at line 109 of file RawStringLiteralCheck.cpp.
Referenced by createRawStringLiteral().
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 167 of file LoopConvertUtils.cpp.
References digThroughConstructorsConversions().
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 581 of file AvoidBindCheck.cpp.
Referenced by emitCaptureList().
|
static |
Definition at line 603 of file AvoidBindCheck.cpp.
References emitCapture().
Referenced by clang::tidy::modernize::AvoidBindCheck::check().
|
static |
Definition at line 530 of file MacroToEnumCheck.cpp.
Referenced by clang::tidy::modernize::MacroToEnumCheck::check(), isCopyAssignmentAndCanBeDefaulted(), isCopyConstructorAndCanBeDefaulted(), and clang::tidy::modernize::MakeUniqueCheck::MakeUniqueCheck().
|
static |
Definition at line 149 of file UseTrailingReturnTypeCheck.cpp.
References expandIfMacroId().
Referenced by classifyTokensBeforeFunctionName(), expandIfMacroId(), and findReturnTypeAndCVSourceRange().
|
static |
Determines if an expression is a declaration reference to a particular variable.
Definition at line 208 of file LoopConvertUtils.cpp.
References areSameVariable(), 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 391 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 432 of file LoopConvertCheck.cpp.
References areSameExpr(), and getContainerFromBeginEndCall().
Referenced by clang::tidy::modernize::LoopConvertCheck::check().
|
static |
Definition at line 271 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 361 of file UseTrailingReturnTypeCheck.cpp.
|
static |
Definition at line 62 of file UseScopedLockCheck.cpp.
References getLockGuardsFromDecl().
Referenced by clang::tidy::modernize::UseScopedLockCheck::check().
|
static |
Definition at line 318 of file AvoidBindCheck.cpp.
Referenced by addPlaceholderArgs().
|
static |
Definition at line 305 of file UseTrailingReturnTypeCheck.cpp.
References classifyTokensBeforeFunctionName(), expandIfMacroId(), and hasAnyNestedLocalQualifiers().
Referenced by clang::tidy::modernize::UseTrailingReturnTypeCheck::check().
|
static |
Definition at line 158 of file UseTrailingReturnTypeCheck.cpp.
Referenced by clang::tidy::modernize::UseTrailingReturnTypeCheck::check().
|
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.
Referenced by isCopyAssignmentAndCanBeDefaulted(), and isCopyConstructorAndCanBeDefaulted().
|
static |
Definition at line 511 of file AvoidBindCheck.cpp.
References ignoreTemporariesAndPointers().
Referenced by getLambdaProperties().
|
static |
Definition at line 488 of file AvoidBindCheck.cpp.
Referenced by getLambdaProperties().
|
static |
Definition at line 466 of file AvoidBindCheck.cpp.
References getCallOperator(), and ignoreTemporariesAndPointers().
Referenced by getLambdaProperties().
|
static |
Definition at line 455 of file AvoidBindCheck.cpp.
References findCandidateCallOperators().
Referenced by getCallMethodDecl().
|
static |
Definition at line 218 of file UseConstraintsCheck.cpp.
References clang::tidy::utils::lexer::findPreviousTokenKind(), and getRAngleFileLoc().
Referenced by handleReturnType(), and handleTrailingTemplateType().
|
static |
Definition at line 314 of file UseConstraintsCheck.cpp.
References clang::tidy::utils::lexer::getPreviousTokenAndStart(), and isPrimaryExpression().
Referenced by handleReturnType(), and handleTrailingTemplateType().
|
static |
Definition at line 355 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 409 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 196 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 217 of file LoopConvertUtils.cpp.
Referenced by isIndexInSubscriptExpr().
|
static |
Definition at line 626 of file AvoidBindCheck.cpp.
Referenced by clang::tidy::modernize::AvoidBindCheck::check().
|
static |
Definition at line 181 of file UseDefaultMemberInitCheck.cpp.
Referenced by sameValue().
|
static |
Definition at line 64 of file UseTransparentFunctorsCheck.cpp.
Referenced by clang::tidy::modernize::UseTransparentFunctorsCheck::check().
|
static |
Definition at line 538 of file AvoidBindCheck.cpp.
References Bind, buildBindArguments(), getCallableMaterialization(), getCallableType(), getCallMethodDecl(), getSourceTextForExpr(), ignoreTemporariesAndPointers(), and isFixitSupported().
Referenced by clang::tidy::modernize::AvoidBindCheck::check().
|
static |
Definition at line 100 of file UseScopedLockCheck.cpp.
|
static |
Definition at line 93 of file UseScopedLockCheck.cpp.
|
static |
Definition at line 44 of file UseScopedLockCheck.cpp.
References isLockGuard().
Referenced by clang::tidy::modernize::UseScopedLockCheck::check(), and findLocksInCompoundStmt().
|
static |
Definition at line 167 of file TypeTraitsCheck.cpp.
|
static |
Definition at line 163 of file TypeTraitsCheck.cpp.
Referenced by clang::tidy::modernize::NS::appendCloseComment().
|
static |
Definition at line 24 of file MakeSmartPtrCheck.cpp.
|
static |
Definition at line 209 of file UseConstraintsCheck.cpp.
Referenced by getConditionRange(), getTypeRange(), and handleTrailingTemplateType().
|
static |
Definition at line 25 of file ConcatNestedNamespacesCheck.cpp.
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 475 of file LoopConvertCheck.cpp.
References getDeclRef().
Referenced by clang::tidy::modernize::LoopConvertCheck::check(), and containerIsConst().
|
static |
Definition at line 22 of file DeprecatedIosBaseAliasesCheck.cpp.
Referenced by clang::tidy::modernize::DeprecatedIosBaseAliasesCheck::check().
|
static |
Definition at line 136 of file AvoidBindCheck.cpp.
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 461 of file LoopConvertCheck.cpp.
|
static |
Definition at line 88 of file UseOverrideCheck.cpp.
Referenced by clang::tidy::modernize::UseOverrideCheck::check().
|
static |
Definition at line 75 of file MacroToEnumCheck.cpp.
Referenced by clang::tidy::modernize::MacroToEnumCallbacks::MacroUndefined().
|
static |
Definition at line 236 of file UseConstraintsCheck.cpp.
References clang::tidy::utils::lexer::findPreviousTokenKind(), and getRAngleFileLoc().
Referenced by getTypeText().
|
static |
Definition at line 251 of file UseConstraintsCheck.cpp.
References getTypeRange().
Referenced by handleReturnType().
|
static |
Definition at line 64 of file UseDefaultMemberInitCheck.cpp.
References getValueOfValueInit().
Referenced by getValueOfValueInit().
|
static |
Definition at line 360 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 409 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 293 of file UseTrailingReturnTypeCheck.cpp.
References hasAnyNestedLocalQualifiers().
Referenced by clang::tidy::modernize::UseTrailingReturnTypeCheck::check(), findReturnTypeAndCVSourceRange(), and hasAnyNestedLocalQualifiers().
|
static |
Definition at line 22 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:
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 160 of file PassByValueCheck.cpp.
References hasRValueOverload().
Referenced by clang::tidy::modernize::PassByValueCheck::check(), and hasRValueOverload().
|
static |
Definition at line 125 of file AvoidBindCheck.cpp.
References ignoreTemporariesAndConstructors(), and ignoreTemporariesAndPointers().
Referenced by buildBindArguments(), and ignoreTemporariesAndConstructors().
|
static |
Definition at line 114 of file AvoidBindCheck.cpp.
References ignoreTemporariesAndPointers().
Referenced by clang::tidy::modernize::AvoidBindCheck::check(), getCallableMaterialization(), getCallMethodDecl(), getLambdaProperties(), ignoreTemporariesAndConstructors(), and ignoreTemporariesAndPointers().
|
static |
Definition at line 335 of file UseAutoCheck.cpp.
Referenced by isMultiLevelPointerToTypeLocClasses().
|
static |
Definition at line 174 of file UseDefaultMemberInitCheck.cpp.
Referenced by sameValue().
|
static |
Definition at line 90 of file LoopConvertCheck.cpp.
References InitVarName.
Referenced by makeArrayLoopMatcher(), and makePseudoArrayLoopMatcher().
|
static |
Definition at line 154 of file AvoidBindCheck.cpp.
References getSourceTextForExpr(), isCallExprNamed(), tryCaptureAsLocalVariable(), and tryCaptureAsMemberVariable().
Referenced by buildBindArguments().
|
static |
Definition at line 84 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 79 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.
|
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 347 of file LoopConvertUtils.cpp.
References digThroughConstructorsConversions(), isDereferenceOfOpCall(), isDereferenceOfUop(), and isIndexInSubscriptExpr().
|
static |
Definition at line 143 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(), 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(), getAllDirectBases(), and getAllNamedFields().
Referenced by clang::tidy::modernize::UseEqualsDefaultCheck::check().
|
static |
Definition at line 201 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 311 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 324 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 485 of file LoopConvertCheck.cpp.
Referenced by clang::tidy::modernize::LoopConvertCheck::check().
|
static |
Definition at line 21 of file UseDefaultMemberInitCheck.cpp.
References isExprAllowedInMemberInit().
Referenced by isExprAllowedInMemberInit().
|
static |
Definition at line 23 of file PassByValueCheck.cpp.
|
static |
Definition at line 426 of file AvoidBindCheck.cpp.
References 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 285 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 251 of file LoopConvertUtils.cpp.
References areSameVariable(), and getDeclRef().
Referenced by isAliasDecl(), and isIndexInSubscriptExpr().
|
static |
Definition at line 20 of file IntegralLiteralExpressionMatcher.cpp.
|
static |
Definition at line 30 of file UseScopedLockCheck.cpp.
References isLockGuardDecl().
Referenced by getLockGuardsFromDecl().
|
static |
Definition at line 25 of file UseScopedLockCheck.cpp.
Referenced by isLockGuard().
|
static |
Definition at line 115 of file RedundantVoidArgCheck.cpp.
|
static |
Definition at line 342 of file UseAutoCheck.cpp.
References ignoreTypeLocClasses().
|
static |
Definition at line 202 of file TypeTraitsCheck.cpp.
Referenced by clang::tidy::modernize::TypeTraitsCheck::check(), and checkTemplatedDecl().
|
static |
Definition at line 22 of file UseStartsEndsWithCheck.cpp.
Referenced by clang::tidy::modernize::UseStartsEndsWithCheck::check().
|
static |
Definition at line 379 of file AvoidBindCheck.cpp.
Referenced by isFixitSupported().
|
static |
Definition at line 296 of file UseConstraintsCheck.cpp.
Referenced by getConditionText().
|
static |
Definition at line 36 of file RawStringLiteralCheck.cpp.
Referenced by containsEscapedCharacters().
|
static |
Definition at line 205 of file UseTrailingReturnTypeCheck.cpp.
Referenced by classifyToken().
|
static |
Definition at line 526 of file MacroToEnumCheck.cpp.
Referenced by clang::tidy::modernize::MacroToEnumCheck::check(), and clang::tidy::modernize::UseNoexceptCheck::registerMatchers().
|
static |
Definition at line 152 of file UseDefaultMemberInitCheck.cpp.
Referenced by sameValue().
|
static |
Definition at line 403 of file UseTrailingReturnTypeCheck.cpp.
References classifyTokensBeforeFunctionName().
Referenced by clang::tidy::modernize::UseTrailingReturnTypeCheck::check().
|
static |
Definition at line 403 of file MacroToEnumCheck.cpp.
Referenced by clang::tidy::modernize::MacroToEnumCallbacks::PragmaDirective().
|
static |
Definition at line 97 of file IntegralLiteralExpressionMatcher.cpp.
References Int, Long, LongLong, UnsignedInt, UnsignedLong, and UnsignedLongLong.
|
static |
Definition at line 19 of file ConcatNestedNamespacesCheck.cpp.
Referenced by clang::tidy::modernize::ConcatNestedNamespacesCheck::check().
|
static |
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 117 of file LoopConvertCheck.cpp.
References arrayConditionMatcher(), ConditionBoundName, incrementVarMatcher(), initToZeroMatcher(), and LoopNameArray.
Referenced by clang::tidy::modernize::LoopConvertCheck::registerMatchers().
|
static |
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 158 of file LoopConvertCheck.cpp.
References BeginCallName, DerefByRefResultName, DerefByValueResultName, EndCallName, EndVarName, InitVarName, LoopNameIterator, and LoopNameReverseIterator.
Referenced by clang::tidy::modernize::LoopConvertCheck::registerMatchers().
|
static |
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 270 of file LoopConvertCheck.cpp.
References arrayConditionMatcher(), EndCallName, EndVarName, incrementVarMatcher(), initToZeroMatcher(), and LoopNamePseudoArray.
Referenced by clang::tidy::modernize::LoopConvertCheck::registerMatchers().
|
static |
Definition at line 153 of file UseConstraintsCheck.cpp.
References matchEnableIfSpecializationImpl().
Referenced by clang::tidy::modernize::UseConstraintsCheck::check(), and matchTrailingTemplateParam().
|
static |
Definition at line 146 of file UseConstraintsCheck.cpp.
References matchEnableIfSpecializationImplTrait(), and matchEnableIfSpecializationImplTypename().
Referenced by matchEnableIfSpecialization().
|
static |
Definition at line 101 of file UseConstraintsCheck.cpp.
Referenced by matchEnableIfSpecializationImpl().
|
static |
Definition at line 55 of file UseConstraintsCheck.cpp.
Referenced by matchEnableIfSpecializationImpl().
|
static |
Definition at line 167 of file UseConstraintsCheck.cpp.
References matchEnableIfSpecialization().
Referenced by clang::tidy::modernize::UseConstraintsCheck::check().
|
static |
Definition at line 83 of file PassByValueCheck.cpp.
References nonConstValueType().
Referenced by nonConstValueType(), and clang::tidy::modernize::PassByValueCheck::registerMatchers().
|
static |
Definition at line 78 of file PassByValueCheck.cpp.
References notTemplateSpecConstRefType().
Referenced by notTemplateSpecConstRefType(), and 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 90 of file PassByValueCheck.cpp.
References paramReferredExactlyOnce().
Referenced by clang::tidy::modernize::PassByValueCheck::check(), and paramReferredExactlyOnce().
|
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 188 of file UseDefaultMemberInitCheck.cpp.
References getInitializer(), ignoreUnaryPlus(), isZero(), and sameValue().
Referenced by sameValue().
|
static |
Definition at line 399 of file MacroToEnumCheck.cpp.
Referenced by clang::tidy::modernize::MacroToEnumCallbacks::PragmaDirective().
|
static |
Definition at line 194 of file AvoidBindCheck.cpp.
References getSourceTextForExpr(), and tryCaptureAsLocalVariable().
Referenced by buildBindArguments(), initializeBindArgumentForCallExpr(), and tryCaptureAsLocalVariable().
|
static |
Definition at line 216 of file AvoidBindCheck.cpp.
References getSourceTextForExpr(), and tryCaptureAsMemberVariable().
Referenced by buildBindArguments(), initializeBindArgumentForCallExpr(), and tryCaptureAsMemberVariable().
|
static |
Definition at line 74 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 513 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 529 of file LoopConvertCheck.cpp.
|
static |
|
static |
Definition at line 72 of file LoopConvertCheck.cpp.
Referenced by getContainerExpr().
|
static |
Definition at line 64 of file LoopConvertCheck.cpp.
Referenced by makeIteratorLoopMatcher().
|
staticconstexpr |
Definition at line 189 of file TypeTraitsCheck.cpp.
Referenced by clang::tidy::modernize::TypeTraitsCheck::check(), getLambdaProperties(), and clang::tidy::modernize::TypeTraitsCheck::registerMatchers().
|
static |
Definition at line 62 of file LoopConvertCheck.cpp.
Referenced by clang::tidy::modernize::LoopConvertCheck::check(), and makeArrayLoopMatcher().
|
staticconstexpr |
Definition at line 19 of file MakeSmartPtrCheck.cpp.
Referenced by clang::tidy::modernize::MakeSmartPtrCheck::check(), and clang::tidy::modernize::MakeSmartPtrCheck::registerMatchers().
|
staticconstexpr |
Definition at line 33 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 17 of file DeprecatedIosBaseAliasesCheck.cpp.
Referenced by clang::tidy::modernize::DeprecatedIosBaseAliasesCheck::registerMatchers().
|
static |
Definition at line 68 of file LoopConvertCheck.cpp.
Referenced by makeIteratorLoopMatcher().
|
static |
Definition at line 67 of file LoopConvertCheck.cpp.
Referenced by makeIteratorLoopMatcher().
|
staticconstexpr |
Definition at line 20 of file MakeSmartPtrCheck.cpp.
Referenced by clang::tidy::modernize::MakeSmartPtrCheck::check(), and clang::tidy::modernize::MakeSmartPtrCheck::registerMatchers().
|
static |
Definition at line 65 of file LoopConvertCheck.cpp.
Referenced by clang::tidy::modernize::LoopConvertCheck::check(), makeIteratorLoopMatcher(), and makePseudoArrayLoopMatcher().
|
static |
Definition at line 66 of file LoopConvertCheck.cpp.
Referenced by clang::tidy::modernize::LoopConvertCheck::check(), makeIteratorLoopMatcher(), and makePseudoArrayLoopMatcher().
|
constexpr |
Definition at line 144 of file UseTrailingReturnTypeCheck.cpp.
Referenced by clang::tidy::modernize::UseTrailingReturnTypeCheck::check().
|
constexpr |
Definition at line 146 of file UseTrailingReturnTypeCheck.cpp.
|
staticconstexpr |
Definition at line 29 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.
Referenced by clang::tidy::modernize::UseDesignatedInitializersCheck::UseDesignatedInitializersCheck().
|
staticconstexpr |
Definition at line 32 of file UseDesignatedInitializersCheck.cpp.
Referenced by clang::tidy::modernize::UseDesignatedInitializersCheck::storeOptions(), and clang::tidy::modernize::UseDesignatedInitializersCheck::UseDesignatedInitializersCheck().
|
staticconstexpr |
Definition at line 27 of file UseDesignatedInitializersCheck.cpp.
Referenced by clang::tidy::modernize::UseDesignatedInitializersCheck::UseDesignatedInitializersCheck().
|
staticconstexpr |
Definition at line 25 of file UseDesignatedInitializersCheck.cpp.
Referenced by clang::tidy::modernize::UseDesignatedInitializersCheck::storeOptions(), and clang::tidy::modernize::UseDesignatedInitializersCheck::UseDesignatedInitializersCheck().
|
static |
Definition at line 63 of file LoopConvertCheck.cpp.
Referenced by clang::tidy::modernize::LoopConvertCheck::check(), incrementVarMatcher(), initToZeroMatcher(), integerComparisonMatcher(), and makeIteratorLoopMatcher().
|
static |
Definition at line 58 of file LoopConvertCheck.cpp.
Referenced by clang::tidy::modernize::LoopConvertCheck::check(), and makeArrayLoopMatcher().
|
static |
Definition at line 59 of file LoopConvertCheck.cpp.
Referenced by clang::tidy::modernize::LoopConvertCheck::check(), and makeIteratorLoopMatcher().
|
static |
Definition at line 61 of file LoopConvertCheck.cpp.
Referenced by clang::tidy::modernize::LoopConvertCheck::check(), and makePseudoArrayLoopMatcher().
|
static |
Definition at line 60 of file LoopConvertCheck.cpp.
Referenced by clang::tidy::modernize::LoopConvertCheck::check(), and makeIteratorLoopMatcher().
|
static |
Definition at line 69 of file LoopConvertCheck.cpp.
Referenced by getContainerExpr().
|
static |
Definition at line 62 of file UseTransparentFunctorsCheck.cpp.
Referenced by clang::tidy::modernize::UseOverrideCheck::check(), and clang::tidy::modernize::UseTransparentFunctorsCheck::check().
|
staticconstexpr |
Definition at line 22 of file MakeSmartPtrCheck.cpp.
Referenced by clang::tidy::modernize::MakeSmartPtrCheck::check(), and clang::tidy::modernize::MakeSmartPtrCheck::registerMatchers().
|
staticconstexpr |
Definition at line 30 of file UseUsingCheck.cpp.
Referenced by clang::tidy::modernize::UseUsingCheck::check(), and clang::tidy::modernize::UseUsingCheck::registerMatchers().
|
staticconstexpr |
Definition at line 21 of file MakeSmartPtrCheck.cpp.
Referenced by clang::tidy::modernize::MakeSmartPtrCheck::check(), and clang::tidy::modernize::MakeSmartPtrCheck::registerMatchers().
|
staticconstexpr |
Definition at line 30 of file UseDesignatedInitializersCheck.cpp.
Referenced by clang::tidy::modernize::UseDesignatedInitializersCheck::UseDesignatedInitializersCheck().
|
staticconstexpr |
Definition at line 29 of file UseDesignatedInitializersCheck.cpp.
Referenced by clang::tidy::modernize::UseDesignatedInitializersCheck::storeOptions(), and clang::tidy::modernize::UseDesignatedInitializersCheck::UseDesignatedInitializersCheck().
|
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 75 of file LoopConvertCheck.cpp.
Referenced by getContainerExpr().
|
staticconstexpr |
Definition at line 41 of file UseDesignatedInitializersCheck.cpp.
Referenced by clang::tidy::modernize::UseDesignatedInitializersCheck::UseDesignatedInitializersCheck().
|
staticconstexpr |
Definition at line 39 of file UseDesignatedInitializersCheck.cpp.
Referenced by clang::tidy::modernize::UseDesignatedInitializersCheck::storeOptions(), and clang::tidy::modernize::UseDesignatedInitializersCheck::UseDesignatedInitializersCheck().
|
staticconstexpr |
Definition at line 37 of file UseDesignatedInitializersCheck.cpp.
Referenced by clang::tidy::modernize::UseDesignatedInitializersCheck::UseDesignatedInitializersCheck().
|
staticconstexpr |
Definition at line 35 of file UseDesignatedInitializersCheck.cpp.
Referenced by clang::tidy::modernize::UseDesignatedInitializersCheck::storeOptions(), and clang::tidy::modernize::UseDesignatedInitializersCheck::UseDesignatedInitializersCheck().
|
staticconstexpr |
Definition at line 31 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 32 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 127 of file TypeTraitsCheck.cpp.
Referenced by clang::tidy::modernize::TypeTraitsCheck::check().
|
static |
Definition at line 110 of file UseScopedLockCheck.cpp.
|
static |
Definition at line 21 of file TypeTraitsCheck.cpp.
Referenced by clang::tidy::modernize::TypeTraitsCheck::check().