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));
630 internal::Matcher<ClassTemplateDecl>, InnerMatcher) {
632 return (Decl !=
nullptr &&
633 InnerMatcher.matches(*Decl, Finder, Builder));
639 return Node.isImplicit();
664 hasAnyTemplateArgument,
668 internal::Matcher<TemplateArgument>, InnerMatcher) {
670 internal::getTemplateSpecializationArgs(
Node);
671 return matchesFirstInRange(InnerMatcher, List.begin(), List.end(), Finder,
698 return InnerMatcher.matches(*
Node.IgnoreImplicit(), Finder, Builder);
727 internal::Matcher<Expr>, InnerMatcher) {
728 return InnerMatcher.matches(*
Node.IgnoreImpCasts(), Finder, Builder);
749 return InnerMatcher.matches(*
Node.IgnoreParenCasts(), Finder, Builder);
774 internal::Matcher<Expr>, InnerMatcher) {
775 return InnerMatcher.matches(*
Node.IgnoreParenImpCasts(), Finder, Builder);
790 internal::Matcher<QualType>, InnerMatcher) {
791 return InnerMatcher.matches(
Node.IgnoreParens(), Finder, Builder);
817 unsigned, N, internal::Matcher<TemplateArgument>, InnerMatcher) {
819 internal::getTemplateSpecializationArgs(
Node);
820 if (List.size() <= N)
822 return InnerMatcher.matches(List[N], Finder, Builder);
835 templateArgumentCountIs,
839 return internal::getTemplateSpecializationArgs(
Node).size() == N;
854 internal::Matcher<QualType>, InnerMatcher) {
857 return InnerMatcher.matches(
Node.getAsType(), Finder, Builder);
872 internal::Matcher<TemplateName>, InnerMatcher) {
875 return InnerMatcher.matches(
Node.getAsTemplate(), Finder, Builder);
892 internal::Matcher<Decl>, InnerMatcher) {
894 return InnerMatcher.matches(*
Node.getAsDecl(), Finder, Builder);
912 return InnerMatcher.matches(*
Node.getAsExpr(), Finder, Builder);
942 internal::Matcher<QualType>, InnerMatcher) {
945 return InnerMatcher.matches(
Node.getIntegralType(), Finder, Builder);
963 std::string,
Value) {
966 return Node.getAsIntegral().toString(10) ==
Value;
976 extern const internal::VariadicDynCastAllOfMatcher<Decl, ValueDecl>
valueDecl;
989 extern const internal::VariadicDynCastAllOfMatcher<Decl, CXXConstructorDecl>
1001 extern const internal::VariadicDynCastAllOfMatcher<Decl, CXXDestructorDecl>
1012 extern const internal::VariadicDynCastAllOfMatcher<Decl, EnumDecl>
enumDecl;
1022 extern const internal::VariadicDynCastAllOfMatcher<Decl, EnumConstantDecl>
1031 extern const internal::VariadicDynCastAllOfMatcher<Decl, CXXMethodDecl>
1040 extern const internal::VariadicDynCastAllOfMatcher<Decl, CXXConversionDecl>
1052 extern const internal::VariadicDynCastAllOfMatcher<Decl, VarDecl>
varDecl;
1062 extern const internal::VariadicDynCastAllOfMatcher<Decl, FieldDecl>
fieldDecl;
1070 extern const internal::VariadicDynCastAllOfMatcher<Decl, FunctionDecl>
1079 extern const internal::VariadicDynCastAllOfMatcher<Decl, FunctionTemplateDecl>
1090 extern const internal::VariadicDynCastAllOfMatcher<Decl, FriendDecl>
friendDecl;
1100 extern const internal::VariadicAllOfMatcher<Stmt>
stmt;
1110 extern const internal::VariadicDynCastAllOfMatcher<Stmt, DeclStmt>
declStmt;
1123 extern const internal::VariadicDynCastAllOfMatcher<Stmt, MemberExpr>
memberExpr;
1133 extern const internal::VariadicDynCastAllOfMatcher<Stmt, CallExpr>
callExpr;
1141 extern const internal::VariadicDynCastAllOfMatcher<Stmt, LambdaExpr>
lambdaExpr;
1150 extern const internal::VariadicDynCastAllOfMatcher<Stmt, CXXMemberCallExpr>
1162 extern const internal::VariadicDynCastAllOfMatcher<Stmt, ObjCMessageExpr>
1172 extern const internal::VariadicDynCastAllOfMatcher<Decl, ObjCInterfaceDecl>
1182 extern const internal::VariadicDynCastAllOfMatcher<Decl, ObjCImplementationDecl>
1192 extern const internal::VariadicDynCastAllOfMatcher<Decl, ObjCProtocolDecl>
1202 extern const internal::VariadicDynCastAllOfMatcher<Decl, ObjCCategoryDecl>
1212 extern const internal::VariadicDynCastAllOfMatcher<Decl, ObjCCategoryImplDecl>
1227 extern const internal::VariadicDynCastAllOfMatcher<Decl, ObjCMethodDecl>
1239 extern const internal::VariadicDynCastAllOfMatcher<Decl, ObjCIvarDecl>
1250 extern const internal::VariadicDynCastAllOfMatcher<Decl, ObjCPropertyDecl>
1259 extern const internal::VariadicDynCastAllOfMatcher<Stmt, ObjCAtThrowStmt>
1269 extern const internal::VariadicDynCastAllOfMatcher<Stmt, ObjCAtTryStmt>
1279 extern const internal::VariadicDynCastAllOfMatcher<Stmt, ObjCAtCatchStmt>
1289 extern const internal::VariadicDynCastAllOfMatcher<Stmt, ObjCAtFinallyStmt>
1299 extern const internal::VariadicDynCastAllOfMatcher<Stmt, ExprWithCleanups>
1312 extern const internal::VariadicDynCastAllOfMatcher<Stmt, InitListExpr>
1318 internal::Matcher<Expr>, InnerMatcher) {
1319 const Expr *SyntForm =
Node.getSyntacticForm();
1320 return (SyntForm !=
nullptr &&
1321 InnerMatcher.matches(*SyntForm, Finder, Builder));
1335 extern const internal::VariadicDynCastAllOfMatcher<
Stmt,
1347 extern const internal::VariadicDynCastAllOfMatcher<Stmt, ImplicitValueInitExpr>
1365 extern const internal::VariadicDynCastAllOfMatcher<Stmt, ParenListExpr>
1378 extern const internal::VariadicDynCastAllOfMatcher<Stmt,
1391 extern const internal::VariadicDynCastAllOfMatcher<Decl, UsingDecl>
usingDecl;
1402 extern const internal::VariadicDynCastAllOfMatcher<Decl, UsingDirectiveDecl>
1419 extern const internal::VariadicDynCastAllOfMatcher<Stmt, UnresolvedLookupExpr>
1433 extern const internal::VariadicDynCastAllOfMatcher<Decl,
1452 extern const internal::VariadicDynCastAllOfMatcher<Decl,
1463 extern const internal::VariadicDynCastAllOfMatcher<Stmt, ParenExpr>
parenExpr;
1475 extern const internal::VariadicDynCastAllOfMatcher<Stmt, CXXConstructExpr>
1486 extern const internal::VariadicDynCastAllOfMatcher<Stmt,
1500 extern const internal::VariadicDynCastAllOfMatcher<Stmt, CXXThisExpr>
1511 extern const internal::VariadicDynCastAllOfMatcher<Stmt, CXXBindTemporaryExpr>
1532 extern const internal::VariadicDynCastAllOfMatcher<Stmt,
1544 extern const internal::VariadicDynCastAllOfMatcher<Stmt, CXXNewExpr>
cxxNewExpr;
1554 extern const internal::VariadicDynCastAllOfMatcher<Stmt, CXXDeleteExpr>
1565 extern const internal::VariadicDynCastAllOfMatcher<Stmt, ArraySubscriptExpr>
1577 extern const internal::VariadicDynCastAllOfMatcher<Stmt, CXXDefaultArgExpr>
1594 extern const internal::VariadicDynCastAllOfMatcher<Stmt, CXXOperatorCallExpr>
1603 extern const internal::VariadicDynCastAllOfMatcher<Stmt, Expr>
expr;
1612 extern const internal::VariadicDynCastAllOfMatcher<Stmt, DeclRefExpr>
1621 extern const internal::VariadicDynCastAllOfMatcher<Stmt, IfStmt>
ifStmt;
1630 extern const internal::VariadicDynCastAllOfMatcher<Stmt, ForStmt>
forStmt;
1642 const Stmt *
const Increment =
Node.getInc();
1643 return (Increment !=
nullptr &&
1644 InnerMatcher.matches(*Increment, Finder, Builder));
1657 const Stmt *
const Init =
Node.getInit();
1658 return (Init !=
nullptr && InnerMatcher.matches(*Init, Finder, Builder));
1668 extern const internal::VariadicDynCastAllOfMatcher<Stmt, CXXForRangeStmt>
1681 const VarDecl *
const Var =
Node.getLoopVariable();
1682 return (Var !=
nullptr && InnerMatcher.matches(*Var, Finder, Builder));
1695 const Expr *
const Init =
Node.getRangeInit();
1696 return (Init !=
nullptr && InnerMatcher.matches(*Init, Finder, Builder));
1707 extern const internal::VariadicDynCastAllOfMatcher<Stmt, WhileStmt>
whileStmt;
1717 extern const internal::VariadicDynCastAllOfMatcher<Stmt, DoStmt>
doStmt;
1727 extern const internal::VariadicDynCastAllOfMatcher<Stmt, BreakStmt>
breakStmt;
1737 extern const internal::VariadicDynCastAllOfMatcher<Stmt, ContinueStmt>
1748 extern const internal::VariadicDynCastAllOfMatcher<Stmt, ReturnStmt>
returnStmt;
1759 extern const internal::VariadicDynCastAllOfMatcher<Stmt, GotoStmt>
gotoStmt;
1770 extern const internal::VariadicDynCastAllOfMatcher<Stmt, LabelStmt>
labelStmt;
1782 extern const internal::VariadicDynCastAllOfMatcher<Stmt, AddrLabelExpr>
1793 extern const internal::VariadicDynCastAllOfMatcher<Stmt, SwitchStmt>
switchStmt;
1803 extern const internal::VariadicDynCastAllOfMatcher<Stmt, SwitchCase>
switchCase;
1813 extern const internal::VariadicDynCastAllOfMatcher<Stmt, CaseStmt>
caseStmt;
1823 extern const internal::VariadicDynCastAllOfMatcher<Stmt, DefaultStmt>
1832 extern const internal::VariadicDynCastAllOfMatcher<Stmt, CompoundStmt>
1842 extern const internal::VariadicDynCastAllOfMatcher<Stmt, CXXCatchStmt>
1852 extern const internal::VariadicDynCastAllOfMatcher<Stmt, CXXTryStmt>
cxxTryStmt;
1861 extern const internal::VariadicDynCastAllOfMatcher<Stmt, CXXThrowExpr>
1871 extern const internal::VariadicDynCastAllOfMatcher<Stmt, NullStmt>
nullStmt;
1881 extern const internal::VariadicDynCastAllOfMatcher<Stmt, AsmStmt>
asmStmt;
1889 extern const internal::VariadicDynCastAllOfMatcher<Stmt, CXXBoolLiteralExpr>
1899 extern const internal::VariadicDynCastAllOfMatcher<Stmt, StringLiteral>
1912 extern const internal::VariadicDynCastAllOfMatcher<Stmt, CharacterLiteral>
1919 extern const internal::VariadicDynCastAllOfMatcher<Stmt, IntegerLiteral>
1929 extern const internal::VariadicDynCastAllOfMatcher<Stmt, FloatingLiteral>
1935 extern const internal::VariadicDynCastAllOfMatcher<Stmt, UserDefinedLiteral>
1945 extern const internal::VariadicDynCastAllOfMatcher<Stmt, CompoundLiteralExpr>
1949 extern const internal::VariadicDynCastAllOfMatcher<Stmt, CXXNullPtrLiteralExpr>
1953 extern const internal::VariadicDynCastAllOfMatcher<Stmt, GNUNullExpr>
1961 extern const internal::VariadicDynCastAllOfMatcher<Stmt, AtomicExpr>
atomicExpr;
1969 extern const internal::VariadicDynCastAllOfMatcher<Stmt, StmtExpr>
stmtExpr;
1977 extern const internal::VariadicDynCastAllOfMatcher<Stmt, BinaryOperator>
1986 extern const internal::VariadicDynCastAllOfMatcher<Stmt, UnaryOperator>
1995 extern const internal::VariadicDynCastAllOfMatcher<Stmt, ConditionalOperator>
2004 extern const internal::VariadicDynCastAllOfMatcher<Stmt,
2016 extern const internal::VariadicDynCastAllOfMatcher<Stmt, OpaqueValueExpr>
2032 extern const internal::VariadicDynCastAllOfMatcher<Decl, StaticAssertDecl>
2045 extern const internal::VariadicDynCastAllOfMatcher<Stmt, CXXReinterpretCastExpr>
2061 extern const internal::VariadicDynCastAllOfMatcher<Stmt, CXXStaticCastExpr>
2076 extern const internal::VariadicDynCastAllOfMatcher<Stmt, CXXDynamicCastExpr>
2087 extern const internal::VariadicDynCastAllOfMatcher<Stmt, CXXConstCastExpr>
2096 extern const internal::VariadicDynCastAllOfMatcher<Stmt, CStyleCastExpr>
2120 extern const internal::VariadicDynCastAllOfMatcher<Stmt, ExplicitCastExpr>
2127 extern const internal::VariadicDynCastAllOfMatcher<Stmt, ImplicitCastExpr>
2143 extern const internal::VariadicDynCastAllOfMatcher<Stmt, CastExpr>
castExpr;
2153 extern const internal::VariadicDynCastAllOfMatcher<Stmt, CXXFunctionalCastExpr>
2162 extern const internal::VariadicDynCastAllOfMatcher<Stmt, CXXTemporaryObjectExpr>
2171 extern const internal::VariadicDynCastAllOfMatcher<Stmt, PredefinedExpr>
2180 extern const internal::VariadicDynCastAllOfMatcher<Stmt, DesignatedInitExpr>
2195 return Node.size() == N;
2199 extern const internal::VariadicAllOfMatcher<QualType>
qualType;
2202 extern const internal::VariadicAllOfMatcher<Type>
type;
2205 extern const internal::VariadicAllOfMatcher<TypeLoc>
typeLoc;
2226 extern const internal::VariadicOperatorMatcherFunc<
2233 extern const internal::VariadicOperatorMatcherFunc<
2240 extern const internal::VariadicOperatorMatcherFunc<
2253 extern const internal::VariadicDynCastAllOfMatcher<Stmt,
2266 internal::Matcher<QualType>, InnerMatcher) {
2267 const QualType ArgumentType =
Node.getTypeOfArgument();
2268 return InnerMatcher.matches(ArgumentType, Finder, Builder);
2287 const internal::Matcher<UnaryExprOrTypeTraitExpr> &InnerMatcher) {
2295 const internal::Matcher<UnaryExprOrTypeTraitExpr> &InnerMatcher) {
2315 inline internal::Matcher<NamedDecl>
hasName(
const std::string &Name) {
2316 std::vector<std::string> Names;
2317 Names.push_back(Name);
2318 return internal::Matcher<NamedDecl>(
new internal::HasNameMatcher(Names));
2331 extern const internal::VariadicFunction<internal::Matcher<NamedDecl>, StringRef,
2352 assert(!RegExp.empty());
2353 std::string FullNameString =
"::" +
Node.getQualifiedNameAsString();
2354 llvm::Regex RE(RegExp);
2355 return RE.match(FullNameString);
2377 inline internal::PolymorphicMatcherWithParam1<
2378 internal::HasOverloadedOperatorNameMatcher, StringRef,
2381 return internal::PolymorphicMatcherWithParam1<
2382 internal::HasOverloadedOperatorNameMatcher, StringRef,
2408 internal::Matcher<NamedDecl>,
Base) {
2409 return Finder->classIsDerivedFrom(&
Node,
Base, Builder);
2414 assert(!BaseName.empty());
2415 return isDerivedFrom(
hasName(BaseName)).matches(
Node, Finder, Builder);
2421 internal::Matcher<NamedDecl>,
Base, 0) {
2422 return Matcher<CXXRecordDecl>(
anyOf(
Base, isDerivedFrom(
Base)))
2430 assert(!BaseName.empty());
2431 return isSameOrDerivedFrom(
hasName(BaseName)).matches(
Node, Finder, Builder);
2447 return matchesFirstInPointerRange(InnerMatcher,
Node.method_begin(),
2448 Node.method_end(), Finder, Builder);
2461 return Node.isLambda();
2482 extern const internal::ArgumentAdaptingMatcherFunc<internal::HasMatcher>
has;
2498 extern const internal::ArgumentAdaptingMatcherFunc<
2499 internal::HasDescendantMatcher>
2519 extern const internal::ArgumentAdaptingMatcherFunc<internal::ForEachMatcher>
2548 extern const internal::ArgumentAdaptingMatcherFunc<
2549 internal::ForEachDescendantMatcher>
2568 template <
typename T>
2569 internal::Matcher<T>
findAll(
const internal::Matcher<T> &Matcher) {
2583 extern const internal::ArgumentAdaptingMatcherFunc<
2584 internal::HasParentMatcher,
2585 internal::TypeList<Decl, NestedNameSpecifierLoc, Stmt, TypeLoc>,
2586 internal::TypeList<Decl, NestedNameSpecifierLoc, Stmt, TypeLoc>>
2600 extern const internal::ArgumentAdaptingMatcherFunc<
2601 internal::HasAncestorMatcher,
2602 internal::TypeList<Decl, NestedNameSpecifierLoc, Stmt, TypeLoc>,
2603 internal::TypeList<Decl, NestedNameSpecifierLoc, Stmt, TypeLoc>>
2615 extern const internal::VariadicOperatorMatcherFunc<1, 1>
unless;
2650 inline internal::PolymorphicMatcherWithParam1<
2651 internal::HasDeclarationMatcher, internal::Matcher<Decl>,
2652 void(internal::HasDeclarationSupportedTypes)>
2654 return internal::PolymorphicMatcherWithParam1<
2655 internal::HasDeclarationMatcher, internal::Matcher<Decl>,
2656 void(internal::HasDeclarationSupportedTypes)>(InnerMatcher);
2674 return UnderlyingDecl !=
nullptr &&
2675 InnerMatcher.matches(*UnderlyingDecl, Finder, Builder);
2690 const Expr *ExprNode =
Node.getImplicitObjectArgument()
2691 ->IgnoreParenImpCasts();
2692 return (ExprNode !=
nullptr &&
2693 InnerMatcher.matches(*ExprNode, Finder, Builder));
2710 return InnerMatcher.matches(TypeDecl, Finder, Builder);
2736 assert(!RegExp.empty());
2737 std::string SelectorString =
Node.getSelector().getAsString();
2738 llvm::Regex RE(RegExp);
2739 return RE.match(SelectorString);
2747 return Node.getSelector().isNull();
2759 return Node.getSelector().isUnarySelector();
2775 return Node.getSelector().isKeywordSelector();
2790 return Node.getSelector().getNumArgs() == N;
2811 const Expr *ExprNode =
Node.getCallee();
2812 return (ExprNode !=
nullptr &&
2813 InnerMatcher.matches(*ExprNode, Finder, Builder));
2843 internal::Matcher<QualType>, InnerMatcher, 0) {
2868 internal::Matcher<Decl>, InnerMatcher, 1) {
2870 .matches(
Node.getType(), Finder, Builder);
2883 if (!
Node.getTypeSourceInfo())
2886 return Inner.matches(
Node.getTypeSourceInfo()->getTypeLoc(), Finder, Builder);
2899 return Name ==
Node.getAsString();
2913 QualType, pointsTo, internal::Matcher<QualType>,
2915 return (!
Node.isNull() &&
Node->isAnyPointerType() &&
2916 InnerMatcher.matches(
Node->getPointeeType(), Finder, Builder));
2923 .matches(
Node, Finder, Builder);
2938 return InnerMatcher.matches(*
Node.getUnqualifiedDesugaredType(), Finder,
2957 return (!
Node.isNull() &&
Node->isReferenceType() &&
2958 InnerMatcher.matches(
Node->getPointeeType(), Finder, Builder));
2977 return InnerMatcher.matches(
Node.getCanonicalType(), Finder, Builder);
2984 .matches(
Node, Finder, Builder);
2988 internal::Matcher<Expr>, InnerMatcher) {
2989 const Expr *ExprNode =
Node.getImplicitObjectArgument();
2990 return (ExprNode !=
nullptr &&
2991 InnerMatcher.matches(*ExprNode, Finder, Builder));
2997 internal::Matcher<QualType>, InnerMatcher, 0) {
2998 return onImplicitObjectArgument(
2999 anyOf(hasType(InnerMatcher), hasType(pointsTo(InnerMatcher))))
3000 .matches(
Node, Finder, Builder);
3005 internal::Matcher<Decl>, InnerMatcher, 1) {
3006 return onImplicitObjectArgument(
3007 anyOf(hasType(InnerMatcher), hasType(pointsTo(InnerMatcher))))
3008 .matches(
Node, Finder, Builder);
3022 const Decl *DeclNode =
Node.getDecl();
3023 return (DeclNode !=
nullptr &&
3024 InnerMatcher.matches(*DeclNode, Finder, Builder));
3042 internal::Matcher<UsingShadowDecl>, InnerMatcher) {
3045 return InnerMatcher.matches(*
UsingDecl, Finder, Builder);
3066 return matchesFirstInPointerRange(InnerMatcher,
Node.decls_begin(),
3067 Node.decls_end(), Finder, Builder);
3080 if (
Node.isSingleDecl()) {
3081 const Decl *FoundDecl =
Node.getSingleDecl();
3082 return InnerMatcher.matches(*FoundDecl, Finder, Builder);
3096 VarDecl, hasInitializer, internal::Matcher<Expr>,
3098 const Expr *Initializer =
Node.getAnyInitializer();
3099 return (Initializer !=
nullptr &&
3100 InnerMatcher.matches(*Initializer, Finder, Builder));
3115 return Node.hasLocalStorage();
3129 return Node.hasGlobalStorage();
3196 return Node.isExceptionVariable();
3212 return Node.getNumArgs() == N;
3227 unsigned, N, internal::Matcher<Expr>, InnerMatcher) {
3228 return (N <
Node.getNumArgs() &&
3229 InnerMatcher.matches(
3230 *
Node.getArg(N)->IgnoreParenImpCasts(), Finder, Builder));
3268 internal::Matcher<Decl>, InnerMatcher) {
3273 std::advance(Iterator, N);
3274 return InnerMatcher.matches(**Iterator, Finder, Builder);
3291 return Node.getExceptionDecl() ==
nullptr;
3308 internal::Matcher<CXXCtorInitializer>, InnerMatcher) {
3309 return matchesFirstInPointerRange(InnerMatcher,
Node.init_begin(),
3310 Node.init_end(), Finder, Builder);
3327 internal::Matcher<FieldDecl>, InnerMatcher) {
3329 return (NodeAsDecl !=
nullptr &&
3330 InnerMatcher.matches(*NodeAsDecl, Finder, Builder));
3347 internal::Matcher<Expr>, InnerMatcher) {
3348 const Expr* NodeAsExpr =
Node.getInit();
3349 return (NodeAsExpr !=
nullptr &&
3350 InnerMatcher.matches(*NodeAsExpr, Finder, Builder));
3367 return Node.isWritten();
3387 return Node.isBaseInitializer();
3407 return Node.isMemberInitializer();
3424 internal::Matcher<Expr>, InnerMatcher) {
3425 for (
const Expr *Arg :
Node.arguments()) {
3426 BoundNodesTreeBuilder Result(*Builder);
3427 if (InnerMatcher.matches(*Arg, Finder, &Result)) {
3428 *Builder = std::move(Result);
3437 return Node.isListInitialization();
3453 return Node.requiresZeroInitialization();
3467 unsigned, N, internal::Matcher<ParmVarDecl>,
3469 return (N <
Node.getNumParams() &&
3470 InnerMatcher.matches(
3471 *
Node.getParamDecl(N), Finder, Builder));
3495 internal::Matcher<Expr>, ArgMatcher,
3496 internal::Matcher<ParmVarDecl>, ParamMatcher) {
3497 BoundNodesTreeBuilder Result;
3501 BoundNodesTreeBuilder Matches;
3503 .matches(
Node, Finder, &Matches)
3507 bool Matched =
false;
3508 for (; ArgIndex <
Node.getNumArgs(); ++ArgIndex) {
3509 BoundNodesTreeBuilder ArgMatches(*Builder);
3510 if (ArgMatcher.matches(*(
Node.getArg(ArgIndex)->IgnoreParenCasts()),
3511 Finder, &ArgMatches)) {
3512 BoundNodesTreeBuilder ParamMatches(ArgMatches);
3514 hasParameter(ParamIndex, ParamMatcher)))),
3516 hasParameter(ParamIndex, ParamMatcher))))))
3518 Result.addMatch(ParamMatches);
3524 *Builder = std::move(Result);
3541 internal::Matcher<ParmVarDecl>, InnerMatcher) {
3542 return matchesFirstInPointerRange(InnerMatcher,
Node.param_begin(),
3543 Node.param_end(), Finder, Builder);
3567 return Node.getNumParams() == N;
3579 internal::Matcher<QualType>, InnerMatcher) {
3580 return InnerMatcher.matches(
Node.getReturnType(), Finder, Builder);
3600 return Node.isExternC();
3633 return Node.isDeleted();
3646 return Node.isDefaulted();
3668 return FnTy->hasDynamicExceptionSpec();
3699 return FnTy->
isNothrow(Finder->getASTContext());
3716 return Node.isConstexpr();
3730 internal::Matcher<Expr>, InnerMatcher) {
3731 const Expr *
const Condition =
Node.getCond();
3732 return (Condition !=
nullptr &&
3733 InnerMatcher.matches(*Condition, Finder, Builder));
3744 const Stmt *
const Then =
Node.getThen();
3745 return (Then !=
nullptr && InnerMatcher.matches(*Then, Finder, Builder));
3756 const Stmt *
const Else =
Node.getElse();
3757 return (Else !=
nullptr && InnerMatcher.matches(*Else, Finder, Builder));
3791 internal::NotEqualsBoundNodePredicate Predicate;
3794 return Builder->removeBindings(Predicate);
3806 internal::Matcher<DeclStmt>, InnerMatcher) {
3807 const DeclStmt*
const DeclarationStatement =
3808 Node.getConditionVariableDeclStmt();
3809 return DeclarationStatement !=
nullptr &&
3810 InnerMatcher.matches(*DeclarationStatement, Finder, Builder);
3823 internal::Matcher<Expr>, InnerMatcher) {
3824 if (
const Expr* Expression =
Node.getIdx())
3825 return InnerMatcher.matches(*Expression, Finder, Builder);
3840 internal::Matcher<Expr>, InnerMatcher) {
3841 if (
const Expr* Expression =
Node.getBase())
3842 return InnerMatcher.matches(*Expression, Finder, Builder);
3862 internal::Matcher<Stmt>, InnerMatcher) {
3863 const Stmt *
const Statement = internal::GetBodyMatcher<NodeType>::get(
Node);
3864 return (Statement !=
nullptr &&
3865 InnerMatcher.matches(*Statement, Finder, Builder));
3882 internal::Matcher<Stmt>, InnerMatcher) {
3884 return CS && matchesFirstInPointerRange(InnerMatcher, CS->
body_begin(),
3899 return Node.size() == N;
3927 template <
typename ValueT>
3928 internal::PolymorphicMatcherWithParam1<internal::ValueEqualsMatcher, ValueT>
3930 return internal::PolymorphicMatcherWithParam1<
3931 internal::ValueEqualsMatcher,
3940 return internal::ValueEqualsMatcher<NodeType, ParamT>(
Value)
3948 unsigned,
Value, 1) {
3949 return internal::ValueEqualsMatcher<NodeType, ParamT>(
Value)
3959 return internal::ValueEqualsMatcher<NodeType, ParamT>(
Value)
3973 std::string, Name) {
3974 return Name ==
Node.getOpcodeStr(
Node.getOpcode());
3986 internal::Matcher<Expr>, InnerMatcher) {
3987 const Expr *LeftHandSide =
Node.getLHS();
3988 return (LeftHandSide !=
nullptr &&
3989 InnerMatcher.matches(*LeftHandSide, Finder, Builder));
4001 internal::Matcher<Expr>, InnerMatcher) {
4002 const Expr *RightHandSide =
Node.getRHS();
4003 return (RightHandSide !=
nullptr &&
4004 InnerMatcher.matches(*RightHandSide, Finder, Builder));
4010 const internal::Matcher<Expr> &InnerMatcher) {
4011 return anyOf(hasLHS(InnerMatcher), hasRHS(InnerMatcher));
4022 internal::Matcher<Expr>, InnerMatcher) {
4023 const Expr *
const Operand =
Node.getSubExpr();
4024 return (Operand !=
nullptr &&
4025 InnerMatcher.matches(*Operand, Finder, Builder));
4046 internal::Matcher<Expr>, InnerMatcher) {
4047 const Expr *
const SubExpression =
4048 internal::GetSourceExpressionMatcher<NodeType>::get(
Node);
4049 return (SubExpression !=
nullptr &&
4050 InnerMatcher.matches(*SubExpression, Finder, Builder));
4069 internal::Matcher<QualType>, InnerMatcher) {
4071 return InnerMatcher.matches(NodeType, Finder, Builder);
4079 internal::Matcher<QualType>, InnerMatcher) {
4080 return InnerMatcher.matches(
Node.getType(), Finder, Builder);
4092 return Node.isStruct();
4104 return Node.isUnion();
4116 return Node.isClass();
4131 internal::Matcher<Expr>, InnerMatcher) {
4132 const Expr *Expression =
Node.getTrueExpr();
4133 return (Expression !=
nullptr &&
4134 InnerMatcher.matches(*Expression, Finder, Builder));
4146 internal::Matcher<Expr>, InnerMatcher) {
4147 const Expr *Expression =
Node.getFalseExpr();
4148 return (Expression !=
nullptr &&
4149 InnerMatcher.matches(*Expression, Finder, Builder));
4176 return Node.isThisDeclarationADefinition();
4190 return Node.isVariadic();
4211 internal::Matcher<CXXRecordDecl>, InnerMatcher) {
4213 return (Parent !=
nullptr &&
4214 InnerMatcher.matches(*Parent, Finder, Builder));
4242 internal::Matcher<CXXMethodDecl>, InnerMatcher) {
4243 BoundNodesTreeBuilder Result;
4244 bool Matched =
false;
4245 for (
const auto *Overridden :
Node.overridden_methods()) {
4246 BoundNodesTreeBuilder OverriddenBuilder(*Builder);
4247 const bool OverriddenMatched =
4248 InnerMatcher.matches(*Overridden, Finder, &OverriddenBuilder);
4249 if (OverriddenMatched) {
4251 Result.addMatch(OverriddenBuilder);
4254 *Builder = std::move(Result);
4269 return Node.isVirtual();
4287 return Node.isVirtualAsWritten();
4308 return Node.template hasAttr<FinalAttr>();
4322 return Node.isPure();
4337 return Node.isConst();
4354 return Node.isCopyAssignmentOperator();
4371 return Node.isMoveAssignmentOperator();
4389 return Node.size_overridden_methods() > 0 ||
Node.hasAttr<OverrideAttr>();
4404 return Node.isUserProvided();
4423 return Node.isArrow();
4437 return Node->isIntegerType();
4451 return Node->isUnsignedIntegerType();
4465 return Node->isSignedIntegerType();
4479 return Node->isAnyCharacterType();
4499 return Node->isAnyPointerType();
4518 return Node.isConstQualified();
4537 return Node.isVolatileQualified();
4554 return Node.hasLocalQualifiers();
4570 internal::Matcher<ValueDecl>, InnerMatcher) {
4571 return InnerMatcher.matches(*
Node.getMemberDecl(), Finder, Builder);
4587 internal::Matcher<Expr>, InnerMatcher) {
4588 return InnerMatcher.matches(*
Node.getBase(), Finder, Builder);
4601 internal::Matcher<UsingShadowDecl>, InnerMatcher) {
4602 return matchesFirstInPointerRange(InnerMatcher,
Node.shadow_begin(),
4603 Node.shadow_end(), Finder, Builder);
4619 internal::Matcher<NamedDecl>, InnerMatcher) {
4620 return InnerMatcher.matches(*
Node.getTargetDecl(), Finder, Builder);
4650 Node.getTemplateSpecializationKind() ==
4712 internal::Matcher<QualType>, InnerMatcher, 0) {
4713 return internal::BindableMatcher<TypeLoc>(
4714 new internal::TypeLocTypeMatcher(InnerMatcher));
4726 return Node.isBooleanType();
4738 return Node.isVoidType();
4741 template <
typename NodeType>
4790 return Node.isRealFloatingType();
4843 return internal::HasSizeMatcher<NodeType>::hasSize(
Node, N);
4899 internal::Matcher<Expr>, InnerMatcher) {
4900 return InnerMatcher.matches(*
Node.getSizeExpr(), Finder, Builder);
5119 pointee, getPointee,
5240 internal::Matcher<NestedNameSpecifier>, InnerMatcher) {
5242 return InnerMatcher.matches(*Qualifier, Finder, Builder);
5264 return InnerMatcher.matches(
Node.getNamedType(), Finder, Builder);
5295 hasReplacementType, getReplacementType,
5334 return InnerType.matches(
Node.getDecayedType(), Finder, Builder);
5353 if (!DC)
return false;
5370 extern const internal::VariadicAllOfMatcher<NestedNameSpecifier>
5374 extern const internal::VariadicAllOfMatcher<NestedNameSpecifierLoc>
5380 internal::BindableMatcher<NestedNameSpecifierLoc>, loc,
5381 internal::Matcher<NestedNameSpecifier>, InnerMatcher, 1) {
5382 return internal::BindableMatcher<NestedNameSpecifierLoc>(
5383 new internal::LocMatcher<NestedNameSpecifierLoc, NestedNameSpecifier>(
5400 internal::Matcher<QualType>, InnerMatcher) {
5401 if (!
Node.getAsType())
5403 return InnerMatcher.matches(
QualType(
Node.getAsType(), 0), Finder, Builder);
5418 internal::Matcher<TypeLoc>, InnerMatcher) {
5419 return Node && InnerMatcher.matches(
Node.getTypeLoc(), Finder, Builder);
5432 internal::Matcher<NestedNameSpecifier>, InnerMatcher,
5437 return InnerMatcher.matches(*NextNode, Finder, Builder);
5450 internal::Matcher<NestedNameSpecifierLoc>, InnerMatcher,
5455 return InnerMatcher.matches(NextNode, Finder, Builder);
5469 internal::Matcher<NamespaceDecl>, InnerMatcher) {
5470 if (!
Node.getAsNamespace())
5472 return InnerMatcher.matches(*
Node.getAsNamespace(), Finder, Builder);
5483 return &
Node == Other;
5489 return &
Node == Other;
5495 return &
Node == Other;
5513 BoundNodesTreeBuilder Result;
5518 bool Matched =
false;
5520 SC = SC->getNextSwitchCase()) {
5521 BoundNodesTreeBuilder CaseBuilder(*Builder);
5522 bool CaseMatched = InnerMatcher.matches(*SC, Finder, &CaseBuilder);
5525 Result.addMatch(CaseBuilder);
5528 *Builder = std::move(Result);
5543 internal::Matcher<CXXCtorInitializer>, InnerMatcher) {
5544 BoundNodesTreeBuilder Result;
5545 bool Matched =
false;
5546 for (
const auto *I :
Node.inits()) {
5547 BoundNodesTreeBuilder InitBuilder(*Builder);
5548 if (InnerMatcher.matches(*I, Finder, &InitBuilder)) {
5550 Result.addMatch(InitBuilder);
5553 *Builder = std::move(Result);
5569 return Node.isCopyConstructor();
5584 return Node.isMoveConstructor();
5599 return Node.isDefaultConstructor();
5616 return Node.isDelegatingConstructor();
5636 return Node.isExplicit();
5657 if (
const auto *FD = dyn_cast<FunctionDecl>(&
Node))
5658 return FD->isInlineSpecified();
5659 else if (
const auto *NSD = dyn_cast<NamespaceDecl>(&
Node))
5660 return NSD->isInline();
5661 llvm_unreachable(
"Not a valid polymorphic type");
5674 return Node.isAnonymousNamespace();
5691 return InnerMatcher.matches(*
Node.getLHS(), Finder, Builder);
5704 for (
const auto *
Attr :
Node.attrs()) {
5723 if (
const auto *RetValue =
Node.getRetValue())
5724 return InnerMatcher.matches(*RetValue, Finder, Builder);
5734 extern const internal::VariadicDynCastAllOfMatcher<Stmt, CUDAKernelCallExpr>
5772 const auto &Parents = Finder->getASTContext().getParents(
Node);
5776 while(!Stack.empty()) {
5777 const auto &CurNode = Stack.back();
5779 if(
const auto *FuncDeclNode = CurNode.get<
FunctionDecl>()) {
5780 if(InnerMatcher.matches(*FuncDeclNode, Finder, Builder)) {
5783 }
else if(
const auto *LambdaExprNode = CurNode.get<
LambdaExpr>()) {
5784 if(InnerMatcher.matches(*LambdaExprNode->getCallOperator(),
5789 for(
const auto &
Parent: Finder->getASTContext().getParents(CurNode))
5817 return Node.hasExternalFormalLinkage();
5828 return Node.hasDefaultArg();
5840 return Node.isArray();
5852 return Node.isArray() &&
5853 InnerMatcher.matches(*
Node.getArraySize(), Finder, Builder);
5864 return Node.hasDefinition();
5870 #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.
An instance of this class is created to represent 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 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.
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.
NamespaceDecl - 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.
VarDecl - An instance of this class is created to represent 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.
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.
ParmVarDecl - 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.
RecordDecl - 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...
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.
FieldDecl - An instance of this class is created by Sema::ActOnField to represent a member of a struc...
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...
TypeDecl - 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.
bool isNothrow(const ASTContext &Ctx, bool ResultIfDependent=false) const
Determine whether this function type has a non-throwing exception specification.
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< 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.
ValueDecl - Represent the declaration of a variable (in which case it is an lvalue) a function (in wh...
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 FunctionProtoType * T
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.
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.
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...
AST_POLYMORPHIC_MATCHER_P_OVERLOAD(hasType, AST_POLYMORPHIC_SUPPORTED_TYPES(Expr, TypedefNameDecl, ValueDecl), internal::Matcher< QualType >, InnerMatcher, 0)
Matches if the expression's or declaration's type matches a type matcher.
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)"...
TagDecl - 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.
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.
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()
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.
char __ovld __cnfn max(char x, char y)
Returns y if x < y, otherwise it returns x.
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]).
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).
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.
NamedDecl - This represents a decl with 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...
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)