|
clang
3.8.0
|
Namespaces | |
| dynamic | |
| internal | |
Classes | |
| class | BoundNodes |
| Maps string IDs to AST nodes matched by parts of a matcher. More... | |
| class | MatchFinder |
| A class to allow finding matches over the Clang AST. More... | |
Typedefs | |
| typedef internal::Matcher< Decl > | DeclarationMatcher |
| Types of matchers for the top-level classes in the AST class hierarchy. More... | |
| typedef internal::Matcher< Stmt > | StatementMatcher |
| typedef internal::Matcher < QualType > | TypeMatcher |
| typedef internal::Matcher < TypeLoc > | TypeLocMatcher |
| typedef internal::Matcher < NestedNameSpecifier > | NestedNameSpecifierMatcher |
| typedef internal::Matcher < NestedNameSpecifierLoc > | NestedNameSpecifierLocMatcher |
Functions | |
| template<typename T > | |
| internal::Matcher< T > | id (StringRef ID, const internal::BindableMatcher< T > &InnerMatcher) |
If the provided matcher matches a node, binds the node to ID. More... | |
| internal::TrueMatcher | anything () |
| Matches any node. More... | |
| AST_POLYMORPHIC_MATCHER (isExpansionInMainFile, AST_POLYMORPHIC_SUPPORTED_TYPES(Decl, Stmt, TypeLoc)) | |
| Matches AST nodes that were expanded within the main-file. More... | |
| AST_POLYMORPHIC_MATCHER (isExpansionInSystemHeader, AST_POLYMORPHIC_SUPPORTED_TYPES(Decl, Stmt, TypeLoc)) | |
| Matches AST nodes that were expanded within system-header-files. More... | |
| AST_POLYMORPHIC_MATCHER_P (isExpansionInFileMatching, AST_POLYMORPHIC_SUPPORTED_TYPES(Decl, Stmt, TypeLoc), std::string, RegExp) | |
| Matches AST nodes that were expanded within files whose name is partially matching a given regex. More... | |
| AST_MATCHER (Decl, isPublic) | |
| Matches public C++ declarations. More... | |
| AST_MATCHER (Decl, isProtected) | |
| Matches protected C++ declarations. More... | |
| AST_MATCHER (Decl, isPrivate) | |
| Matches private C++ declarations. More... | |
| AST_MATCHER (Decl, isImplicit) | |
| Matches a declaration that has been implicitly added by the compiler (eg. More... | |
| AST_POLYMORPHIC_MATCHER_P (hasAnyTemplateArgument, AST_POLYMORPHIC_SUPPORTED_TYPES(ClassTemplateSpecializationDecl, TemplateSpecializationType), internal::Matcher< TemplateArgument >, InnerMatcher) | |
| Matches classTemplateSpecializations that have at least one TemplateArgument matching the given InnerMatcher. More... | |
| AST_MATCHER_P (Expr, ignoringImpCasts, internal::Matcher< Expr >, InnerMatcher) | |
| Matches expressions that match InnerMatcher after any implicit casts are stripped off. More... | |
| AST_MATCHER_P (Expr, ignoringParenCasts, internal::Matcher< Expr >, InnerMatcher) | |
| Matches expressions that match InnerMatcher after parentheses and casts are stripped off. More... | |
| AST_MATCHER_P (Expr, ignoringParenImpCasts, internal::Matcher< Expr >, InnerMatcher) | |
| Matches expressions that match InnerMatcher after implicit casts and parentheses are stripped off. More... | |
| AST_POLYMORPHIC_MATCHER_P2 (hasTemplateArgument, AST_POLYMORPHIC_SUPPORTED_TYPES(ClassTemplateSpecializationDecl, TemplateSpecializationType), unsigned, N, internal::Matcher< TemplateArgument >, InnerMatcher) | |
| Matches classTemplateSpecializations where the n'th TemplateArgument matches the given InnerMatcher. More... | |
| AST_POLYMORPHIC_MATCHER_P (templateArgumentCountIs, AST_POLYMORPHIC_SUPPORTED_TYPES(ClassTemplateSpecializationDecl, TemplateSpecializationType), unsigned, N) | |
Matches if the number of template arguments equals N. More... | |
| AST_MATCHER_P (TemplateArgument, refersToType, internal::Matcher< QualType >, InnerMatcher) | |
| Matches a TemplateArgument that refers to a certain type. More... | |
| AST_MATCHER_P (TemplateArgument, refersToDeclaration, internal::Matcher< Decl >, InnerMatcher) | |
| Matches a canonical TemplateArgument that refers to a certain declaration. More... | |
| AST_MATCHER_P (TemplateArgument, isExpr, internal::Matcher< Expr >, InnerMatcher) | |
| Matches a sugar TemplateArgument that refers to a certain expression. More... | |
| AST_MATCHER (TemplateArgument, isIntegral) | |
| Matches a TemplateArgument that is an integral value. More... | |
| AST_MATCHER_P (TemplateArgument, refersToIntegralType, internal::Matcher< QualType >, InnerMatcher) | |
| Matches a TemplateArgument that referes to an integral type. More... | |
| AST_MATCHER_P (TemplateArgument, equalsIntegralValue, std::string, Value) | |
| Matches a TemplateArgument of integral type with a given value. More... | |
| AST_MATCHER_P (ForStmt, hasIncrement, internal::Matcher< Stmt >, InnerMatcher) | |
| Matches the increment statement of a for loop. More... | |
| AST_MATCHER_P (ForStmt, hasLoopInit, internal::Matcher< Stmt >, InnerMatcher) | |
| Matches the initialization statement of a for loop. More... | |
| AST_MATCHER_P (CXXForRangeStmt, hasLoopVariable, internal::Matcher< VarDecl >, InnerMatcher) | |
| Matches the initialization statement of a for loop. More... | |
| AST_MATCHER_P (CXXForRangeStmt, hasRangeInit, internal::Matcher< Expr >, InnerMatcher) | |
| Matches the range initialization statement of a for loop. More... | |
| AST_MATCHER_P (UnaryExprOrTypeTraitExpr, hasArgumentOfType, internal::Matcher< QualType >, InnerMatcher) | |
| Matches unary expressions that have a specific type of argument. More... | |
| AST_MATCHER_P (UnaryExprOrTypeTraitExpr, ofKind, UnaryExprOrTypeTrait, Kind) | |
| Matches unary expressions of a certain kind. More... | |
| internal::Matcher< Stmt > | alignOfExpr (const internal::Matcher< UnaryExprOrTypeTraitExpr > &InnerMatcher) |
| Same as unaryExprOrTypeTraitExpr, but only matching alignof. More... | |
| internal::Matcher< Stmt > | sizeOfExpr (const internal::Matcher< UnaryExprOrTypeTraitExpr > &InnerMatcher) |
| Same as unaryExprOrTypeTraitExpr, but only matching sizeof. More... | |
| internal::Matcher< NamedDecl > | hasName (const std::string &Name) |
| Matches NamedDecl nodes that have the specified name. More... | |
| AST_MATCHER_P (NamedDecl, matchesName, std::string, RegExp) | |
| Matches NamedDecl nodes whose fully qualified names contain a substring matched by the given RegExp. More... | |
| internal::PolymorphicMatcherWithParam1 < internal::HasOverloadedOperatorNameMatcher, StringRef, AST_POLYMORPHIC_SUPPORTED_TYPES(CXXOperatorCallExpr, FunctionDecl)> | hasOverloadedOperatorName (StringRef Name) |
| Matches overloaded operator names. More... | |
| AST_MATCHER_P (CXXRecordDecl, isDerivedFrom, internal::Matcher< NamedDecl >, Base) | |
Matches C++ classes that are directly or indirectly derived from a class matching Base. More... | |
| AST_MATCHER_P_OVERLOAD (CXXRecordDecl, isDerivedFrom, std::string, BaseName, 1) | |
Overloaded method as shortcut for isDerivedFrom(hasName(...)). More... | |
| AST_MATCHER_P_OVERLOAD (CXXRecordDecl, isSameOrDerivedFrom, internal::Matcher< NamedDecl >, Base, 0) | |
Similar to isDerivedFrom(), but also matches classes that directly match Base. More... | |
| AST_MATCHER_P_OVERLOAD (CXXRecordDecl, isSameOrDerivedFrom, std::string, BaseName, 1) | |
Overloaded method as shortcut for isSameOrDerivedFrom(hasName(...)). More... | |
| AST_MATCHER_P (CXXRecordDecl, hasMethod, internal::Matcher< CXXMethodDecl >, InnerMatcher) | |
Matches the first method of a class or struct that satisfies InnerMatcher. More... | |
| template<typename T > | |
| internal::Matcher< T > | findAll (const internal::Matcher< T > &Matcher) |
| Matches if the node or any descendant matches. More... | |
| internal::PolymorphicMatcherWithParam1 < internal::HasDeclarationMatcher, internal::Matcher< Decl > , void(internal::HasDeclarationSupportedTypes)> | hasDeclaration (const internal::Matcher< Decl > &InnerMatcher) |
| Matches a node if the declaration associated with that node matches the given matcher. More... | |
| AST_MATCHER_P (CXXMemberCallExpr, on, internal::Matcher< Expr >, InnerMatcher) | |
| Matches on the implicit object argument of a member call expression. More... | |
| AST_MATCHER_P (ObjCMessageExpr, hasReceiverType, internal::Matcher< QualType >, InnerMatcher) | |
| Matches on the receiver of an ObjectiveC Message expression. More... | |
| AST_MATCHER_P (ObjCMessageExpr, hasSelector, std::string, BaseName) | |
| Matches when BaseName == Selector.getAsString() More... | |
| AST_MATCHER_P (ObjCMessageExpr, matchesSelector, std::string, RegExp) | |
| Matches ObjC selectors whose name contains a substring matched by the given RegExp. More... | |
| AST_MATCHER (ObjCMessageExpr, hasNullSelector) | |
| Matches when the selector is the empty selector. More... | |
| AST_MATCHER (ObjCMessageExpr, hasUnarySelector) | |
| Matches when the selector is a Unary Selector. More... | |
| AST_MATCHER (ObjCMessageExpr, hasKeywordSelector) | |
| Matches when the selector is a keyword selector. More... | |
| AST_MATCHER_P (ObjCMessageExpr, numSelectorArgs, unsigned, N) | |
| Matches when the selector has the specified number of arguments. More... | |
| AST_MATCHER_P (CallExpr, callee, internal::Matcher< Stmt >, InnerMatcher) | |
| Matches if the call expression's callee expression matches. More... | |
| AST_MATCHER_P_OVERLOAD (CallExpr, callee, internal::Matcher< Decl >, InnerMatcher, 1) | |
| Matches if the call expression's callee's declaration matches the given matcher. More... | |
| AST_POLYMORPHIC_MATCHER_P_OVERLOAD (hasType, AST_POLYMORPHIC_SUPPORTED_TYPES(Expr, ValueDecl), internal::Matcher< QualType >, InnerMatcher, 0) | |
| Matches if the expression's or declaration's type matches a type matcher. More... | |
| AST_POLYMORPHIC_MATCHER_P_OVERLOAD (hasType, AST_POLYMORPHIC_SUPPORTED_TYPES(Expr, ValueDecl), internal::Matcher< Decl >, InnerMatcher, 1) | |
| Overloaded to match the declaration of the expression's or value declaration's type. More... | |
| AST_MATCHER_P (DeclaratorDecl, hasTypeLoc, internal::Matcher< TypeLoc >, Inner) | |
| Matches if the type location of the declarator decl's type matches the inner matcher. More... | |
| AST_MATCHER_P (QualType, asString, std::string, Name) | |
| Matches if the matched type is represented by the given string. More... | |
| AST_MATCHER_P (QualType, pointsTo, internal::Matcher< QualType >, InnerMatcher) | |
| Matches if the matched type is a pointer type and the pointee type matches the specified matcher. More... | |
| AST_MATCHER_P_OVERLOAD (QualType, pointsTo, internal::Matcher< Decl >, InnerMatcher, 1) | |
| Overloaded to match the pointee type's declaration. More... | |
| AST_MATCHER_P (QualType, references, internal::Matcher< QualType >, InnerMatcher) | |
| Matches if the matched type is a reference type and the referenced type matches the specified matcher. More... | |
| AST_MATCHER_P (QualType, hasCanonicalType, internal::Matcher< QualType >, InnerMatcher) | |
| Matches QualTypes whose canonical type matches InnerMatcher. More... | |
| AST_MATCHER_P_OVERLOAD (QualType, references, internal::Matcher< Decl >, InnerMatcher, 1) | |
| Overloaded to match the referenced type's declaration. More... | |
| AST_MATCHER_P (CXXMemberCallExpr, onImplicitObjectArgument, internal::Matcher< Expr >, InnerMatcher) | |
| AST_MATCHER_P_OVERLOAD (CXXMemberCallExpr, thisPointerType, internal::Matcher< QualType >, InnerMatcher, 0) | |
| Matches if the expression's type either matches the specified matcher, or is a pointer to a type that matches the InnerMatcher. More... | |
| AST_MATCHER_P_OVERLOAD (CXXMemberCallExpr, thisPointerType, internal::Matcher< Decl >, InnerMatcher, 1) | |
| Overloaded to match the type's declaration. More... | |
| AST_MATCHER_P (DeclRefExpr, to, internal::Matcher< Decl >, InnerMatcher) | |
| Matches a DeclRefExpr that refers to a declaration that matches the specified matcher. More... | |
| AST_MATCHER_P (DeclRefExpr, throughUsingDecl, internal::Matcher< UsingShadowDecl >, InnerMatcher) | |
Matches a DeclRefExpr that refers to a declaration through a specific using shadow declaration. More... | |
| AST_MATCHER_P (DeclStmt, hasSingleDecl, internal::Matcher< Decl >, InnerMatcher) | |
| Matches the Decl of a DeclStmt which has a single declaration. More... | |
| AST_MATCHER_P (VarDecl, hasInitializer, internal::Matcher< Expr >, InnerMatcher) | |
| Matches a variable declaration that has an initializer expression that matches the given matcher. More... | |
| AST_MATCHER (VarDecl, hasLocalStorage) | |
| Matches a variable declaration that has function scope and is a non-static local variable. More... | |
| AST_MATCHER (VarDecl, hasGlobalStorage) | |
| Matches a variable declaration that does not have local storage. More... | |
| AST_MATCHER (VarDecl, hasAutomaticStorageDuration) | |
| Matches a variable declaration that has automatic storage duration. More... | |
| AST_MATCHER (VarDecl, hasStaticStorageDuration) | |
| Matches a variable declaration that has static storage duration. More... | |
| AST_MATCHER (VarDecl, hasThreadStorageDuration) | |
| Matches a variable declaration that has thread storage duration. More... | |
| AST_MATCHER (VarDecl, isExceptionVariable) | |
| Matches a variable declaration that is an exception variable from a C++ catch block, or an Objective-C @catch statement. More... | |
| AST_POLYMORPHIC_MATCHER_P (argumentCountIs, AST_POLYMORPHIC_SUPPORTED_TYPES(CallExpr, CXXConstructExpr, ObjCMessageExpr), unsigned, N) | |
| Checks that a call expression or a constructor call expression has a specific number of arguments (including absent default arguments). More... | |
| AST_POLYMORPHIC_MATCHER_P2 (hasArgument, AST_POLYMORPHIC_SUPPORTED_TYPES(CallExpr, CXXConstructExpr, ObjCMessageExpr), unsigned, N, internal::Matcher< Expr >, InnerMatcher) | |
| Matches the n'th argument of a call expression or a constructor call expression. More... | |
| AST_MATCHER_P (DeclStmt, declCountIs, unsigned, N) | |
| Matches declaration statements that contain a specific number of declarations. More... | |
| AST_MATCHER_P2 (DeclStmt, containsDeclaration, unsigned, N, internal::Matcher< Decl >, InnerMatcher) | |
| Matches the n'th declaration of a declaration statement. More... | |
| AST_MATCHER_P (CXXConstructorDecl, hasAnyConstructorInitializer, internal::Matcher< CXXCtorInitializer >, InnerMatcher) | |
| Matches a C++ catch statement that has a catch-all handler. More... | |
| AST_MATCHER_P (CXXCtorInitializer, forField, internal::Matcher< FieldDecl >, InnerMatcher) | |
| Matches the field declaration of a constructor initializer. More... | |
| AST_MATCHER_P (CXXCtorInitializer, withInitializer, internal::Matcher< Expr >, InnerMatcher) | |
| Matches the initializer expression of a constructor initializer. More... | |
| AST_MATCHER (CXXCtorInitializer, isWritten) | |
| Matches a constructor initializer if it is explicitly written in code (as opposed to implicitly added by the compiler). More... | |
| AST_MATCHER (CXXCtorInitializer, isBaseInitializer) | |
| Matches a constructor initializer if it is initializing a base, as opposed to a member. More... | |
| AST_MATCHER (CXXCtorInitializer, isMemberInitializer) | |
| Matches a constructor initializer if it is initializing a member, as opposed to a base. More... | |
| AST_POLYMORPHIC_MATCHER_P (hasAnyArgument, AST_POLYMORPHIC_SUPPORTED_TYPES(CallExpr, CXXConstructExpr), internal::Matcher< Expr >, InnerMatcher) | |
| Matches any argument of a call expression or a constructor call expression. More... | |
| AST_MATCHER (CXXConstructExpr, isListInitialization) | |
| Matches a constructor call expression which uses list initialization. More... | |
| AST_MATCHER_P2 (FunctionDecl, hasParameter, unsigned, N, internal::Matcher< ParmVarDecl >, InnerMatcher) | |
| Matches the n'th parameter of a function declaration. More... | |
| AST_MATCHER_P (FunctionDecl, hasAnyParameter, internal::Matcher< ParmVarDecl >, InnerMatcher) | |
| Matches any parameter of a function declaration. More... | |
| AST_MATCHER_P (FunctionDecl, parameterCountIs, unsigned, N) | |
Matches FunctionDecls that have a specific parameter count. More... | |
| AST_MATCHER_P (FunctionDecl, returns, internal::Matcher< QualType >, InnerMatcher) | |
| Matches the return type of a function declaration. More... | |
| AST_MATCHER (FunctionDecl, isExternC) | |
| Matches extern "C" function declarations. More... | |
| AST_MATCHER (FunctionDecl, isDeleted) | |
| Matches deleted function declarations. More... | |
| AST_MATCHER (FunctionDecl, isNoThrow) | |
| Matches functions that have a non-throwing exception specification. More... | |
| AST_POLYMORPHIC_MATCHER (isConstexpr, AST_POLYMORPHIC_SUPPORTED_TYPES(VarDecl, FunctionDecl)) | |
| Matches constexpr variable and function declarations. More... | |
| AST_POLYMORPHIC_MATCHER_P (hasCondition, AST_POLYMORPHIC_SUPPORTED_TYPES(IfStmt, ForStmt, WhileStmt, DoStmt, ConditionalOperator), internal::Matcher< Expr >, InnerMatcher) | |
| Matches the condition expression of an if statement, for loop, or conditional operator. More... | |
| AST_MATCHER_P (IfStmt, hasThen, internal::Matcher< Stmt >, InnerMatcher) | |
| Matches the then-statement of an if statement. More... | |
| AST_MATCHER_P (IfStmt, hasElse, internal::Matcher< Stmt >, InnerMatcher) | |
| Matches the else-statement of an if statement. More... | |
| AST_POLYMORPHIC_MATCHER_P (equalsBoundNode, AST_POLYMORPHIC_SUPPORTED_TYPES(Stmt, Decl, Type, QualType), std::string, ID) | |
| Matches if a node equals a previously bound node. More... | |
| AST_MATCHER_P (IfStmt, hasConditionVariableStatement, internal::Matcher< DeclStmt >, InnerMatcher) | |
| Matches the condition variable statement in an if statement. More... | |
| AST_MATCHER_P (ArraySubscriptExpr, hasIndex, internal::Matcher< Expr >, InnerMatcher) | |
| Matches the index expression of an array subscript expression. More... | |
| AST_MATCHER_P (ArraySubscriptExpr, hasBase, internal::Matcher< Expr >, InnerMatcher) | |
| Matches the base expression of an array subscript expression. More... | |
| AST_POLYMORPHIC_MATCHER_P (hasBody, AST_POLYMORPHIC_SUPPORTED_TYPES(DoStmt, ForStmt, WhileStmt, CXXForRangeStmt), internal::Matcher< Stmt >, InnerMatcher) | |
| Matches a 'for', 'while', or 'do while' statement that has a given body. More... | |
| AST_MATCHER_P (CompoundStmt, hasAnySubstatement, internal::Matcher< Stmt >, InnerMatcher) | |
| Matches compound statements where at least one substatement matches a given matcher. More... | |
| AST_MATCHER_P (CompoundStmt, statementCountIs, unsigned, N) | |
| Checks that a compound statement contains a specific number of child statements. More... | |
| template<typename ValueT > | |
| internal::PolymorphicMatcherWithParam1 < internal::ValueEqualsMatcher, ValueT > | equals (const ValueT &Value) |
| Matches literals that are equal to the given value. More... | |
| AST_POLYMORPHIC_MATCHER_P (hasOperatorName, AST_POLYMORPHIC_SUPPORTED_TYPES(BinaryOperator, UnaryOperator), std::string, Name) | |
| Matches the operator Name of operator expressions (binary or unary). More... | |
| AST_POLYMORPHIC_MATCHER_P (hasLHS, AST_POLYMORPHIC_SUPPORTED_TYPES(BinaryOperator, ArraySubscriptExpr), internal::Matcher< Expr >, InnerMatcher) | |
| Matches the left hand side of binary operator expressions. More... | |
| AST_POLYMORPHIC_MATCHER_P (hasRHS, AST_POLYMORPHIC_SUPPORTED_TYPES(BinaryOperator, ArraySubscriptExpr), internal::Matcher< Expr >, InnerMatcher) | |
| Matches the right hand side of binary operator expressions. More... | |
| internal::Matcher< BinaryOperator > | hasEitherOperand (const internal::Matcher< Expr > &InnerMatcher) |
| Matches if either the left hand side or the right hand side of a binary operator matches. More... | |
| AST_MATCHER_P (UnaryOperator, hasUnaryOperand, internal::Matcher< Expr >, InnerMatcher) | |
| Matches if the operand of a unary operator matches. More... | |
| AST_MATCHER_P (CastExpr, hasSourceExpression, internal::Matcher< Expr >, InnerMatcher) | |
| Matches if the cast's source expression matches the given matcher. More... | |
| AST_MATCHER_P (ExplicitCastExpr, hasDestinationType, internal::Matcher< QualType >, InnerMatcher) | |
| Matches casts whose destination type matches a given matcher. More... | |
| AST_MATCHER_P (ImplicitCastExpr, hasImplicitDestinationType, internal::Matcher< QualType >, InnerMatcher) | |
| Matches implicit casts whose destination type matches a given matcher. More... | |
| AST_MATCHER (RecordDecl, isStruct) | |
| Matches RecordDecl object that are spelled with "struct.". More... | |
| AST_MATCHER (RecordDecl, isUnion) | |
| Matches RecordDecl object that are spelled with "union.". More... | |
| AST_MATCHER (RecordDecl, isClass) | |
| Matches RecordDecl object that are spelled with "class.". More... | |
| AST_MATCHER_P (ConditionalOperator, hasTrueExpression, internal::Matcher< Expr >, InnerMatcher) | |
| Matches the true branch expression of a conditional operator. More... | |
| AST_MATCHER_P (ConditionalOperator, hasFalseExpression, internal::Matcher< Expr >, InnerMatcher) | |
| Matches the false branch expression of a conditional operator. More... | |
| AST_POLYMORPHIC_MATCHER (isDefinition, AST_POLYMORPHIC_SUPPORTED_TYPES(TagDecl, VarDecl, FunctionDecl)) | |
| Matches if a declaration has a body attached. More... | |
| AST_MATCHER (FunctionDecl, isVariadic) | |
| Matches if a function declaration is variadic. More... | |
| AST_MATCHER_P (CXXMethodDecl, ofClass, internal::Matcher< CXXRecordDecl >, InnerMatcher) | |
| Matches the class declaration that the given method declaration belongs to. More... | |
| AST_MATCHER (CXXMethodDecl, isVirtual) | |
| Matches if the given method declaration is virtual. More... | |
| AST_POLYMORPHIC_MATCHER (isFinal, AST_POLYMORPHIC_SUPPORTED_TYPES(CXXRecordDecl, CXXMethodDecl)) | |
| Matches if the given method or class declaration is final. More... | |
| AST_MATCHER (CXXMethodDecl, isPure) | |
| Matches if the given method declaration is pure. More... | |
| AST_MATCHER (CXXMethodDecl, isConst) | |
| Matches if the given method declaration is const. More... | |
| AST_MATCHER (CXXMethodDecl, isCopyAssignmentOperator) | |
| Matches if the given method declaration declares a copy assignment operator. More... | |
| AST_MATCHER (CXXMethodDecl, isOverride) | |
| Matches if the given method declaration overrides another method. More... | |
| AST_MATCHER (MemberExpr, isArrow) | |
| Matches member expressions that are called with '->' as opposed to '. More... | |
| AST_MATCHER (QualType, isInteger) | |
| Matches QualType nodes that are of integer type. More... | |
| AST_MATCHER (QualType, isAnyCharacter) | |
| Matches QualType nodes that are of character type. More... | |
| AST_MATCHER (QualType, isConstQualified) | |
| Matches QualType nodes that are const-qualified, i.e., that include "top-level" const. More... | |
| AST_MATCHER (QualType, isVolatileQualified) | |
| Matches QualType nodes that are volatile-qualified, i.e., that include "top-level" volatile. More... | |
| AST_MATCHER (QualType, hasLocalQualifiers) | |
| Matches QualType nodes that have local CV-qualifiers attached to the node, not hidden within a typedef. More... | |
| AST_MATCHER_P (MemberExpr, member, internal::Matcher< ValueDecl >, InnerMatcher) | |
| Matches a member expression where the member is matched by a given matcher. More... | |
| AST_MATCHER_P (MemberExpr, hasObjectExpression, internal::Matcher< Expr >, InnerMatcher) | |
| Matches a member expression where the object expression is matched by a given matcher. More... | |
| AST_MATCHER_P (UsingDecl, hasAnyUsingShadowDecl, internal::Matcher< UsingShadowDecl >, InnerMatcher) | |
| Matches any using shadow declaration. More... | |
| AST_MATCHER_P (UsingShadowDecl, hasTargetDecl, internal::Matcher< NamedDecl >, InnerMatcher) | |
| Matches a using shadow declaration where the target declaration is matched by the given matcher. More... | |
| AST_POLYMORPHIC_MATCHER (isTemplateInstantiation, AST_POLYMORPHIC_SUPPORTED_TYPES(FunctionDecl, VarDecl, CXXRecordDecl)) | |
| Matches template instantiations of function, class, or static member variable template instantiations. More... | |
| AST_MATCHER_FUNCTION (internal::Matcher< Decl >, isInstantiated) | |
| Matches declarations that are template instantiations or are inside template instantiations. More... | |
| AST_MATCHER_FUNCTION (internal::Matcher< Stmt >, isInTemplateInstantiation) | |
| Matches statements inside of a template instantiation. More... | |
| AST_POLYMORPHIC_MATCHER (isExplicitTemplateSpecialization, AST_POLYMORPHIC_SUPPORTED_TYPES(FunctionDecl, VarDecl, CXXRecordDecl)) | |
| Matches explicit template specializations of function, class, or static member variable template instantiations. More... | |
| AST_MATCHER_FUNCTION_P_OVERLOAD (internal::BindableMatcher< TypeLoc >, loc, internal::Matcher< QualType >, InnerMatcher, 0) | |
Matches TypeLocs for which the given inner QualType-matcher matches. More... | |
| AST_MATCHER (Type, booleanType) | |
Matches type bool. More... | |
| AST_MATCHER (Type, voidType) | |
Matches type void. More... | |
| AST_TYPE_MATCHER (BuiltinType, builtinType) | |
| Matches builtin Types. More... | |
| AST_TYPE_MATCHER (ArrayType, arrayType) | |
| Matches all kinds of arrays. More... | |
| AST_TYPE_MATCHER (ComplexType, complexType) | |
| Matches C99 complex types. More... | |
| AST_TYPELOC_TRAVERSE_MATCHER (hasElementType, getElement, AST_POLYMORPHIC_SUPPORTED_TYPES(ArrayType, ComplexType)) | |
| Matches arrays and C99 complex types that have a specific element type. More... | |
| AST_TYPE_MATCHER (ConstantArrayType, constantArrayType) | |
| Matches C arrays with a specified constant size. More... | |
| AST_MATCHER_P (ConstantArrayType, hasSize, unsigned, N) | |
Matches ConstantArrayType nodes that have the specified size. More... | |
| AST_TYPE_MATCHER (DependentSizedArrayType, dependentSizedArrayType) | |
| Matches C++ arrays whose size is a value-dependent expression. More... | |
| AST_TYPE_MATCHER (IncompleteArrayType, incompleteArrayType) | |
| Matches C arrays with unspecified size. More... | |
| AST_TYPE_MATCHER (VariableArrayType, variableArrayType) | |
| Matches C arrays with a specified size that is not an integer-constant-expression. More... | |
| AST_MATCHER_P (VariableArrayType, hasSizeExpr, internal::Matcher< Expr >, InnerMatcher) | |
Matches VariableArrayType nodes that have a specific size expression. More... | |
| AST_TYPE_MATCHER (AtomicType, atomicType) | |
| Matches atomic types. More... | |
| AST_TYPELOC_TRAVERSE_MATCHER (hasValueType, getValue, AST_POLYMORPHIC_SUPPORTED_TYPES(AtomicType)) | |
| Matches atomic types with a specific value type. More... | |
| AST_TYPE_MATCHER (AutoType, autoType) | |
| Matches types nodes representing C++11 auto types. More... | |
| AST_TYPE_TRAVERSE_MATCHER (hasDeducedType, getDeducedType, AST_POLYMORPHIC_SUPPORTED_TYPES(AutoType)) | |
Matches AutoType nodes where the deduced type is a specific type. More... | |
| AST_TYPE_MATCHER (FunctionType, functionType) | |
Matches FunctionType nodes. More... | |
| AST_TYPE_MATCHER (ParenType, parenType) | |
Matches ParenType nodes. More... | |
| AST_TYPE_TRAVERSE_MATCHER (innerType, getInnerType, AST_POLYMORPHIC_SUPPORTED_TYPES(ParenType)) | |
Matches ParenType nodes where the inner type is a specific type. More... | |
| AST_TYPE_MATCHER (BlockPointerType, blockPointerType) | |
| Matches block pointer types, i.e. More... | |
| AST_TYPE_MATCHER (MemberPointerType, memberPointerType) | |
| Matches member pointer types. More... | |
| AST_TYPE_MATCHER (PointerType, pointerType) | |
| Matches pointer types, but does not match Objective-C object pointer types. More... | |
| AST_TYPE_MATCHER (ObjCObjectPointerType, objcObjectPointerType) | |
| Matches an Objective-C object pointer type, which is different from a pointer type, despite being syntactically similar. More... | |
| AST_TYPE_MATCHER (ReferenceType, referenceType) | |
| Matches both lvalue and rvalue reference types. More... | |
| AST_TYPE_MATCHER (LValueReferenceType, lValueReferenceType) | |
| Matches lvalue reference types. More... | |
| AST_TYPE_MATCHER (RValueReferenceType, rValueReferenceType) | |
| Matches rvalue reference types. More... | |
| AST_TYPELOC_TRAVERSE_MATCHER (pointee, getPointee, AST_POLYMORPHIC_SUPPORTED_TYPES(BlockPointerType, MemberPointerType, PointerType, ReferenceType)) | |
Narrows PointerType (and similar) matchers to those where the pointee matches a given matcher. More... | |
| AST_TYPE_MATCHER (TypedefType, typedefType) | |
| Matches typedef types. More... | |
| AST_TYPE_MATCHER (TemplateSpecializationType, templateSpecializationType) | |
| Matches template specialization types. More... | |
| AST_TYPE_MATCHER (UnaryTransformType, unaryTransformType) | |
| Matches types nodes representing unary type transformations. More... | |
| AST_TYPE_MATCHER (RecordType, recordType) | |
| Matches record types (e.g. More... | |
| AST_TYPE_MATCHER (ElaboratedType, elaboratedType) | |
| Matches types specified with an elaborated type keyword or with a qualified name. More... | |
| AST_MATCHER_P (ElaboratedType, hasQualifier, internal::Matcher< NestedNameSpecifier >, InnerMatcher) | |
Matches ElaboratedTypes whose qualifier, a NestedNameSpecifier, matches InnerMatcher if the qualifier exists. More... | |
| AST_MATCHER_P (ElaboratedType, namesType, internal::Matcher< QualType >, InnerMatcher) | |
Matches ElaboratedTypes whose named type matches InnerMatcher. More... | |
| AST_TYPE_MATCHER (SubstTemplateTypeParmType, substTemplateTypeParmType) | |
| Matches types that represent the result of substituting a type for a template type parameter. More... | |
| AST_TYPE_MATCHER (TemplateTypeParmType, templateTypeParmType) | |
| Matches template type parameter types. More... | |
| AST_TYPE_MATCHER (InjectedClassNameType, injectedClassNameType) | |
| Matches injected class name types. More... | |
| AST_TYPE_MATCHER (DecayedType, decayedType) | |
| Matches decayed type Example matches i[] in declaration of f. More... | |
| AST_MATCHER_P (DecayedType, hasDecayedType, internal::Matcher< QualType >, InnerType) | |
Matches the decayed type, whos decayed type matches InnerMatcher. More... | |
| AST_MATCHER_P (Decl, hasDeclContext, internal::Matcher< Decl >, InnerMatcher) | |
Matches declarations whose declaration context, interpreted as a Decl, matches InnerMatcher. More... | |
| AST_MATCHER_FUNCTION_P_OVERLOAD (internal::BindableMatcher< NestedNameSpecifierLoc >, loc, internal::Matcher< NestedNameSpecifier >, InnerMatcher, 1) | |
Matches NestedNameSpecifierLocs for which the given inner NestedNameSpecifier-matcher matches. More... | |
| AST_MATCHER_P (NestedNameSpecifier, specifiesType, internal::Matcher< QualType >, InnerMatcher) | |
Matches nested name specifiers that specify a type matching the given QualType matcher without qualifiers. More... | |
| AST_MATCHER_P (NestedNameSpecifierLoc, specifiesTypeLoc, internal::Matcher< TypeLoc >, InnerMatcher) | |
Matches nested name specifier locs that specify a type matching the given TypeLoc. More... | |
| AST_MATCHER_P_OVERLOAD (NestedNameSpecifier, hasPrefix, internal::Matcher< NestedNameSpecifier >, InnerMatcher, 0) | |
Matches on the prefix of a NestedNameSpecifier. More... | |
| AST_MATCHER_P_OVERLOAD (NestedNameSpecifierLoc, hasPrefix, internal::Matcher< NestedNameSpecifierLoc >, InnerMatcher, 1) | |
Matches on the prefix of a NestedNameSpecifierLoc. More... | |
| AST_MATCHER_P (NestedNameSpecifier, specifiesNamespace, internal::Matcher< NamespaceDecl >, InnerMatcher) | |
| Matches nested name specifiers that specify a namespace matching the given namespace matcher. More... | |
| AST_MATCHER_P (SwitchStmt, forEachSwitchCase, internal::Matcher< SwitchCase >, InnerMatcher) | |
| Matches each case or default statement belonging to the given switch statement. More... | |
| AST_MATCHER_P (CXXConstructorDecl, forEachConstructorInitializer, internal::Matcher< CXXCtorInitializer >, InnerMatcher) | |
| Matches each constructor initializer in a constructor definition. More... | |
| AST_MATCHER (CXXConstructorDecl, isCopyConstructor) | |
| Matches constructor declarations that are copy constructors. More... | |
| AST_MATCHER (CXXConstructorDecl, isMoveConstructor) | |
| Matches constructor declarations that are move constructors. More... | |
| AST_MATCHER (CXXConstructorDecl, isDefaultConstructor) | |
| Matches constructor declarations that are default constructors. More... | |
| AST_POLYMORPHIC_MATCHER (isExplicit, AST_POLYMORPHIC_SUPPORTED_TYPES(CXXConstructorDecl, CXXConversionDecl)) | |
| Matches constructor and conversion declarations that are marked with the explicit keyword. More... | |
| AST_POLYMORPHIC_MATCHER (isInline, AST_POLYMORPHIC_SUPPORTED_TYPES(NamespaceDecl, FunctionDecl)) | |
| Matches function and namespace declarations that are marked with the inline keyword. More... | |
| AST_MATCHER (NamespaceDecl, isAnonymous) | |
| Matches anonymous namespace declarations. More... | |
| AST_MATCHER_P (CaseStmt, hasCaseConstant, internal::Matcher< Expr >, InnerMatcher) | |
| If the given case statement does not use the GNU case range extension, matches the constant given in the statement. More... | |
| AST_MATCHER_P (Decl, hasAttr, attr::Kind, AttrKind) | |
| Matches declaration that has a given attribute. More... | |
| template<typename NodeT > | |
| const NodeT * | selectFirst (StringRef BoundTo, const SmallVectorImpl< BoundNodes > &Results) |
Returns the first result of type NodeT bound to BoundTo. More... | |
| AST_MATCHER_P_OVERLOAD (Decl, equalsNode, const Decl *, Other, 0) | |
Overloads for the equalsNode matcher. More... | |
| AST_MATCHER_P_OVERLOAD (Stmt, equalsNode, const Stmt *, Other, 1) | |
| Matches if a node equals another node. More... | |
| AST_MATCHER_P_OVERLOAD (Type, equalsNode, const Type *, Other, 2) | |
| Matches if a node equals another node. More... | |
| template<typename MatcherT , typename NodeT > | |
| SmallVector< BoundNodes, 1 > | match (MatcherT Matcher, const NodeT &Node, ASTContext &Context) |
Returns the results of matching Matcher on Node. More... | |
| template<typename MatcherT > | |
| SmallVector< BoundNodes, 1 > | match (MatcherT Matcher, const ast_type_traits::DynTypedNode &Node, ASTContext &Context) |
Variables | |
| const internal::VariadicDynCastAllOfMatcher < Decl, TranslationUnitDecl > | translationUnitDecl |
| Matches the top declaration context. More... | |
| const internal::VariadicDynCastAllOfMatcher < Decl, TypedefDecl > | typedefDecl |
| Matches typedef declarations. More... | |
| const internal::VariadicAllOfMatcher < Decl > | decl |
| Matches declarations. More... | |
| const internal::VariadicDynCastAllOfMatcher < Decl, LinkageSpecDecl > | linkageSpecDecl |
| Matches a declaration of a linkage specification. More... | |
| const internal::VariadicDynCastAllOfMatcher < Decl, NamedDecl > | namedDecl |
| Matches a declaration of anything that could have a name. More... | |
| const internal::VariadicDynCastAllOfMatcher < Decl, NamespaceDecl > | namespaceDecl |
| Matches a declaration of a namespace. More... | |
| const internal::VariadicDynCastAllOfMatcher < Decl, NamespaceAliasDecl > | namespaceAliasDecl |
| Matches a declaration of a namespace alias. More... | |
| const internal::VariadicDynCastAllOfMatcher < Decl, RecordDecl > | recordDecl |
| Matches class, struct, and union declarations. More... | |
| const internal::VariadicDynCastAllOfMatcher < Decl, CXXRecordDecl > | cxxRecordDecl |
| Matches C++ class declarations. More... | |
| const internal::VariadicDynCastAllOfMatcher < Decl, ClassTemplateDecl > | classTemplateDecl |
| Matches C++ class template declarations. More... | |
| const internal::VariadicDynCastAllOfMatcher < Decl, ClassTemplateSpecializationDecl > | classTemplateSpecializationDecl |
| Matches C++ class template specializations. More... | |
| const internal::VariadicDynCastAllOfMatcher < Decl, DeclaratorDecl > | declaratorDecl |
| Matches declarator declarations (field, variable, function and non-type template parameter declarations). More... | |
| const internal::VariadicDynCastAllOfMatcher < Decl, ParmVarDecl > | parmVarDecl |
| Matches parameter variable declarations. More... | |
| const internal::VariadicDynCastAllOfMatcher < Decl, AccessSpecDecl > | accessSpecDecl |
| Matches C++ access specifier declarations. More... | |
| const internal::VariadicAllOfMatcher < CXXCtorInitializer > | cxxCtorInitializer |
| Matches constructor initializers. More... | |
| const internal::VariadicAllOfMatcher < TemplateArgument > | templateArgument |
| Matches template arguments. More... | |
| const internal::VariadicDynCastAllOfMatcher < Decl, NonTypeTemplateParmDecl > | nonTypeTemplateParmDecl |
| Matches non-type template parameter declarations. More... | |
| const internal::VariadicDynCastAllOfMatcher < Decl, TemplateTypeParmDecl > | templateTypeParmDecl |
| Matches template type parameter declarations. More... | |
| const internal::VariadicDynCastAllOfMatcher < Decl, ValueDecl > | valueDecl |
| Matches any value declaration. More... | |
| const internal::VariadicDynCastAllOfMatcher < Decl, CXXConstructorDecl > | cxxConstructorDecl |
| Matches C++ constructor declarations. More... | |
| const internal::VariadicDynCastAllOfMatcher < Decl, CXXDestructorDecl > | cxxDestructorDecl |
| Matches explicit C++ destructor declarations. More... | |
| const internal::VariadicDynCastAllOfMatcher < Decl, EnumDecl > | enumDecl |
| Matches enum declarations. More... | |
| const internal::VariadicDynCastAllOfMatcher < Decl, EnumConstantDecl > | enumConstantDecl |
| Matches enum constants. More... | |
| const internal::VariadicDynCastAllOfMatcher < Decl, CXXMethodDecl > | cxxMethodDecl |
| Matches method declarations. More... | |
| const internal::VariadicDynCastAllOfMatcher < Decl, CXXConversionDecl > | cxxConversionDecl |
| Matches conversion operator declarations. More... | |
| const internal::VariadicDynCastAllOfMatcher < Decl, VarDecl > | varDecl |
| Matches variable declarations. More... | |
| const internal::VariadicDynCastAllOfMatcher < Decl, FieldDecl > | fieldDecl |
| Matches field declarations. More... | |
| const internal::VariadicDynCastAllOfMatcher < Decl, FunctionDecl > | functionDecl |
| Matches function declarations. More... | |
| const internal::VariadicDynCastAllOfMatcher < Decl, FunctionTemplateDecl > | functionTemplateDecl |
| Matches C++ function template declarations. More... | |
| const internal::VariadicDynCastAllOfMatcher < Decl, FriendDecl > | friendDecl |
| Matches friend declarations. More... | |
| const internal::VariadicAllOfMatcher < Stmt > | stmt |
| Matches statements. More... | |
| const internal::VariadicDynCastAllOfMatcher < Stmt, DeclStmt > | declStmt |
| Matches declaration statements. More... | |
| const internal::VariadicDynCastAllOfMatcher < Stmt, MemberExpr > | memberExpr |
| Matches member expressions. More... | |
| const internal::VariadicDynCastAllOfMatcher < Stmt, CallExpr > | callExpr |
| Matches call expressions. More... | |
| const internal::VariadicDynCastAllOfMatcher < Stmt, LambdaExpr > | lambdaExpr |
| Matches lambda expressions. More... | |
| const internal::VariadicDynCastAllOfMatcher < Stmt, CXXMemberCallExpr > | cxxMemberCallExpr |
| Matches member call expressions. More... | |
| const internal::VariadicDynCastAllOfMatcher < Stmt, ObjCMessageExpr > | objcMessageExpr |
| Matches ObjectiveC Message invocation expressions. More... | |
| const internal::VariadicDynCastAllOfMatcher < Decl, ObjCInterfaceDecl > | objcInterfaceDecl |
| Matches Objective-C interface declarations. More... | |
| const internal::VariadicDynCastAllOfMatcher < Stmt, ExprWithCleanups > | exprWithCleanups |
| Matches expressions that introduce cleanups to be run at the end of the sub-expression's evaluation. More... | |
| const internal::VariadicDynCastAllOfMatcher < Stmt, InitListExpr > | initListExpr |
| Matches init list expressions. More... | |
| const internal::VariadicDynCastAllOfMatcher < Stmt, SubstNonTypeTemplateParmExpr > | substNonTypeTemplateParmExpr |
| Matches substitutions of non-type template parameters. More... | |
| const internal::VariadicDynCastAllOfMatcher < Decl, UsingDecl > | usingDecl |
| Matches using declarations. More... | |
| const internal::VariadicDynCastAllOfMatcher < Decl, UsingDirectiveDecl > | usingDirectiveDecl |
| Matches using namespace declarations. More... | |
| const internal::VariadicDynCastAllOfMatcher < Decl, UnresolvedUsingValueDecl > | unresolvedUsingValueDecl |
| Matches unresolved using value declarations. More... | |
| const internal::VariadicDynCastAllOfMatcher < Decl, UnresolvedUsingTypenameDecl > | unresolvedUsingTypenameDecl |
| Matches unresolved using value declarations that involve the typename. More... | |
| const internal::VariadicDynCastAllOfMatcher < Stmt, CXXConstructExpr > | cxxConstructExpr |
| Matches constructor call expressions (including implicit ones). More... | |
| const internal::VariadicDynCastAllOfMatcher < Stmt, CXXUnresolvedConstructExpr > | cxxUnresolvedConstructExpr |
| Matches unresolved constructor call expressions. More... | |
| const internal::VariadicDynCastAllOfMatcher < Stmt, CXXThisExpr > | cxxThisExpr |
| Matches implicit and explicit this expressions. More... | |
| const internal::VariadicDynCastAllOfMatcher < Stmt, CXXBindTemporaryExpr > | cxxBindTemporaryExpr |
| Matches nodes where temporaries are created. More... | |
| const internal::VariadicDynCastAllOfMatcher < Stmt, MaterializeTemporaryExpr > | materializeTemporaryExpr |
| Matches nodes where temporaries are materialized. More... | |
| const internal::VariadicDynCastAllOfMatcher < Stmt, CXXNewExpr > | cxxNewExpr |
| Matches new expressions. More... | |
| const internal::VariadicDynCastAllOfMatcher < Stmt, CXXDeleteExpr > | cxxDeleteExpr |
| Matches delete expressions. More... | |
| const internal::VariadicDynCastAllOfMatcher < Stmt, ArraySubscriptExpr > | arraySubscriptExpr |
| Matches array subscript expressions. More... | |
| const internal::VariadicDynCastAllOfMatcher < Stmt, CXXDefaultArgExpr > | cxxDefaultArgExpr |
| Matches the value of a default argument at the call site. More... | |
| const internal::VariadicDynCastAllOfMatcher < Stmt, CXXOperatorCallExpr > | cxxOperatorCallExpr |
| Matches overloaded operator calls. More... | |
| const internal::VariadicDynCastAllOfMatcher < Stmt, Expr > | expr |
| Matches expressions. More... | |
| const internal::VariadicDynCastAllOfMatcher < Stmt, DeclRefExpr > | declRefExpr |
| Matches expressions that refer to declarations. More... | |
| const internal::VariadicDynCastAllOfMatcher < Stmt, IfStmt > | ifStmt |
| Matches if statements. More... | |
| const internal::VariadicDynCastAllOfMatcher < Stmt, ForStmt > | forStmt |
| Matches for statements. More... | |
| const internal::VariadicDynCastAllOfMatcher < Stmt, CXXForRangeStmt > | cxxForRangeStmt |
| Matches range-based for statements. More... | |
| const internal::VariadicDynCastAllOfMatcher < Stmt, WhileStmt > | whileStmt |
| Matches while statements. More... | |
| const internal::VariadicDynCastAllOfMatcher < Stmt, DoStmt > | doStmt |
| Matches do statements. More... | |
| const internal::VariadicDynCastAllOfMatcher < Stmt, BreakStmt > | breakStmt |
| Matches break statements. More... | |
| const internal::VariadicDynCastAllOfMatcher < Stmt, ContinueStmt > | continueStmt |
| Matches continue statements. More... | |
| const internal::VariadicDynCastAllOfMatcher < Stmt, ReturnStmt > | returnStmt |
| Matches return statements. More... | |
| const internal::VariadicDynCastAllOfMatcher < Stmt, GotoStmt > | gotoStmt |
| Matches goto statements. More... | |
| const internal::VariadicDynCastAllOfMatcher < Stmt, LabelStmt > | labelStmt |
| Matches label statements. More... | |
| const internal::VariadicDynCastAllOfMatcher < Stmt, SwitchStmt > | switchStmt |
| Matches switch statements. More... | |
| const internal::VariadicDynCastAllOfMatcher < Stmt, SwitchCase > | switchCase |
| Matches case and default statements inside switch statements. More... | |
| const internal::VariadicDynCastAllOfMatcher < Stmt, CaseStmt > | caseStmt |
| Matches case statements inside switch statements. More... | |
| const internal::VariadicDynCastAllOfMatcher < Stmt, DefaultStmt > | defaultStmt |
| Matches default statements inside switch statements. More... | |
| const internal::VariadicDynCastAllOfMatcher < Stmt, CompoundStmt > | compoundStmt |
| Matches compound statements. More... | |
| const internal::VariadicDynCastAllOfMatcher < Stmt, CXXCatchStmt > | cxxCatchStmt |
| Matches catch statements. More... | |
| const internal::VariadicDynCastAllOfMatcher < Stmt, CXXTryStmt > | cxxTryStmt |
| Matches try statements. More... | |
| const internal::VariadicDynCastAllOfMatcher < Stmt, CXXThrowExpr > | cxxThrowExpr |
| Matches throw expressions. More... | |
| const internal::VariadicDynCastAllOfMatcher < Stmt, NullStmt > | nullStmt |
| Matches null statements. More... | |
| const internal::VariadicDynCastAllOfMatcher < Stmt, AsmStmt > | asmStmt |
| Matches asm statements. More... | |
| const internal::VariadicDynCastAllOfMatcher < Stmt, CXXBoolLiteralExpr > | cxxBoolLiteral |
| Matches bool literals. More... | |
| const internal::VariadicDynCastAllOfMatcher < Stmt, StringLiteral > | stringLiteral |
| Matches string literals (also matches wide string literals). More... | |
| const internal::VariadicDynCastAllOfMatcher < Stmt, CharacterLiteral > | characterLiteral |
| Matches character literals (also matches wchar_t). More... | |
| const internal::VariadicDynCastAllOfMatcher < Stmt, IntegerLiteral > | integerLiteral |
| Matches integer literals of all sizes / encodings, e.g. More... | |
| const internal::VariadicDynCastAllOfMatcher < Stmt, FloatingLiteral > | floatLiteral |
| Matches float literals of all sizes / encodings, e.g. More... | |
| const internal::VariadicDynCastAllOfMatcher < Stmt, UserDefinedLiteral > | userDefinedLiteral |
| Matches user defined literal operator call. More... | |
| const internal::VariadicDynCastAllOfMatcher < Stmt, CompoundLiteralExpr > | compoundLiteralExpr |
| Matches compound (i.e. More... | |
| const internal::VariadicDynCastAllOfMatcher < Stmt, CXXNullPtrLiteralExpr > | cxxNullPtrLiteralExpr |
| Matches nullptr literal. More... | |
| const internal::VariadicDynCastAllOfMatcher < Stmt, GNUNullExpr > | gnuNullExpr |
| Matches GNU __null expression. More... | |
| const internal::VariadicDynCastAllOfMatcher < Stmt, BinaryOperator > | binaryOperator |
| Matches binary operator expressions. More... | |
| const internal::VariadicDynCastAllOfMatcher < Stmt, UnaryOperator > | unaryOperator |
| Matches unary operator expressions. More... | |
| const internal::VariadicDynCastAllOfMatcher < Stmt, ConditionalOperator > | conditionalOperator |
| Matches conditional operator expressions. More... | |
| const internal::VariadicDynCastAllOfMatcher < Decl, StaticAssertDecl > | staticAssertDecl |
| Matches a C++ static_assert declaration. More... | |
| const internal::VariadicDynCastAllOfMatcher < Stmt, CXXReinterpretCastExpr > | cxxReinterpretCastExpr |
| Matches a reinterpret_cast expression. More... | |
| const internal::VariadicDynCastAllOfMatcher < Stmt, CXXStaticCastExpr > | cxxStaticCastExpr |
| Matches a C++ static_cast expression. More... | |
| const internal::VariadicDynCastAllOfMatcher < Stmt, CXXDynamicCastExpr > | cxxDynamicCastExpr |
| Matches a dynamic_cast expression. More... | |
| const internal::VariadicDynCastAllOfMatcher < Stmt, CXXConstCastExpr > | cxxConstCastExpr |
| Matches a const_cast expression. More... | |
| const internal::VariadicDynCastAllOfMatcher < Stmt, CStyleCastExpr > | cStyleCastExpr |
| Matches a C-style cast expression. More... | |
| const internal::VariadicDynCastAllOfMatcher < Stmt, ExplicitCastExpr > | explicitCastExpr |
| Matches explicit cast expressions. More... | |
| const internal::VariadicDynCastAllOfMatcher < Stmt, ImplicitCastExpr > | implicitCastExpr |
| Matches the implicit cast nodes of Clang's AST. More... | |
| const internal::VariadicDynCastAllOfMatcher < Stmt, CastExpr > | castExpr |
| Matches any cast nodes of Clang's AST. More... | |
| const internal::VariadicDynCastAllOfMatcher < Stmt, CXXFunctionalCastExpr > | cxxFunctionalCastExpr |
| Matches functional cast expressions. More... | |
| const internal::VariadicDynCastAllOfMatcher < Stmt, CXXTemporaryObjectExpr > | cxxTemporaryObjectExpr |
| Matches functional cast expressions having N != 1 arguments. More... | |
| const internal::VariadicAllOfMatcher < QualType > | qualType |
Matches QualTypes in the clang AST. More... | |
| const internal::VariadicAllOfMatcher < Type > | type |
Matches Types in the clang AST. More... | |
| const internal::VariadicAllOfMatcher < TypeLoc > | typeLoc |
Matches TypeLocs in the clang AST. More... | |
| const internal::VariadicOperatorMatcherFunc < 2, UINT_MAX > | eachOf |
| Matches if any of the given matchers matches. More... | |
| const internal::VariadicOperatorMatcherFunc < 2, UINT_MAX > | anyOf |
| Matches if any of the given matchers matches. More... | |
| const internal::VariadicOperatorMatcherFunc < 2, UINT_MAX > | allOf |
| Matches if all given matchers match. More... | |
| const internal::VariadicDynCastAllOfMatcher < Stmt, UnaryExprOrTypeTraitExpr > | unaryExprOrTypeTraitExpr |
| Matches sizeof (C99), alignof (C++11) and vec_step (OpenCL) More... | |
| const internal::ArgumentAdaptingMatcherFunc < internal::HasMatcher > LLVM_ATTRIBUTE_UNUSED | has = {} |
| Matches AST nodes that have child AST nodes that match the provided matcher. More... | |
| const internal::ArgumentAdaptingMatcherFunc < internal::HasDescendantMatcher > LLVM_ATTRIBUTE_UNUSED | hasDescendant = {} |
| Matches AST nodes that have descendant AST nodes that match the provided matcher. More... | |
| const internal::ArgumentAdaptingMatcherFunc < internal::ForEachMatcher > LLVM_ATTRIBUTE_UNUSED | forEach = {} |
| Matches AST nodes that have child AST nodes that match the provided matcher. More... | |
| const internal::ArgumentAdaptingMatcherFunc < internal::ForEachDescendantMatcher > LLVM_ATTRIBUTE_UNUSED | forEachDescendant = {} |
| Matches AST nodes that have descendant AST nodes that match the provided matcher. More... | |
| const internal::ArgumentAdaptingMatcherFunc < internal::HasParentMatcher, internal::TypeList< Decl, NestedNameSpecifierLoc, Stmt, TypeLoc >, internal::TypeList < Decl, NestedNameSpecifierLoc, Stmt, TypeLoc > > LLVM_ATTRIBUTE_UNUSED | hasParent = {} |
| Matches AST nodes that have a parent that matches the provided matcher. More... | |
| const internal::ArgumentAdaptingMatcherFunc < internal::HasAncestorMatcher, internal::TypeList< Decl, NestedNameSpecifierLoc, Stmt, TypeLoc >, internal::TypeList < Decl, NestedNameSpecifierLoc, Stmt, TypeLoc > > LLVM_ATTRIBUTE_UNUSED | hasAncestor = {} |
| Matches AST nodes that have an ancestor that matches the provided matcher. More... | |
| const internal::VariadicOperatorMatcherFunc< 1, 1 > | unless |
| Matches if the provided matcher does not match. More... | |
| const internal::VariadicAllOfMatcher < NestedNameSpecifier > | nestedNameSpecifier |
| Matches nested name specifiers. More... | |
| const internal::VariadicAllOfMatcher < NestedNameSpecifierLoc > | nestedNameSpecifierLoc |
Same as nestedNameSpecifier but matches NestedNameSpecifierLoc. More... | |
| const internal::VariadicDynCastAllOfMatcher < Stmt, CUDAKernelCallExpr > | cudaKernelCallExpr |
| Matches CUDA kernel call expression. More... | |
Types of matchers for the top-level classes in the AST class hierarchy.
Definition at line 123 of file ASTMatchers.h.
| typedef internal::Matcher<NestedNameSpecifierLoc> clang::ast_matchers::NestedNameSpecifierLocMatcher |
Definition at line 128 of file ASTMatchers.h.
Definition at line 127 of file ASTMatchers.h.
Definition at line 124 of file ASTMatchers.h.
Definition at line 126 of file ASTMatchers.h.
Definition at line 125 of file ASTMatchers.h.
|
inline |
Same as unaryExprOrTypeTraitExpr, but only matching alignof.
Definition at line 1807 of file ASTMatchers.h.
References allOf, stmt, clang::UETT_AlignOf, and unaryExprOrTypeTraitExpr.
|
inline |
Matches any node.
Useful when another matcher requires a child matcher, but there's no additional constraint. This will often be used with an explicit conversion to an internal::Matcher<> type such as TypeMatcher.
Example: DeclarationMatcher(anything()) matches all declarations, e.g.,
Usable as: Any Matcher
Definition at line 145 of file ASTMatchers.h.
| clang::ast_matchers::AST_MATCHER | ( | Decl | , |
| isPublic | |||
| ) |
Matches public C++ declarations.
Given
fieldDecl(isPublic()) matches 'int a;'
Definition at line 451 of file ASTMatchers.h.
References clang::AS_public, and Node.
| clang::ast_matchers::AST_MATCHER | ( | Decl | , |
| isProtected | |||
| ) |
Matches protected C++ declarations.
Given
fieldDecl(isProtected()) matches 'int b;'
Definition at line 467 of file ASTMatchers.h.
References clang::AS_protected, and Node.
| clang::ast_matchers::AST_MATCHER | ( | Decl | , |
| isPrivate | |||
| ) |
Matches private C++ declarations.
Given
fieldDecl(isPrivate()) matches 'int c;'
Definition at line 483 of file ASTMatchers.h.
References clang::AS_private, and Node.
| clang::ast_matchers::AST_MATCHER | ( | Decl | , |
| isImplicit | |||
| ) |
Matches a declaration that has been implicitly added by the compiler (eg.
implicit default/copy constructors).
Definition at line 489 of file ASTMatchers.h.
References Node.
| clang::ast_matchers::AST_MATCHER | ( | TemplateArgument | , |
| isIntegral | |||
| ) |
Matches a TemplateArgument that is an integral value.
Given
classTemplateSpecializationDecl( hasAnyTemplateArgument(isIntegral())) matches the implicit instantiation of C in C<42> with isIntegral() matching 42.
Definition at line 701 of file ASTMatchers.h.
References clang::TemplateArgument::Integral, and Node.
| clang::ast_matchers::AST_MATCHER | ( | ObjCMessageExpr | , |
| hasNullSelector | |||
| ) |
Matches when the selector is the empty selector.
Matches only when the selector of the objCMessageExpr is NULL. This may represent an error condition in the tree!
Definition at line 2201 of file ASTMatchers.h.
References Node.
| clang::ast_matchers::AST_MATCHER | ( | ObjCMessageExpr | , |
| hasUnarySelector | |||
| ) |
Matches when the selector is a Unary Selector.
matcher = objCMessageExpr(matchesSelector(hasUnarySelector()); matches self.bodyView in the code below, but NOT the outer message invocation of "loadHTMLString:baseURL:".
Definition at line 2213 of file ASTMatchers.h.
References Node.
| clang::ast_matchers::AST_MATCHER | ( | ObjCMessageExpr | , |
| hasKeywordSelector | |||
| ) |
Matches when the selector is a keyword selector.
objCMessageExpr(hasKeywordSelector()) matches the generated setFrame message expression in
Definition at line 2229 of file ASTMatchers.h.
References Node.
| clang::ast_matchers::AST_MATCHER | ( | VarDecl | , |
| hasLocalStorage | |||
| ) |
Matches a variable declaration that has function scope and is a non-static local variable.
Example matches x (matcher = varDecl(hasLocalStorage())
Definition at line 2529 of file ASTMatchers.h.
References Node.
| clang::ast_matchers::AST_MATCHER | ( | VarDecl | , |
| hasGlobalStorage | |||
| ) |
Matches a variable declaration that does not have local storage.
Example matches y and z (matcher = varDecl(hasGlobalStorage())
Definition at line 2543 of file ASTMatchers.h.
References Node.
| clang::ast_matchers::AST_MATCHER | ( | VarDecl | , |
| hasAutomaticStorageDuration | |||
| ) |
Matches a variable declaration that has automatic storage duration.
Example matches x, but not y, z, or a. (matcher = varDecl(hasAutomaticStorageDuration())
Definition at line 2559 of file ASTMatchers.h.
References Node, and clang::SD_Automatic.
| clang::ast_matchers::AST_MATCHER | ( | VarDecl | , |
| hasStaticStorageDuration | |||
| ) |
Matches a variable declaration that has static storage duration.
Example matches y and a, but not x or z. (matcher = varDecl(hasStaticStorageDuration())
Definition at line 2575 of file ASTMatchers.h.
References Node, and clang::SD_Static.
| clang::ast_matchers::AST_MATCHER | ( | VarDecl | , |
| hasThreadStorageDuration | |||
| ) |
Matches a variable declaration that has thread storage duration.
Example matches z, but not x, z, or a. (matcher = varDecl(hasThreadStorageDuration())
Definition at line 2591 of file ASTMatchers.h.
References Node, and clang::SD_Thread.
| clang::ast_matchers::AST_MATCHER | ( | VarDecl | , |
| isExceptionVariable | |||
| ) |
Matches a variable declaration that is an exception variable from a C++ catch block, or an Objective-C @catch statement.
Example matches x (matcher = varDecl(isExceptionVariable())
Definition at line 2606 of file ASTMatchers.h.
References Node.
| clang::ast_matchers::AST_MATCHER | ( | CXXCtorInitializer | , |
| isWritten | |||
| ) |
Matches a constructor initializer if it is explicitly written in code (as opposed to implicitly added by the compiler).
Given
cxxConstructorDecl(hasAnyConstructorInitializer(isWritten())) will match Foo(int), but not Foo()
Definition at line 2777 of file ASTMatchers.h.
References Node.
| clang::ast_matchers::AST_MATCHER | ( | CXXCtorInitializer | , |
| isBaseInitializer | |||
| ) |
Matches a constructor initializer if it is initializing a base, as opposed to a member.
Given
cxxConstructorDecl(hasAnyConstructorInitializer(isBaseInitializer())) will match E(), but not match D(int).
Definition at line 2797 of file ASTMatchers.h.
References Node.
| clang::ast_matchers::AST_MATCHER | ( | CXXCtorInitializer | , |
| isMemberInitializer | |||
| ) |
Matches a constructor initializer if it is initializing a member, as opposed to a base.
Given
cxxConstructorDecl(hasAnyConstructorInitializer(isMemberInitializer())) will match D(int), but not match E().
Definition at line 2817 of file ASTMatchers.h.
References Node.
| clang::ast_matchers::AST_MATCHER | ( | CXXConstructExpr | , |
| isListInitialization | |||
| ) |
Matches a constructor call expression which uses list initialization.
Definition at line 2852 of file ASTMatchers.h.
References Node.
| clang::ast_matchers::AST_MATCHER | ( | FunctionDecl | , |
| isExternC | |||
| ) |
Matches extern "C" function declarations.
Given:
functionDecl(isExternC()) matches the declaration of f and g, but not the declaration h
Definition at line 2928 of file ASTMatchers.h.
References Node.
| clang::ast_matchers::AST_MATCHER | ( | FunctionDecl | , |
| isDeleted | |||
| ) |
Matches deleted function declarations.
Given:
functionDecl(isDeleted()) matches the declaration of DeletedFunc, but not Func.
Definition at line 2941 of file ASTMatchers.h.
References Node.
| clang::ast_matchers::AST_MATCHER | ( | FunctionDecl | , |
| isNoThrow | |||
| ) |
Matches functions that have a non-throwing exception specification.
Given:
functionDecl(isNoThrow()) matches the declarations of g, and h, but not f, i or j.
Definition at line 2957 of file ASTMatchers.h.
References clang::FunctionProtoType::isNothrow(), clang::isUnresolvedExceptionSpec(), and Node.
| clang::ast_matchers::AST_MATCHER | ( | RecordDecl | , |
| isStruct | |||
| ) |
Matches RecordDecl object that are spelled with "struct.".
Example matches S, but not C or U.
Definition at line 3293 of file ASTMatchers.h.
References Node.
| clang::ast_matchers::AST_MATCHER | ( | RecordDecl | , |
| isUnion | |||
| ) |
Matches RecordDecl object that are spelled with "union.".
Example matches U, but not C or S.
Definition at line 3305 of file ASTMatchers.h.
References Node.
| clang::ast_matchers::AST_MATCHER | ( | RecordDecl | , |
| isClass | |||
| ) |
Matches RecordDecl object that are spelled with "class.".
Example matches C, but not S or U.
Definition at line 3317 of file ASTMatchers.h.
References Node.
| clang::ast_matchers::AST_MATCHER | ( | FunctionDecl | , |
| isVariadic | |||
| ) |
Matches if a function declaration is variadic.
Example matches f, but not g or h. The function i will not match, even when compiled in C mode.
Definition at line 3376 of file ASTMatchers.h.
References Node.
| clang::ast_matchers::AST_MATCHER | ( | CXXMethodDecl | , |
| isVirtual | |||
| ) |
Matches if the given method declaration is virtual.
Given
matches A::x
Definition at line 3414 of file ASTMatchers.h.
References Node.
| clang::ast_matchers::AST_MATCHER | ( | CXXMethodDecl | , |
| isPure | |||
| ) |
Matches if the given method declaration is pure.
Given
matches A::x
Definition at line 3449 of file ASTMatchers.h.
References Node.
| clang::ast_matchers::AST_MATCHER | ( | CXXMethodDecl | , |
| isConst | |||
| ) |
Matches if the given method declaration is const.
Given
cxxMethodDecl(isConst()) matches A::foo() but not A::bar()
Definition at line 3464 of file ASTMatchers.h.
References Node.
| clang::ast_matchers::AST_MATCHER | ( | CXXMethodDecl | , |
| isCopyAssignmentOperator | |||
| ) |
Matches if the given method declaration declares a copy assignment operator.
Given
cxxMethodDecl(isCopyAssignmentOperator()) matches the first method but not the second one.
Definition at line 3481 of file ASTMatchers.h.
References Node.
| clang::ast_matchers::AST_MATCHER | ( | CXXMethodDecl | , |
| isOverride | |||
| ) |
Matches if the given method declaration overrides another method.
Given
matches B::x
Definition at line 3499 of file ASTMatchers.h.
References Node.
| clang::ast_matchers::AST_MATCHER | ( | MemberExpr | , |
| isArrow | |||
| ) |
Matches member expressions that are called with '->' as opposed to '.
'.
Member calls on the implicit this pointer match as called with '->'.
Given
memberExpr(isArrow()) matches this->x, x, y.x, a, this->b
Definition at line 3518 of file ASTMatchers.h.
References Node.
| clang::ast_matchers::AST_MATCHER | ( | QualType | , |
| isInteger | |||
| ) |
Matches QualType nodes that are of integer type.
Given
functionDecl(hasAnyParameter(hasType(isInteger()))) matches "a(int)", "b(long)", but not "c(double)".
Definition at line 3532 of file ASTMatchers.h.
References Node.
| clang::ast_matchers::AST_MATCHER | ( | QualType | , |
| isAnyCharacter | |||
| ) |
Matches QualType nodes that are of character type.
Given
functionDecl(hasAnyParameter(hasType(isAnyCharacter()))) matches "a(char)", "b(wchar_t)", but not "c(double)".
Definition at line 3546 of file ASTMatchers.h.
References Node.
| clang::ast_matchers::AST_MATCHER | ( | QualType | , |
| isConstQualified | |||
| ) |
Matches QualType nodes that are const-qualified, i.e., that include "top-level" const.
Given
functionDecl(hasAnyParameter(hasType(isConstQualified()))) matches "void b(int const)", "void c(const int)" and "void e(int const) {}". It does not match d as there is no top-level const on the parameter type "const int *".
Definition at line 3565 of file ASTMatchers.h.
References Node.
| clang::ast_matchers::AST_MATCHER | ( | QualType | , |
| isVolatileQualified | |||
| ) |
Matches QualType nodes that are volatile-qualified, i.e., that include "top-level" volatile.
Given
functionDecl(hasAnyParameter(hasType(isVolatileQualified()))) matches "void b(int volatile)", "void c(volatile int)" and "void e(int volatile) {}". It does not match d as there is no top-level volatile on the parameter type "volatile int *".
Definition at line 3584 of file ASTMatchers.h.
References Node.
| clang::ast_matchers::AST_MATCHER | ( | QualType | , |
| hasLocalQualifiers | |||
| ) |
Matches QualType nodes that have local CV-qualifiers attached to the node, not hidden within a typedef.
Given
varDecl(hasType(hasLocalQualifiers())) matches only j and k. i is const-qualified but the qualifier is not local.
Definition at line 3601 of file ASTMatchers.h.
References Node.
| clang::ast_matchers::AST_MATCHER | ( | Type | , |
| booleanType | |||
| ) |
Matches type bool.
Given
functionDecl(returns(booleanType())) matches "bool func();"
Definition at line 3773 of file ASTMatchers.h.
References Node.
| clang::ast_matchers::AST_MATCHER | ( | Type | , |
| voidType | |||
| ) |
Matches type void.
Given
functionDecl(returns(voidType())) matches "void func();"
Definition at line 3785 of file ASTMatchers.h.
References Node.
| clang::ast_matchers::AST_MATCHER | ( | CXXConstructorDecl | , |
| isCopyConstructor | |||
| ) |
| clang::ast_matchers::AST_MATCHER | ( | CXXConstructorDecl | , |
| isMoveConstructor | |||
| ) |
| clang::ast_matchers::AST_MATCHER | ( | CXXConstructorDecl | , |
| isDefaultConstructor | |||
| ) |
| clang::ast_matchers::AST_MATCHER | ( | NamespaceDecl | , |
| isAnonymous | |||
| ) |
Matches anonymous namespace declarations.
Given
namespaceDecl(isAnonymous()) will match #1 but not ::n.
Definition at line 4620 of file ASTMatchers.h.
References Node.
| clang::ast_matchers::AST_MATCHER_FUNCTION | ( | internal::Matcher< Decl > | , |
| isInstantiated | |||
| ) |
Matches declarations that are template instantiations or are inside template instantiations.
Given
functionDecl(isInstantiated()) matches 'A(int) {...};' and 'A(unsigned) {...}'.
Definition at line 3713 of file ASTMatchers.h.
References anyOf, cxxRecordDecl, decl, functionDecl, hasAncestor, and clang::isTemplateInstantiation().
| clang::ast_matchers::AST_MATCHER_FUNCTION | ( | internal::Matcher< Stmt > | , |
| isInTemplateInstantiation | |||
| ) |
Matches statements inside of a template instantiation.
Given
declStmt(isInTemplateInstantiation()) matches 'int i;' and 'unsigned i'. unless(stmt(isInTemplateInstantiation())) will NOT match j += 42; as it's shared between the template definition and instantiation.
Definition at line 3733 of file ASTMatchers.h.
References anyOf, cxxRecordDecl, decl, functionDecl, hasAncestor, clang::isTemplateInstantiation(), and stmt.
| clang::ast_matchers::AST_MATCHER_FUNCTION_P_OVERLOAD | ( | internal::BindableMatcher< TypeLoc > | , |
| loc | , | ||
| internal::Matcher< QualType > | , | ||
| InnerMatcher | , | ||
| 0 | |||
| ) |
Matches TypeLocs for which the given inner QualType-matcher matches.
Definition at line 3759 of file ASTMatchers.h.
References InnerMatcher.
| clang::ast_matchers::AST_MATCHER_FUNCTION_P_OVERLOAD | ( | internal::BindableMatcher< NestedNameSpecifierLoc > | , |
| loc | , | ||
| internal::Matcher< NestedNameSpecifier > | , | ||
| InnerMatcher | , | ||
| 1 | |||
| ) |
Matches NestedNameSpecifierLocs for which the given inner NestedNameSpecifier-matcher matches.
Definition at line 4343 of file ASTMatchers.h.
References InnerMatcher.
| clang::ast_matchers::AST_MATCHER_P | ( | Expr | , |
| ignoringImpCasts | , | ||
| internal::Matcher< Expr > | , | ||
| InnerMatcher | |||
| ) |
Matches expressions that match InnerMatcher after any implicit casts are stripped off.
Parentheses and explicit casts are not discarded. Given
The matchers
would match the declarations for a, b, c, and d, but not e. While
only match the declarations for b, c, and d.
Definition at line 541 of file ASTMatchers.h.
References Builder, Finder, InnerMatcher, and Node.
| clang::ast_matchers::AST_MATCHER_P | ( | Expr | , |
| ignoringParenCasts | , | ||
| internal::Matcher< Expr > | , | ||
| InnerMatcher | |||
| ) |
Matches expressions that match InnerMatcher after parentheses and casts are stripped off.
Implicit and non-C Style casts are also discarded. Given
The matcher varDecl(hasInitializer(ignoringParenCasts(integerLiteral()))) would match the declarations for a, b, c, and d. while varDecl(hasInitializer(integerLiteral())) only match the declaration for a.
Definition at line 563 of file ASTMatchers.h.
References Builder, Finder, InnerMatcher, and Node.
| clang::ast_matchers::AST_MATCHER_P | ( | Expr | , |
| ignoringParenImpCasts | , | ||
| internal::Matcher< Expr > | , | ||
| InnerMatcher | |||
| ) |
Matches expressions that match InnerMatcher after implicit casts and parentheses are stripped off.
Explicit casts are not discarded. Given
The matchers varDecl(hasInitializer(ignoringParenImpCasts(integerLiteral()))) varDecl(hasInitializer(ignoringParenImpCasts(declRefExpr()))) would match the declarations for a, b, c, and d, but not e. while varDecl(hasInitializer(integerLiteral())) varDecl(hasInitializer(declRefExpr())) would only match the declaration for a.
Definition at line 588 of file ASTMatchers.h.
References Builder, Finder, InnerMatcher, and Node.
| clang::ast_matchers::AST_MATCHER_P | ( | TemplateArgument | , |
| refersToType | , | ||
| internal::Matcher< QualType > | , | ||
| InnerMatcher | |||
| ) |
Matches a TemplateArgument that refers to a certain type.
Given
classTemplateSpecializationDecl(hasAnyTemplateArgument( refersToType(class(hasName("X"))))) matches the specialization A<X>
Definition at line 645 of file ASTMatchers.h.
References Builder, Finder, InnerMatcher, Node, and clang::TemplateArgument::Type.
| clang::ast_matchers::AST_MATCHER_P | ( | TemplateArgument | , |
| refersToDeclaration | , | ||
| internal::Matcher< Decl > | , | ||
| InnerMatcher | |||
| ) |
Matches a canonical TemplateArgument that refers to a certain declaration.
Given
classTemplateSpecializationDecl(hasAnyTemplateArgument( refersToDeclaration(fieldDecl(hasName("next")))) matches the specialization A<&B::next> with fieldDecl(...) matching B::next
Definition at line 665 of file ASTMatchers.h.
References Builder, clang::TemplateArgument::Declaration, Finder, InnerMatcher, and Node.
| clang::ast_matchers::AST_MATCHER_P | ( | TemplateArgument | , |
| isExpr | , | ||
| internal::Matcher< Expr > | , | ||
| InnerMatcher | |||
| ) |
Matches a sugar TemplateArgument that refers to a certain expression.
Given
templateSpecializationType(hasAnyTemplateArgument( isExpr(hasDescendant(declRefExpr(to(fieldDecl(hasName("next")))))))) matches the specialization A<&B::next> with fieldDecl(...) matching B::next
Definition at line 684 of file ASTMatchers.h.
References Builder, clang::TemplateArgument::Expression, Finder, InnerMatcher, and Node.
| clang::ast_matchers::AST_MATCHER_P | ( | TemplateArgument | , |
| refersToIntegralType | , | ||
| internal::Matcher< QualType > | , | ||
| InnerMatcher | |||
| ) |
Matches a TemplateArgument that referes to an integral type.
Given
classTemplateSpecializationDecl( hasAnyTemplateArgument(refersToIntegralType(asString("int")))) matches the implicit instantiation of C in C<42>.
Definition at line 715 of file ASTMatchers.h.
References Builder, Finder, InnerMatcher, clang::TemplateArgument::Integral, and Node.
| clang::ast_matchers::AST_MATCHER_P | ( | TemplateArgument | , |
| equalsIntegralValue | , | ||
| std::string | , | ||
| Value | |||
| ) |
Matches a TemplateArgument of integral type with a given value.
Note that 'Value' is a string as the template argument's value is an arbitrary precision integer. 'Value' must be euqal to the canonical representation of that integral value in base 10.
Given
classTemplateSpecializationDecl( hasAnyTemplateArgument(equalsIntegralValue("42"))) matches the implicit instantiation of C in C<42>.
Definition at line 736 of file ASTMatchers.h.
References clang::TemplateArgument::Integral, and Node.
| clang::ast_matchers::AST_MATCHER_P | ( | ForStmt | , |
| hasIncrement | , | ||
| internal::Matcher< Stmt > | , | ||
| InnerMatcher | |||
| ) |
Matches the increment statement of a for loop.
Example: forStmt(hasIncrement(unaryOperator(hasOperatorName("++")))) matches '++x' in
Definition at line 1228 of file ASTMatchers.h.
References Builder, Finder, InnerMatcher, and Node.
| clang::ast_matchers::AST_MATCHER_P | ( | ForStmt | , |
| hasLoopInit | , | ||
| internal::Matcher< Stmt > | , | ||
| InnerMatcher | |||
| ) |
Matches the initialization statement of a for loop.
Example: forStmt(hasLoopInit(declStmt())) matches 'int x = 0' in
Definition at line 1243 of file ASTMatchers.h.
References Builder, Finder, InnerMatcher, and Node.
| clang::ast_matchers::AST_MATCHER_P | ( | CXXForRangeStmt | , |
| hasLoopVariable | , | ||
| internal::Matcher< VarDecl > | , | ||
| InnerMatcher | |||
| ) |
Matches the initialization statement of a for loop.
Example: forStmt(hasLoopVariable(anything())) matches 'int x' in
Definition at line 1268 of file ASTMatchers.h.
References Builder, Finder, InnerMatcher, and Node.
| clang::ast_matchers::AST_MATCHER_P | ( | CXXForRangeStmt | , |
| hasRangeInit | , | ||
| internal::Matcher< Expr > | , | ||
| InnerMatcher | |||
| ) |
Matches the range initialization statement of a for loop.
Example: forStmt(hasRangeInit(anything())) matches 'a' in
Definition at line 1282 of file ASTMatchers.h.
References Builder, Finder, InnerMatcher, and Node.
| clang::ast_matchers::AST_MATCHER_P | ( | UnaryExprOrTypeTraitExpr | , |
| hasArgumentOfType | , | ||
| internal::Matcher< QualType > | , | ||
| InnerMatcher | |||
| ) |
Matches unary expressions that have a specific type of argument.
Given
unaryExprOrTypeTraitExpr(hasArgumentOfType(asString("int")) matches sizeof(a) and alignof(c)
Definition at line 1786 of file ASTMatchers.h.
References Builder, Finder, InnerMatcher, and Node.
| clang::ast_matchers::AST_MATCHER_P | ( | UnaryExprOrTypeTraitExpr | , |
| ofKind | , | ||
| UnaryExprOrTypeTrait | , | ||
| Kind | |||
| ) |
Matches unary expressions of a certain kind.
Given
unaryExprOrTypeTraitExpr(ofKind(UETT_SizeOf)) matches sizeof(x)
Definition at line 1801 of file ASTMatchers.h.
References Node.
| clang::ast_matchers::AST_MATCHER_P | ( | NamedDecl | , |
| matchesName | , | ||
| std::string | , | ||
| RegExp | |||
| ) |
Matches NamedDecl nodes whose fully qualified names contain a substring matched by the given RegExp.
Supports specifying enclosing namespaces or classes by prefixing the name with '<enclosing>::'. Does not match typedefs of an underlying type with the given name.
Example matches X (regexp == "::X")
Example matches X (regexp is one of "::X", "^foo::.*X", among others)
Definition at line 1856 of file ASTMatchers.h.
References Node.
| clang::ast_matchers::AST_MATCHER_P | ( | CXXRecordDecl | , |
| isDerivedFrom | , | ||
| internal::Matcher< NamedDecl > | , | ||
| Base | |||
| ) |
Matches C++ classes that are directly or indirectly derived from a class matching Base.
Note that a class is not considered to be derived from itself.
Example matches Y, Z, C (Base == hasName("X"))
In the following example, Bar matches isDerivedFrom(hasName("X")):
Definition at line 1912 of file ASTMatchers.h.
| clang::ast_matchers::AST_MATCHER_P | ( | CXXRecordDecl | , |
| hasMethod | , | ||
| internal::Matcher< CXXMethodDecl > | , | ||
| InnerMatcher | |||
| ) |
Matches the first method of a class or struct that satisfies InnerMatcher.
Given:
cxxRecordDecl(hasMethod(hasName("func"))) matches the declaration of A but not B.
Definition at line 1950 of file ASTMatchers.h.
References Builder, Finder, InnerMatcher, and Node.
| clang::ast_matchers::AST_MATCHER_P | ( | CXXMemberCallExpr | , |
| on | , | ||
| internal::Matcher< Expr > | , | ||
| InnerMatcher | |||
| ) |
Matches on the implicit object argument of a member call expression.
Example matches y.x() (matcher = cxxMemberCallExpr(on(hasType(cxxRecordDecl(hasName("Y"))))))
FIXME: Overload to allow directly matching types?
Definition at line 2143 of file ASTMatchers.h.
References Builder, Finder, InnerMatcher, and Node.
| clang::ast_matchers::AST_MATCHER_P | ( | ObjCMessageExpr | , |
| hasReceiverType | , | ||
| internal::Matcher< QualType > | , | ||
| InnerMatcher | |||
| ) |
Matches on the receiver of an ObjectiveC Message expression.
Example matcher = objCMessageExpr(hasRecieverType(asString("UIWebView *"))); matches the [webView ...] message invocation.
Definition at line 2162 of file ASTMatchers.h.
References Builder, Finder, InnerMatcher, and Node.
| clang::ast_matchers::AST_MATCHER_P | ( | ObjCMessageExpr | , |
| hasSelector | , | ||
| std::string | , | ||
| BaseName | |||
| ) |
Matches when BaseName == Selector.getAsString()
matcher = objCMessageExpr(hasSelector("loadHTMLString:baseURL:")); matches the outer message expr in the code below, but NOT the message invocation for self.bodyView.
Definition at line 2176 of file ASTMatchers.h.
References clang::Selector::getAsString(), and Node.
| clang::ast_matchers::AST_MATCHER_P | ( | ObjCMessageExpr | , |
| matchesSelector | , | ||
| std::string | , | ||
| RegExp | |||
| ) |
Matches ObjC selectors whose name contains a substring matched by the given RegExp.
matcher = objCMessageExpr(matchesSelector("loadHTMLString\:baseURL?")); matches the outer message expr in the code below, but NOT the message invocation for self.bodyView.
Definition at line 2190 of file ASTMatchers.h.
References Node.
| clang::ast_matchers::AST_MATCHER_P | ( | ObjCMessageExpr | , |
| numSelectorArgs | , | ||
| unsigned | , | ||
| N | |||
| ) |
Matches when the selector has the specified number of arguments.
matcher = objCMessageExpr(numSelectorArgs(0)); matches self.bodyView in the code below
matcher = objCMessageExpr(numSelectorArgs(2)); matches the invocation of "loadHTMLString:baseURL:" but not that of self.bodyView
Definition at line 2244 of file ASTMatchers.h.
References Node.
| clang::ast_matchers::AST_MATCHER_P | ( | CallExpr | , |
| callee | , | ||
| internal::Matcher< Stmt > | , | ||
| InnerMatcher | |||
| ) |
Matches if the call expression's callee expression matches.
Given
callExpr(callee(expr())) matches this->x(), x(), y.x(), f() with callee(...) matching this->x, x, y.x, f respectively
Note: Callee cannot take the more general internal::Matcher<Expr> because this introduces ambiguous overloads with calls to Callee taking a internal::Matcher<Decl>, as the matcher hierarchy is purely implemented in terms of implicit casts.
Definition at line 2264 of file ASTMatchers.h.
References Builder, Finder, InnerMatcher, and Node.
| clang::ast_matchers::AST_MATCHER_P | ( | DeclaratorDecl | , |
| hasTypeLoc | , | ||
| internal::Matcher< TypeLoc > | , | ||
| Inner | |||
| ) |
Matches if the type location of the declarator decl's type matches the inner matcher.
Given
declaratorDecl(hasTypeLoc(loc(asString("int")))) matches int x
Definition at line 2334 of file ASTMatchers.h.
| clang::ast_matchers::AST_MATCHER_P | ( | QualType | , |
| asString | , | ||
| std::string | , | ||
| Name | |||
| ) |
Matches if the matched type is represented by the given string.
Given
cxxMemberCallExpr(on(hasType(asString("class Y *")))) matches y->x()
Definition at line 2350 of file ASTMatchers.h.
References clang::Name, and Node.
| clang::ast_matchers::AST_MATCHER_P | ( | QualType | , |
| pointsTo | , | ||
| internal::Matcher< QualType > | , | ||
| InnerMatcher | |||
| ) |
Matches if the matched type is a pointer type and the pointee type matches the specified matcher.
Example matches y->x() (matcher = cxxMemberCallExpr(on(hasType(pointsTo cxxRecordDecl(hasName("Y")))))))
Definition at line 2364 of file ASTMatchers.h.
References Builder, Finder, InnerMatcher, and Node.
| clang::ast_matchers::AST_MATCHER_P | ( | QualType | , |
| references | , | ||
| internal::Matcher< QualType > | , | ||
| InnerMatcher | |||
| ) |
Matches if the matched type is a reference type and the referenced type matches the specified matcher.
Example matches X &x and const X &y (matcher = varDecl(hasType(references(cxxRecordDecl(hasName("X"))))))
Definition at line 2391 of file ASTMatchers.h.
References Builder, Finder, InnerMatcher, and Node.
| clang::ast_matchers::AST_MATCHER_P | ( | QualType | , |
| hasCanonicalType | , | ||
| internal::Matcher< QualType > | , | ||
| InnerMatcher | |||
| ) |
Matches QualTypes whose canonical type matches InnerMatcher.
Given:
varDecl(hasType(qualType(referenceType()))))) will not match the declaration of b but varDecl(hasType(qualType(hasCanonicalType(referenceType())))))) does.
Definition at line 2409 of file ASTMatchers.h.
References Builder, Finder, InnerMatcher, and Node.
| clang::ast_matchers::AST_MATCHER_P | ( | CXXMemberCallExpr | , |
| onImplicitObjectArgument | , | ||
| internal::Matcher< Expr > | , | ||
| InnerMatcher | |||
| ) |
Definition at line 2423 of file ASTMatchers.h.
References Builder, Finder, InnerMatcher, and Node.
| clang::ast_matchers::AST_MATCHER_P | ( | DeclRefExpr | , |
| to | , | ||
| internal::Matcher< Decl > | , | ||
| InnerMatcher | |||
| ) |
Matches a DeclRefExpr that refers to a declaration that matches the specified matcher.
Example matches x in if(x) (matcher = declRefExpr(to(varDecl(hasName("x")))))
Definition at line 2456 of file ASTMatchers.h.
References Builder, Finder, InnerMatcher, and Node.
| clang::ast_matchers::AST_MATCHER_P | ( | DeclRefExpr | , |
| throughUsingDecl | , | ||
| internal::Matcher< UsingShadowDecl > | , | ||
| InnerMatcher | |||
| ) |
Matches a DeclRefExpr that refers to a declaration through a specific using shadow declaration.
Given
declRefExpr(throughUsingDecl(anything())) matches f()
Definition at line 2477 of file ASTMatchers.h.
References Builder, Finder, InnerMatcher, and Node.
| clang::ast_matchers::AST_MATCHER_P | ( | DeclStmt | , |
| hasSingleDecl | , | ||
| internal::Matcher< Decl > | , | ||
| InnerMatcher | |||
| ) |
Matches the Decl of a DeclStmt which has a single declaration.
Given
declStmt(hasSingleDecl(anything())) matches 'int c;' but not 'int a, b;'.
Definition at line 2494 of file ASTMatchers.h.
References Builder, Finder, InnerMatcher, and Node.
| clang::ast_matchers::AST_MATCHER_P | ( | VarDecl | , |
| hasInitializer | , | ||
| internal::Matcher< Expr > | , | ||
| InnerMatcher | |||
| ) |
Matches a variable declaration that has an initializer expression that matches the given matcher.
Example matches x (matcher = varDecl(hasInitializer(callExpr())))
Definition at line 2510 of file ASTMatchers.h.
References Builder, Finder, InnerMatcher, and Node.
| clang::ast_matchers::AST_MATCHER_P | ( | DeclStmt | , |
| declCountIs | , | ||
| unsigned | , | ||
| N | |||
| ) |
Matches declaration statements that contain a specific number of declarations.
Example: Given
declCountIs(2) matches 'int a, b;' and 'int d = 2, e;', but not 'int c;'.
Definition at line 2655 of file ASTMatchers.h.
References Node.
| clang::ast_matchers::AST_MATCHER_P | ( | CXXConstructorDecl | , |
| hasAnyConstructorInitializer | , | ||
| internal::Matcher< CXXCtorInitializer > | , | ||
| InnerMatcher | |||
| ) |
Matches a C++ catch statement that has a catch-all handler.
Given
cxxRecordDecl(has(cxxConstructorDecl( hasAnyConstructorInitializer(anything()) ))) record matches Foo, hasAnyConstructorInitializer matches foo_(1)
Definition at line 2718 of file ASTMatchers.h.
References Builder, Finder, InnerMatcher, and Node.
| clang::ast_matchers::AST_MATCHER_P | ( | CXXCtorInitializer | , |
| forField | , | ||
| internal::Matcher< FieldDecl > | , | ||
| InnerMatcher | |||
| ) |
Matches the field declaration of a constructor initializer.
Given
cxxRecordDecl(has(cxxConstructorDecl(hasAnyConstructorInitializer( forField(hasName("foo_")))))) matches Foo with forField matching foo_
Definition at line 2737 of file ASTMatchers.h.
References Builder, Finder, InnerMatcher, and Node.
| clang::ast_matchers::AST_MATCHER_P | ( | CXXCtorInitializer | , |
| withInitializer | , | ||
| internal::Matcher< Expr > | , | ||
| InnerMatcher | |||
| ) |
Matches the initializer expression of a constructor initializer.
Given
cxxRecordDecl(has(cxxConstructorDecl(hasAnyConstructorInitializer( withInitializer(integerLiteral(equals(1))))))) matches Foo with withInitializer matching (1)
Definition at line 2757 of file ASTMatchers.h.
References Builder, Finder, InnerMatcher, and Node.
| clang::ast_matchers::AST_MATCHER_P | ( | FunctionDecl | , |
| hasAnyParameter | , | ||
| internal::Matcher< ParmVarDecl > | , | ||
| InnerMatcher | |||
| ) |
Matches any parameter of a function declaration.
Does not match the 'this' parameter of a method.
Given
cxxMethodDecl(hasAnyParameter(hasName("y"))) matches f(int x, int y, int z) {} with hasAnyParameter(...) matching int y
Definition at line 2886 of file ASTMatchers.h.
References Builder, Finder, InnerMatcher, and Node.
| clang::ast_matchers::AST_MATCHER_P | ( | FunctionDecl | , |
| parameterCountIs | , | ||
| unsigned | , | ||
| N | |||
| ) |
Matches FunctionDecls that have a specific parameter count.
Given
functionDecl(parameterCountIs(2)) matches g(int i, int j) {}
Definition at line 2901 of file ASTMatchers.h.
References Node.
| clang::ast_matchers::AST_MATCHER_P | ( | FunctionDecl | , |
| returns | , | ||
| internal::Matcher< QualType > | , | ||
| InnerMatcher | |||
| ) |
Matches the return type of a function declaration.
Given:
cxxMethodDecl(returns(asString("int"))) matches int f() { return 1; }
Definition at line 2913 of file ASTMatchers.h.
References Builder, Finder, InnerMatcher, and Node.
| clang::ast_matchers::AST_MATCHER_P | ( | IfStmt | , |
| hasThen | , | ||
| internal::Matcher< Stmt > | , | ||
| InnerMatcher | |||
| ) |
Matches the then-statement of an if statement.
Examples matches the if statement (matcher = ifStmt(hasThen(cxxBoolLiteral(equals(true)))))
Definition at line 3014 of file ASTMatchers.h.
References Builder, Finder, InnerMatcher, and Node.
| clang::ast_matchers::AST_MATCHER_P | ( | IfStmt | , |
| hasElse | , | ||
| internal::Matcher< Stmt > | , | ||
| InnerMatcher | |||
| ) |
Matches the else-statement of an if statement.
Examples matches the if statement (matcher = ifStmt(hasElse(cxxBoolLiteral(equals(true)))))
Definition at line 3026 of file ASTMatchers.h.
References Builder, Finder, InnerMatcher, and Node.
| clang::ast_matchers::AST_MATCHER_P | ( | IfStmt | , |
| hasConditionVariableStatement | , | ||
| internal::Matcher< DeclStmt > | , | ||
| InnerMatcher | |||
| ) |
Matches the condition variable statement in an if statement.
Given
hasConditionVariableStatement(...) matches 'A* a = GetAPointer()'.
Definition at line 3076 of file ASTMatchers.h.
References Builder, Finder, InnerMatcher, and Node.
| clang::ast_matchers::AST_MATCHER_P | ( | ArraySubscriptExpr | , |
| hasIndex | , | ||
| internal::Matcher< Expr > | , | ||
| InnerMatcher | |||
| ) |
Matches the index expression of an array subscript expression.
Given
arraySubscriptExpression(hasIndex(integerLiteral())) matches i[1] with the integerLiteral() matching 1
Definition at line 3093 of file ASTMatchers.h.
References Builder, Finder, InnerMatcher, and Node.
| clang::ast_matchers::AST_MATCHER_P | ( | ArraySubscriptExpr | , |
| hasBase | , | ||
| internal::Matcher< Expr > | , | ||
| InnerMatcher | |||
| ) |
Matches the base expression of an array subscript expression.
Given
arraySubscriptExpression(hasBase(implicitCastExpr( hasSourceExpression(declRefExpr())))) matches i[1] with the declRefExpr() matching i
Definition at line 3110 of file ASTMatchers.h.
References Builder, Finder, InnerMatcher, and Node.
| clang::ast_matchers::AST_MATCHER_P | ( | CompoundStmt | , |
| hasAnySubstatement | , | ||
| internal::Matcher< Stmt > | , | ||
| InnerMatcher | |||
| ) |
Matches compound statements where at least one substatement matches a given matcher.
Given
hasAnySubstatement(compoundStmt()) matches '{ {}; 1+2; }' with compoundStmt() matching '{}'
Definition at line 3149 of file ASTMatchers.h.
References Builder, Finder, InnerMatcher, and Node.
| clang::ast_matchers::AST_MATCHER_P | ( | CompoundStmt | , |
| statementCountIs | , | ||
| unsigned | , | ||
| N | |||
| ) |
Checks that a compound statement contains a specific number of child statements.
Example: Given
compoundStmt(statementCountIs(0))) matches '{}' but does not match the outer compound statement.
Definition at line 3165 of file ASTMatchers.h.
References Node.
| clang::ast_matchers::AST_MATCHER_P | ( | UnaryOperator | , |
| hasUnaryOperand | , | ||
| internal::Matcher< Expr > | , | ||
| InnerMatcher | |||
| ) |
Matches if the operand of a unary operator matches.
Example matches true (matcher = hasUnaryOperand( cxxBoolLiteral(equals(true))))
Definition at line 3244 of file ASTMatchers.h.
References Builder, Finder, InnerMatcher, and Node.
| clang::ast_matchers::AST_MATCHER_P | ( | CastExpr | , |
| hasSourceExpression | , | ||
| internal::Matcher< Expr > | , | ||
| InnerMatcher | |||
| ) |
Matches if the cast's source expression matches the given matcher.
Example: matches "a string" (matcher = hasSourceExpression(cxxConstructExpr()))
Definition at line 3259 of file ASTMatchers.h.
References Builder, Finder, InnerMatcher, and Node.
| clang::ast_matchers::AST_MATCHER_P | ( | ExplicitCastExpr | , |
| hasDestinationType | , | ||
| internal::Matcher< QualType > | , | ||
| InnerMatcher | |||
| ) |
Matches casts whose destination type matches a given matcher.
(Note: Clang's AST refers to other conversions as "casts" too, and calls actual casts "explicit" casts.)
Definition at line 3270 of file ASTMatchers.h.
References Builder, Finder, InnerMatcher, and Node.
| clang::ast_matchers::AST_MATCHER_P | ( | ImplicitCastExpr | , |
| hasImplicitDestinationType | , | ||
| internal::Matcher< QualType > | , | ||
| InnerMatcher | |||
| ) |
Matches implicit casts whose destination type matches a given matcher.
FIXME: Unit test this matcher
Definition at line 3280 of file ASTMatchers.h.
References Builder, Finder, InnerMatcher, and Node.
| clang::ast_matchers::AST_MATCHER_P | ( | ConditionalOperator | , |
| hasTrueExpression | , | ||
| internal::Matcher< Expr > | , | ||
| InnerMatcher | |||
| ) |
Matches the true branch expression of a conditional operator.
Example matches a
Definition at line 3327 of file ASTMatchers.h.
References Builder, Finder, InnerMatcher, and Node.
| clang::ast_matchers::AST_MATCHER_P | ( | ConditionalOperator | , |
| hasFalseExpression | , | ||
| internal::Matcher< Expr > | , | ||
| InnerMatcher | |||
| ) |
Matches the false branch expression of a conditional operator.
Example matches b
Definition at line 3340 of file ASTMatchers.h.
References Builder, Finder, InnerMatcher, and Node.
| clang::ast_matchers::AST_MATCHER_P | ( | CXXMethodDecl | , |
| ofClass | , | ||
| internal::Matcher< CXXRecordDecl > | , | ||
| InnerMatcher | |||
| ) |
Matches the class declaration that the given method declaration belongs to.
FIXME: Generalize this for other kinds of declarations. FIXME: What other kind of declarations would we need to generalize this to?
Example matches A() in the last line (matcher = cxxConstructExpr(hasDeclaration(cxxMethodDecl( ofClass(hasName("A"))))))
Definition at line 3397 of file ASTMatchers.h.
References Builder, Finder, InnerMatcher, and Node.
| clang::ast_matchers::AST_MATCHER_P | ( | MemberExpr | , |
| member | , | ||
| internal::Matcher< ValueDecl > | , | ||
| InnerMatcher | |||
| ) |
Matches a member expression where the member is matched by a given matcher.
Given
memberExpr(member(hasName("first"))) matches second.first but not first.second (because the member name there is "second").
Definition at line 3617 of file ASTMatchers.h.
References Builder, Finder, InnerMatcher, and Node.
| clang::ast_matchers::AST_MATCHER_P | ( | MemberExpr | , |
| hasObjectExpression | , | ||
| internal::Matcher< Expr > | , | ||
| InnerMatcher | |||
| ) |
Matches a member expression where the object expression is matched by a given matcher.
Given
memberExpr(hasObjectExpression(hasType(cxxRecordDecl(hasName("X"))))))) matches "x.m" and "m" with hasObjectExpression(...) matching "x" and the implicit object expression of "m" which has type X*.
Definition at line 3634 of file ASTMatchers.h.
References Builder, Finder, InnerMatcher, and Node.
| clang::ast_matchers::AST_MATCHER_P | ( | UsingDecl | , |
| hasAnyUsingShadowDecl | , | ||
| internal::Matcher< UsingShadowDecl > | , | ||
| InnerMatcher | |||
| ) |
Matches any using shadow declaration.
Given
usingDecl(hasAnyUsingShadowDecl(hasName("b")))) matches
Definition at line 3648 of file ASTMatchers.h.
References Builder, Finder, InnerMatcher, and Node.
| clang::ast_matchers::AST_MATCHER_P | ( | UsingShadowDecl | , |
| hasTargetDecl | , | ||
| internal::Matcher< NamedDecl > | , | ||
| InnerMatcher | |||
| ) |
Matches a using shadow declaration where the target declaration is matched by the given matcher.
Given
usingDecl(hasAnyUsingShadowDecl(hasTargetDecl(functionDecl()))) matches
but not
Definition at line 3666 of file ASTMatchers.h.
References Builder, Finder, InnerMatcher, and Node.
| clang::ast_matchers::AST_MATCHER_P | ( | ConstantArrayType | , |
| hasSize | , | ||
| unsigned | , | ||
| N | |||
| ) |
Matches ConstantArrayType nodes that have the specified size.
Given
constantArrayType(hasSize(42)) matches "int a[42]" and "int b[2 * 21]"
Definition at line 3866 of file ASTMatchers.h.
References Node.
| clang::ast_matchers::AST_MATCHER_P | ( | VariableArrayType | , |
| hasSizeExpr | , | ||
| internal::Matcher< Expr > | , | ||
| InnerMatcher | |||
| ) |
Matches VariableArrayType nodes that have a specific size expression.
Given
variableArrayType(hasSizeExpr(ignoringImpCasts(declRefExpr(to( varDecl(hasName("b"))))))) matches "int a[b]"
Definition at line 3922 of file ASTMatchers.h.
References Builder, Finder, InnerMatcher, and Node.
| clang::ast_matchers::AST_MATCHER_P | ( | ElaboratedType | , |
| hasQualifier | , | ||
| internal::Matcher< NestedNameSpecifier > | , | ||
| InnerMatcher | |||
| ) |
Matches ElaboratedTypes whose qualifier, a NestedNameSpecifier, matches InnerMatcher if the qualifier exists.
Given
elaboratedType(hasQualifier(hasPrefix(specifiesNamespace(hasName("N")))) matches the type of the variable declaration of d.
Definition at line 4221 of file ASTMatchers.h.
References Builder, Finder, InnerMatcher, and Node.
| clang::ast_matchers::AST_MATCHER_P | ( | ElaboratedType | , |
| namesType | , | ||
| internal::Matcher< QualType > | , | ||
| InnerMatcher | |||
| ) |
Matches ElaboratedTypes whose named type matches InnerMatcher.
Given
elaboratedType(namesType(recordType( hasDeclaration(namedDecl(hasName("D")))))) matches the type of the variable declaration of d.
Definition at line 4244 of file ASTMatchers.h.
References Builder, Finder, InnerMatcher, and Node.
| clang::ast_matchers::AST_MATCHER_P | ( | DecayedType | , |
| hasDecayedType | , | ||
| internal::Matcher< QualType > | , | ||
| InnerType | |||
| ) |
Matches the decayed type, whos decayed type matches InnerMatcher.
Definition at line 4297 of file ASTMatchers.h.
| clang::ast_matchers::AST_MATCHER_P | ( | Decl | , |
| hasDeclContext | , | ||
| internal::Matcher< Decl > | , | ||
| InnerMatcher | |||
| ) |
Matches declarations whose declaration context, interpreted as a Decl, matches InnerMatcher.
Given
cxxRcordDecl(hasDeclContext(namedDecl(hasName("M")))) matches the declaration of class D.
Definition at line 4316 of file ASTMatchers.h.
References Builder, clang::Decl::castFromDeclContext(), Finder, InnerMatcher, and Node.
| clang::ast_matchers::AST_MATCHER_P | ( | NestedNameSpecifier | , |
| specifiesType | , | ||
| internal::Matcher< QualType > | , | ||
| InnerMatcher | |||
| ) |
Matches nested name specifiers that specify a type matching the given QualType matcher without qualifiers.
Given
nestedNameSpecifier(specifiesType( hasDeclaration(cxxRecordDecl(hasName("A"))) )) matches "A::"
Definition at line 4363 of file ASTMatchers.h.
References Builder, Finder, InnerMatcher, and Node.
| clang::ast_matchers::AST_MATCHER_P | ( | NestedNameSpecifierLoc | , |
| specifiesTypeLoc | , | ||
| internal::Matcher< TypeLoc > | , | ||
| InnerMatcher | |||
| ) |
Matches nested name specifier locs that specify a type matching the given TypeLoc.
Given
nestedNameSpecifierLoc(specifiesTypeLoc(loc(type( hasDeclaration(cxxRecordDecl(hasName("A"))))))) matches "A::"
Definition at line 4381 of file ASTMatchers.h.
References Builder, Finder, InnerMatcher, and Node.
| clang::ast_matchers::AST_MATCHER_P | ( | NestedNameSpecifier | , |
| specifiesNamespace | , | ||
| internal::Matcher< NamespaceDecl > | , | ||
| InnerMatcher | |||
| ) |
Matches nested name specifiers that specify a namespace matching the given namespace matcher.
Given
nestedNameSpecifier(specifiesNamespace(hasName("ns"))) matches "ns::"
Definition at line 4432 of file ASTMatchers.h.
References Builder, Finder, InnerMatcher, and Node.
| clang::ast_matchers::AST_MATCHER_P | ( | SwitchStmt | , |
| forEachSwitchCase | , | ||
| internal::Matcher< SwitchCase > | , | ||
| InnerMatcher | |||
| ) |
Matches each case or default statement belonging to the given switch statement.
This matcher may produce multiple matches.
Given
switchStmt(forEachSwitchCase(caseStmt().bind("c"))).bind("s") matches four times, with "c" binding each of "case 1:", "case 2:", "case 3:" and "case 4:", and "s" respectively binding "switch (1)", "switch (1)", "switch (2)" and "switch (2)".
Definition at line 4475 of file ASTMatchers.h.
References Builder, Finder, InnerMatcher, Node, and clang::Result.
| clang::ast_matchers::AST_MATCHER_P | ( | CXXConstructorDecl | , |
| forEachConstructorInitializer | , | ||
| internal::Matcher< CXXCtorInitializer > | , | ||
| InnerMatcher | |||
| ) |
Matches each constructor initializer in a constructor definition.
Given
cxxConstructorDecl(forEachConstructorInitializer( forField(decl().bind("x")) )) will trigger two matches, binding for 'i' and 'j' respectively.
Definition at line 4506 of file ASTMatchers.h.
References Builder, Finder, I, InnerMatcher, Node, and clang::Result.
| clang::ast_matchers::AST_MATCHER_P | ( | CaseStmt | , |
| hasCaseConstant | , | ||
| internal::Matcher< Expr > | , | ||
| InnerMatcher | |||
| ) |
If the given case statement does not use the GNU case range extension, matches the constant given in the statement.
Given
caseStmt(hasCaseConstant(integerLiteral())) matches "case 1:"
Definition at line 4633 of file ASTMatchers.h.
References Builder, Finder, InnerMatcher, and Node.
| clang::ast_matchers::AST_MATCHER_P | ( | Decl | , |
| hasAttr | , | ||
| attr::Kind | , | ||
| AttrKind | |||
| ) |
Matches declaration that has a given attribute.
Given
decl(hasAttr(clang::attr::CUDADevice)) matches the function declaration of f. If the matcher is use from clang-query, attr::Kind parameter should be passed as a quoted string. e.g., hasAttr("attr::CUDADevice").
Definition at line 4650 of file ASTMatchers.h.
References clang::Attr::getKind(), and Node.
| clang::ast_matchers::AST_MATCHER_P2 | ( | DeclStmt | , |
| containsDeclaration | , | ||
| unsigned | , | ||
| N | , | ||
| internal::Matcher< Decl > | , | ||
| InnerMatcher | |||
| ) |
Matches the n'th declaration of a declaration statement.
Note that this does not work for global declarations because the AST breaks up multiple-declaration DeclStmt's into multiple single-declaration DeclStmt's. Example: Given non-global declarations
declStmt(containsDeclaration( 0, varDecl(hasInitializer(anything())))) matches only 'int d = 2, e;', and declStmt(containsDeclaration(1, varDecl()))
Definition at line 2678 of file ASTMatchers.h.
References Builder, Finder, InnerMatcher, and Node.
| clang::ast_matchers::AST_MATCHER_P2 | ( | FunctionDecl | , |
| hasParameter | , | ||
| unsigned | , | ||
| N | , | ||
| internal::Matcher< ParmVarDecl > | , | ||
| InnerMatcher | |||
| ) |
Matches the n'th parameter of a function declaration.
Given
cxxMethodDecl(hasParameter(0, hasType(varDecl()))) matches f(int x) {} with hasParameter(...) matching int x
Definition at line 2866 of file ASTMatchers.h.
References Builder, Finder, InnerMatcher, and Node.
| clang::ast_matchers::AST_MATCHER_P_OVERLOAD | ( | CXXRecordDecl | , |
| isDerivedFrom | , | ||
| std::string | , | ||
| BaseName | , | ||
| 1 | |||
| ) |
| clang::ast_matchers::AST_MATCHER_P_OVERLOAD | ( | CXXRecordDecl | , |
| isSameOrDerivedFrom | , | ||
| internal::Matcher< NamedDecl > | , | ||
| Base | , | ||
| 0 | |||
| ) |
Similar to isDerivedFrom(), but also matches classes that directly match Base.
Definition at line 1925 of file ASTMatchers.h.
References anyOf, Builder, Finder, clang::threadSafety::sx::matches(), and Node.
| clang::ast_matchers::AST_MATCHER_P_OVERLOAD | ( | CXXRecordDecl | , |
| isSameOrDerivedFrom | , | ||
| std::string | , | ||
| BaseName | , | ||
| 1 | |||
| ) |
| clang::ast_matchers::AST_MATCHER_P_OVERLOAD | ( | CallExpr | , |
| callee | , | ||
| internal::Matcher< Decl > | , | ||
| InnerMatcher | , | ||
| 1 | |||
| ) |
Matches if the call expression's callee's declaration matches the given matcher.
Example matches y.x() (matcher = callExpr(callee( cxxMethodDecl(hasName("x")))))
Definition at line 2280 of file ASTMatchers.h.
References Builder, callExpr, Finder, hasDeclaration(), InnerMatcher, and Node.
| clang::ast_matchers::AST_MATCHER_P_OVERLOAD | ( | QualType | , |
| pointsTo | , | ||
| internal::Matcher< Decl > | , | ||
| InnerMatcher | , | ||
| 1 | |||
| ) |
Overloaded to match the pointee type's declaration.
Definition at line 2372 of file ASTMatchers.h.
References Builder, Finder, hasDeclaration(), InnerMatcher, Node, and qualType.
| clang::ast_matchers::AST_MATCHER_P_OVERLOAD | ( | QualType | , |
| references | , | ||
| internal::Matcher< Decl > | , | ||
| InnerMatcher | , | ||
| 1 | |||
| ) |
Overloaded to match the referenced type's declaration.
Definition at line 2417 of file ASTMatchers.h.
References Builder, Finder, hasDeclaration(), InnerMatcher, Node, and qualType.
| clang::ast_matchers::AST_MATCHER_P_OVERLOAD | ( | CXXMemberCallExpr | , |
| thisPointerType | , | ||
| internal::Matcher< QualType > | , | ||
| InnerMatcher | , | ||
| 0 | |||
| ) |
Matches if the expression's type either matches the specified matcher, or is a pointer to a type that matches the InnerMatcher.
Definition at line 2432 of file ASTMatchers.h.
References anyOf, Builder, Finder, InnerMatcher, and Node.
| clang::ast_matchers::AST_MATCHER_P_OVERLOAD | ( | CXXMemberCallExpr | , |
| thisPointerType | , | ||
| internal::Matcher< Decl > | , | ||
| InnerMatcher | , | ||
| 1 | |||
| ) |
Overloaded to match the type's declaration.
Definition at line 2440 of file ASTMatchers.h.
References anyOf, Builder, Finder, InnerMatcher, and Node.
| clang::ast_matchers::AST_MATCHER_P_OVERLOAD | ( | NestedNameSpecifier | , |
| hasPrefix | , | ||
| internal::Matcher< NestedNameSpecifier > | , | ||
| InnerMatcher | , | ||
| 0 | |||
| ) |
Matches on the prefix of a NestedNameSpecifier.
Given
nestedNameSpecifier(hasPrefix(specifiesType(asString("struct A")))) and matches "A::"
Definition at line 4395 of file ASTMatchers.h.
References Builder, Finder, InnerMatcher, and Node.
| clang::ast_matchers::AST_MATCHER_P_OVERLOAD | ( | NestedNameSpecifierLoc | , |
| hasPrefix | , | ||
| internal::Matcher< NestedNameSpecifierLoc > | , | ||
| InnerMatcher | , | ||
| 1 | |||
| ) |
Matches on the prefix of a NestedNameSpecifierLoc.
Given
nestedNameSpecifierLoc(hasPrefix(loc(specifiesType(asString("struct A"))))) matches "A::"
Definition at line 4413 of file ASTMatchers.h.
References Builder, Finder, InnerMatcher, and Node.
| clang::ast_matchers::AST_MATCHER_P_OVERLOAD | ( | Decl | , |
| equalsNode | , | ||
| const Decl * | , | ||
| Other | , | ||
| 0 | |||
| ) |
Overloads for the equalsNode matcher.
FIXME: Implement for other node types.Matches if a node equals another node.
Decl has pointer identity in the AST.
Definition at line 4446 of file ASTMatchers.h.
References Node.
Matches if a node equals another node.
Stmt has pointer identity in the AST.
Definition at line 4452 of file ASTMatchers.h.
References Node.
| clang::ast_matchers::AST_MATCHER_P_OVERLOAD | ( | Type | , |
| equalsNode | , | ||
| const Type * | , | ||
| Other | , | ||
| 2 | |||
| ) |
Matches if a node equals another node.
Type has pointer identity in the AST.
Definition at line 4458 of file ASTMatchers.h.
References Node.
| clang::ast_matchers::AST_POLYMORPHIC_MATCHER | ( | isExpansionInMainFile | , |
| AST_POLYMORPHIC_SUPPORTED_TYPES(Decl, Stmt, TypeLoc) | |||
| ) |
Matches AST nodes that were expanded within the main-file.
Example matches X but not Y (matcher = cxxRecordDecl(isExpansionInMainFile())
Y.h:
Usable as: Matcher<Decl>, Matcher<Stmt>, Matcher<TypeLoc>
Definition at line 185 of file ASTMatchers.h.
References Finder, clang::SourceManager::getExpansionLoc(), clang::SourceManager::isInMainFile(), and Node.
| clang::ast_matchers::AST_POLYMORPHIC_MATCHER | ( | isExpansionInSystemHeader | , |
| AST_POLYMORPHIC_SUPPORTED_TYPES(Decl, Stmt, TypeLoc) | |||
| ) |
Matches AST nodes that were expanded within system-header-files.
Example matches Y but not X (matcher = cxxRecordDecl(isExpansionInSystemHeader())
SystemHeader.h:
Usable as: Matcher<Decl>, Matcher<Stmt>, Matcher<TypeLoc>
Definition at line 206 of file ASTMatchers.h.
References Finder, clang::SourceManager::getExpansionLoc(), clang::SourceManager::isInSystemHeader(), and Node.
| clang::ast_matchers::AST_POLYMORPHIC_MATCHER | ( | isConstexpr | , |
| AST_POLYMORPHIC_SUPPORTED_TYPES(VarDecl,FunctionDecl) | |||
| ) |
Matches constexpr variable and function declarations.
Given:
varDecl(isConstexpr()) matches the declaration of foo. functionDecl(isConstexpr()) matches the declaration of bar.
Definition at line 2984 of file ASTMatchers.h.
References Node.
| clang::ast_matchers::AST_POLYMORPHIC_MATCHER | ( | isDefinition | , |
| AST_POLYMORPHIC_SUPPORTED_TYPES(TagDecl, VarDecl,FunctionDecl) | |||
| ) |
Matches if a declaration has a body attached.
Example matches A, va, fa
Usable as: Matcher<TagDecl>, Matcher<VarDecl>, Matcher<FunctionDecl>
Definition at line 3360 of file ASTMatchers.h.
References Node.
| clang::ast_matchers::AST_POLYMORPHIC_MATCHER | ( | isFinal | , |
| AST_POLYMORPHIC_SUPPORTED_TYPES(CXXRecordDecl,CXXMethodDecl) | |||
| ) |
Matches if the given method or class declaration is final.
Given:
matches A and C::f, but not B, C, or B::f
Definition at line 3433 of file ASTMatchers.h.
References Node.
| clang::ast_matchers::AST_POLYMORPHIC_MATCHER | ( | isTemplateInstantiation | , |
| AST_POLYMORPHIC_SUPPORTED_TYPES(FunctionDecl, VarDecl,CXXRecordDecl) | |||
| ) |
Matches template instantiations of function, class, or static member variable template instantiations.
Given
or
cxxRecordDecl(hasName("::X"), isTemplateInstantiation()) matches the template instantiation of X.
But given
cxxRecordDecl(hasName("::X"), isTemplateInstantiation()) does not match, as X is an explicit template specialization.
Usable as: Matcher<FunctionDecl>, Matcher<VarDecl>, Matcher<CXXRecordDecl>
Definition at line 3694 of file ASTMatchers.h.
References Node, clang::TSK_ExplicitInstantiationDefinition, and clang::TSK_ImplicitInstantiation.
| clang::ast_matchers::AST_POLYMORPHIC_MATCHER | ( | isExplicitTemplateSpecialization | , |
| AST_POLYMORPHIC_SUPPORTED_TYPES(FunctionDecl, VarDecl,CXXRecordDecl) | |||
| ) |
Matches explicit template specializations of function, class, or static member variable template instantiations.
Given
functionDecl(isExplicitTemplateSpecialization()) matches the specialization A<int>().
Usable as: Matcher<FunctionDecl>, Matcher<VarDecl>, Matcher<CXXRecordDecl>
Definition at line 3751 of file ASTMatchers.h.
References Node, and clang::TSK_ExplicitSpecialization.
| clang::ast_matchers::AST_POLYMORPHIC_MATCHER | ( | isExplicit | , |
| AST_POLYMORPHIC_SUPPORTED_TYPES(CXXConstructorDecl,CXXConversionDecl) | |||
| ) |
Matches constructor and conversion declarations that are marked with the explicit keyword.
Given
cxxConstructorDecl(isExplicit()) will match #2, but not #1. cxxConversionDecl(isExplicit()) will match #4, but not #3.
Definition at line 4580 of file ASTMatchers.h.
References Node.
| clang::ast_matchers::AST_POLYMORPHIC_MATCHER | ( | isInline | , |
| AST_POLYMORPHIC_SUPPORTED_TYPES(NamespaceDecl,FunctionDecl) | |||
| ) |
Matches function and namespace declarations that are marked with the inline keyword.
Given
functionDecl(isInline()) will match ::f(). namespaceDecl(isInline()) will match n::m.
Definition at line 4599 of file ASTMatchers.h.
References Node.
| clang::ast_matchers::AST_POLYMORPHIC_MATCHER_P | ( | isExpansionInFileMatching | , |
| AST_POLYMORPHIC_SUPPORTED_TYPES(Decl, Stmt, TypeLoc) | , | ||
| std::string | , | ||
| RegExp | |||
| ) |
Matches AST nodes that were expanded within files whose name is partially matching a given regex.
Example matches Y but not X (matcher = cxxRecordDecl(isExpansionInFileMatching("AST.*"))
ASTMatcher.h:
Usable as: Matcher<Decl>, Matcher<Stmt>, Matcher<TypeLoc>
Definition at line 231 of file ASTMatchers.h.
References Filename, Finder, clang::SourceManager::getExpansionLoc(), clang::SourceManager::getFileEntryForID(), clang::SourceManager::getFileID(), clang::FileEntry::getName(), and Node.
| clang::ast_matchers::AST_POLYMORPHIC_MATCHER_P | ( | hasAnyTemplateArgument | , |
| AST_POLYMORPHIC_SUPPORTED_TYPES(ClassTemplateSpecializationDecl,TemplateSpecializationType) | , | ||
| internal::Matcher< TemplateArgument > | , | ||
| InnerMatcher | |||
| ) |
Matches classTemplateSpecializations that have at least one TemplateArgument matching the given InnerMatcher.
Given
classTemplateSpecializationDecl(hasAnyTemplateArgument( refersToType(asString("int")))) matches the specialization A<int>
Definition at line 505 of file ASTMatchers.h.
References Builder, Finder, InnerMatcher, and Node.
| clang::ast_matchers::AST_POLYMORPHIC_MATCHER_P | ( | templateArgumentCountIs | , |
| AST_POLYMORPHIC_SUPPORTED_TYPES(ClassTemplateSpecializationDecl,TemplateSpecializationType) | , | ||
| unsigned | , | ||
| N | |||
| ) |
Matches if the number of template arguments equals N.
Given
classTemplateSpecializationDecl(templateArgumentCountIs(1)) matches C<int>.
Definition at line 626 of file ASTMatchers.h.
References Node.
| clang::ast_matchers::AST_POLYMORPHIC_MATCHER_P | ( | argumentCountIs | , |
| AST_POLYMORPHIC_SUPPORTED_TYPES(CallExpr,CXXConstructExpr,ObjCMessageExpr) | , | ||
| unsigned | , | ||
| N | |||
| ) |
Checks that a call expression or a constructor call expression has a specific number of arguments (including absent default arguments).
Example matches f(0, 0) (matcher = callExpr(argumentCountIs(2)))
Definition at line 2618 of file ASTMatchers.h.
References Node.
| clang::ast_matchers::AST_POLYMORPHIC_MATCHER_P | ( | hasAnyArgument | , |
| AST_POLYMORPHIC_SUPPORTED_TYPES(CallExpr,CXXConstructExpr) | , | ||
| internal::Matcher< Expr > | , | ||
| InnerMatcher | |||
| ) |
Matches any argument of a call expression or a constructor call expression.
Given
callExpr(hasAnyArgument(declRefExpr())) matches x(1, y, 42) with hasAnyArgument(...) matching y
FIXME: Currently this will ignore parentheses and implicit casts on the argument before applying the inner matcher. We'll want to remove this to allow for greater control by the user once ignoreImplicit() has been implemented.
Definition at line 2837 of file ASTMatchers.h.
References Builder, Finder, InnerMatcher, Node, and clang::Result.
| clang::ast_matchers::AST_POLYMORPHIC_MATCHER_P | ( | hasCondition | , |
| AST_POLYMORPHIC_SUPPORTED_TYPES(IfStmt, ForStmt,WhileStmt, DoStmt,ConditionalOperator) | , | ||
| internal::Matcher< Expr > | , | ||
| InnerMatcher | |||
| ) |
Matches the condition expression of an if statement, for loop, or conditional operator.
Example matches true (matcher = hasCondition(cxxBoolLiteral(equals(true))))
Definition at line 2997 of file ASTMatchers.h.
References Builder, Finder, InnerMatcher, and Node.
| clang::ast_matchers::AST_POLYMORPHIC_MATCHER_P | ( | equalsBoundNode | , |
| AST_POLYMORPHIC_SUPPORTED_TYPES(Stmt, Decl, Type,QualType) | , | ||
| std::string | , | ||
| ID | |||
| ) |
Matches if a node equals a previously bound node.
Matches a node if it equals the node previously bound to ID.
Given
cxxRecordDecl( has(fieldDecl(hasName("a"), hasType(type().bind("t")))), has(fieldDecl(hasName("b"), hasType(type(equalsBoundNode("t")))))) matches the class X, as a and b have the same type.
Note that when multiple matches are involved via forEach* matchers, equalsBoundNodes acts as a filter. For example: compoundStmt( forEachDescendant(varDecl().bind("d")), forEachDescendant(declRefExpr(to(decl(equalsBoundNode("d")))))) will trigger a match for each combination of variable declaration and reference to that variable declaration within a compound statement.
Definition at line 3052 of file ASTMatchers.h.
References Builder, clang::ast_type_traits::DynTypedNode::create(), and Node.
| clang::ast_matchers::AST_POLYMORPHIC_MATCHER_P | ( | hasBody | , |
| AST_POLYMORPHIC_SUPPORTED_TYPES(DoStmt, ForStmt,WhileStmt,CXXForRangeStmt) | , | ||
| internal::Matcher< Stmt > | , | ||
| InnerMatcher | |||
| ) |
Matches a 'for', 'while', or 'do while' statement that has a given body.
Given
hasBody(compoundStmt()) matches 'for (;;) {}' with compoundStmt() matching '{}'
Definition at line 3128 of file ASTMatchers.h.
References Builder, Finder, InnerMatcher, and Node.
| clang::ast_matchers::AST_POLYMORPHIC_MATCHER_P | ( | hasOperatorName | , |
| AST_POLYMORPHIC_SUPPORTED_TYPES(BinaryOperator,UnaryOperator) | , | ||
| std::string | , | ||
| Name | |||
| ) |
Matches the operator Name of operator expressions (binary or unary).
Example matches a || b (matcher = binaryOperator(hasOperatorName("||")))
Definition at line 3193 of file ASTMatchers.h.
References clang::Name, and Node.
| clang::ast_matchers::AST_POLYMORPHIC_MATCHER_P | ( | hasLHS | , |
| AST_POLYMORPHIC_SUPPORTED_TYPES(BinaryOperator,ArraySubscriptExpr) | , | ||
| internal::Matcher< Expr > | , | ||
| InnerMatcher | |||
| ) |
Matches the left hand side of binary operator expressions.
Example matches a (matcher = binaryOperator(hasLHS()))
Definition at line 3206 of file ASTMatchers.h.
References Builder, Finder, InnerMatcher, and Node.
| clang::ast_matchers::AST_POLYMORPHIC_MATCHER_P | ( | hasRHS | , |
| AST_POLYMORPHIC_SUPPORTED_TYPES(BinaryOperator,ArraySubscriptExpr) | , | ||
| internal::Matcher< Expr > | , | ||
| InnerMatcher | |||
| ) |
Matches the right hand side of binary operator expressions.
Example matches b (matcher = binaryOperator(hasRHS()))
Definition at line 3221 of file ASTMatchers.h.
References Builder, Finder, InnerMatcher, and Node.
| clang::ast_matchers::AST_POLYMORPHIC_MATCHER_P2 | ( | hasTemplateArgument | , |
| AST_POLYMORPHIC_SUPPORTED_TYPES(ClassTemplateSpecializationDecl,TemplateSpecializationType) | , | ||
| unsigned | , | ||
| N | , | ||
| internal::Matcher< TemplateArgument > | , | ||
| InnerMatcher | |||
| ) |
Matches classTemplateSpecializations where the n'th TemplateArgument matches the given InnerMatcher.
Given
classTemplateSpecializationDecl(hasTemplateArgument( 1, refersToType(asString("int")))) matches the specialization A<bool, int>
Definition at line 605 of file ASTMatchers.h.
References Builder, Finder, InnerMatcher, and Node.
| clang::ast_matchers::AST_POLYMORPHIC_MATCHER_P2 | ( | hasArgument | , |
| AST_POLYMORPHIC_SUPPORTED_TYPES(CallExpr,CXXConstructExpr,ObjCMessageExpr) | , | ||
| unsigned | , | ||
| N | , | ||
| internal::Matcher< Expr > | , | ||
| InnerMatcher | |||
| ) |
Matches the n'th argument of a call expression or a constructor call expression.
Example matches y in x(y) (matcher = callExpr(hasArgument(0, declRefExpr())))
Definition at line 2634 of file ASTMatchers.h.
References Builder, Finder, InnerMatcher, and Node.
| clang::ast_matchers::AST_POLYMORPHIC_MATCHER_P_OVERLOAD | ( | hasType | , |
| AST_POLYMORPHIC_SUPPORTED_TYPES(Expr, ValueDecl) | , | ||
| internal::Matcher< QualType > | , | ||
| InnerMatcher | , | ||
| 0 | |||
| ) |
Matches if the expression's or declaration's type matches a type matcher.
Example matches x (matcher = expr(hasType(cxxRecordDecl(hasName("X"))))) and z (matcher = varDecl(hasType(cxxRecordDecl(hasName("X")))))
Definition at line 2294 of file ASTMatchers.h.
References Builder, Finder, InnerMatcher, and Node.
| clang::ast_matchers::AST_POLYMORPHIC_MATCHER_P_OVERLOAD | ( | hasType | , |
| AST_POLYMORPHIC_SUPPORTED_TYPES(Expr,ValueDecl) | , | ||
| internal::Matcher< Decl > | , | ||
| InnerMatcher | , | ||
| 1 | |||
| ) |
Overloaded to match the declaration of the expression's or value declaration's type.
In case of a value declaration (for example a variable declaration), this resolves one layer of indirection. For example, in the value declaration "X x;", cxxRecordDecl(hasName("X")) matches the declaration of X, while varDecl(hasType(cxxRecordDecl(hasName("X")))) matches the declaration of x.
Example matches x (matcher = expr(hasType(cxxRecordDecl(hasName("X"))))) and z (matcher = varDecl(hasType(cxxRecordDecl(hasName("X")))))
Usable as: Matcher<Expr>, Matcher<ValueDecl>
Definition at line 2317 of file ASTMatchers.h.
References Builder, Finder, hasDeclaration(), InnerMatcher, Node, and qualType.
| clang::ast_matchers::AST_TYPE_MATCHER | ( | BuiltinType | , |
| builtinType | |||
| ) |
Matches builtin Types.
Given
builtinType() matches "int b", "float c" and "bool d"
| clang::ast_matchers::AST_TYPE_MATCHER | ( | ArrayType | , |
| arrayType | |||
| ) |
Matches all kinds of arrays.
Given
arrayType() matches "int a[]", "int b[4]" and "int c[a[0]]";
| clang::ast_matchers::AST_TYPE_MATCHER | ( | ComplexType | , |
| complexType | |||
| ) |
Matches C99 complex types.
Given
complexType() matches "_Complex float f"
| clang::ast_matchers::AST_TYPE_MATCHER | ( | ConstantArrayType | , |
| constantArrayType | |||
| ) |
Matches C arrays with a specified constant size.
Given
constantArrayType() matches "int a[2]"
| clang::ast_matchers::AST_TYPE_MATCHER | ( | DependentSizedArrayType | , |
| dependentSizedArrayType | |||
| ) |
Matches C++ arrays whose size is a value-dependent expression.
Given
dependentSizedArrayType matches "T data[Size]"
| clang::ast_matchers::AST_TYPE_MATCHER | ( | IncompleteArrayType | , |
| incompleteArrayType | |||
| ) |
Matches C arrays with unspecified size.
Given
incompleteArrayType() matches "int a[]" and "int c[]"
| clang::ast_matchers::AST_TYPE_MATCHER | ( | VariableArrayType | , |
| variableArrayType | |||
| ) |
Matches C arrays with a specified size that is not an integer-constant-expression.
Given
variableArrayType() matches "int c[a[0]]"
| clang::ast_matchers::AST_TYPE_MATCHER | ( | AtomicType | , |
| atomicType | |||
| ) |
| clang::ast_matchers::AST_TYPE_MATCHER | ( | AutoType | , |
| autoType | |||
| ) |
Matches types nodes representing C++11 auto types.
Given:
autoType() matches "auto n" and "auto i"
| clang::ast_matchers::AST_TYPE_MATCHER | ( | FunctionType | , |
| functionType | |||
| ) |
Matches FunctionType nodes.
Given
functionType() matches "int (*f)(int)" and the type of "g".
| clang::ast_matchers::AST_TYPE_MATCHER | ( | ParenType | , |
| parenType | |||
| ) |
Matches ParenType nodes.
Given
varDecl(hasType(pointsTo(parenType()))) matches ptr_to_array but not array_of_ptrs.
| clang::ast_matchers::AST_TYPE_MATCHER | ( | BlockPointerType | , |
| blockPointerType | |||
| ) |
Matches block pointer types, i.e.
types syntactically represented as "void (^)(int)".
The pointee is always required to be a FunctionType.
| clang::ast_matchers::AST_TYPE_MATCHER | ( | MemberPointerType | , |
| memberPointerType | |||
| ) |
Matches member pointer types.
Given
memberPointerType() matches "A::* ptr"
| clang::ast_matchers::AST_TYPE_MATCHER | ( | PointerType | , |
| pointerType | |||
| ) |
Matches pointer types, but does not match Objective-C object pointer types.
Given
pointerType() matches "int *a", but does not match "Foo *f".
| clang::ast_matchers::AST_TYPE_MATCHER | ( | ObjCObjectPointerType | , |
| objcObjectPointerType | |||
| ) |
Matches an Objective-C object pointer type, which is different from a pointer type, despite being syntactically similar.
Given
pointerType() matches "Foo *f", but does not match "int *a".
| clang::ast_matchers::AST_TYPE_MATCHER | ( | ReferenceType | , |
| referenceType | |||
| ) |
Matches both lvalue and rvalue reference types.
Given
referenceType() matches the types of b, c, d, e, and f.
| clang::ast_matchers::AST_TYPE_MATCHER | ( | LValueReferenceType | , |
| lValueReferenceType | |||
| ) |
Matches lvalue reference types.
Given:
lValueReferenceType() matches the types of b, d, and e. e is matched since the type is deduced as int& by reference collapsing rules.
| clang::ast_matchers::AST_TYPE_MATCHER | ( | RValueReferenceType | , |
| rValueReferenceType | |||
| ) |
Matches rvalue reference types.
Given:
rValueReferenceType() matches the types of c and f. e is not matched as it is deduced to int& by reference collapsing rules.
| clang::ast_matchers::AST_TYPE_MATCHER | ( | TypedefType | , |
| typedefType | |||
| ) |
| clang::ast_matchers::AST_TYPE_MATCHER | ( | TemplateSpecializationType | , |
| templateSpecializationType | |||
| ) |
Matches template specialization types.
Given
templateSpecializationType() matches the type of the explicit instantiation in A and the type of the variable declaration in B.
| clang::ast_matchers::AST_TYPE_MATCHER | ( | UnaryTransformType | , |
| unaryTransformType | |||
| ) |
Matches types nodes representing unary type transformations.
Given:
unaryTransformType() matches "__underlying_type(T)"
| clang::ast_matchers::AST_TYPE_MATCHER | ( | RecordType | , |
| recordType | |||
| ) |
| clang::ast_matchers::AST_TYPE_MATCHER | ( | ElaboratedType | , |
| elaboratedType | |||
| ) |
| clang::ast_matchers::AST_TYPE_MATCHER | ( | SubstTemplateTypeParmType | , |
| substTemplateTypeParmType | |||
| ) |
Matches types that represent the result of substituting a type for a template type parameter.
Given
substTemplateTypeParmType() matches the type of 't' but not '1'
| clang::ast_matchers::AST_TYPE_MATCHER | ( | TemplateTypeParmType | , |
| templateTypeParmType | |||
| ) |
Matches template type parameter types.
Example matches T, but not int. (matcher = templateTypeParmType())
| clang::ast_matchers::AST_TYPE_MATCHER | ( | InjectedClassNameType | , |
| injectedClassNameType | |||
| ) |
| clang::ast_matchers::AST_TYPE_MATCHER | ( | DecayedType | , |
| decayedType | |||
| ) |
Matches decayed type Example matches i[] in declaration of f.
(matcher = valueDecl(hasType(decayedType(hasDecayedType(pointerType()))))) Example matches i[1]. (matcher = expr(hasType(decayedType(hasDecayedType(pointerType())))))
| clang::ast_matchers::AST_TYPE_TRAVERSE_MATCHER | ( | hasDeducedType | , |
| getDeducedType | , | ||
| AST_POLYMORPHIC_SUPPORTED_TYPES(AutoType) | |||
| ) |
| clang::ast_matchers::AST_TYPE_TRAVERSE_MATCHER | ( | innerType | , |
| getInnerType | , | ||
| AST_POLYMORPHIC_SUPPORTED_TYPES(ParenType) | |||
| ) |
Matches ParenType nodes where the inner type is a specific type.
Given
varDecl(hasType(pointsTo(parenType(innerType(functionType()))))) matches ptr_to_func but not ptr_to_array.
Usable as: Matcher<ParenType>
| clang::ast_matchers::AST_TYPELOC_TRAVERSE_MATCHER | ( | hasElementType | , |
| getElement | , | ||
| AST_POLYMORPHIC_SUPPORTED_TYPES(ArrayType, ComplexType) | |||
| ) |
Matches arrays and C99 complex types that have a specific element type.
Given
arrayType(hasElementType(builtinType())) matches "int b[7]"
Usable as: Matcher<ArrayType>, Matcher<ComplexType>
| clang::ast_matchers::AST_TYPELOC_TRAVERSE_MATCHER | ( | hasValueType | , |
| getValue | , | ||
| AST_POLYMORPHIC_SUPPORTED_TYPES(AtomicType) | |||
| ) |
| clang::ast_matchers::AST_TYPELOC_TRAVERSE_MATCHER | ( | pointee | , |
| getPointee | , | ||
| AST_POLYMORPHIC_SUPPORTED_TYPES(BlockPointerType, MemberPointerType, PointerType, ReferenceType) | |||
| ) |
Narrows PointerType (and similar) matchers to those where the pointee matches a given matcher.
Given
pointerType(pointee(isConstQualified(), isInteger())) matches "int const *b"
Usable as: Matcher<BlockPointerType>, Matcher<MemberPointerType>, Matcher<PointerType>, Matcher<ReferenceType>
| internal::PolymorphicMatcherWithParam1<internal::ValueEqualsMatcher, ValueT> clang::ast_matchers::equals | ( | const ValueT & | Value | ) |
Matches literals that are equal to the given value.
Example matches true (matcher = cxxBoolLiteral(equals(true)))
Usable as: Matcher<CharacterLiteral>, Matcher<CXXBoolLiteral>, Matcher<FloatingLiteral>, Matcher<IntegerLiteral>
Definition at line 3180 of file ASTMatchers.h.
| internal::Matcher<T> clang::ast_matchers::findAll | ( | const internal::Matcher< T > & | Matcher | ) |
Matches if the node or any descendant matches.
Generates results for each match.
For example, in:
The matcher:
will generate results for A, B and C.
Usable as: Any Matcher
Definition at line 2056 of file ASTMatchers.h.
References eachOf, and forEachDescendant.
|
inline |
Matches a node if the declaration associated with that node matches the given matcher.
The associated declaration is:
Also usable as Matcher<T> for any T supporting the getDecl() member function. e.g. various subtypes of clang::Type and various expressions.
Usable as: Matcher<CallExpr>, Matcher<CXXConstructExpr>, Matcher<DeclRefExpr>, Matcher<EnumType>, Matcher<InjectedClassNameType>, Matcher<LabelStmt>, Matcher<MemberExpr>, Matcher<QualType>, Matcher<RecordType>, Matcher<TagType>, Matcher<TemplateSpecializationType>, Matcher<TemplateTypeParmType>, Matcher<TypedefType>, Matcher<UnresolvedUsingType>
Definition at line 2127 of file ASTMatchers.h.
References InnerMatcher.
Referenced by AST_MATCHER_P_OVERLOAD(), and AST_POLYMORPHIC_MATCHER_P_OVERLOAD().
|
inline |
Matches if either the left hand side or the right hand side of a binary operator matches.
Definition at line 3232 of file ASTMatchers.h.
References anyOf.
|
inline |
Matches NamedDecl nodes that have the specified name.
Supports specifying enclosing namespaces or classes by prefixing the name with '<enclosing>::'. Does not match typedefs of an underlying type with the given name.
Example matches X (Name == "X")
Example matches X (Name is one of "::a::b::X", "a::b::X", "b::X", "X")
Definition at line 1836 of file ASTMatchers.h.
Referenced by AST_MATCHER_P_OVERLOAD().
|
inline |
Matches overloaded operator names.
Matches overloaded operator names specified in strings without the "operator" prefix: e.g. "<<".
Given:
cxxOperatorCallExpr(hasOverloadedOperatorName("<<"))) matches the specified line and cxxRecordDecl(hasMethod(hasOverloadedOperatorName("*"))) matches the declaration of A.
Usable as: Matcher<CXXOperatorCallExpr>, Matcher<FunctionDecl>
Definition at line 1885 of file ASTMatchers.h.
References AST_POLYMORPHIC_SUPPORTED_TYPES, and clang::Name.
| internal::Matcher<T> clang::ast_matchers::id | ( | StringRef | ID, |
| const internal::BindableMatcher< T > & | InnerMatcher | ||
| ) |
If the provided matcher matches a node, binds the node to ID.
FIXME: Do we want to support this now that we have bind()?
Definition at line 115 of file ASTMatchers.h.
Referenced by buildByrefHelpers(), clang::Sema::CodeCompleteObjCSuperMessage(), clang::ASTContext::getAttributedType(), clang::MicrosoftVTableContext::getVFTableLayout(), and HandleExtVectorTypeAttr().
| SmallVector< BoundNodes, 1 > clang::ast_matchers::match | ( | MatcherT | Matcher, |
| const NodeT & | Node, | ||
| ASTContext & | Context | ||
| ) |
Returns the results of matching Matcher on Node.
Collects the BoundNodes of all callback invocations when matching Matcher on Node and returns the collected results.
Multiple results occur when using matchers like forEachDescendant, which generate a result for each sub-match.
Definition at line 287 of file ASTMatchFinder.h.
References clang::ast_type_traits::DynTypedNode::create().
Referenced by clang::Sema::ActOnAtEnd(), clang::Sema::ActOnCXXDelete(), AttributesMatch(), ClassImplementsAllMethodsAndProperties(), MatchTwoAttributeLists(), clang::ASTContext::ObjCQualifiedClassTypesAreCompatible(), clang::ASTContext::ObjCQualifiedIdTypesAreCompatible(), clang::format::sortIncludes(), and clang::Sema::WarnExactTypedMethods().
| SmallVector< BoundNodes, 1 > clang::ast_matchers::match | ( | MatcherT | Matcher, |
| const ast_type_traits::DynTypedNode & | Node, | ||
| ASTContext & | Context | ||
| ) |
Definition at line 276 of file ASTMatchFinder.h.
References clang::ast_matchers::MatchFinder::addMatcher(), Callback, Finder, clang::ast_matchers::MatchFinder::match(), and clang::ast_matchers::internal::CollectMatchesCallback::Nodes.
| const NodeT* clang::ast_matchers::selectFirst | ( | StringRef | BoundTo, |
| const SmallVectorImpl< BoundNodes > & | Results | ||
| ) |
Returns the first result of type NodeT bound to BoundTo.
Returns NULL if there is no match, or if the matching node cannot be casted to NodeT.
This is useful in combanation with match():
Definition at line 256 of file ASTMatchFinder.h.
References Node.
|
inline |
Same as unaryExprOrTypeTraitExpr, but only matching sizeof.
Definition at line 1815 of file ASTMatchers.h.
References allOf, stmt, clang::UETT_SizeOf, and unaryExprOrTypeTraitExpr.
| const internal::VariadicDynCastAllOfMatcher< Decl, AccessSpecDecl> clang::ast_matchers::accessSpecDecl |
Matches C++ access specifier declarations.
Given
accessSpecDecl() matches 'public:'
Definition at line 391 of file ASTMatchers.h.
| const internal::VariadicOperatorMatcherFunc<2, UINT_MAX> clang::ast_matchers::allOf |
Matches if all given matchers match.
Usable as: Any Matcher
Definition at line 1761 of file ASTMatchers.h.
Referenced by alignOfExpr(), and sizeOfExpr().
| const internal::VariadicOperatorMatcherFunc<2, UINT_MAX> clang::ast_matchers::anyOf |
Matches if any of the given matchers matches.
Usable as: Any Matcher
Definition at line 1754 of file ASTMatchers.h.
Referenced by AST_MATCHER_FUNCTION(), AST_MATCHER_P_OVERLOAD(), and hasEitherOperand().
| const internal::VariadicDynCastAllOfMatcher< Stmt, ArraySubscriptExpr> clang::ast_matchers::arraySubscriptExpr |
Matches array subscript expressions.
Given
arraySubscriptExpr() matches "a[1]"
Definition at line 1153 of file ASTMatchers.h.
Matches asm statements.
asmStmt() matches '__asm("mov al, 2")'
Definition at line 1452 of file ASTMatchers.h.
| const internal::VariadicDynCastAllOfMatcher< Stmt, BinaryOperator> clang::ast_matchers::binaryOperator |
Matches binary operator expressions.
Example matches a || b
Definition at line 1541 of file ASTMatchers.h.
Matches break statements.
Given
breakStmt() matches 'break'
Definition at line 1316 of file ASTMatchers.h.
Matches call expressions.
Example matches x.y() and y()
Definition at line 911 of file ASTMatchers.h.
Referenced by clang::Sema::ActOnPropertyImplDecl(), and AST_MATCHER_P_OVERLOAD().
Matches case statements inside switch statements.
Given
caseStmt() matches 'case 42: break;'.
Definition at line 1388 of file ASTMatchers.h.
Referenced by clang::Sema::ActOnCaseStmtBody().
Matches any cast nodes of Clang's AST.
Example: castExpr() matches each of the following:
but does not match
Definition at line 1695 of file ASTMatchers.h.
Referenced by addFixitForObjCARCConversion(), clang::Sema::CheckObjCARCConversion(), clang::Sema::CheckObjCBridgeRelatedCast(), clang::Sema::CheckTollFreeBridgeCast(), clang::Sema::diagnoseARCUnbridgedCast(), and tryEmitARCCopyWeakInit().
| const internal::VariadicDynCastAllOfMatcher< Stmt, CharacterLiteral> clang::ast_matchers::characterLiteral |
Matches character literals (also matches wchar_t).
Not matching Hex-encoded chars (e.g. 0x1234, which is a IntegerLiteral), though.
Example matches 'a', L'a'
Definition at line 1485 of file ASTMatchers.h.
| const internal::VariadicDynCastAllOfMatcher< Decl, ClassTemplateDecl> clang::ast_matchers::classTemplateDecl |
Matches C++ class template declarations.
Example matches Z
Definition at line 340 of file ASTMatchers.h.
| const internal::VariadicDynCastAllOfMatcher< Decl, ClassTemplateSpecializationDecl> clang::ast_matchers::classTemplateSpecializationDecl |
Matches C++ class template specializations.
Given
classTemplateSpecializationDecl() matches the specializations A<int> and A<double>
Definition at line 354 of file ASTMatchers.h.
| const internal::VariadicDynCastAllOfMatcher< Stmt, CompoundLiteralExpr> clang::ast_matchers::compoundLiteralExpr |
Matches compound (i.e.
non-scalar) literals
Example match: {1}, (1, 2)
Definition at line 1521 of file ASTMatchers.h.
| const internal::VariadicDynCastAllOfMatcher<Stmt, CompoundStmt> clang::ast_matchers::compoundStmt |
Matches compound statements.
Example matches '{}' and '{{}}'in 'for (;;) {{}}'
Definition at line 1406 of file ASTMatchers.h.
| const internal::VariadicDynCastAllOfMatcher< Stmt, ConditionalOperator> clang::ast_matchers::conditionalOperator |
Matches conditional operator expressions.
Example matches a ? b : c
Definition at line 1561 of file ASTMatchers.h.
| const internal::VariadicDynCastAllOfMatcher<Stmt, ContinueStmt> clang::ast_matchers::continueStmt |
Matches continue statements.
Given
continueStmt() matches 'continue'
Definition at line 1326 of file ASTMatchers.h.
| const internal::VariadicDynCastAllOfMatcher< Stmt, CStyleCastExpr> clang::ast_matchers::cStyleCastExpr |
Matches a C-style cast expression.
Example: Matches (int*) 2.2f in
Definition at line 1647 of file ASTMatchers.h.
| const internal::VariadicDynCastAllOfMatcher< Stmt, CUDAKernelCallExpr> clang::ast_matchers::cudaKernelCallExpr |
Matches CUDA kernel call expression.
Example matches,
Definition at line 4666 of file ASTMatchers.h.
| const internal::VariadicDynCastAllOfMatcher< Stmt, CXXBindTemporaryExpr> clang::ast_matchers::cxxBindTemporaryExpr |
Matches nodes where temporaries are created.
Example matches FunctionTakesString(GetStringByValue()) (matcher = cxxBindTemporaryExpr())
Definition at line 1099 of file ASTMatchers.h.
| const internal::VariadicDynCastAllOfMatcher< Stmt, CXXBoolLiteralExpr> clang::ast_matchers::cxxBoolLiteral |
| const internal::VariadicDynCastAllOfMatcher<Stmt, CXXCatchStmt> clang::ast_matchers::cxxCatchStmt |
Matches catch statements.
cxxCatchStmt() matches 'catch(int i)'
Definition at line 1415 of file ASTMatchers.h.
| const internal::VariadicDynCastAllOfMatcher< Stmt, CXXConstCastExpr> clang::ast_matchers::cxxConstCastExpr |
Matches a const_cast expression.
Example: Matches const_cast<int*>(&r) in
Definition at line 1637 of file ASTMatchers.h.
| const internal::VariadicDynCastAllOfMatcher< Stmt, CXXConstructExpr> clang::ast_matchers::cxxConstructExpr |
Matches constructor call expressions (including implicit ones).
Example matches string(ptr, n) and ptr within arguments of f (matcher = cxxConstructExpr())
Definition at line 1063 of file ASTMatchers.h.
| const internal::VariadicDynCastAllOfMatcher< Decl, CXXConstructorDecl> clang::ast_matchers::cxxConstructorDecl |
Matches C++ constructor declarations.
Example matches Foo::Foo() and Foo::Foo(int)
Definition at line 765 of file ASTMatchers.h.
| const internal::VariadicDynCastAllOfMatcher<Decl, CXXConversionDecl> clang::ast_matchers::cxxConversionDecl |
Matches conversion operator declarations.
Example matches the operator.
Definition at line 817 of file ASTMatchers.h.
| const internal::VariadicAllOfMatcher<CXXCtorInitializer> clang::ast_matchers::cxxCtorInitializer |
Matches constructor initializers.
Examples matches i(42).
Definition at line 402 of file ASTMatchers.h.
| const internal::VariadicDynCastAllOfMatcher< Stmt, CXXDefaultArgExpr> clang::ast_matchers::cxxDefaultArgExpr |
Matches the value of a default argument at the call site.
Example matches the CXXDefaultArgExpr placeholder inserted for the default value of the second parameter in the call expression f(42) (matcher = cxxDefaultArgExpr())
Definition at line 1166 of file ASTMatchers.h.
| const internal::VariadicDynCastAllOfMatcher<Stmt, CXXDeleteExpr> clang::ast_matchers::cxxDeleteExpr |
Matches delete expressions.
Given
cxxDeleteExpr() matches 'delete X'.
Definition at line 1141 of file ASTMatchers.h.
| const internal::VariadicDynCastAllOfMatcher< Decl, CXXDestructorDecl> clang::ast_matchers::cxxDestructorDecl |
Matches explicit C++ destructor declarations.
Example matches Foo::~Foo()
Definition at line 778 of file ASTMatchers.h.
| const internal::VariadicDynCastAllOfMatcher< Stmt, CXXDynamicCastExpr> clang::ast_matchers::cxxDynamicCastExpr |
Matches a dynamic_cast expression.
Example: cxxDynamicCastExpr() matches dynamic_cast<D*>(&b); in
Definition at line 1625 of file ASTMatchers.h.
| const internal::VariadicDynCastAllOfMatcher< Stmt, CXXForRangeStmt> clang::ast_matchers::cxxForRangeStmt |
Matches range-based for statements.
cxxForRangeStmt() matches 'for (auto a : i)'
Definition at line 1258 of file ASTMatchers.h.
| const internal::VariadicDynCastAllOfMatcher< Stmt, CXXFunctionalCastExpr> clang::ast_matchers::cxxFunctionalCastExpr |
Matches functional cast expressions.
Example: Matches Foo(bar);
Definition at line 1707 of file ASTMatchers.h.
| const internal::VariadicDynCastAllOfMatcher< Stmt, CXXMemberCallExpr> clang::ast_matchers::cxxMemberCallExpr |
Matches member call expressions.
Example matches x.y()
Definition at line 930 of file ASTMatchers.h.
| const internal::VariadicDynCastAllOfMatcher<Decl, CXXMethodDecl> clang::ast_matchers::cxxMethodDecl |
| const internal::VariadicDynCastAllOfMatcher<Stmt, CXXNewExpr> clang::ast_matchers::cxxNewExpr |
Matches new expressions.
Given
cxxNewExpr() matches 'new X'.
Definition at line 1131 of file ASTMatchers.h.
| const internal::VariadicDynCastAllOfMatcher< Stmt, CXXNullPtrLiteralExpr> clang::ast_matchers::cxxNullPtrLiteralExpr |
Matches nullptr literal.
Definition at line 1526 of file ASTMatchers.h.
| const internal::VariadicDynCastAllOfMatcher< Stmt, CXXOperatorCallExpr> clang::ast_matchers::cxxOperatorCallExpr |
Matches overloaded operator calls.
Note that if an operator isn't overloaded, it won't match. Instead, use binaryOperator matcher. Currently it does not match operators such as new delete. FIXME: figure out why these do not match?
Example matches both operator<<((o << b), c) and operator<<(o, b) (matcher = cxxOperatorCallExpr())
Definition at line 1184 of file ASTMatchers.h.
| const internal::VariadicDynCastAllOfMatcher< Decl, CXXRecordDecl> clang::ast_matchers::cxxRecordDecl |
Matches C++ class declarations.
Example matches X, Z
Definition at line 330 of file ASTMatchers.h.
Referenced by AST_MATCHER_FUNCTION().
| const internal::VariadicDynCastAllOfMatcher< Stmt, CXXReinterpretCastExpr> clang::ast_matchers::cxxReinterpretCastExpr |
Matches a reinterpret_cast expression.
Either the source expression or the destination type can be matched using has(), but hasDestinationType() is more specific and can be more readable.
Example matches reinterpret_cast<char*>(&p) in
Definition at line 1592 of file ASTMatchers.h.
| const internal::VariadicDynCastAllOfMatcher< Stmt, CXXStaticCastExpr> clang::ast_matchers::cxxStaticCastExpr |
Matches a C++ static_cast expression.
Example: cxxStaticCastExpr() matches static_cast<long>(8) in
Definition at line 1609 of file ASTMatchers.h.
| const internal::VariadicDynCastAllOfMatcher< Stmt, CXXTemporaryObjectExpr> clang::ast_matchers::cxxTemporaryObjectExpr |
Matches functional cast expressions having N != 1 arguments.
Example: Matches Foo(bar, bar)
Definition at line 1717 of file ASTMatchers.h.
| const internal::VariadicDynCastAllOfMatcher<Stmt, CXXThisExpr> clang::ast_matchers::cxxThisExpr |
Matches implicit and explicit this expressions.
Example matches the implicit this expression in "return i". (matcher = cxxThisExpr())
Definition at line 1087 of file ASTMatchers.h.
| const internal::VariadicDynCastAllOfMatcher<Stmt, CXXThrowExpr> clang::ast_matchers::cxxThrowExpr |
Matches throw expressions.
cxxThrowExpr() matches 'throw 5'
Definition at line 1433 of file ASTMatchers.h.
| const internal::VariadicDynCastAllOfMatcher<Stmt, CXXTryStmt> clang::ast_matchers::cxxTryStmt |
Matches try statements.
cxxTryStmt() matches 'try {}'
Definition at line 1424 of file ASTMatchers.h.
| const internal::VariadicDynCastAllOfMatcher< Stmt, CXXUnresolvedConstructExpr> clang::ast_matchers::cxxUnresolvedConstructExpr |
Matches unresolved constructor call expressions.
Example matches T(t) in return statement of f (matcher = cxxUnresolvedConstructExpr())
Definition at line 1075 of file ASTMatchers.h.
| const internal::VariadicAllOfMatcher<Decl> clang::ast_matchers::decl |
Matches declarations.
Examples matches X, C, and the friend declaration inside C;
Definition at line 259 of file ASTMatchers.h.
Referenced by clang::Sema::ActOnForEachDeclStmt(), clang::Sema::actOnObjCTypeArgsOrProtocolQualifiers(), AST_MATCHER_FUNCTION(), checkMethodFamilyMismatch(), CXXRecordMembersNamed(), getInterestingTagDecl(), clang::CodeGen::CodeGenModule::getMemberPointerConstant(), clang::ObjCInterfaceDecl::getTypeParamList(), handleObjCMethodFamilyAttr(), hasOnlyNonStaticMemberFunctions(), isAccessedBy(), clang::ento::ExprEngine::ProcessInitializer(), and clang::ASTDeclReader::VisitBlockDecl().
| const internal::VariadicDynCastAllOfMatcher<Decl, DeclaratorDecl> clang::ast_matchers::declaratorDecl |
Matches declarator declarations (field, variable, function and non-type template parameter declarations).
Given
declaratorDecl() matches int y.
Definition at line 366 of file ASTMatchers.h.
| const internal::VariadicDynCastAllOfMatcher<Stmt, DeclRefExpr> clang::ast_matchers::declRefExpr |
Matches expressions that refer to declarations.
Example matches x in if (x)
Definition at line 1201 of file ASTMatchers.h.
Matches declaration statements.
Given
declStmt() matches 'int a'.
Definition at line 888 of file ASTMatchers.h.
| const internal::VariadicDynCastAllOfMatcher<Stmt, DefaultStmt> clang::ast_matchers::defaultStmt |
Matches default statements inside switch statements.
Given
defaultStmt() matches 'default: break;'.
Definition at line 1398 of file ASTMatchers.h.
Matches do statements.
Given
doStmt() matches 'do {} while(true)'
Definition at line 1306 of file ASTMatchers.h.
| const internal::VariadicOperatorMatcherFunc<2, UINT_MAX> clang::ast_matchers::eachOf |
Matches if any of the given matchers matches.
Unlike anyOf, eachOf will generate a match result for each matching submatcher.
For example, in:
The matcher:
will generate two results binding "v", the first of which binds the field declaration of a, the second the field declaration of b.
Usable as: Any Matcher
Definition at line 1747 of file ASTMatchers.h.
Referenced by findAll().
| const internal::VariadicDynCastAllOfMatcher< Decl, EnumConstantDecl> clang::ast_matchers::enumConstantDecl |
| const internal::VariadicDynCastAllOfMatcher< Stmt, ExplicitCastExpr> clang::ast_matchers::explicitCastExpr |
Matches explicit cast expressions.
Matches any cast expression written in user code, whether it be a C-style cast, a functional-style cast, or a keyword cast.
Does not match implicit conversions.
Note: the name "explicitCast" is chosen to match Clang's terminology, as Clang uses the term "cast" to apply to implicit conversions as well as to actual cast expressions.
Example: matches all five of the casts in
but does not match the implicit conversion in
Definition at line 1672 of file ASTMatchers.h.
Matches expressions.
Example matches x()
Definition at line 1192 of file ASTMatchers.h.
Referenced by clang::Sema::ActOnFileScopeAsmDecl(), clang::Sema::ActOnParenListExpr(), emitPointerArithmetic(), getDereferenceExpr(), implies(), and clang::InitListExpr::setInit().
| const internal::VariadicDynCastAllOfMatcher< Stmt, ExprWithCleanups> clang::ast_matchers::exprWithCleanups |
Matches expressions that introduce cleanups to be run at the end of the sub-expression's evaluation.
Example matches std::string()
Definition at line 965 of file ASTMatchers.h.
Matches field declarations.
Given
fieldDecl() matches 'm'.
Definition at line 838 of file ASTMatchers.h.
| const internal::VariadicDynCastAllOfMatcher< Stmt, FloatingLiteral> clang::ast_matchers::floatLiteral |
Matches float literals of all sizes / encodings, e.g.
1.0, 1.0f, 1.0L and 1e10.
Does not match implicit conversions such as
Definition at line 1504 of file ASTMatchers.h.
| const internal::ArgumentAdaptingMatcherFunc<internal::ForEachMatcher> LLVM_ATTRIBUTE_UNUSED clang::ast_matchers::forEach = {} |
Matches AST nodes that have child AST nodes that match the provided matcher.
Example matches X, Y (matcher = cxxRecordDecl(forEach(cxxRecordDecl(hasName("X")))
ChildT must be an AST base type.
As opposed to 'has', 'forEach' will cause a match for each result that matches instead of only on the first one.
Usable as: Any Matcher
Definition at line 2008 of file ASTMatchers.h.
| const internal::ArgumentAdaptingMatcherFunc<internal::ForEachDescendantMatcher> LLVM_ATTRIBUTE_UNUSED clang::ast_matchers::forEachDescendant = {} |
Matches AST nodes that have descendant AST nodes that match the provided matcher.
Example matches X, A, B, C (matcher = cxxRecordDecl(forEachDescendant(cxxRecordDecl(hasName("X")))))
DescendantT must be an AST base type.
As opposed to 'hasDescendant', 'forEachDescendant' will cause a match for each result that matches instead of only on the first one.
Note: Recursively combined ForEachDescendant can cause many matches: cxxRecordDecl(forEachDescendant(cxxRecordDecl( forEachDescendant(cxxRecordDecl()) ))) will match 10 times (plus injected class name matches) on:
Usable as: Any Matcher
Definition at line 2037 of file ASTMatchers.h.
Referenced by findAll().
Matches for statements.
Example matches 'for (;;) {}'
Definition at line 1218 of file ASTMatchers.h.
| const internal::VariadicDynCastAllOfMatcher<Decl, FriendDecl> clang::ast_matchers::friendDecl |
Matches friend declarations.
Given
friendDecl() matches 'friend void foo()'.
Definition at line 866 of file ASTMatchers.h.
| const internal::VariadicDynCastAllOfMatcher<Decl, FunctionDecl> clang::ast_matchers::functionDecl |
Matches function declarations.
Example matches f
Definition at line 846 of file ASTMatchers.h.
Referenced by AST_MATCHER_FUNCTION().
| const internal::VariadicDynCastAllOfMatcher< Decl, FunctionTemplateDecl> clang::ast_matchers::functionTemplateDecl |
Matches C++ function template declarations.
Example matches f
Definition at line 856 of file ASTMatchers.h.
| const internal::VariadicDynCastAllOfMatcher< Stmt, GNUNullExpr> clang::ast_matchers::gnuNullExpr |
Matches GNU __null expression.
Definition at line 1531 of file ASTMatchers.h.
Matches goto statements.
Given
gotoStmt() matches 'goto FOO'
Definition at line 1347 of file ASTMatchers.h.
| const internal::ArgumentAdaptingMatcherFunc<internal::HasMatcher> LLVM_ATTRIBUTE_UNUSED clang::ast_matchers::has = {} |
Matches AST nodes that have child AST nodes that match the provided matcher.
Example matches X, Y (matcher = cxxRecordDecl(has(cxxRecordDecl(hasName("X")))
ChildT must be an AST base type.
Usable as: Any Matcher
Definition at line 1971 of file ASTMatchers.h.
Referenced by getLiteralInfo().
| const internal::ArgumentAdaptingMatcherFunc< internal::HasAncestorMatcher, internal::TypeList<Decl, NestedNameSpecifierLoc, Stmt, TypeLoc>, internal::TypeList<Decl, NestedNameSpecifierLoc, Stmt, TypeLoc> > LLVM_ATTRIBUTE_UNUSED clang::ast_matchers::hasAncestor = {} |
Matches AST nodes that have an ancestor that matches the provided matcher.
Given
expr(integerLiteral(hasAncestor(ifStmt()))) matches 42, but not 43.
Usable as: Any Matcher
Definition at line 2091 of file ASTMatchers.h.
Referenced by AST_MATCHER_FUNCTION().
| const internal::ArgumentAdaptingMatcherFunc<internal::HasDescendantMatcher> LLVM_ATTRIBUTE_UNUSED clang::ast_matchers::hasDescendant = {} |
Matches AST nodes that have descendant AST nodes that match the provided matcher.
Example matches X, Y, Z (matcher = cxxRecordDecl(hasDescendant(cxxRecordDecl(hasName("X")))))
DescendantT must be an AST base type.
Usable as: Any Matcher
Definition at line 1988 of file ASTMatchers.h.
| const internal::ArgumentAdaptingMatcherFunc< internal::HasParentMatcher, internal::TypeList<Decl, NestedNameSpecifierLoc, Stmt, TypeLoc>, internal::TypeList<Decl, NestedNameSpecifierLoc, Stmt, TypeLoc> > LLVM_ATTRIBUTE_UNUSED clang::ast_matchers::hasParent = {} |
Matches AST nodes that have a parent that matches the provided matcher.
Given
compoundStmt(hasParent(ifStmt())) matches "{ int x = 43; }".
Usable as: Any Matcher
Definition at line 2074 of file ASTMatchers.h.
Matches if statements.
Example matches 'if (x) {}'
Definition at line 1209 of file ASTMatchers.h.
| const internal::VariadicDynCastAllOfMatcher< Stmt, ImplicitCastExpr> clang::ast_matchers::implicitCastExpr |
Matches the implicit cast nodes of Clang's AST.
This matches many different places, including function call return value eliding, as well as any type conversions.
Definition at line 1680 of file ASTMatchers.h.
| const internal::VariadicDynCastAllOfMatcher<Stmt, InitListExpr> clang::ast_matchers::initListExpr |
Matches init list expressions.
Given
initListExpr() matches "{ 1, 2 }" and "{ 5, 6 }"
Definition at line 977 of file ASTMatchers.h.
| const internal::VariadicDynCastAllOfMatcher< Stmt, IntegerLiteral> clang::ast_matchers::integerLiteral |
Matches integer literals of all sizes / encodings, e.g.
1, 1L, 0x1 and 1U.
Does not match character-encoded integers such as L'a'.
Definition at line 1493 of file ASTMatchers.h.
Matches label statements.
Given
labelStmt() matches 'FOO:'
Definition at line 1358 of file ASTMatchers.h.
| const internal::VariadicDynCastAllOfMatcher<Stmt, LambdaExpr> clang::ast_matchers::lambdaExpr |
Matches lambda expressions.
Example matches [&](){return 5;}
Definition at line 919 of file ASTMatchers.h.
| const internal::VariadicDynCastAllOfMatcher<Decl, LinkageSpecDecl> clang::ast_matchers::linkageSpecDecl |
Matches a declaration of a linkage specification.
Given
linkageSpecDecl() matches "extern "C" {}"
Definition at line 270 of file ASTMatchers.h.
| const internal::VariadicDynCastAllOfMatcher< Stmt, MaterializeTemporaryExpr> clang::ast_matchers::materializeTemporaryExpr |
Matches nodes where temporaries are materialized.
Example: Given
materializeTemporaryExpr() matches 'f()' in these statements
but does not match
Definition at line 1121 of file ASTMatchers.h.
| const internal::VariadicDynCastAllOfMatcher<Stmt, MemberExpr> clang::ast_matchers::memberExpr |
Matches member expressions.
Given
memberExpr() matches this->x, x, y.x, a, this->b
Definition at line 901 of file ASTMatchers.h.
Matches a declaration of anything that could have a name.
Example matches X, S, the anonymous union type, i, and U;
Definition at line 283 of file ASTMatchers.h.
| const internal::VariadicDynCastAllOfMatcher<Decl, NamespaceAliasDecl> clang::ast_matchers::namespaceAliasDecl |
Matches a declaration of a namespace alias.
Given
namespaceAliasDecl() matches "namespace alias" but not "namespace test"
Definition at line 306 of file ASTMatchers.h.
| const internal::VariadicDynCastAllOfMatcher<Decl, NamespaceDecl> clang::ast_matchers::namespaceDecl |
Matches a declaration of a namespace.
Given
namespaceDecl() matches "namespace {}" and "namespace test {}"
Definition at line 294 of file ASTMatchers.h.
| const internal::VariadicAllOfMatcher<NestedNameSpecifier> clang::ast_matchers::nestedNameSpecifier |
Matches nested name specifiers.
Given
nestedNameSpecifier() matches "ns::" and both "A::"
Definition at line 4335 of file ASTMatchers.h.
| const internal::VariadicAllOfMatcher< NestedNameSpecifierLoc> clang::ast_matchers::nestedNameSpecifierLoc |
Same as nestedNameSpecifier but matches NestedNameSpecifierLoc.
Definition at line 4339 of file ASTMatchers.h.
| const internal::VariadicDynCastAllOfMatcher< Decl, NonTypeTemplateParmDecl> clang::ast_matchers::nonTypeTemplateParmDecl |
Matches non-type template parameter declarations.
Given
nonTypeTemplateParmDecl() matches 'N', but not 'T'.
Definition at line 425 of file ASTMatchers.h.
Matches null statements.
nullStmt() matches the second ';'
Definition at line 1442 of file ASTMatchers.h.
| const internal::VariadicDynCastAllOfMatcher< Decl, ObjCInterfaceDecl> clang::ast_matchers::objcInterfaceDecl |
Matches Objective-C interface declarations.
Example matches Foo
Definition at line 954 of file ASTMatchers.h.
| const internal::VariadicDynCastAllOfMatcher< Stmt, ObjCMessageExpr> clang::ast_matchers::objcMessageExpr |
Matches ObjectiveC Message invocation expressions.
The innermost message send invokes the "alloc" class method on the NSString class, while the outermost message send invokes the "initWithString" instance method on the object returned from NSString's "alloc". This matcher should match both message sends.
Definition at line 943 of file ASTMatchers.h.
| const internal::VariadicDynCastAllOfMatcher<Decl, ParmVarDecl> clang::ast_matchers::parmVarDecl |
Matches parameter variable declarations.
Given
parmVarDecl() matches int x.
Definition at line 376 of file ASTMatchers.h.
| const internal::VariadicAllOfMatcher<QualType> clang::ast_matchers::qualType |
Matches QualTypes in the clang AST.
Definition at line 1720 of file ASTMatchers.h.
Referenced by AST_MATCHER_P_OVERLOAD(), and AST_POLYMORPHIC_MATCHER_P_OVERLOAD().
| const internal::VariadicDynCastAllOfMatcher< Decl, RecordDecl> clang::ast_matchers::recordDecl |
Matches class, struct, and union declarations.
Example matches X, Z, U, and S
Definition at line 319 of file ASTMatchers.h.
Referenced by classifyPointerDeclarator().
| const internal::VariadicDynCastAllOfMatcher<Stmt, ReturnStmt> clang::ast_matchers::returnStmt |
Matches return statements.
Given
returnStmt() matches 'return 1'
Definition at line 1336 of file ASTMatchers.h.
| const internal::VariadicDynCastAllOfMatcher< Decl, StaticAssertDecl> clang::ast_matchers::staticAssertDecl |
Matches a C++ static_assert declaration.
Example: staticAssertExpr() matches static_assert(sizeof(S) == sizeof(int)) in
Definition at line 1578 of file ASTMatchers.h.
| const internal::VariadicAllOfMatcher<Stmt> clang::ast_matchers::stmt |
Matches statements.
Given
stmt() matches both the compound statement '{ ++a; }' and '++a'.
Definition at line 876 of file ASTMatchers.h.
Referenced by alignOfExpr(), AST_MATCHER_FUNCTION(), GenerateExtensivePathDiagnostic(), clang::AnalysisDeclContext::registerForcedBlockExpression(), sizeOfExpr(), and clang::CFG::VisitBlockStmts().
| const internal::VariadicDynCastAllOfMatcher< Stmt, StringLiteral> clang::ast_matchers::stringLiteral |
Matches string literals (also matches wide string literals).
Example matches "abcd", L"abcd"
Definition at line 1472 of file ASTMatchers.h.
| const internal::VariadicDynCastAllOfMatcher< Stmt, SubstNonTypeTemplateParmExpr> clang::ast_matchers::substNonTypeTemplateParmExpr |
Matches substitutions of non-type template parameters.
Given
substNonTypeTemplateParmExpr() matches "N" in the right-hand side of "static const int n = N;"
Definition at line 991 of file ASTMatchers.h.
| const internal::VariadicDynCastAllOfMatcher<Stmt, SwitchCase> clang::ast_matchers::switchCase |
Matches case and default statements inside switch statements.
Given
switchCase() matches 'case 42: break;' and 'default: break;'.
Definition at line 1378 of file ASTMatchers.h.
| const internal::VariadicDynCastAllOfMatcher<Stmt, SwitchStmt> clang::ast_matchers::switchStmt |
Matches switch statements.
Given
switchStmt() matches 'switch(a)'.
Definition at line 1368 of file ASTMatchers.h.
| const internal::VariadicAllOfMatcher<TemplateArgument> clang::ast_matchers::templateArgument |
Matches template arguments.
Given
templateArgument() matches 'int' in C<int>.
Definition at line 413 of file ASTMatchers.h.
| const internal::VariadicDynCastAllOfMatcher< Decl, TemplateTypeParmDecl> clang::ast_matchers::templateTypeParmDecl |
Matches template type parameter declarations.
Given
templateTypeParmDecl() matches 'T', but not 'N'.
Definition at line 437 of file ASTMatchers.h.
| const internal::VariadicDynCastAllOfMatcher<Decl, TranslationUnitDecl> clang::ast_matchers::translationUnitDecl |
Matches the top declaration context.
Given
decl(hasDeclContext(translationUnitDecl())) matches "int X", but not "int Y".
Definition at line 159 of file ASTMatchers.h.
| const internal::VariadicAllOfMatcher<Type> clang::ast_matchers::type |
Matches Types in the clang AST.
Definition at line 1723 of file ASTMatchers.h.
Referenced by clang::Sema::ActOnForEachDeclStmt(), clang::Sema::ActOnObjCAtSynchronizedOperand(), clang::Sema::actOnObjCTypeArgsOrProtocolQualifiers(), clang::InitializationSequence::AddPassByIndirectCopyRestoreStep(), clang::Sema::AddPushedVisibilityAttribute(), applyObjCTypeArgs(), breakDownVectorType(), clang::Sema::BuildDeclarationNameExpr(), clang::Sema::BuildMemberReferenceExpr(), clang::Sema::BuildObjCBoxedExpr(), clang::arcmt::trans::canApplyWeak(), clang::Sema::CheckCompleteVariableDeclaration(), CheckNonNullArguments(), clang::Sema::checkNullabilityTypeSpecifier(), clang::Sema::checkObjCKindOfType(), clang::Sema::CodeCompleteCase(), clang::PseudoObjectExpr::Create(), diagnoseBadTypeAttribute(), clang::Sema::DiagnoseSentinelCalls(), distributeFunctionTypeAttr(), distributeObjCPointerTypeAttr(), clang::CodeGen::CodeGenFunction::EmitARCRetainAutoreleasedReturnValue(), clang::CodeGen::CodeGenFunction::EmitARCStoreStrong(), clang::CodeGen::CodeGenFunction::EmitAutoVarInit(), clang::CodeGen::CodeGenFunction::emitAutoVarTypeCleanup(), clang::CodeGen::CodeGenFunction::EmitBlockLiteral(), clang::CodeGen::CodeGenFunction::EmitCallArg(), clang::CodeGen::CodeGenFunction::EmitCXXAggrConstructorCall(), emitCXXDestructMethod(), EmitCXXNewAllocSize(), clang::CodeGen::CGDebugInfo::EmitDeclareOfBlockLiteralArgVariable(), EmitDeclDestroy(), EmitDeclInit(), clang::CodeGen::CodeGenFunction::EmitDelegateCallArg(), clang::CodeGen::CodeGenFunction::EmitExprAsInit(), clang::CodeGen::CodeGenFunction::EmitExtVectorElementExpr(), clang::CodeGen::CodeGenFunction::EmitLValueForField(), clang::CodeGen::CodeGenFunction::EnterDtorCleanups(), clang::Expr::findBoundMemberType(), clang::Sema::FixOverloadedFunctionReference(), clang::CodeGen::CodeGenFunction::GenerateCopyHelperFunction(), clang::CodeGen::CodeGenFunction::GenerateDestroyHelperFunction(), clang::ASTContext::getAttributedType(), clang::Type::getBaseElementTypeUnsafe(), getBaseMessageSendResultType(), getComplexType(), clang::CodeGen::CodeGenFunction::getEvaluationKind(), getLVForTemplateParameterList(), clang::CodeGen::CodeGenModule::getMemberPointerConstant(), clang::Type::getNullability(), getNullForVariable(), clang::ASTContext::getObjCObjectType(), clang::ASTContext::getVariableArrayDecayedType(), handleBlocksAttr(), handleObjCGCTypeAttr(), handleObjCOwnershipTypeAttr(), handleObjCPreciseLifetimeAttr(), handleVisibilityAttr(), inferARCLifetimeForPointee(), clang::Sema::inferObjCARCLifetime(), isPlaceholderToRemoveAsArg(), mergeTypeNullabilityForRedecl(), clang::operator&(), clang::operator<<(), clang::operator|(), clang::operator~(), clang::Sema::PrepareCastToObjCObjectPointer(), clang::CodeGen::CodeGenFunction::pushDestroy(), clang::CodeGen::CodeGenFunction::pushLifetimeExtendedDestroy(), clang::Sema::RequireCompleteDeclContext(), clang::QualType::stripObjCKindOfType(), clang::QualType::substObjCTypeArgs(), tryCaptureAsConstant(), and tryEmitARCRetainLoadOfScalar().
| const internal::VariadicDynCastAllOfMatcher<Decl, TypedefDecl> clang::ast_matchers::typedefDecl |
Matches typedef declarations.
Given
typedefDecl() matches "typedef int X"
Definition at line 169 of file ASTMatchers.h.
Referenced by clang::Sema::checkNullabilityTypeSpecifier().
| const internal::VariadicAllOfMatcher<TypeLoc> clang::ast_matchers::typeLoc |
Matches TypeLocs in the clang AST.
Definition at line 1726 of file ASTMatchers.h.
| const internal::VariadicDynCastAllOfMatcher< Stmt, UnaryExprOrTypeTraitExpr> clang::ast_matchers::unaryExprOrTypeTraitExpr |
Matches sizeof (C99), alignof (C++11) and vec_step (OpenCL)
Given
unaryExprOrTypeTraitExpr() matches sizeof(x) and alignof(x)
Definition at line 1776 of file ASTMatchers.h.
Referenced by alignOfExpr(), and sizeOfExpr().
| const internal::VariadicDynCastAllOfMatcher< Stmt, UnaryOperator> clang::ast_matchers::unaryOperator |
Matches unary operator expressions.
Example matches !a
Definition at line 1551 of file ASTMatchers.h.
| const internal::VariadicOperatorMatcherFunc<1, 1> clang::ast_matchers::unless |
Matches if the provided matcher does not match.
Example matches Y (matcher = cxxRecordDecl(unless(hasName("X"))))
Usable as: Any Matcher
Definition at line 2102 of file ASTMatchers.h.
| const internal::VariadicDynCastAllOfMatcher< Decl, UnresolvedUsingTypenameDecl> clang::ast_matchers::unresolvedUsingTypenameDecl |
Matches unresolved using value declarations that involve the typename.
Given
unresolvedUsingTypenameDecl() matches
Definition at line 1049 of file ASTMatchers.h.
| const internal::VariadicDynCastAllOfMatcher< Decl, UnresolvedUsingValueDecl> clang::ast_matchers::unresolvedUsingValueDecl |
Matches unresolved using value declarations.
Given
unresolvedUsingValueDecl() matches
Definition at line 1030 of file ASTMatchers.h.
| const internal::VariadicDynCastAllOfMatcher< Stmt, UserDefinedLiteral> clang::ast_matchers::userDefinedLiteral |
Matches user defined literal operator call.
Example match: "foo"_suffix
Definition at line 1511 of file ASTMatchers.h.
Matches using declarations.
Given
usingDecl() matches
Definition at line 1002 of file ASTMatchers.h.
| const internal::VariadicDynCastAllOfMatcher< Decl, UsingDirectiveDecl> clang::ast_matchers::usingDirectiveDecl |
Matches using namespace declarations.
Given
usingDirectiveDecl() matches
Definition at line 1015 of file ASTMatchers.h.
Matches any value declaration.
Example matches A, B, C and F
Definition at line 750 of file ASTMatchers.h.
Matches variable declarations.
Note: this does not match declarations of member variables, which are "field" declarations in Clang parlance.
Example matches a
Definition at line 828 of file ASTMatchers.h.
Referenced by clang::ento::ExprEngine::ProcessAutomaticObjDtor().
Matches while statements.
Given
whileStmt() matches 'while (true) {}'.
Definition at line 1296 of file ASTMatchers.h.
1.8.6