45 #ifndef LLVM_CLANG_ASTMATCHERS_ASTMATCHERS_H 46 #define LLVM_CLANG_ASTMATCHERS_ASTMATCHERS_H 77 #include "llvm/ADT/ArrayRef.h" 78 #include "llvm/ADT/SmallVector.h" 79 #include "llvm/ADT/StringRef.h" 80 #include "llvm/Support/Casting.h" 81 #include "llvm/Support/Compiler.h" 82 #include "llvm/Support/ErrorHandling.h" 83 #include "llvm/Support/Regex.h" 108 template <
typename T>
110 return MyBoundNodes.getNodeAs<T>(
ID);
120 return MyBoundNodes.getMap();
127 BoundNodes(internal::BoundNodesMap &MyBoundNodes)
128 : MyBoundNodes(MyBoundNodes) {}
130 internal::BoundNodesMap MyBoundNodes;
136 template <
typename T>
137 internal::Matcher<T>
id(StringRef
ID,
138 const internal::BindableMatcher<T> &InnerMatcher) {
139 return InnerMatcher.bind(ID);
168 inline internal::TrueMatcher
anything() {
return internal::TrueMatcher(); }
181 extern const internal::VariadicDynCastAllOfMatcher<Decl, TranslationUnitDecl>
193 extern const internal::VariadicDynCastAllOfMatcher<Decl, TypedefDecl>
205 extern const internal::VariadicDynCastAllOfMatcher<Decl, TypedefNameDecl>
217 extern const internal::VariadicDynCastAllOfMatcher<Decl, TypeAliasDecl>
227 extern const internal::VariadicDynCastAllOfMatcher<Decl, TypeAliasTemplateDecl>
246 auto &
SourceManager = Finder->getASTContext().getSourceManager();
267 auto &
SourceManager = Finder->getASTContext().getSourceManager();
269 if (ExpansionLoc.isInvalid()) {
292 std::string, RegExp) {
293 auto &
SourceManager = Finder->getASTContext().getSourceManager();
295 if (ExpansionLoc.isInvalid()) {
305 llvm::Regex RE(RegExp);
318 extern const internal::VariadicAllOfMatcher<Decl>
decl;
328 extern const internal::VariadicDynCastAllOfMatcher<Decl, LinkageSpecDecl>
342 extern const internal::VariadicDynCastAllOfMatcher<Decl, NamedDecl>
namedDecl;
353 extern const internal::VariadicDynCastAllOfMatcher<Decl, LabelDecl>
labelDecl;
364 extern const internal::VariadicDynCastAllOfMatcher<Decl, NamespaceDecl>
376 extern const internal::VariadicDynCastAllOfMatcher<Decl, NamespaceAliasDecl>
388 extern const internal::VariadicDynCastAllOfMatcher<Decl, RecordDecl>
recordDecl;
397 extern const internal::VariadicDynCastAllOfMatcher<Decl, CXXRecordDecl>
406 extern const internal::VariadicDynCastAllOfMatcher<Decl, ClassTemplateDecl>
419 extern const internal::VariadicDynCastAllOfMatcher<
432 extern const internal::VariadicDynCastAllOfMatcher<Decl, DeclaratorDecl>
443 extern const internal::VariadicDynCastAllOfMatcher<Decl, ParmVarDecl>
457 extern const internal::VariadicDynCastAllOfMatcher<Decl, AccessSpecDecl>
469 extern const internal::VariadicAllOfMatcher<CXXCtorInitializer>
481 extern const internal::VariadicAllOfMatcher<TemplateArgument>
templateArgument;
492 extern const internal::VariadicAllOfMatcher<TemplateName>
templateName;
502 extern const internal::VariadicDynCastAllOfMatcher<Decl,
514 extern const internal::VariadicDynCastAllOfMatcher<Decl, TemplateTypeParmDecl>
577 return Node.isBitField();
594 return Node.isBitField() &&
595 Node.getBitWidthValue(Finder->getASTContext()) == Width;
614 const Expr *Initializer =
Node.getInClassInitializer();
615 return (Initializer !=
nullptr &&
616 InnerMatcher.matches(*Initializer, Finder, Builder));
622 return Node.isMain();
636 internal::Matcher<ClassTemplateDecl>, InnerMatcher) {
638 return (Decl !=
nullptr &&
639 InnerMatcher.matches(*Decl, Finder, Builder));
645 return Node.isImplicit();
670 hasAnyTemplateArgument,
674 internal::Matcher<TemplateArgument>, InnerMatcher) {
676 internal::getTemplateSpecializationArgs(
Node);
677 return matchesFirstInRange(InnerMatcher, List.begin(), List.end(), Finder,
704 return InnerMatcher.matches(*
Node.IgnoreImplicit(), Finder, Builder);
733 internal::Matcher<Expr>, InnerMatcher) {
734 return InnerMatcher.matches(*
Node.IgnoreImpCasts(), Finder, Builder);
755 return InnerMatcher.matches(*
Node.IgnoreParenCasts(), Finder, Builder);
780 internal::Matcher<Expr>, InnerMatcher) {
781 return InnerMatcher.matches(*
Node.IgnoreParenImpCasts(), Finder, Builder);
796 internal::Matcher<QualType>, InnerMatcher) {
797 return InnerMatcher.matches(
Node.IgnoreParens(), Finder, Builder);
823 unsigned, N, internal::Matcher<TemplateArgument>, InnerMatcher) {
825 internal::getTemplateSpecializationArgs(
Node);
826 if (List.size() <= N)
828 return InnerMatcher.matches(List[N], Finder, Builder);
841 templateArgumentCountIs,
845 return internal::getTemplateSpecializationArgs(
Node).size() == N;
860 internal::Matcher<QualType>, InnerMatcher) {
863 return InnerMatcher.matches(
Node.getAsType(), Finder, Builder);
878 internal::Matcher<TemplateName>, InnerMatcher) {
881 return InnerMatcher.matches(
Node.getAsTemplate(), Finder, Builder);
898 internal::Matcher<Decl>, InnerMatcher) {
900 return InnerMatcher.matches(*
Node.getAsDecl(), Finder, Builder);
918 return InnerMatcher.matches(*
Node.getAsExpr(), Finder, Builder);
948 internal::Matcher<QualType>, InnerMatcher) {
951 return InnerMatcher.matches(
Node.getIntegralType(), Finder, Builder);
969 std::string,
Value) {
972 return Node.getAsIntegral().toString(10) ==
Value;
985 extern const internal::VariadicDynCastAllOfMatcher<
Stmt,
995 extern const internal::VariadicDynCastAllOfMatcher<Decl, ValueDecl>
valueDecl;
1008 extern const internal::VariadicDynCastAllOfMatcher<Decl, CXXConstructorDecl>
1020 extern const internal::VariadicDynCastAllOfMatcher<Decl, CXXDestructorDecl>
1031 extern const internal::VariadicDynCastAllOfMatcher<Decl, EnumDecl>
enumDecl;
1041 extern const internal::VariadicDynCastAllOfMatcher<Decl, EnumConstantDecl>
1050 extern const internal::VariadicDynCastAllOfMatcher<Decl, CXXMethodDecl>
1059 extern const internal::VariadicDynCastAllOfMatcher<Decl, CXXConversionDecl>
1071 extern const internal::VariadicDynCastAllOfMatcher<Decl, VarDecl>
varDecl;
1081 extern const internal::VariadicDynCastAllOfMatcher<Decl, FieldDecl>
fieldDecl;
1089 extern const internal::VariadicDynCastAllOfMatcher<Decl, FunctionDecl>
1098 extern const internal::VariadicDynCastAllOfMatcher<Decl, FunctionTemplateDecl>
1109 extern const internal::VariadicDynCastAllOfMatcher<Decl, FriendDecl>
friendDecl;
1119 extern const internal::VariadicAllOfMatcher<Stmt>
stmt;
1129 extern const internal::VariadicDynCastAllOfMatcher<Stmt, DeclStmt>
declStmt;
1142 extern const internal::VariadicDynCastAllOfMatcher<Stmt, MemberExpr>
memberExpr;
1152 extern const internal::VariadicDynCastAllOfMatcher<Stmt, CallExpr>
callExpr;
1160 extern const internal::VariadicDynCastAllOfMatcher<Stmt, LambdaExpr>
lambdaExpr;
1169 extern const internal::VariadicDynCastAllOfMatcher<Stmt, CXXMemberCallExpr>
1181 extern const internal::VariadicDynCastAllOfMatcher<Stmt, ObjCMessageExpr>
1191 extern const internal::VariadicDynCastAllOfMatcher<Decl, ObjCInterfaceDecl>
1201 extern const internal::VariadicDynCastAllOfMatcher<Decl, ObjCImplementationDecl>
1211 extern const internal::VariadicDynCastAllOfMatcher<Decl, ObjCProtocolDecl>
1221 extern const internal::VariadicDynCastAllOfMatcher<Decl, ObjCCategoryDecl>
1231 extern const internal::VariadicDynCastAllOfMatcher<Decl, ObjCCategoryImplDecl>
1246 extern const internal::VariadicDynCastAllOfMatcher<Decl, ObjCMethodDecl>
1259 extern const internal::VariadicDynCastAllOfMatcher<Decl, BlockDecl>
1271 extern const internal::VariadicDynCastAllOfMatcher<Decl, ObjCIvarDecl>
1282 extern const internal::VariadicDynCastAllOfMatcher<Decl, ObjCPropertyDecl>
1291 extern const internal::VariadicDynCastAllOfMatcher<Stmt, ObjCAtThrowStmt>
1301 extern const internal::VariadicDynCastAllOfMatcher<Stmt, ObjCAtTryStmt>
1311 extern const internal::VariadicDynCastAllOfMatcher<Stmt, ObjCAtCatchStmt>
1321 extern const internal::VariadicDynCastAllOfMatcher<Stmt, ObjCAtFinallyStmt>
1331 extern const internal::VariadicDynCastAllOfMatcher<Stmt, ExprWithCleanups>
1344 extern const internal::VariadicDynCastAllOfMatcher<Stmt, InitListExpr>
1350 internal::Matcher<Expr>, InnerMatcher) {
1351 const Expr *SyntForm =
Node.getSyntacticForm();
1352 return (SyntForm !=
nullptr &&
1353 InnerMatcher.matches(*SyntForm, Finder, Builder));
1367 extern const internal::VariadicDynCastAllOfMatcher<Stmt,
1379 extern const internal::VariadicDynCastAllOfMatcher<Stmt, ImplicitValueInitExpr>
1397 extern const internal::VariadicDynCastAllOfMatcher<Stmt, ParenListExpr>
1410 extern const internal::VariadicDynCastAllOfMatcher<Stmt,
1423 extern const internal::VariadicDynCastAllOfMatcher<Decl, UsingDecl>
usingDecl;
1434 extern const internal::VariadicDynCastAllOfMatcher<Decl, UsingDirectiveDecl>
1451 extern const internal::VariadicDynCastAllOfMatcher<Stmt, UnresolvedLookupExpr>
1465 extern const internal::VariadicDynCastAllOfMatcher<Decl,
1484 extern const internal::VariadicDynCastAllOfMatcher<Decl,
1495 extern const internal::VariadicDynCastAllOfMatcher<Stmt, ParenExpr>
parenExpr;
1507 extern const internal::VariadicDynCastAllOfMatcher<Stmt, CXXConstructExpr>
1518 extern const internal::VariadicDynCastAllOfMatcher<Stmt,
1532 extern const internal::VariadicDynCastAllOfMatcher<Stmt, CXXThisExpr>
1543 extern const internal::VariadicDynCastAllOfMatcher<Stmt, CXXBindTemporaryExpr>
1564 extern const internal::VariadicDynCastAllOfMatcher<Stmt,
1576 extern const internal::VariadicDynCastAllOfMatcher<Stmt, CXXNewExpr>
cxxNewExpr;
1586 extern const internal::VariadicDynCastAllOfMatcher<Stmt, CXXDeleteExpr>
1597 extern const internal::VariadicDynCastAllOfMatcher<Stmt, ArraySubscriptExpr>
1609 extern const internal::VariadicDynCastAllOfMatcher<Stmt, CXXDefaultArgExpr>
1626 extern const internal::VariadicDynCastAllOfMatcher<Stmt, CXXOperatorCallExpr>
1635 extern const internal::VariadicDynCastAllOfMatcher<Stmt, Expr>
expr;
1644 extern const internal::VariadicDynCastAllOfMatcher<Stmt, DeclRefExpr>
1658 extern const internal::VariadicDynCastAllOfMatcher<Stmt, ObjCIvarRefExpr>
1667 extern const internal::VariadicDynCastAllOfMatcher<Stmt, IfStmt>
ifStmt;
1676 extern const internal::VariadicDynCastAllOfMatcher<Stmt, ForStmt>
forStmt;
1688 const Stmt *
const Increment =
Node.getInc();
1689 return (Increment !=
nullptr &&
1690 InnerMatcher.matches(*Increment, Finder, Builder));
1703 const Stmt *
const Init =
Node.getInit();
1704 return (Init !=
nullptr && InnerMatcher.matches(*Init, Finder, Builder));
1714 extern const internal::VariadicDynCastAllOfMatcher<Stmt, CXXForRangeStmt>
1727 const VarDecl *
const Var =
Node.getLoopVariable();
1728 return (Var !=
nullptr && InnerMatcher.matches(*Var, Finder, Builder));
1741 const Expr *
const Init =
Node.getRangeInit();
1742 return (Init !=
nullptr && InnerMatcher.matches(*Init, Finder, Builder));
1753 extern const internal::VariadicDynCastAllOfMatcher<Stmt, WhileStmt>
whileStmt;
1763 extern const internal::VariadicDynCastAllOfMatcher<Stmt, DoStmt>
doStmt;
1773 extern const internal::VariadicDynCastAllOfMatcher<Stmt, BreakStmt>
breakStmt;
1783 extern const internal::VariadicDynCastAllOfMatcher<Stmt, ContinueStmt>
1794 extern const internal::VariadicDynCastAllOfMatcher<Stmt, ReturnStmt>
returnStmt;
1805 extern const internal::VariadicDynCastAllOfMatcher<Stmt, GotoStmt>
gotoStmt;
1816 extern const internal::VariadicDynCastAllOfMatcher<Stmt, LabelStmt>
labelStmt;
1828 extern const internal::VariadicDynCastAllOfMatcher<Stmt, AddrLabelExpr>
1839 extern const internal::VariadicDynCastAllOfMatcher<Stmt, SwitchStmt>
switchStmt;
1849 extern const internal::VariadicDynCastAllOfMatcher<Stmt, SwitchCase>
switchCase;
1859 extern const internal::VariadicDynCastAllOfMatcher<Stmt, CaseStmt>
caseStmt;
1869 extern const internal::VariadicDynCastAllOfMatcher<Stmt, DefaultStmt>
1878 extern const internal::VariadicDynCastAllOfMatcher<Stmt, CompoundStmt>
1888 extern const internal::VariadicDynCastAllOfMatcher<Stmt, CXXCatchStmt>
1898 extern const internal::VariadicDynCastAllOfMatcher<Stmt, CXXTryStmt>
cxxTryStmt;
1907 extern const internal::VariadicDynCastAllOfMatcher<Stmt, CXXThrowExpr>
1917 extern const internal::VariadicDynCastAllOfMatcher<Stmt, NullStmt>
nullStmt;
1927 extern const internal::VariadicDynCastAllOfMatcher<Stmt, AsmStmt>
asmStmt;
1935 extern const internal::VariadicDynCastAllOfMatcher<Stmt, CXXBoolLiteralExpr>
1945 extern const internal::VariadicDynCastAllOfMatcher<Stmt, StringLiteral>
1958 extern const internal::VariadicDynCastAllOfMatcher<Stmt, CharacterLiteral>
1965 extern const internal::VariadicDynCastAllOfMatcher<Stmt, IntegerLiteral>
1975 extern const internal::VariadicDynCastAllOfMatcher<Stmt, FloatingLiteral>
1981 extern const internal::VariadicDynCastAllOfMatcher<Stmt, UserDefinedLiteral>
1991 extern const internal::VariadicDynCastAllOfMatcher<Stmt, CompoundLiteralExpr>
1995 extern const internal::VariadicDynCastAllOfMatcher<Stmt, CXXNullPtrLiteralExpr>
1999 extern const internal::VariadicDynCastAllOfMatcher<Stmt, GNUNullExpr>
2007 extern const internal::VariadicDynCastAllOfMatcher<Stmt, AtomicExpr>
atomicExpr;
2015 extern const internal::VariadicDynCastAllOfMatcher<Stmt, StmtExpr>
stmtExpr;
2023 extern const internal::VariadicDynCastAllOfMatcher<Stmt, BinaryOperator>
2032 extern const internal::VariadicDynCastAllOfMatcher<Stmt, UnaryOperator>
2041 extern const internal::VariadicDynCastAllOfMatcher<Stmt, ConditionalOperator>
2050 extern const internal::VariadicDynCastAllOfMatcher<Stmt,
2062 extern const internal::VariadicDynCastAllOfMatcher<Stmt, OpaqueValueExpr>
2078 extern const internal::VariadicDynCastAllOfMatcher<Decl, StaticAssertDecl>
2091 extern const internal::VariadicDynCastAllOfMatcher<Stmt, CXXReinterpretCastExpr>
2107 extern const internal::VariadicDynCastAllOfMatcher<Stmt, CXXStaticCastExpr>
2122 extern const internal::VariadicDynCastAllOfMatcher<Stmt, CXXDynamicCastExpr>
2133 extern const internal::VariadicDynCastAllOfMatcher<Stmt, CXXConstCastExpr>
2142 extern const internal::VariadicDynCastAllOfMatcher<Stmt, CStyleCastExpr>
2166 extern const internal::VariadicDynCastAllOfMatcher<Stmt, ExplicitCastExpr>
2173 extern const internal::VariadicDynCastAllOfMatcher<Stmt, ImplicitCastExpr>
2189 extern const internal::VariadicDynCastAllOfMatcher<Stmt, CastExpr>
castExpr;
2199 extern const internal::VariadicDynCastAllOfMatcher<Stmt, CXXFunctionalCastExpr>
2208 extern const internal::VariadicDynCastAllOfMatcher<Stmt, CXXTemporaryObjectExpr>
2217 extern const internal::VariadicDynCastAllOfMatcher<Stmt, PredefinedExpr>
2226 extern const internal::VariadicDynCastAllOfMatcher<Stmt, DesignatedInitExpr>
2241 return Node.size() == N;
2245 extern const internal::VariadicAllOfMatcher<QualType>
qualType;
2248 extern const internal::VariadicAllOfMatcher<Type>
type;
2251 extern const internal::VariadicAllOfMatcher<TypeLoc>
typeLoc;
2272 extern const internal::VariadicOperatorMatcherFunc<
2279 extern const internal::VariadicOperatorMatcherFunc<
2286 extern const internal::VariadicOperatorMatcherFunc<
2299 extern const internal::VariadicDynCastAllOfMatcher<Stmt,
2312 internal::Matcher<QualType>, InnerMatcher) {
2313 const QualType ArgumentType =
Node.getTypeOfArgument();
2314 return InnerMatcher.matches(ArgumentType, Finder, Builder);
2333 const internal::Matcher<UnaryExprOrTypeTraitExpr> &InnerMatcher) {
2341 const internal::Matcher<UnaryExprOrTypeTraitExpr> &InnerMatcher) {
2361 inline internal::Matcher<NamedDecl>
hasName(
const std::string &Name) {
2362 return internal::Matcher<NamedDecl>(
new internal::HasNameMatcher({Name}));
2375 extern const internal::VariadicFunction<internal::Matcher<NamedDecl>, StringRef,
2396 assert(!RegExp.empty());
2397 std::string FullNameString =
"::" +
Node.getQualifiedNameAsString();
2398 llvm::Regex RE(RegExp);
2399 return RE.match(FullNameString);
2421 inline internal::PolymorphicMatcherWithParam1<
2422 internal::HasOverloadedOperatorNameMatcher, StringRef,
2425 return internal::PolymorphicMatcherWithParam1<
2426 internal::HasOverloadedOperatorNameMatcher, StringRef,
2452 internal::Matcher<NamedDecl>,
Base) {
2453 return Finder->classIsDerivedFrom(&
Node,
Base, Builder);
2458 assert(!BaseName.empty());
2459 return isDerivedFrom(
hasName(BaseName)).matches(
Node, Finder, Builder);
2465 internal::Matcher<NamedDecl>,
Base, 0) {
2466 return Matcher<CXXRecordDecl>(
anyOf(
Base, isDerivedFrom(
Base)))
2474 assert(!BaseName.empty());
2475 return isSameOrDerivedFrom(
hasName(BaseName)).matches(
Node, Finder, Builder);
2491 return matchesFirstInPointerRange(InnerMatcher,
Node.method_begin(),
2492 Node.method_end(), Finder, Builder);
2505 return Node.isLambda();
2526 extern const internal::ArgumentAdaptingMatcherFunc<internal::HasMatcher>
has;
2542 extern const internal::ArgumentAdaptingMatcherFunc<
2543 internal::HasDescendantMatcher>
2564 extern const internal::ArgumentAdaptingMatcherFunc<internal::ForEachMatcher>
2594 extern const internal::ArgumentAdaptingMatcherFunc<
2595 internal::ForEachDescendantMatcher>
2614 template <
typename T>
2615 internal::Matcher<T>
findAll(
const internal::Matcher<T> &Matcher) {
2629 extern const internal::ArgumentAdaptingMatcherFunc<
2630 internal::HasParentMatcher,
2631 internal::TypeList<Decl, NestedNameSpecifierLoc, Stmt, TypeLoc>,
2632 internal::TypeList<Decl, NestedNameSpecifierLoc, Stmt, TypeLoc>>
2646 extern const internal::ArgumentAdaptingMatcherFunc<
2647 internal::HasAncestorMatcher,
2648 internal::TypeList<Decl, NestedNameSpecifierLoc, Stmt, TypeLoc>,
2649 internal::TypeList<Decl, NestedNameSpecifierLoc, Stmt, TypeLoc>>
2661 extern const internal::VariadicOperatorMatcherFunc<1, 1>
unless;
2697 inline internal::PolymorphicMatcherWithParam1<
2698 internal::HasDeclarationMatcher, internal::Matcher<Decl>,
2699 void(internal::HasDeclarationSupportedTypes)>
2701 return internal::PolymorphicMatcherWithParam1<
2702 internal::HasDeclarationMatcher, internal::Matcher<Decl>,
2703 void(internal::HasDeclarationSupportedTypes)>(InnerMatcher);
2721 return UnderlyingDecl !=
nullptr &&
2722 InnerMatcher.matches(*UnderlyingDecl, Finder, Builder);
2737 const Expr *ExprNode =
Node.getImplicitObjectArgument()
2738 ->IgnoreParenImpCasts();
2739 return (ExprNode !=
nullptr &&
2740 InnerMatcher.matches(*ExprNode, Finder, Builder));
2757 return InnerMatcher.matches(TypeDecl, Finder, Builder);
2774 return Node.isInstanceMessage();
2789 const Expr *ReceiverNode =
Node.getInstanceReceiver();
2790 return (ReceiverNode !=
nullptr &&
2818 extern const internal::VariadicFunction<internal::Matcher<ObjCMessageExpr>,
2832 assert(!RegExp.empty());
2833 std::string SelectorString =
Node.getSelector().getAsString();
2834 llvm::Regex RE(RegExp);
2835 return RE.match(SelectorString);
2843 return Node.getSelector().isNull();
2855 return Node.getSelector().isUnarySelector();
2871 return Node.getSelector().isKeywordSelector();
2886 return Node.getSelector().getNumArgs() == N;
2907 const Expr *ExprNode =
Node.getCallee();
2908 return (ExprNode !=
nullptr &&
2909 InnerMatcher.matches(*ExprNode, Finder, Builder));
2943 internal::Matcher<QualType>, InnerMatcher, 0) {
2946 return InnerMatcher.matches(QT, Finder, Builder);
2971 internal::Matcher<Decl>, InnerMatcher, 1) {
2988 if (!
Node.getTypeSourceInfo())
2991 return Inner.matches(
Node.getTypeSourceInfo()->getTypeLoc(), Finder, Builder);
3004 return Name ==
Node.getAsString();
3018 QualType, pointsTo, internal::Matcher<QualType>,
3020 return (!
Node.isNull() &&
Node->isAnyPointerType() &&
3021 InnerMatcher.matches(
Node->getPointeeType(), Finder, Builder));
3028 .matches(
Node, Finder, Builder);
3043 return InnerMatcher.matches(*
Node.getUnqualifiedDesugaredType(), Finder,
3062 return (!
Node.isNull() &&
Node->isReferenceType() &&
3063 InnerMatcher.matches(
Node->getPointeeType(), Finder, Builder));
3082 return InnerMatcher.matches(
Node.getCanonicalType(), Finder, Builder);
3089 .matches(
Node, Finder, Builder);
3093 internal::Matcher<Expr>, InnerMatcher) {
3094 const Expr *ExprNode =
Node.getImplicitObjectArgument();
3095 return (ExprNode !=
nullptr &&
3096 InnerMatcher.matches(*ExprNode, Finder, Builder));
3102 internal::Matcher<QualType>, InnerMatcher, 0) {
3103 return onImplicitObjectArgument(
3104 anyOf(hasType(InnerMatcher), hasType(pointsTo(InnerMatcher))))
3105 .matches(
Node, Finder, Builder);
3110 internal::Matcher<Decl>, InnerMatcher, 1) {
3111 return onImplicitObjectArgument(
3112 anyOf(hasType(InnerMatcher), hasType(pointsTo(InnerMatcher))))
3113 .matches(
Node, Finder, Builder);
3127 const Decl *DeclNode =
Node.getDecl();
3128 return (DeclNode !=
nullptr &&
3129 InnerMatcher.matches(*DeclNode, Finder, Builder));
3147 internal::Matcher<UsingShadowDecl>, InnerMatcher) {
3150 return InnerMatcher.matches(*
UsingDecl, Finder, Builder);
3171 return matchesFirstInPointerRange(InnerMatcher,
Node.decls_begin(),
3172 Node.decls_end(), Finder, Builder);
3185 if (
Node.isSingleDecl()) {
3186 const Decl *FoundDecl =
Node.getSingleDecl();
3187 return InnerMatcher.matches(*FoundDecl, Finder, Builder);
3201 VarDecl, hasInitializer, internal::Matcher<Expr>,
3203 const Expr *Initializer =
Node.getAnyInitializer();
3204 return (Initializer !=
nullptr &&
3205 InnerMatcher.matches(*Initializer, Finder, Builder));
3220 return Node.hasLocalStorage();
3234 return Node.hasGlobalStorage();
3301 return Node.isExceptionVariable();
3317 return Node.getNumArgs() == N;
3332 unsigned, N, internal::Matcher<Expr>, InnerMatcher) {
3333 return (N <
Node.getNumArgs() &&
3334 InnerMatcher.matches(
3335 *
Node.getArg(N)->IgnoreParenImpCasts(), Finder, Builder));
3373 internal::Matcher<Decl>, InnerMatcher) {
3378 std::advance(Iterator, N);
3379 return InnerMatcher.matches(**Iterator, Finder, Builder);
3396 return Node.getExceptionDecl() ==
nullptr;
3413 internal::Matcher<CXXCtorInitializer>, InnerMatcher) {
3414 return matchesFirstInPointerRange(InnerMatcher,
Node.init_begin(),
3415 Node.init_end(), Finder, Builder);
3432 internal::Matcher<FieldDecl>, InnerMatcher) {
3434 return (NodeAsDecl !=
nullptr &&
3435 InnerMatcher.matches(*NodeAsDecl, Finder, Builder));
3452 internal::Matcher<Expr>, InnerMatcher) {
3453 const Expr* NodeAsExpr =
Node.getInit();
3454 return (NodeAsExpr !=
nullptr &&
3455 InnerMatcher.matches(*NodeAsExpr, Finder, Builder));
3472 return Node.isWritten();
3492 return Node.isBaseInitializer();
3512 return Node.isMemberInitializer();
3538 internal::Matcher<Expr>, InnerMatcher) {
3539 for (
const Expr *Arg :
Node.arguments()) {
3540 BoundNodesTreeBuilder Result(*Builder);
3541 if (InnerMatcher.matches(*Arg, Finder, &Result)) {
3542 *Builder = std::move(Result);
3551 return Node.isListInitialization();
3567 return Node.requiresZeroInitialization();
3594 unsigned, N, internal::Matcher<ParmVarDecl>,
3596 return (N <
Node.parameters().size()
3597 && InnerMatcher.matches(*
Node.parameters()[N], Finder, Builder));
3621 internal::Matcher<Expr>, ArgMatcher,
3622 internal::Matcher<ParmVarDecl>, ParamMatcher) {
3623 BoundNodesTreeBuilder Result;
3627 BoundNodesTreeBuilder Matches;
3629 .matches(
Node, Finder, &Matches)
3633 bool Matched =
false;
3634 for (; ArgIndex <
Node.getNumArgs(); ++ArgIndex) {
3635 BoundNodesTreeBuilder ArgMatches(*Builder);
3636 if (ArgMatcher.matches(*(
Node.getArg(ArgIndex)->IgnoreParenCasts()),
3637 Finder, &ArgMatches)) {
3638 BoundNodesTreeBuilder ParamMatches(ArgMatches);
3640 hasParameter(ParamIndex, ParamMatcher)))),
3642 hasParameter(ParamIndex, ParamMatcher))))))
3644 Result.addMatch(ParamMatches);
3650 *Builder = std::move(Result);
3689 internal::Matcher<ParmVarDecl>,
3691 return matchesFirstInPointerRange(InnerMatcher,
Node.param_begin(),
3692 Node.param_end(), Finder, Builder);
3716 return Node.getNumParams() == N;
3744 internal::Matcher<QualType>, InnerMatcher) {
3745 return InnerMatcher.matches(
Node.getReturnType(), Finder, Builder);
3765 return Node.isExternC();
3798 return Node.isDeleted();
3811 return Node.isDefaulted();
3833 return FnTy->hasDynamicExceptionSpec();
3886 return Node.isConstexpr();
3900 internal::Matcher<Expr>, InnerMatcher) {
3901 const Expr *
const Condition =
Node.getCond();
3902 return (Condition !=
nullptr &&
3903 InnerMatcher.matches(*Condition, Finder, Builder));
3914 const Stmt *
const Then =
Node.getThen();
3915 return (Then !=
nullptr && InnerMatcher.matches(*Then, Finder, Builder));
3926 const Stmt *
const Else =
Node.getElse();
3927 return (Else !=
nullptr && InnerMatcher.matches(*Else, Finder, Builder));
3961 internal::NotEqualsBoundNodePredicate Predicate;
3964 return Builder->removeBindings(Predicate);
3976 internal::Matcher<DeclStmt>, InnerMatcher) {
3977 const DeclStmt*
const DeclarationStatement =
3978 Node.getConditionVariableDeclStmt();
3979 return DeclarationStatement !=
nullptr &&
3980 InnerMatcher.matches(*DeclarationStatement, Finder, Builder);
3993 internal::Matcher<Expr>, InnerMatcher) {
3994 if (
const Expr* Expression =
Node.getIdx())
3995 return InnerMatcher.matches(*Expression, Finder, Builder);
4010 internal::Matcher<Expr>, InnerMatcher) {
4011 if (
const Expr* Expression =
Node.getBase())
4012 return InnerMatcher.matches(*Expression, Finder, Builder);
4032 internal::Matcher<Stmt>, InnerMatcher) {
4033 const Stmt *
const Statement = internal::GetBodyMatcher<NodeType>::get(
Node);
4034 return (Statement !=
nullptr &&
4035 InnerMatcher.matches(*Statement, Finder, Builder));
4052 internal::Matcher<Stmt>, InnerMatcher) {
4054 return CS && matchesFirstInPointerRange(InnerMatcher, CS->
body_begin(),
4069 return Node.size() == N;
4097 template <
typename ValueT>
4098 internal::PolymorphicMatcherWithParam1<internal::ValueEqualsMatcher, ValueT>
4100 return internal::PolymorphicMatcherWithParam1<
4101 internal::ValueEqualsMatcher,
4110 return internal::ValueEqualsMatcher<NodeType, ParamT>(
Value)
4118 unsigned,
Value, 1) {
4119 return internal::ValueEqualsMatcher<NodeType, ParamT>(
Value)
4129 return internal::ValueEqualsMatcher<NodeType, ParamT>(
Value)
4143 std::string, Name) {
4144 return Name ==
Node.getOpcodeStr(
Node.getOpcode());
4164 return Node.isAssignmentOp();
4176 internal::Matcher<Expr>, InnerMatcher) {
4177 const Expr *LeftHandSide =
Node.getLHS();
4178 return (LeftHandSide !=
nullptr &&
4179 InnerMatcher.matches(*LeftHandSide, Finder, Builder));
4191 internal::Matcher<Expr>, InnerMatcher) {
4192 const Expr *RightHandSide =
Node.getRHS();
4193 return (RightHandSide !=
nullptr &&
4194 InnerMatcher.matches(*RightHandSide, Finder, Builder));
4200 const internal::Matcher<Expr> &InnerMatcher) {
4201 return anyOf(hasLHS(InnerMatcher), hasRHS(InnerMatcher));
4212 internal::Matcher<Expr>, InnerMatcher) {
4213 const Expr *
const Operand =
Node.getSubExpr();
4214 return (Operand !=
nullptr &&
4215 InnerMatcher.matches(*Operand, Finder, Builder));
4236 internal::Matcher<Expr>, InnerMatcher) {
4237 const Expr *
const SubExpression =
4238 internal::GetSourceExpressionMatcher<NodeType>::get(
Node);
4239 return (SubExpression !=
nullptr &&
4240 InnerMatcher.matches(*SubExpression, Finder, Builder));
4259 internal::Matcher<QualType>, InnerMatcher) {
4261 return InnerMatcher.matches(NodeType, Finder, Builder);
4269 internal::Matcher<QualType>, InnerMatcher) {
4270 return InnerMatcher.matches(
Node.getType(), Finder, Builder);
4282 return Node.isStruct();
4294 return Node.isUnion();
4306 return Node.isClass();
4321 internal::Matcher<Expr>, InnerMatcher) {
4322 const Expr *Expression =
Node.getTrueExpr();
4323 return (Expression !=
nullptr &&
4324 InnerMatcher.matches(*Expression, Finder, Builder));
4336 internal::Matcher<Expr>, InnerMatcher) {
4337 const Expr *Expression =
Node.getFalseExpr();
4338 return (Expression !=
nullptr &&
4339 InnerMatcher.matches(*Expression, Finder, Builder));
4366 return Node.isThisDeclarationADefinition();
4380 return Node.isVariadic();
4401 internal::Matcher<CXXRecordDecl>, InnerMatcher) {
4403 return (Parent !=
nullptr &&
4404 InnerMatcher.matches(*Parent, Finder, Builder));
4432 internal::Matcher<CXXMethodDecl>, InnerMatcher) {
4433 BoundNodesTreeBuilder Result;
4434 bool Matched =
false;
4435 for (
const auto *Overridden :
Node.overridden_methods()) {
4436 BoundNodesTreeBuilder OverriddenBuilder(*Builder);
4437 const bool OverriddenMatched =
4438 InnerMatcher.matches(*Overridden, Finder, &OverriddenBuilder);
4439 if (OverriddenMatched) {
4441 Result.addMatch(OverriddenBuilder);
4444 *Builder = std::move(Result);
4459 return Node.isVirtual();
4477 return Node.isVirtualAsWritten();
4498 return Node.template hasAttr<FinalAttr>();
4512 return Node.isPure();
4527 return Node.isConst();
4544 return Node.isCopyAssignmentOperator();
4561 return Node.isMoveAssignmentOperator();
4579 return Node.size_overridden_methods() > 0 ||
Node.hasAttr<OverrideAttr>();
4594 return Node.isUserProvided();
4613 return Node.isArrow();
4627 return Node->isIntegerType();
4641 return Node->isUnsignedIntegerType();
4655 return Node->isSignedIntegerType();
4669 return Node->isAnyCharacterType();
4689 return Node->isAnyPointerType();
4708 return Node.isConstQualified();
4727 return Node.isVolatileQualified();
4744 return Node.hasLocalQualifiers();
4760 internal::Matcher<ValueDecl>, InnerMatcher) {
4761 return InnerMatcher.matches(*
Node.getMemberDecl(), Finder, Builder);
4777 internal::Matcher<Expr>, InnerMatcher) {
4778 return InnerMatcher.matches(*
Node.getBase(), Finder, Builder);
4791 internal::Matcher<UsingShadowDecl>, InnerMatcher) {
4792 return matchesFirstInPointerRange(InnerMatcher,
Node.shadow_begin(),
4793 Node.shadow_end(), Finder, Builder);
4809 internal::Matcher<NamedDecl>, InnerMatcher) {
4810 return InnerMatcher.matches(*
Node.getTargetDecl(), Finder, Builder);
4844 Node.getTemplateSpecializationKind() ==
4846 Node.getTemplateSpecializationKind() ==
4908 internal::Matcher<QualType>, InnerMatcher, 0) {
4909 return internal::BindableMatcher<TypeLoc>(
4910 new internal::TypeLocTypeMatcher(InnerMatcher));
4922 return Node.isBooleanType();
4934 return Node.isVoidType();
4937 template <
typename NodeType>
4986 return Node.isRealFloatingType();
5039 return internal::HasSizeMatcher<NodeType>::hasSize(
Node, N);
5095 internal::Matcher<Expr>, InnerMatcher) {
5096 return InnerMatcher.matches(*
Node.getSizeExpr(), Finder, Builder);
5341 pointee, getPointee,
5462 internal::Matcher<NestedNameSpecifier>, InnerMatcher) {
5464 return InnerMatcher.matches(*Qualifier, Finder, Builder);
5486 return InnerMatcher.matches(
Node.getNamedType(), Finder, Builder);
5517 hasReplacementType, getReplacementType,
5556 return InnerType.matches(
Node.getDecayedType(), Finder, Builder);
5575 if (!DC)
return false;
5592 extern const internal::VariadicAllOfMatcher<NestedNameSpecifier>
5596 extern const internal::VariadicAllOfMatcher<NestedNameSpecifierLoc>
5602 internal::BindableMatcher<NestedNameSpecifierLoc>, loc,
5603 internal::Matcher<NestedNameSpecifier>, InnerMatcher, 1) {
5604 return internal::BindableMatcher<NestedNameSpecifierLoc>(
5605 new internal::LocMatcher<NestedNameSpecifierLoc, NestedNameSpecifier>(
5622 internal::Matcher<QualType>, InnerMatcher) {
5623 if (!
Node.getAsType())
5625 return InnerMatcher.matches(
QualType(
Node.getAsType(), 0), Finder, Builder);
5640 internal::Matcher<TypeLoc>, InnerMatcher) {
5641 return Node &&
Node.getNestedNameSpecifier()->getAsType() &&
5642 InnerMatcher.matches(
Node.getTypeLoc(), Finder, Builder);
5655 internal::Matcher<NestedNameSpecifier>, InnerMatcher,
5660 return InnerMatcher.matches(*NextNode, Finder, Builder);
5673 internal::Matcher<NestedNameSpecifierLoc>, InnerMatcher,
5678 return InnerMatcher.matches(NextNode, Finder, Builder);
5692 internal::Matcher<NamespaceDecl>, InnerMatcher) {
5693 if (!
Node.getAsNamespace())
5695 return InnerMatcher.matches(*
Node.getAsNamespace(), Finder, Builder);
5706 return &
Node == Other;
5712 return &
Node == Other;
5718 return &
Node == Other;
5736 BoundNodesTreeBuilder Result;
5741 bool Matched =
false;
5743 SC = SC->getNextSwitchCase()) {
5744 BoundNodesTreeBuilder CaseBuilder(*Builder);
5745 bool CaseMatched = InnerMatcher.matches(*SC, Finder, &CaseBuilder);
5748 Result.addMatch(CaseBuilder);
5751 *Builder = std::move(Result);
5766 internal::Matcher<CXXCtorInitializer>, InnerMatcher) {
5767 BoundNodesTreeBuilder Result;
5768 bool Matched =
false;
5769 for (
const auto *I :
Node.inits()) {
5770 BoundNodesTreeBuilder InitBuilder(*Builder);
5771 if (InnerMatcher.matches(*I, Finder, &InitBuilder)) {
5773 Result.addMatch(InitBuilder);
5776 *Builder = std::move(Result);
5792 return Node.isCopyConstructor();
5807 return Node.isMoveConstructor();
5822 return Node.isDefaultConstructor();
5839 return Node.isDelegatingConstructor();
5859 return Node.isExplicit();
5880 if (
const auto *FD = dyn_cast<FunctionDecl>(&
Node))
5881 return FD->isInlineSpecified();
5882 else if (
const auto *NSD = dyn_cast<NamespaceDecl>(&
Node))
5883 return NSD->isInline();
5884 llvm_unreachable(
"Not a valid polymorphic type");
5897 return Node.isAnonymousNamespace();
5914 return InnerMatcher.matches(*
Node.getLHS(), Finder, Builder);
5927 for (
const auto *
Attr :
Node.attrs()) {
5946 if (
const auto *RetValue =
Node.getRetValue())
5947 return InnerMatcher.matches(*RetValue, Finder, Builder);
5957 extern const internal::VariadicDynCastAllOfMatcher<Stmt, CUDAKernelCallExpr>
5995 const auto &Parents = Finder->getASTContext().getParents(
Node);
5999 while(!Stack.empty()) {
6000 const auto &CurNode = Stack.back();
6002 if(
const auto *FuncDeclNode = CurNode.get<
FunctionDecl>()) {
6003 if(InnerMatcher.matches(*FuncDeclNode, Finder, Builder)) {
6006 }
else if(
const auto *LambdaExprNode = CurNode.get<
LambdaExpr>()) {
6007 if(InnerMatcher.matches(*LambdaExprNode->getCallOperator(),
6012 for(
const auto &
Parent: Finder->getASTContext().getParents(CurNode))
6040 return Node.hasExternalFormalLinkage();
6051 return Node.hasDefaultArg();
6063 return Node.isArray();
6075 return Node.isArray() &&
6076 InnerMatcher.matches(*
Node.getArraySize(), Finder, Builder);
6087 return Node.hasDefinition();
6098 return Node.isScoped();
6110 return F->hasTrailingReturn();
6117 #endif // LLVM_CLANG_ASTMATCHERS_ASTMATCHERS_H const internal::VariadicDynCastAllOfMatcher< Stmt, CXXThisExpr > cxxThisExpr
Matches implicit and explicit this expressions.
A call to an overloaded operator written using operator syntax.
internal::TrueMatcher anything()
Matches any node.
const internal::VariadicAllOfMatcher< Type > type
Matches Types in the clang AST.
const internal::VariadicDynCastAllOfMatcher< Decl, NonTypeTemplateParmDecl > nonTypeTemplateParmDecl
Matches non-type template parameter declarations.
Defines the clang::ASTContext interface.
Represents a type that was referred to using an elaborated type keyword, e.g., struct S...
const internal::VariadicDynCastAllOfMatcher< Stmt, ObjCAtThrowStmt > objcThrowStmt
Matches Objective-C @throw statements.
const internal::VariadicDynCastAllOfMatcher< Stmt, CallExpr > callExpr
Matches call expressions.
const internal::VariadicDynCastAllOfMatcher< Stmt, ParenExpr > parenExpr
Matches parentheses used in expressions.
Represents a function declaration or definition.
const internal::VariadicDynCastAllOfMatcher< Decl, TypedefDecl > typedefDecl
Matches typedef declarations.
const internal::VariadicDynCastAllOfMatcher< Decl, LinkageSpecDecl > linkageSpecDecl
Matches a declaration of a linkage specification.
Smart pointer class that efficiently represents Objective-C method names.
PointerType - C99 6.7.5.1 - Pointer Declarators.
A (possibly-)qualified type.
const AstTypeMatcher< DecltypeType > decltypeType
Matches types nodes representing C++11 decltype(<expr>) types.
const internal::ArgumentAdaptingMatcherFunc< internal::ForEachMatcher > forEach
Matches AST nodes that have child AST nodes that match the provided matcher.
internal::Matcher< NestedNameSpecifier > NestedNameSpecifierMatcher
AST_MATCHER_P(FieldDecl, hasBitWidth, unsigned, Width)
Matches non-static data members that are bit-fields of the specified bit width.
const AstTypeMatcher< UnaryTransformType > unaryTransformType
Matches types nodes representing unary type transformations.
Defines enumerations for the type traits support.
const internal::VariadicAllOfMatcher< Stmt > stmt
Matches statements.
static Decl * castFromDeclContext(const DeclContext *)
const internal::VariadicDynCastAllOfMatcher< Stmt, CXXUnresolvedConstructExpr > cxxUnresolvedConstructExpr
Matches unresolved constructor call expressions.
const internal::VariadicDynCastAllOfMatcher< Decl, ObjCInterfaceDecl > objcInterfaceDecl
Matches Objective-C interface declarations.
const internal::ArgumentAdaptingMatcherFunc< internal::HasMatcher > has
Matches AST nodes that have child AST nodes that match the provided matcher.
const internal::VariadicDynCastAllOfMatcher< Stmt, CXXBindTemporaryExpr > cxxBindTemporaryExpr
Matches nodes where temporaries are created.
Stmt - This represents one statement.
internal::Matcher< Stmt > StatementMatcher
const internal::VariadicDynCastAllOfMatcher< Decl, RecordDecl > recordDecl
Matches class, struct, and union declarations.
IfStmt - This represents an if/then/else.
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.
const internal::VariadicFunction< internal::Matcher< ObjCMessageExpr >, StringRef, internal::hasAnySelectorFunc > hasAnySelector
Matches when at least one of the supplied string equals to the Selector.getAsString() ...
C Language Family Type Representation.
Defines the SourceManager interface.
const AstTypeMatcher< TagType > tagType
Matches tag types (record and enum types).
The template argument is an expression, and we've not resolved it to one of the other forms yet...
internal::BoundNodesMap::IDToNodeMap IDToNodeMap
Type of mapping from binding identifiers to bound nodes.
const internal::VariadicOperatorMatcherFunc< 2, std::numeric_limits< unsigned >::max()> anyOf
Matches if any of the given matchers matches.
Decl - This represents one declaration (or definition), e.g.
Defines the C++ template declaration subclasses.
Represents a C++11 auto or C++14 decltype(auto) type.
const internal::ArgumentAdaptingMatcherFunc< internal::HasDescendantMatcher > hasDescendant
Matches AST nodes that have descendant AST nodes that match the provided matcher. ...
const AstTypeMatcher< FunctionType > functionType
Matches FunctionType nodes.
The base class of the type hierarchy.
Represents an array type, per C99 6.7.5.2 - Array Declarators.
The template argument is a declaration that was provided for a pointer, reference, or pointer to member non-type template parameter.
Represent a C++ namespace.
Represents a call to a C++ constructor.
Represents a C++ constructor within a class.
Represents a prvalue temporary that is written into memory so that a reference can bind to it...
float __ovld __cnfn distance(float p0, float p1)
Returns the distance between p0 and p1.
const AstTypeMatcher< SubstTemplateTypeParmType > substTemplateTypeParmType
Matches types that represent the result of substituting a type for a template type parameter...
const internal::VariadicOperatorMatcherFunc< 2, std::numeric_limits< unsigned >::max()> eachOf
Matches if any of the given matchers matches.
const AstTypeMatcher< AutoType > autoType
Matches types nodes representing C++11 auto types.
const AstTypeMatcher< RValueReferenceType > rValueReferenceType
Matches rvalue reference types.
const internal::VariadicAllOfMatcher< TemplateName > templateName
Matches template name.
FriendDecl - Represents the declaration of a friend entity, which can be a function, a type, or a templated function or type.
Represents a variable declaration or definition.
const internal::VariadicDynCastAllOfMatcher< Stmt, ObjCAtTryStmt > objcTryStmt
Matches Objective-C statements.
const AstTypeMatcher< PointerType > pointerType
Matches pointer types, but does not match Objective-C object pointer types.
const internal::VariadicDynCastAllOfMatcher< Stmt, Expr > expr
Matches expressions.
const internal::VariadicOperatorMatcherFunc< 2, std::numeric_limits< unsigned >::max()> allOf
Matches if all given matchers match.
const internal::VariadicDynCastAllOfMatcher< Stmt, BinaryOperator > binaryOperator
Matches binary operator expressions.
const internal::VariadicDynCastAllOfMatcher< Stmt, CXXStdInitializerListExpr > cxxStdInitializerListExpr
Matches C++ initializer list expressions.
AST_MATCHER(Decl, isPublic)
Matches public C++ declarations.
Matcher< NamedDecl > hasAnyNameFunc(ArrayRef< const StringRef *> NameRefs)
internal::PolymorphicMatcherWithParam1< internal::ValueEqualsMatcher, ValueT > equals(const ValueT &Value)
Matches literals that are equal to the given value of type ValueT.
ObjCMethodDecl - Represents an instance or class method declaration.
const internal::VariadicDynCastAllOfMatcher< Stmt, ObjCIvarRefExpr > objcIvarRefExpr
Matches a reference to an ObjCIvar.
Implicit construction of a std::initializer_list<T> object from an array temporary within list-initia...
const internal::VariadicDynCastAllOfMatcher< Decl, VarDecl > varDecl
Matches variable declarations.
Defines the Objective-C statement AST node classes.
const internal::VariadicDynCastAllOfMatcher< Decl, FunctionDecl > functionDecl
Matches function declarations.
const internal::VariadicDynCastAllOfMatcher< Decl, NamedDecl > namedDecl
Matches a declaration of anything that could have a name.
Represents a parameter to a function.
Represents the result of substituting a type for a template type parameter.
Defines the clang::Expr interface and subclasses for C++ expressions.
const AstTypeMatcher< BuiltinType > builtinType
Matches builtin Types.
internal::Matcher< QualType > TypeMatcher
AST_POLYMORPHIC_MATCHER_P2(hasTemplateArgument, AST_POLYMORPHIC_SUPPORTED_TYPES(ClassTemplateSpecializationDecl, TemplateSpecializationType, FunctionDecl), unsigned, N, internal::Matcher< TemplateArgument >, InnerMatcher)
Matches classTemplateSpecializations, templateSpecializationType and functionDecl where the n'th Temp...
const internal::VariadicDynCastAllOfMatcher< Stmt, CXXThrowExpr > cxxThrowExpr
Matches throw expressions.
Base wrapper for a particular "section" of type source info.
const internal::VariadicDynCastAllOfMatcher< Decl, EnumDecl > enumDecl
Matches enum declarations.
const AstTypeMatcher< RecordType > recordType
Matches record types (e.g.
Represents a struct/union/class.
Represents a C99 designated initializer expression.
Represents a class template specialization, which refers to a class template with a given set of temp...
bool isNothrow(bool ResultIfDependent=false) const
Determine whether this function type has a non-throwing exception specification.
DeclGroupRef::const_iterator const_decl_iterator
const internal::VariadicDynCastAllOfMatcher< Decl, ClassTemplateDecl > classTemplateDecl
Matches C++ class template declarations.
const internal::VariadicDynCastAllOfMatcher< Decl, ObjCCategoryDecl > objcCategoryDecl
Matches Objective-C category declarations.
A C++ nested-name-specifier augmented with source location information.
The template argument is an integral value stored in an llvm::APSInt that was provided for an integra...
const internal::VariadicDynCastAllOfMatcher< Stmt, CXXOperatorCallExpr > cxxOperatorCallExpr
Matches overloaded operator calls.
const IDToNodeMap & getMap() const
Retrieve mapping from binding identifiers to bound nodes.
const internal::VariadicDynCastAllOfMatcher< Decl, TypeAliasTemplateDecl > typeAliasTemplateDecl
Matches type alias template declarations.
Represents a member of a struct/union/class.
const internal::VariadicDynCastAllOfMatcher< Stmt, DesignatedInitExpr > designatedInitExpr
Matches C99 designated initializer expressions [C99 6.7.8].
Defines the ExceptionSpecificationType enumeration and various utility functions. ...
const AstTypeMatcher< InjectedClassNameType > injectedClassNameType
Matches injected class name types.
const internal::VariadicDynCastAllOfMatcher< Stmt, CXXNullPtrLiteralExpr > cxxNullPtrLiteralExpr
Matches nullptr literal.
UnaryExprOrTypeTrait
Names for the "expression or type" traits.
const AstTypeMatcher< DependentSizedArrayType > dependentSizedArrayType
Matches C++ arrays whose size is a value-dependent expression.
const internal::VariadicDynCastAllOfMatcher< Stmt, CXXTryStmt > cxxTryStmt
Matches try statements.
Defines the clang::attr::Kind enum.
const internal::VariadicDynCastAllOfMatcher< Stmt, CXXStaticCastExpr > cxxStaticCastExpr
Matches a C++ static_cast expression.
internal::VariadicDynCastAllOfMatcher< Type, NodeType > AstTypeMatcher
const AstTypeMatcher< TypedefType > typedefType
Matches typedef types.
const internal::VariadicDynCastAllOfMatcher< Stmt, GotoStmt > gotoStmt
Matches goto statements.
const AstTypeMatcher< ComplexType > complexType
Matches C99 complex types.
const internal::VariadicDynCastAllOfMatcher< Stmt, CXXFunctionalCastExpr > cxxFunctionalCastExpr
Matches functional cast expressions.
const internal::VariadicDynCastAllOfMatcher< Stmt, CXXReinterpretCastExpr > cxxReinterpretCastExpr
Matches a reinterpret_cast expression.
const internal::VariadicDynCastAllOfMatcher< Stmt, FloatingLiteral > floatLiteral
Matches float literals of all sizes / encodings, e.g.
const internal::VariadicDynCastAllOfMatcher< Stmt, DeclStmt > declStmt
Matches declaration statements.
Describes an C or C++ initializer list.
Represents a C++ using-declaration.
const internal::VariadicDynCastAllOfMatcher< Stmt, OpaqueValueExpr > opaqueValueExpr
Matches opaque value expressions.
const AstTypeMatcher< MemberPointerType > memberPointerType
Matches member pointer types.
ForStmt - This represents a 'for (init;cond;inc)' stmt.
const internal::VariadicDynCastAllOfMatcher< Stmt, DeclRefExpr > declRefExpr
Matches expressions that refer to declarations.
const internal::VariadicDynCastAllOfMatcher< Stmt, IfStmt > ifStmt
Matches if statements.
AST_MATCHER_FUNCTION(internal::Matcher< Decl >, isInstantiated)
Matches declarations that are template instantiations or are inside template instantiations.
Forward-declares and imports various common LLVM datatypes that clang wants to use unqualified...
const T * getNodeAs(StringRef ID) const
Returns the AST node bound to ID.
const internal::VariadicDynCastAllOfMatcher< Decl, NamespaceDecl > namespaceDecl
Matches a declaration of a namespace.
SourceLocation getExpansionLoc(SourceLocation Loc) const
Given a SourceLocation object Loc, return the expansion location referenced by the ID...
Represents a declaration of a type.
A builtin binary operation expression such as "x + y" or "x <= y".
CXXForRangeStmt - This represents C++0x [stmt.ranged]'s ranged for statement, represented as 'for (ra...
const internal::VariadicDynCastAllOfMatcher< Stmt, ImplicitValueInitExpr > implicitValueInitExpr
Matches implicit initializers of init list expressions.
const internal::VariadicDynCastAllOfMatcher< Stmt, SwitchCase > switchCase
Matches case and default statements inside switch statements.
const internal::VariadicFunction< internal::Matcher< NamedDecl >, StringRef, internal::hasAnyNameFunc > hasAnyName
Matches NamedDecl nodes that have any of the specified names.
const internal::VariadicDynCastAllOfMatcher< Stmt, UserDefinedLiteral > userDefinedLiteral
Matches user defined literal operator call.
internal::Matcher< Stmt > sizeOfExpr(const internal::Matcher< UnaryExprOrTypeTraitExpr > &InnerMatcher)
Same as unaryExprOrTypeTraitExpr, but only matching sizeof.
CastExpr - Base class for type casts, including both implicit casts (ImplicitCastExpr) and explicit c...
const AstTypeMatcher< VariableArrayType > variableArrayType
Matches C arrays with a specified size that is not an integer-constant-expression.
const internal::VariadicDynCastAllOfMatcher< Stmt, CastExpr > castExpr
Matches any cast nodes of Clang's AST.
A C++ lambda expression, which produces a function object (of unspecified type) that can be invoked l...
internal::PolymorphicMatcherWithParam1< internal::HasOverloadedOperatorNameMatcher, StringRef, AST_POLYMORPHIC_SUPPORTED_TYPES(CXXOperatorCallExpr, FunctionDecl)> hasOverloadedOperatorName(StringRef Name)
Matches overloaded operator names.
const internal::VariadicDynCastAllOfMatcher< Decl, ValueDecl > valueDecl
Matches any value declaration.
const internal::VariadicDynCastAllOfMatcher< Decl, ObjCPropertyDecl > objcPropertyDecl
Matches Objective-C property declarations.
const internal::VariadicDynCastAllOfMatcher< Stmt, ObjCAtFinallyStmt > objcFinallyStmt
Matches Objective-C statements.
internal::Matcher< T > findAll(const internal::Matcher< T > &Matcher)
Matches if the node or any descendant matches.
const internal::VariadicDynCastAllOfMatcher< Decl, FunctionTemplateDecl > functionTemplateDecl
Matches C++ function template declarations.
const internal::VariadicDynCastAllOfMatcher< Stmt, CXXCatchStmt > cxxCatchStmt
Matches catch statements.
const internal::VariadicDynCastAllOfMatcher< Decl, ClassTemplateSpecializationDecl > classTemplateSpecializationDecl
Matches C++ class template specializations.
const internal::VariadicDynCastAllOfMatcher< Stmt, MaterializeTemporaryExpr > materializeTemporaryExpr
Matches nodes where temporaries are materialized.
const internal::VariadicDynCastAllOfMatcher< Stmt, CaseStmt > caseStmt
Matches case statements inside switch statements.
const AstTypeMatcher< ParenType > parenType
Matches ParenType nodes.
const internal::VariadicDynCastAllOfMatcher< Decl, UsingDirectiveDecl > usingDirectiveDecl
Matches using namespace declarations.
CompoundStmt - This represents a group of statements like { stmt stmt }.
Represents a prototype with parameter type info, e.g.
const internal::ArgumentAdaptingMatcherFunc< internal::ForEachDescendantMatcher > forEachDescendant
Matches AST nodes that have descendant AST nodes that match the provided matcher. ...
Represents a ValueDecl that came out of a declarator.
CastKind
CastKind - The kind of operation required for a conversion.
UnaryExprOrTypeTraitExpr - expression with either a type or (unevaluated) expression operand...
const internal::VariadicDynCastAllOfMatcher< Stmt, AsmStmt > asmStmt
Matches asm statements.
const internal::VariadicDynCastAllOfMatcher< Stmt, ObjCAutoreleasePoolStmt > autoreleasePoolStmt
Matches an Objective-C autorelease pool statement.
const internal::VariadicDynCastAllOfMatcher< Decl, UnresolvedUsingTypenameDecl > unresolvedUsingTypenameDecl
Matches unresolved using value declarations that involve the typename.
const internal::VariadicDynCastAllOfMatcher< Stmt, MemberExpr > memberExpr
Matches member expressions.
const internal::VariadicDynCastAllOfMatcher< Stmt, AddrLabelExpr > addrLabelExpr
Matches address of label statements (GNU extension).
const internal::VariadicDynCastAllOfMatcher< Stmt, ExplicitCastExpr > explicitCastExpr
Matches explicit cast expressions.
Pepresents a block literal declaration, which is like an unnamed FunctionDecl.
Represent the declaration of a variable (in which case it is an lvalue) a function (in which case it ...
Expr - This represents one expression.
const internal::VariadicDynCastAllOfMatcher< Stmt, SwitchStmt > switchStmt
Matches switch statements.
bool isInSystemHeader(SourceLocation Loc) const
Returns if a SourceLocation is in a system header.
const FileEntry * getFileEntryForID(FileID FID) const
Returns the FileEntry record for the provided FileID.
const internal::VariadicDynCastAllOfMatcher< Stmt, UnresolvedLookupExpr > unresolvedLookupExpr
Matches reference to a name that can be looked up during parsing but could not be resolved to a speci...
const internal::VariadicDynCastAllOfMatcher< Stmt, BinaryConditionalOperator > binaryConditionalOperator
Matches binary conditional operator expressions (GNU extension).
const internal::VariadicAllOfMatcher< Decl > decl
Matches declarations.
const AstTypeMatcher< IncompleteArrayType > incompleteArrayType
Matches C arrays with unspecified size.
const internal::VariadicDynCastAllOfMatcher< Stmt, LabelStmt > labelStmt
Matches label statements.
const internal::VariadicDynCastAllOfMatcher< Stmt, CStyleCastExpr > cStyleCastExpr
Matches a C-style cast expression.
const internal::VariadicDynCastAllOfMatcher< Decl, NamespaceAliasDecl > namespaceAliasDecl
Matches a declaration of a namespace alias.
const internal::VariadicDynCastAllOfMatcher< Decl, FieldDecl > fieldDecl
Matches field declarations.
internal::Matcher< T > id(StringRef ID, const internal::BindableMatcher< T > &InnerMatcher)
If the provided matcher matches a node, binds the node to ID.
NonTypeTemplateParmDecl - Declares a non-type template parameter, e.g., "Size" in.
Represents the type decltype(expr) (C++11).
const internal::VariadicDynCastAllOfMatcher< Stmt, ConditionalOperator > conditionalOperator
Matches conditional operator expressions.
static SVal getValue(SVal val, SValBuilder &svalBuilder)
Defines the clang::TypeLoc interface and its subclasses.
const AstTypeMatcher< ArrayType > arrayType
Matches all kinds of arrays.
Defines the clang::IdentifierInfo, clang::IdentifierTable, and clang::Selector interfaces.
const internal::VariadicDynCastAllOfMatcher< Decl, TypedefNameDecl > typedefNameDecl
Matches typedef name declarations.
const internal::VariadicDynCastAllOfMatcher< Stmt, SubstNonTypeTemplateParmExpr > substNonTypeTemplateParmExpr
Matches substitutions of non-type template parameters.
const internal::VariadicDynCastAllOfMatcher< Stmt, ReturnStmt > returnStmt
Matches return statements.
const AstTypeMatcher< FunctionProtoType > functionProtoType
Matches FunctionProtoType nodes.
ReturnStmt - This represents a return, optionally of an expression: return; return 4;...
const internal::VariadicDynCastAllOfMatcher< Stmt, CUDAKernelCallExpr > cudaKernelCallExpr
Matches CUDA kernel call expression.
An expression that sends a message to the given Objective-C object or class.
static bool hasDefinition(const ObjCObjectPointerType *ObjPtr)
UnaryOperator - This represents the unary-expression's (except sizeof and alignof), the postinc/postdec operators from postfix-expression, and various extensions.
const AstTypeMatcher< AtomicType > atomicType
Matches atomic types.
AST_TYPE_TRAVERSE_MATCHER(hasDeducedType, getDeducedType, AST_POLYMORPHIC_SUPPORTED_TYPES(AutoType))
Matches AutoType nodes where the deduced type is a specific type.
Represents a reference to a non-type template parameter that has been substituted with a template arg...
const internal::VariadicDynCastAllOfMatcher< Decl, ObjCCategoryImplDecl > objcCategoryImplDecl
Matches Objective-C category definitions.
const internal::VariadicDynCastAllOfMatcher< Stmt, ExprWithCleanups > exprWithCleanups
Matches expressions that introduce cleanups to be run at the end of the sub-expression's evaluation...
Represents a C++ conversion function within a class.
const internal::VariadicDynCastAllOfMatcher< Decl, FriendDecl > friendDecl
Matches friend declarations.
This template specialization was implicitly instantiated from a template.
const internal::VariadicDynCastAllOfMatcher< Stmt, DoStmt > doStmt
Matches do statements.
bool isNull() const
Return true if this QualType doesn't point to a type yet.
const internal::ArgumentAdaptingMatcherFunc< internal::HasAncestorMatcher, internal::TypeList< Decl, NestedNameSpecifierLoc, Stmt, TypeLoc >, internal::TypeList< Decl, NestedNameSpecifierLoc, Stmt, TypeLoc > > hasAncestor
Matches AST nodes that have an ancestor that matches the provided matcher.
bool isTemplateInstantiation(TemplateSpecializationKind Kind)
Determine whether this template specialization kind refers to an instantiation of an entity (as oppos...
const AstTypeMatcher< TemplateSpecializationType > templateSpecializationType
Matches template specialization types.
DoStmt - This represents a 'do/while' stmt.
AST_MATCHER_P2(DeclStmt, containsDeclaration, unsigned, N, internal::Matcher< Decl >, InnerMatcher)
Matches the n'th declaration of a declaration statement.
const internal::VariadicAllOfMatcher< NestedNameSpecifierLoc > nestedNameSpecifierLoc
Same as nestedNameSpecifier but matches NestedNameSpecifierLoc.
Maps string IDs to AST nodes matched by parts of a matcher.
OpaqueValueExpr - An expression referring to an opaque object of a fixed type and value class...
std::string getAsString() const
Derive the full selector name (e.g.
friend class internal::BoundNodesTreeBuilder
const internal::VariadicDynCastAllOfMatcher< Stmt, PredefinedExpr > predefinedExpr
Matches predefined identifier expressions [C99 6.4.2.2].
A reference to an overloaded function set, either an UnresolvedLookupExpr or an UnresolvedMemberExpr...
AST_MATCHER_FUNCTION_P_OVERLOAD(internal::BindableMatcher< TypeLoc >, loc, internal::Matcher< QualType >, InnerMatcher, 0)
Matches TypeLocs for which the given inner QualType-matcher matches.
const internal::VariadicDynCastAllOfMatcher< Decl, LabelDecl > labelDecl
Matches a declaration of label.
const internal::VariadicDynCastAllOfMatcher< Stmt, CXXMemberCallExpr > cxxMemberCallExpr
Matches member call expressions.
Sugar for parentheses used when specifying types.
StringRef getName() const
const internal::VariadicDynCastAllOfMatcher< Decl, ParmVarDecl > parmVarDecl
Matches parameter variable declarations.
Represents a new-expression for memory allocation and constructor calls, e.g: "new CXXNewExpr(foo)"...
Represents the declaration of a struct/union/class/enum.
const internal::VariadicDynCastAllOfMatcher< Stmt, CXXConstCastExpr > cxxConstCastExpr
Matches a const_cast expression.
const internal::VariadicDynCastAllOfMatcher< Decl, TypeAliasDecl > typeAliasDecl
Matches type alias declarations.
Represents a call to a member function that may be written either with member call syntax (e...
const internal::VariadicAllOfMatcher< CXXCtorInitializer > cxxCtorInitializer
Matches constructor initializers.
DeclStmt - Adaptor class for mixing declarations with statements and expressions. ...
static QualType getUnderlyingType(const SubRegion *R)
const internal::VariadicDynCastAllOfMatcher< Stmt, GNUNullExpr > gnuNullExpr
Matches GNU __null expression.
Represents a dependent using declaration which was not marked with typename.
const internal::VariadicDynCastAllOfMatcher< Stmt, BreakStmt > breakStmt
Matches break statements.
Cached information about one file (either on disk or in the virtual file system). ...
const internal::VariadicDynCastAllOfMatcher< Decl, CXXMethodDecl > cxxMethodDecl
Matches method declarations.
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...
const internal::VariadicDynCastAllOfMatcher< Stmt, CXXDynamicCastExpr > cxxDynamicCastExpr
Matches a dynamic_cast expression.
Represents a static or instance method of a struct/union/class.
internal::Matcher< Stmt > alignOfExpr(const internal::Matcher< UnaryExprOrTypeTraitExpr > &InnerMatcher)
Same as unaryExprOrTypeTraitExpr, but only matching alignof.
static bool hasAttr(const FunctionDecl *D, bool IgnoreImplicitAttr)
const internal::VariadicDynCastAllOfMatcher< Stmt, DefaultStmt > defaultStmt
Matches default statements inside switch statements.
const internal::VariadicDynCastAllOfMatcher< Decl, TranslationUnitDecl > translationUnitDecl
Matches the top declaration context.
const internal::VariadicDynCastAllOfMatcher< Stmt, CXXForRangeStmt > cxxForRangeStmt
Matches range-based for statements.
const internal::VariadicAllOfMatcher< TypeLoc > typeLoc
Matches TypeLocs in the clang AST.
const internal::VariadicDynCastAllOfMatcher< Stmt, IntegerLiteral > integerLiteral
Matches integer literals of all sizes / encodings, e.g.
Represents a C++ nested name specifier, such as "\::std::vector<int>::".
const internal::VariadicDynCastAllOfMatcher< Stmt, CXXConstructExpr > cxxConstructExpr
Matches constructor call expressions (including implicit ones).
const internal::VariadicAllOfMatcher< QualType > qualType
Matches QualTypes in the clang AST.
const internal::VariadicDynCastAllOfMatcher< Decl, TemplateTypeParmDecl > templateTypeParmDecl
Matches template type parameter declarations.
const internal::VariadicDynCastAllOfMatcher< Decl, ObjCMethodDecl > objcMethodDecl
Matches Objective-C method declarations.
const internal::VariadicDynCastAllOfMatcher< Decl, UsingDecl > usingDecl
Matches using declarations.
bool isInMainFile(SourceLocation Loc) const
Returns whether the PresumedLoc for a given SourceLocation is in the main file.
const internal::VariadicDynCastAllOfMatcher< Stmt, ArraySubscriptExpr > arraySubscriptExpr
Matches array subscript expressions.
AST_POLYMORPHIC_MATCHER_P_OVERLOAD(hasType, AST_POLYMORPHIC_SUPPORTED_TYPES(Expr, FriendDecl, TypedefNameDecl, ValueDecl), internal::Matcher< QualType >, InnerMatcher, 0)
Matches if the expression's or declaration's type matches a type matcher.
ImplicitCastExpr - Allows us to explicitly represent implicit type conversions, which have no direct ...
const internal::VariadicDynCastAllOfMatcher< Stmt, UnaryExprOrTypeTraitExpr > unaryExprOrTypeTraitExpr
Matches sizeof (C99), alignof (C++11) and vec_step (OpenCL)
const internal::ArgumentAdaptingMatcherFunc< internal::HasParentMatcher, internal::TypeList< Decl, NestedNameSpecifierLoc, Stmt, TypeLoc >, internal::TypeList< Decl, NestedNameSpecifierLoc, Stmt, TypeLoc > > hasParent
Matches AST nodes that have a parent that matches the provided matcher.
#define AST_POLYMORPHIC_SUPPORTED_TYPES(...)
Construct a type-list to be passed to the AST_POLYMORPHIC_MATCHER* macros.
This template specialization was instantiated from a template due to an explicit instantiation defini...
const internal::VariadicDynCastAllOfMatcher< Decl, ObjCIvarDecl > objcIvarDecl
Matches Objective-C instance variable declarations.
StmtExpr - This is the GNU Statement Expression extension: ({int X=4; X;}).
const internal::VariadicOperatorMatcherFunc< 1, 1 > unless
Matches if the provided matcher does not match.
static DynTypedNode create(const T &Node)
Creates a DynTypedNode from Node.
__PTRDIFF_TYPE__ ptrdiff_t
A signed integer type that is the result of subtracting two pointers.
const internal::VariadicDynCastAllOfMatcher< Stmt, ForStmt > forStmt
Matches for statements.
ExceptionSpecificationType getExceptionSpecType() const
Get the kind of exception specification on this function.
Represents a pointer type decayed from an array or function type.
BoundNodesTreeBuilder BoundNodes
Defines various enumerations that describe declaration and type specifiers.
Base class for declarations which introduce a typedef-name.
ast_type_traits::DynTypedNode Node
const internal::VariadicDynCastAllOfMatcher< Decl, ObjCImplementationDecl > objcImplementationDecl
Matches Objective-C implementation declarations.
Represents a template argument.
const internal::VariadicDynCastAllOfMatcher< Stmt, CompoundLiteralExpr > compoundLiteralExpr
Matches compound (i.e.
Dataflow Directional Tag Classes.
DeclContext - This is used only as base class of specific decl types that can act as declaration cont...
const internal::VariadicDynCastAllOfMatcher< Stmt, AtomicExpr > atomicExpr
Matches atomic builtins.
const internal::VariadicDynCastAllOfMatcher< Decl, StaticAssertDecl > staticAssertDecl
Matches a C++ static_assert declaration.
const AstTypeMatcher< ElaboratedType > elaboratedType
Matches types specified with an elaborated type keyword or with a qualified name. ...
const internal::VariadicDynCastAllOfMatcher< Stmt, ParenListExpr > parenListExpr
Matches paren list expressions.
const internal::VariadicDynCastAllOfMatcher< Decl, CXXConversionDecl > cxxConversionDecl
Matches conversion operator declarations.
const internal::VariadicAllOfMatcher< TemplateArgument > templateArgument
Matches template arguments.
const internal::VariadicDynCastAllOfMatcher< Decl, ObjCProtocolDecl > objcProtocolDecl
Matches Objective-C protocol declarations.
const AstTypeMatcher< DecayedType > decayedType
Matches decayed type Example matches i[] in declaration of f.
const internal::VariadicDynCastAllOfMatcher< Decl, CXXRecordDecl > cxxRecordDecl
Matches C++ class declarations.
const internal::VariadicDynCastAllOfMatcher< Stmt, CXXDefaultArgExpr > cxxDefaultArgExpr
Matches the value of a default argument at the call site.
This template specialization was instantiated from a template due to an explicit instantiation declar...
Represents a dependent using declaration which was marked with typename.
const internal::VariadicDynCastAllOfMatcher< Decl, UnresolvedUsingValueDecl > unresolvedUsingValueDecl
Matches unresolved using value declarations.
const internal::VariadicDynCastAllOfMatcher< Stmt, NullStmt > nullStmt
Matches null statements.
A pointer to member type per C++ 8.3.3 - Pointers to members.
ExplicitCastExpr - An explicit cast written in the source code.
internal::Matcher< CXXCtorInitializer > CXXCtorInitializerMatcher
body_iterator body_begin()
Expr * IgnoreParenImpCasts() LLVM_READONLY
IgnoreParenImpCasts - Ignore parentheses and implicit casts.
SwitchStmt - This represents a 'switch' stmt.
FileID getFileID(SourceLocation SpellingLoc) const
Return the FileID for a SourceLocation.
Complex values, per C99 6.2.5p11.
ArraySubscriptExpr - [C99 6.5.2.1] Array Subscripting.
AbstractConditionalOperator - An abstract base class for ConditionalOperator and BinaryConditionalOpe...
Represents a C++ base or member initializer.
This template specialization was declared or defined by an explicit specialization (C++ [temp...
AST_MATCHER_P_OVERLOAD(CXXRecordDecl, isDerivedFrom, std::string, BaseName, 1)
Overloaded method as shortcut for isDerivedFrom(hasName(...)).
const internal::VariadicDynCastAllOfMatcher< Stmt, LambdaExpr > lambdaExpr
Matches lambda expressions.
const internal::VariadicDynCastAllOfMatcher< Stmt, CXXNewExpr > cxxNewExpr
Matches new expressions.
Base for LValueReferenceType and RValueReferenceType.
The template argument is a type.
const internal::VariadicDynCastAllOfMatcher< Stmt, InitListExpr > initListExpr
Matches init list expressions.
const internal::VariadicDynCastAllOfMatcher< Stmt, CXXDeleteExpr > cxxDeleteExpr
Matches delete expressions.
AST_POLYMORPHIC_MATCHER(isExpansionInMainFile, AST_POLYMORPHIC_SUPPORTED_TYPES(Decl, Stmt, TypeLoc))
Matches AST nodes that were expanded within the main-file.
const internal::VariadicDynCastAllOfMatcher< Stmt, ContinueStmt > continueStmt
Matches continue statements.
const internal::VariadicDynCastAllOfMatcher< Decl, EnumConstantDecl > enumConstantDecl
Matches enum constants.
const internal::VariadicDynCastAllOfMatcher< Stmt, ObjCAtCatchStmt > objcCatchStmt
Matches Objective-C statements.
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.
Describes an explicit type conversion that uses functional notion but could not be resolved because o...
const internal::VariadicDynCastAllOfMatcher< Stmt, UnaryOperator > unaryOperator
Matches unary operator expressions.
const internal::VariadicDynCastAllOfMatcher< Stmt, CharacterLiteral > characterLiteral
Matches character literals (also matches wchar_t).
Defines the C++ Decl subclasses, other than those for templates (found in DeclTemplate.h) and friends (in DeclFriend.h).
MemberExpr - [C99 6.5.2.3] Structure and Union Members.
const internal::VariadicDynCastAllOfMatcher< Stmt, CXXTemporaryObjectExpr > cxxTemporaryObjectExpr
Matches functional cast expressions having N != 1 arguments.
const internal::VariadicDynCastAllOfMatcher< Decl, CXXConstructorDecl > cxxConstructorDecl
Matches C++ constructor declarations.
Represents a C++ struct/union/class.
The template argument is a template name that was provided for a template template parameter...
BinaryConditionalOperator - The GNU extension to the conditional operator which allows the middle ope...
CXXCatchStmt - This represents a C++ catch block.
const internal::VariadicDynCastAllOfMatcher< Stmt, ImplicitCastExpr > implicitCastExpr
Matches the implicit cast nodes of Clang's AST.
const internal::VariadicAllOfMatcher< NestedNameSpecifier > nestedNameSpecifier
Matches nested name specifiers.
const internal::VariadicDynCastAllOfMatcher< Stmt, CXXBoolLiteralExpr > cxxBoolLiteral
Matches bool literals.
WhileStmt - This represents a 'while' stmt.
internal::Matcher< NamedDecl > hasName(const std::string &Name)
Matches NamedDecl nodes that have the specified name.
internal::Matcher< NestedNameSpecifierLoc > NestedNameSpecifierLocMatcher
Declaration of a class template.
const internal::VariadicDynCastAllOfMatcher< Stmt, StmtExpr > stmtExpr
Matches statement expression (GNU extension).
const AstTypeMatcher< ObjCObjectPointerType > objcObjectPointerType
Matches an Objective-C object pointer type, which is different from a pointer type, despite being syntactically similar.
const internal::VariadicDynCastAllOfMatcher< Decl, AccessSpecDecl > accessSpecDecl
Matches C++ access specifier declarations.
const AstTypeMatcher< TemplateTypeParmType > templateTypeParmType
Matches template type parameter types.
StringLiteral - This represents a string literal expression, e.g.
CallExpr - Represents a function call (C99 6.5.2.2, C++ [expr.call]).
__DEVICE__ int max(int __a, int __b)
internal::Matcher< TypeLoc > TypeLocMatcher
A reference to a declared variable, function, enum, etc.
Represents a type template specialization; the template must be a class template, a type alias templa...
const internal::VariadicDynCastAllOfMatcher< Stmt, CompoundStmt > compoundStmt
Matches compound statements.
const internal::VariadicDynCastAllOfMatcher< Stmt, StringLiteral > stringLiteral
Matches string literals (also matches wide string literals).
const internal::VariadicDynCastAllOfMatcher< Decl, BlockDecl > blockDecl
Matches block declarations.
AST_TYPELOC_TRAVERSE_MATCHER_DECL(hasElementType, getElement, AST_POLYMORPHIC_SUPPORTED_TYPES(ArrayType, ComplexType))
Matches arrays and C99 complex types that have a specific element type.
const AstTypeMatcher< ConstantArrayType > constantArrayType
Matches C arrays with a specified constant size.
bool matches(const til::SExpr *E1, const til::SExpr *E2)
bool isUnresolvedExceptionSpec(ExceptionSpecificationType ESpecType)
const internal::VariadicDynCastAllOfMatcher< Decl, CXXDestructorDecl > cxxDestructorDecl
Matches explicit C++ destructor declarations.
This represents a decl that may have a name.
A boolean literal, per ([C++ lex.bool] Boolean literals).
Represents a C array with a specified size that is not an integer-constant-expression.
Automatic storage duration (most local variables).
const AstTypeMatcher< ReferenceType > referenceType
Matches both lvalue and rvalue reference types.
attr::Kind getKind() const
const internal::VariadicDynCastAllOfMatcher< Stmt, ObjCMessageExpr > objcMessageExpr
Matches ObjectiveC Message invocation expressions.
const internal::VariadicDynCastAllOfMatcher< Decl, DeclaratorDecl > declaratorDecl
Matches declarator declarations (field, variable, function and non-type template parameter declaratio...
Matcher< ObjCMessageExpr > hasAnySelectorFunc(ArrayRef< const StringRef *> NameRefs)
Represents Objective-C's @autoreleasepool Statement.
Represents the canonical version of C arrays with a specified constant size.
This class handles loading and caching of source files into memory.
const AstTypeMatcher< LValueReferenceType > lValueReferenceType
Matches lvalue reference types.
Attr - This represents one attribute.
const internal::VariadicDynCastAllOfMatcher< Stmt, WhileStmt > whileStmt
Matches while statements.
const AstTypeMatcher< EnumType > enumType
Matches enum types.
Represents a shadow declaration introduced into a scope by a (resolved) using declaration.
internal::Matcher< Decl > DeclarationMatcher
Types of matchers for the top-level classes in the AST class hierarchy.
const AstTypeMatcher< BlockPointerType > blockPointerType
Matches block pointer types, i.e.
static bool isExternC(const NamedDecl *ND)