14 #ifndef LLVM_CLANG_AST_RECURSIVEASTVISITOR_H
15 #define LLVM_CLANG_AST_RECURSIVEASTVISITOR_H
17 #include <type_traits>
44 #define UNARYOP_LIST() \
45 OPERATOR(PostInc) OPERATOR(PostDec) OPERATOR(PreInc) OPERATOR(PreDec) \
46 OPERATOR(AddrOf) OPERATOR(Deref) OPERATOR(Plus) OPERATOR(Minus) \
47 OPERATOR(Not) OPERATOR(LNot) OPERATOR(Real) OPERATOR(Imag) \
48 OPERATOR(Extension) OPERATOR(Coawait)
51 #define BINOP_LIST() \
52 OPERATOR(PtrMemD) OPERATOR(PtrMemI) OPERATOR(Mul) OPERATOR(Div) \
53 OPERATOR(Rem) OPERATOR(Add) OPERATOR(Sub) OPERATOR(Shl) OPERATOR(Shr) \
54 OPERATOR(LT) OPERATOR(GT) OPERATOR(LE) OPERATOR(GE) OPERATOR(EQ) \
55 OPERATOR(NE) OPERATOR(And) OPERATOR(Xor) OPERATOR(Or) OPERATOR(LAnd) \
56 OPERATOR(LOr) OPERATOR(Assign) OPERATOR(Comma)
60 OPERATOR(Mul) OPERATOR(Div) OPERATOR(Rem) OPERATOR(Add) OPERATOR(Sub) \
61 OPERATOR(Shl) OPERATOR(Shr) OPERATOR(And) OPERATOR(Or) OPERATOR(Xor)
69 #define TRY_TO(CALL_EXPR) \
71 if (!getDerived().CALL_EXPR) \
151 Derived &
getDerived() {
return *
static_cast<Derived *
>(
this); }
293 #define ATTR_VISITOR_DECLS_ONLY
294 #include "clang/AST/AttrVisitor.inc"
295 #undef ATTR_VISITOR_DECLS_ONLY
300 template<
typename T,
typename U>
301 struct has_same_member_pointer_type : std::false_type {};
302 template<
typename T,
typename U,
typename R,
typename...
P>
303 struct has_same_member_pointer_type<R (T::*)(P...), R (U::*)(P...)>
311 #define TRAVERSE_STMT_BASE(NAME, CLASS, VAR, QUEUE) \
312 (has_same_member_pointer_type<decltype( \
313 &RecursiveASTVisitor::Traverse##NAME), \
314 decltype(&Derived::Traverse##NAME)>::value \
315 ? static_cast<typename std::conditional< \
316 has_same_member_pointer_type< \
317 decltype(&RecursiveASTVisitor::Traverse##NAME), \
318 decltype(&Derived::Traverse##NAME)>::value, \
319 Derived &, RecursiveASTVisitor &>::type>(*this) \
320 .Traverse##NAME(static_cast<CLASS *>(VAR), QUEUE) \
321 : getDerived().Traverse##NAME(static_cast<CLASS *>(VAR)))
326 #define TRY_TO_TRAVERSE_OR_ENQUEUE_STMT(S) \
328 if (!TRAVERSE_STMT_BASE(Stmt, Stmt, S, Queue)) \
334 #define ABSTRACT_STMT(STMT)
335 #define STMT(CLASS, PARENT) \
336 bool Traverse##CLASS(CLASS *S, DataRecursionQueue *Queue = nullptr);
337 #include "clang/AST/StmtNodes.inc"
343 #define STMT(CLASS, PARENT) \
344 bool WalkUpFrom##CLASS(CLASS *S) { \
345 TRY_TO(WalkUpFrom##PARENT(S)); \
346 TRY_TO(Visit##CLASS(S)); \
349 bool Visit##CLASS(CLASS *S) { return true; }
350 #include "clang/AST/StmtNodes.inc"
355 #define OPERATOR(NAME) \
356 bool TraverseUnary##NAME(UnaryOperator *S, \
357 DataRecursionQueue *Queue = nullptr) { \
358 TRY_TO(WalkUpFromUnary##NAME(S)); \
359 TRY_TO_TRAVERSE_OR_ENQUEUE_STMT(S->getSubExpr()); \
362 bool WalkUpFromUnary##NAME(UnaryOperator *S) { \
363 TRY_TO(WalkUpFromUnaryOperator(S)); \
364 TRY_TO(VisitUnary##NAME(S)); \
367 bool VisitUnary##NAME(UnaryOperator *S) { return true; }
375 #define GENERAL_BINOP_FALLBACK(NAME, BINOP_TYPE) \
376 bool TraverseBin##NAME(BINOP_TYPE *S, DataRecursionQueue *Queue = nullptr) { \
377 if (!getDerived().shouldTraversePostOrder()) \
378 TRY_TO(WalkUpFromBin##NAME(S)); \
379 TRY_TO_TRAVERSE_OR_ENQUEUE_STMT(S->getLHS()); \
380 TRY_TO_TRAVERSE_OR_ENQUEUE_STMT(S->getRHS()); \
383 bool WalkUpFromBin##NAME(BINOP_TYPE *S) { \
384 TRY_TO(WalkUpFrom##BINOP_TYPE(S)); \
385 TRY_TO(VisitBin##NAME(S)); \
388 bool VisitBin##NAME(BINOP_TYPE *S) { return true; }
390 #define OPERATOR(NAME) GENERAL_BINOP_FALLBACK(NAME, BinaryOperator)
398 #define OPERATOR(NAME) \
399 GENERAL_BINOP_FALLBACK(NAME##Assign, CompoundAssignOperator)
403 #undef GENERAL_BINOP_FALLBACK
409 #define ABSTRACT_TYPE(CLASS, BASE)
410 #define TYPE(CLASS, BASE) bool Traverse##CLASS##Type(CLASS##Type *T);
411 #include "clang/AST/TypeNodes.def"
417 #define TYPE(CLASS, BASE) \
418 bool WalkUpFrom##CLASS##Type(CLASS##Type *T) { \
419 TRY_TO(WalkUpFrom##BASE(T)); \
420 TRY_TO(Visit##CLASS##Type(T)); \
423 bool Visit##CLASS##Type(CLASS##Type *T) { return true; }
424 #include "clang/AST/TypeNodes.def"
430 #define ABSTRACT_TYPELOC(CLASS, BASE)
431 #define TYPELOC(CLASS, BASE) bool Traverse##CLASS##TypeLoc(CLASS##TypeLoc TL);
432 #include "clang/AST/TypeLocNodes.def"
451 #define TYPE(CLASS, BASE) \
452 bool WalkUpFrom##CLASS##TypeLoc(CLASS##TypeLoc TL) { \
453 TRY_TO(WalkUpFrom##BASE##Loc(TL)); \
454 TRY_TO(Visit##CLASS##TypeLoc(TL)); \
457 bool Visit##CLASS##TypeLoc(CLASS##TypeLoc TL) { return true; }
458 #include "clang/AST/TypeNodes.def"
463 #define ABSTRACT_DECL(DECL)
464 #define DECL(CLASS, BASE) bool Traverse##CLASS##Decl(CLASS##Decl *D);
465 #include "clang/AST/DeclNodes.inc"
471 #define DECL(CLASS, BASE) \
472 bool WalkUpFrom##CLASS##Decl(CLASS##Decl *D) { \
473 TRY_TO(WalkUpFrom##BASE(D)); \
474 TRY_TO(Visit##CLASS##Decl(D)); \
477 bool Visit##CLASS##Decl(CLASS##Decl *D) { return true; }
478 #include "clang/AST/DeclNodes.inc"
482 bool TraverseTemplateParameterListHelper(TemplateParameterList *TPL);
483 #define DEF_TRAVERSE_TMPL_INST(TMPLDECLKIND) \
484 bool TraverseTemplateInstantiations(TMPLDECLKIND##TemplateDecl *D);
488 #undef DEF_TRAVERSE_TMPL_INST
489 bool TraverseTemplateArgumentLocsHelper(
const TemplateArgumentLoc *TAL,
491 bool TraverseArrayTypeLocHelper(ArrayTypeLoc TL);
492 bool TraverseRecordHelper(RecordDecl *D);
493 bool TraverseCXXRecordHelper(CXXRecordDecl *D);
494 bool TraverseDeclaratorHelper(DeclaratorDecl *D);
495 bool TraverseDeclContextHelper(DeclContext *DC);
496 bool TraverseFunctionHelper(FunctionDecl *D);
497 bool TraverseVarHelper(VarDecl *D);
498 bool TraverseOMPExecutableDirective(OMPExecutableDirective *
S);
499 bool TraverseOMPLoopDirective(OMPLoopDirective *
S);
501 #define OPENMP_CLAUSE(Name, Class) bool Visit##Class(Class *C);
502 #include "clang/Basic/OpenMPKinds.def"
504 template <
typename T>
bool VisitOMPClauseList(T *
Node);
507 bool VisitOMPClauseWithPostUpdate(OMPClauseWithPostUpdate *
Node);
510 bool PostVisitStmt(
Stmt *
S);
513 template <
typename Derived>
514 bool RecursiveASTVisitor<Derived>::dataTraverseNode(
Stmt *
S,
515 DataRecursionQueue *Queue) {
516 #define DISPATCH_STMT(NAME, CLASS, VAR) \
517 return TRAVERSE_STMT_BASE(NAME, CLASS, VAR, Queue);
522 if (BinaryOperator *BinOp = dyn_cast<BinaryOperator>(S)) {
523 switch (BinOp->getOpcode()) {
524 #define OPERATOR(NAME) \
526 DISPATCH_STMT(Bin##NAME, BinaryOperator, S);
532 #define OPERATOR(NAME) \
533 case BO_##NAME##Assign: \
534 DISPATCH_STMT(Bin##NAME##Assign, CompoundAssignOperator, S);
540 }
else if (UnaryOperator *UnOp = dyn_cast<UnaryOperator>(S)) {
541 switch (UnOp->getOpcode()) {
542 #define OPERATOR(NAME) \
544 DISPATCH_STMT(Unary##NAME, UnaryOperator, S);
553 switch (S->getStmtClass()) {
554 case Stmt::NoStmtClass:
556 #define ABSTRACT_STMT(STMT)
557 #define STMT(CLASS, PARENT) \
558 case Stmt::CLASS##Class: \
559 DISPATCH_STMT(CLASS, CLASS, S);
560 #include "clang/AST/StmtNodes.inc"
569 template <
typename Derived>
570 bool RecursiveASTVisitor<Derived>::PostVisitStmt(
Stmt *S) {
571 switch (S->getStmtClass()) {
572 case Stmt::NoStmtClass:
574 #define ABSTRACT_STMT(STMT)
575 #define STMT(CLASS, PARENT) \
576 case Stmt::CLASS##Class: \
577 TRY_TO(WalkUpFrom##CLASS(static_cast<CLASS *>(S))); break;
578 #include "clang/AST/StmtNodes.inc"
586 template <
typename Derived>
593 Queue->push_back({
S,
false});
598 LocalQueue.push_back({
S,
false});
600 while (!LocalQueue.empty()) {
601 auto &CurrSAndVisited = LocalQueue.back();
602 Stmt *CurrS = CurrSAndVisited.getPointer();
603 bool Visited = CurrSAndVisited.getInt();
605 LocalQueue.pop_back();
606 TRY_TO(dataTraverseStmtPost(CurrS));
607 if (getDerived().shouldTraversePostOrder()) {
608 TRY_TO(PostVisitStmt(CurrS));
613 if (getDerived().dataTraverseStmtPre(CurrS)) {
614 CurrSAndVisited.setInt(
true);
615 size_t N = LocalQueue.size();
616 TRY_TO(dataTraverseNode(CurrS, &LocalQueue));
618 std::reverse(LocalQueue.begin() + N, LocalQueue.end());
620 LocalQueue.pop_back();
627 #define DISPATCH(NAME, CLASS, VAR) \
628 return getDerived().Traverse##NAME(static_cast<CLASS *>(VAR))
630 template <
typename Derived>
636 #define ABSTRACT_TYPE(CLASS, BASE)
637 #define TYPE(CLASS, BASE) \
639 DISPATCH(CLASS##Type, CLASS##Type, const_cast<Type *>(T.getTypePtr()));
640 #include "clang/AST/TypeNodes.def"
646 template <
typename Derived>
652 #define ABSTRACT_TYPELOC(CLASS, BASE)
653 #define TYPELOC(CLASS, BASE) \
654 case TypeLoc::CLASS: \
655 return getDerived().Traverse##CLASS##TypeLoc(TL.castAs<CLASS##TypeLoc>());
656 #include "clang/AST/TypeLocNodes.def"
663 #define VISITORCLASS RecursiveASTVisitor
664 #include "clang/AST/AttrVisitor.inc"
667 template <
typename Derived>
674 if (!getDerived().shouldVisitImplicitCode() && D->isImplicit())
677 switch (D->getKind()) {
678 #define ABSTRACT_DECL(DECL)
679 #define DECL(CLASS, BASE) \
681 if (!getDerived().Traverse##CLASS##Decl(static_cast<CLASS##Decl *>(D))) \
684 #include "clang/AST/DeclNodes.inc"
688 for (
auto *
I : D->attrs()) {
689 if (!getDerived().TraverseAttr(
I))
697 template <
typename Derived>
722 template <
typename Derived>
729 TRY_TO(TraverseNestedNameSpecifierLoc(Prefix));
748 template <
typename Derived>
756 TRY_TO(TraverseTypeLoc(TSInfo->getTypeLoc()));
773 template <
typename Derived>
776 TRY_TO(TraverseNestedNameSpecifier(DTN->getQualifier()));
778 TRY_TO(TraverseNestedNameSpecifier(QTN->getQualifier()));
783 template <
typename Derived>
794 return getDerived().TraverseType(Arg.
getAsType());
798 return getDerived().TraverseTemplateName(
802 return getDerived().TraverseStmt(Arg.
getAsExpr());
805 return getDerived().TraverseTemplateArguments(Arg.
pack_begin(),
814 template <
typename Derived>
829 return getDerived().TraverseTypeLoc(TSI->getTypeLoc());
831 return getDerived().TraverseType(Arg.
getAsType());
837 TRY_TO(getDerived().TraverseNestedNameSpecifierLoc(
839 return getDerived().TraverseTemplateName(
846 return getDerived().TraverseTemplateArguments(Arg.
pack_begin(),
853 template <
typename Derived>
857 TRY_TO(TraverseTemplateArgument(Args[
I]));
863 template <
typename Derived>
867 TRY_TO(TraverseTypeLoc(TInfo->getTypeLoc()));
869 if (Init->
isWritten() || getDerived().shouldVisitImplicitCode())
872 if (getDerived().shouldVisitImplicitCode())
885 template <
typename Derived>
894 template <
typename Derived>
904 #define DEF_TRAVERSE_TYPE(TYPE, CODE) \
905 template <typename Derived> \
906 bool RecursiveASTVisitor<Derived>::Traverse##TYPE(TYPE *T) { \
907 if (!getDerived().shouldTraversePostOrder()) \
908 TRY_TO(WalkUpFrom##TYPE(T)); \
910 if (getDerived().shouldTraversePostOrder()) \
911 TRY_TO(WalkUpFrom##TYPE(T)); \
922 {
TRY_TO(TraverseType(T->getPointeeType())); })
925 {
TRY_TO(TraverseType(T->getPointeeType())); })
928 {
TRY_TO(TraverseType(T->getPointeeType())); })
931 TRY_TO(TraverseType(QualType(T->getClass(), 0)));
932 TRY_TO(TraverseType(T->getPointeeType()));
940 {
TRY_TO(TraverseType(T->getElementType())); })
943 {
TRY_TO(TraverseType(T->getElementType())); })
946 TRY_TO(TraverseType(T->getElementType()));
947 TRY_TO(TraverseStmt(T->getSizeExpr()));
951 TRY_TO(TraverseType(T->getElementType()));
952 if (T->getSizeExpr())
953 TRY_TO(TraverseStmt(T->getSizeExpr()));
957 if (T->getSizeExpr())
958 TRY_TO(TraverseStmt(T->getSizeExpr()));
959 TRY_TO(TraverseType(T->getElementType()));
967 {
TRY_TO(TraverseType(T->getReturnType())); })
970 TRY_TO(TraverseType(T->getReturnType()));
972 for (
const auto &A : T->param_types()) {
976 for (
const auto &
E : T->exceptions()) {
980 if (Expr *NE = T->getNoexceptExpr())
988 {
TRY_TO(TraverseStmt(T->getUnderlyingExpr())); })
993 {
TRY_TO(TraverseStmt(T->getUnderlyingExpr())); })
996 TRY_TO(TraverseType(T->getBaseType()));
997 TRY_TO(TraverseType(T->getUnderlyingType()));
1009 TRY_TO(TraverseTemplateName(T->getTemplateName()));
1010 TRY_TO(TraverseTemplateArguments(T->getArgs(), T->getNumArgs()));
1016 {
TRY_TO(TraverseType(T->getModifiedType())); })
1021 if (T->getQualifier()) {
1022 TRY_TO(TraverseNestedNameSpecifier(T->getQualifier()));
1024 TRY_TO(TraverseType(T->getNamedType()));
1028 {
TRY_TO(TraverseNestedNameSpecifier(T->getQualifier())); })
1031 TRY_TO(TraverseNestedNameSpecifier(T->getQualifier()));
1032 TRY_TO(TraverseTemplateArguments(T->getArgs(), T->getNumArgs()));
1042 if (T->getBaseType().getTypePtr() != T)
1043 TRY_TO(TraverseType(T->getBaseType()));
1044 for (
auto typeArg : T->getTypeArgsAsWritten()) {
1045 TRY_TO(TraverseType(typeArg));
1050 {
TRY_TO(TraverseType(T->getPointeeType())); })
1066 template <typename Derived>
\
1067 bool RecursiveASTVisitor<Derived>::Traverse##
TYPE##Loc(
TYPE##Loc TL) {
\
1068 if (getDerived().shouldWalkTypesOfTypeLocs())
\
1069 TRY_TO(WalkUpFrom##
TYPE(const_cast<TYPE *>(TL.getTypePtr())));
\
1075 template <
typename Derived>
1077 RecursiveASTVisitor<Derived>::TraverseQualifiedTypeLoc(QualifiedTypeLoc TL) {
1093 return TraverseTypeLoc(TL.getUnqualifiedLoc());
1100 TRY_TO(TraverseType(TL.getTypePtr()->getElementType()));
1104 {
TRY_TO(TraverseTypeLoc(TL.getPointeeLoc())); })
1107 {
TRY_TO(TraverseTypeLoc(TL.getPointeeLoc())); })
1110 {
TRY_TO(TraverseTypeLoc(TL.getPointeeLoc())); })
1113 {
TRY_TO(TraverseTypeLoc(TL.getPointeeLoc())); })
1119 TRY_TO(TraverseType(QualType(TL.getTypePtr()->getClass(), 0)));
1120 TRY_TO(TraverseTypeLoc(TL.getPointeeLoc()));
1124 {
TRY_TO(TraverseTypeLoc(TL.getOriginalLoc())); })
1127 {
TRY_TO(TraverseTypeLoc(TL.getOriginalLoc())); })
1129 template <typename Derived>
1132 TRY_TO(TraverseStmt(TL.getSizeExpr()));
1137 TRY_TO(TraverseTypeLoc(TL.getElementLoc()));
1142 TRY_TO(TraverseTypeLoc(TL.getElementLoc()));
1147 TRY_TO(TraverseTypeLoc(TL.getElementLoc()));
1152 TRY_TO(TraverseTypeLoc(TL.getElementLoc()));
1159 if (TL.getTypePtr()->getSizeExpr())
1160 TRY_TO(TraverseStmt(TL.getTypePtr()->getSizeExpr()));
1161 TRY_TO(TraverseType(TL.getTypePtr()->getElementType()));
1166 TRY_TO(TraverseType(TL.getTypePtr()->getElementType()));
1172 TRY_TO(TraverseType(TL.getTypePtr()->getElementType()));
1176 {
TRY_TO(TraverseTypeLoc(TL.getReturnLoc())); })
1180 TRY_TO(TraverseTypeLoc(TL.getReturnLoc()));
1182 const FunctionProtoType *T = TL.getTypePtr();
1184 for (
unsigned I = 0,
E = TL.getNumParams();
I !=
E; ++
I) {
1185 if (TL.getParam(
I)) {
1186 TRY_TO(TraverseDecl(TL.getParam(
I)));
1187 }
else if (I < T->getNumParams()) {
1188 TRY_TO(TraverseType(T->getParamType(
I)));
1192 for (
const auto &
E : T->exceptions()) {
1196 if (Expr *NE = T->getNoexceptExpr())
1197 TRY_TO(TraverseStmt(NE));
1204 {
TRY_TO(TraverseStmt(TL.getUnderlyingExpr())); })
1207 TRY_TO(TraverseTypeLoc(TL.getUnderlyingTInfo()->getTypeLoc()));
1212 TRY_TO(TraverseStmt(TL.getTypePtr()->getUnderlyingExpr()));
1216 TRY_TO(TraverseTypeLoc(TL.getUnderlyingTInfo()->getTypeLoc()));
1220 TRY_TO(TraverseType(TL.getTypePtr()->getDeducedType()));
1231 TRY_TO(TraverseTemplateName(TL.getTypePtr()->getTemplateName()));
1232 for (
unsigned I = 0,
E = TL.getNumArgs();
I !=
E; ++
I) {
1233 TRY_TO(TraverseTemplateArgumentLoc(TL.getArgLoc(
I)));
1242 {
TRY_TO(TraverseTypeLoc(TL.getModifiedLoc())); })
1245 if (TL.getQualifierLoc()) {
1246 TRY_TO(TraverseNestedNameSpecifierLoc(TL.getQualifierLoc()));
1248 TRY_TO(TraverseTypeLoc(TL.getNamedTypeLoc()));
1252 TRY_TO(TraverseNestedNameSpecifierLoc(TL.getQualifierLoc()));
1256 if (TL.getQualifierLoc()) {
1257 TRY_TO(TraverseNestedNameSpecifierLoc(TL.getQualifierLoc()));
1260 for (
unsigned I = 0,
E = TL.getNumArgs();
I !=
E; ++
I) {
1261 TRY_TO(TraverseTemplateArgumentLoc(TL.getArgLoc(
I)));
1266 {
TRY_TO(TraverseTypeLoc(TL.getPatternLoc())); })
1273 if (TL.getTypePtr()->getBaseType().getTypePtr() != TL.getTypePtr())
1274 TRY_TO(TraverseTypeLoc(TL.getBaseLoc()));
1275 for (
unsigned i = 0, n = TL.getNumTypeArgs(); i != n; ++i)
1276 TRY_TO(TraverseTypeLoc(TL.getTypeArgTInfo(i)->getTypeLoc()));
1280 {
TRY_TO(TraverseTypeLoc(TL.getPointeeLoc())); })
1295 template <typename Derived>
1296 bool RecursiveASTVisitor<Derived>::TraverseDeclContextHelper(DeclContext *DC) {
1300 for (
auto *Child : DC->decls()) {
1303 if (!isa<BlockDecl>(Child) && !isa<CapturedDecl>(Child))
1304 TRY_TO(TraverseDecl(Child));
1311 #define DEF_TRAVERSE_DECL(DECL, CODE) \
1312 template <typename Derived> \
1313 bool RecursiveASTVisitor<Derived>::Traverse##DECL(DECL *D) { \
1314 bool ShouldVisitChildren = true; \
1315 bool ReturnValue = true; \
1316 if (!getDerived().shouldTraversePostOrder()) \
1317 TRY_TO(WalkUpFrom##DECL(D)); \
1319 if (ReturnValue && ShouldVisitChildren) \
1320 TRY_TO(TraverseDeclContextHelper(dyn_cast<DeclContext>(D))); \
1321 if (ReturnValue && getDerived().shouldTraversePostOrder()) \
1322 TRY_TO(WalkUpFrom##DECL(D)); \
1323 return ReturnValue; \
1329 if (TypeSourceInfo *TInfo = D->getSignatureAsWritten())
1330 TRY_TO(TraverseTypeLoc(TInfo->getTypeLoc()));
1331 TRY_TO(TraverseStmt(D->getBody()));
1332 for (
const auto &
I : D->captures()) {
1333 if (
I.hasCopyExpr()) {
1334 TRY_TO(TraverseStmt(
I.getCopyExpr()));
1337 ShouldVisitChildren =
false;
1341 TRY_TO(TraverseStmt(D->getBody()));
1342 ShouldVisitChildren =
false;
1348 {
TRY_TO(TraverseStmt(D->getAsmString())); })
1354 if (D->getFriendType())
1355 TRY_TO(TraverseTypeLoc(D->getFriendType()->getTypeLoc()));
1357 TRY_TO(TraverseDecl(D->getFriendDecl()));
1361 if (D->getFriendType())
1362 TRY_TO(TraverseTypeLoc(D->getFriendType()->getTypeLoc()));
1364 TRY_TO(TraverseDecl(D->getFriendDecl()));
1365 for (
unsigned I = 0,
E = D->getNumTemplateParameters();
I <
E; ++
I) {
1366 TemplateParameterList *TPL = D->getTemplateParameterList(
I);
1368 ITPL != ETPL; ++ITPL) {
1369 TRY_TO(TraverseDecl(*ITPL));
1375 TRY_TO(TraverseDecl(D->getSpecialization()));
1377 if (D->hasExplicitTemplateArgs()) {
1378 const TemplateArgumentListInfo &args = D->templateArgs();
1379 TRY_TO(TraverseTemplateArgumentLocsHelper(args.getArgumentArray(),
1390 TRY_TO(TraverseStmt(D->getAssertExpr()));
1391 TRY_TO(TraverseStmt(D->getMessage()));
1395 TranslationUnitDecl,
1408 TRY_TO(TraverseNestedNameSpecifierLoc(D->getQualifierLoc()));
1412 ShouldVisitChildren =
false;
1429 if (ObjCTypeParamList *typeParamList = D->getTypeParamList()) {
1430 for (
auto typeParam : *typeParamList) {
1431 TRY_TO(TraverseObjCTypeParamDecl(typeParam));
1443 if (ObjCTypeParamList *typeParamList = D->getTypeParamListAsWritten()) {
1444 for (
auto typeParam : *typeParamList) {
1445 TRY_TO(TraverseObjCTypeParamDecl(typeParam));
1449 if (TypeSourceInfo *superTInfo = D->getSuperClassTInfo()) {
1450 TRY_TO(TraverseTypeLoc(superTInfo->getTypeLoc()));
1458 if (D->getReturnTypeSourceInfo()) {
1459 TRY_TO(TraverseTypeLoc(D->getReturnTypeSourceInfo()->getTypeLoc()));
1461 for (ParmVarDecl *Parameter : D->parameters()) {
1462 TRY_TO(TraverseDecl(Parameter));
1464 if (D->isThisDeclarationADefinition()) {
1465 TRY_TO(TraverseStmt(D->getBody()));
1467 ShouldVisitChildren =
false;
1471 if (D->hasExplicitBound()) {
1472 TRY_TO(TraverseTypeLoc(D->getTypeSourceInfo()->getTypeLoc()));
1480 if (D->getTypeSourceInfo())
1481 TRY_TO(TraverseTypeLoc(D->getTypeSourceInfo()->getTypeLoc()));
1483 TRY_TO(TraverseType(D->getType()));
1484 ShouldVisitChildren =
false;
1488 TRY_TO(TraverseNestedNameSpecifierLoc(D->getQualifierLoc()));
1489 TRY_TO(TraverseDeclarationNameInfo(D->getNameInfo()));
1493 TRY_TO(TraverseNestedNameSpecifierLoc(D->getQualifierLoc()));
1501 for (
auto *
I : D->varlists()) {
1507 TRY_TO(TraverseStmt(D->getCombiner()));
1508 if (
auto *Initializer = D->getInitializer())
1509 TRY_TO(TraverseStmt(Initializer));
1510 TRY_TO(TraverseType(D->getType()));
1517 template <typename Derived>
1518 bool RecursiveASTVisitor<Derived>::TraverseTemplateParameterListHelper(
1519 TemplateParameterList *TPL) {
1529 template <
typename Derived>
1530 bool RecursiveASTVisitor<Derived>::TraverseTemplateInstantiations(
1531 ClassTemplateDecl *D) {
1532 for (
auto *SD : D->specializations()) {
1533 for (
auto *RD : SD->redecls()) {
1535 if (cast<CXXRecordDecl>(RD)->isInjectedClassName())
1539 cast<ClassTemplateSpecializationDecl>(RD)->getSpecializationKind()) {
1543 TRY_TO(TraverseDecl(RD));
1560 template <
typename Derived>
1561 bool RecursiveASTVisitor<Derived>::TraverseTemplateInstantiations(
1562 VarTemplateDecl *D) {
1563 for (
auto *SD : D->specializations()) {
1564 for (
auto *RD : SD->redecls()) {
1566 cast<VarTemplateSpecializationDecl>(RD)->getSpecializationKind()) {
1569 TRY_TO(TraverseDecl(RD));
1585 template <
typename Derived>
1586 bool RecursiveASTVisitor<Derived>::TraverseTemplateInstantiations(
1587 FunctionTemplateDecl *D) {
1588 for (
auto *FD : D->specializations()) {
1589 for (
auto *RD : FD->redecls()) {
1590 switch (RD->getTemplateSpecializationKind()) {
1594 TRY_TO(TraverseDecl(RD));
1601 TRY_TO(TraverseDecl(RD));
1615 #define DEF_TRAVERSE_TMPL_DECL(TMPLDECLKIND) \
1616 DEF_TRAVERSE_DECL(TMPLDECLKIND##TemplateDecl, { \
1617 TRY_TO(TraverseDecl(D->getTemplatedDecl())); \
1618 TRY_TO(TraverseTemplateParameterListHelper(D->getTemplateParameters())); \
1626 if (getDerived().shouldVisitTemplateInstantiations() && \
1627 D == D->getCanonicalDecl()) \
1628 TRY_TO(TraverseTemplateInstantiations(D)); \
1642 TRY_TO(TraverseDecl(D->getTemplatedDecl()));
1643 if (D->hasDefaultArgument() && !D->defaultArgumentWasInherited()) {
1644 TRY_TO(TraverseTemplateArgumentLoc(D->getDefaultArgument()));
1646 TRY_TO(TraverseTemplateParameterListHelper(D->getTemplateParameters()));
1650 TRY_TO(TraverseTemplateParameterListHelper(D->getTemplateParameters()));
1655 if (D->getTypeForDecl())
1656 TRY_TO(TraverseType(QualType(D->getTypeForDecl(), 0)));
1657 if (D->hasDefaultArgument() && !D->defaultArgumentWasInherited())
1658 TRY_TO(TraverseTypeLoc(D->getDefaultArgumentInfo()->getTypeLoc()));
1662 TRY_TO(TraverseTypeLoc(D->getTypeSourceInfo()->getTypeLoc()));
1669 TRY_TO(TraverseTypeLoc(D->getTypeSourceInfo()->getTypeLoc()));
1676 TRY_TO(TraverseDecl(D->getTemplatedDecl()));
1677 TRY_TO(TraverseTemplateParameterListHelper(D->getTemplateParameters()));
1683 TRY_TO(TraverseNestedNameSpecifierLoc(D->getQualifierLoc()));
1690 if (D->getTypeForDecl())
1691 TRY_TO(TraverseType(QualType(D->getTypeForDecl(), 0)));
1693 TRY_TO(TraverseNestedNameSpecifierLoc(D->getQualifierLoc()));
1699 template <typename Derived>
1700 bool RecursiveASTVisitor<Derived>::TraverseRecordHelper(RecordDecl *D) {
1704 TRY_TO(TraverseNestedNameSpecifierLoc(D->getQualifierLoc()));
1708 template <
typename Derived>
1709 bool RecursiveASTVisitor<Derived>::TraverseCXXRecordHelper(CXXRecordDecl *D) {
1710 if (!TraverseRecordHelper(D))
1712 if (D->isCompleteDefinition()) {
1713 for (
const auto &
I : D->bases()) {
1714 TRY_TO(TraverseTypeLoc(
I.getTypeSourceInfo()->getTypeLoc()));
1736 if (TypeSourceInfo *TSI = D->getTypeAsWritten()) \
1737 TRY_TO(TraverseTypeLoc(TSI->getTypeLoc()));
\
1739 if (!getDerived().shouldVisitTemplateInstantiations() && \
1751 template <typename Derived>
1752 bool RecursiveASTVisitor<Derived>::TraverseTemplateArgumentLocsHelper(
1753 const TemplateArgumentLoc *TAL,
unsigned Count) {
1754 for (
unsigned I = 0;
I <
Count; ++
I) {
1755 TRY_TO(TraverseTemplateArgumentLoc(TAL[
I]));
1760 #define DEF_TRAVERSE_TMPL_PART_SPEC_DECL(TMPLDECLKIND, DECLKIND) \
1761 DEF_TRAVERSE_DECL(TMPLDECLKIND##TemplatePartialSpecializationDecl, { \
1763 if (TemplateParameterList *TPL = D->getTemplateParameters()) { \
1764 for (TemplateParameterList::iterator I = TPL->begin(), E = TPL->end(); \
1766 TRY_TO(TraverseDecl(*I)); \
1770 TRY_TO(TraverseTemplateArgumentLocsHelper( \
1771 D->getTemplateArgsAsWritten()->getTemplateArgs(), \
1772 D->getTemplateArgsAsWritten()->NumTemplateArgs)); \
1777 TRY_TO(Traverse##DECLKIND##Helper(D)); \
1790 TRY_TO(TraverseNestedNameSpecifierLoc(D->getQualifierLoc()));
1791 TRY_TO(TraverseDeclarationNameInfo(D->getNameInfo()));
1796 template <typename Derived>
1797 bool RecursiveASTVisitor<Derived>::TraverseDeclaratorHelper(DeclaratorDecl *D) {
1798 TRY_TO(TraverseNestedNameSpecifierLoc(D->getQualifierLoc()));
1799 if (D->getTypeSourceInfo())
1800 TRY_TO(TraverseTypeLoc(D->getTypeSourceInfo()->getTypeLoc()));
1802 TRY_TO(TraverseType(D->getType()));
1809 TRY_TO(TraverseDeclaratorHelper(D));
1810 if (D->isBitField())
1811 TRY_TO(TraverseStmt(D->getBitWidth()));
1812 else if (D->hasInClassInitializer())
1813 TRY_TO(TraverseStmt(D->getInClassInitializer()));
1817 TRY_TO(TraverseDeclaratorHelper(D));
1818 if (D->isBitField())
1819 TRY_TO(TraverseStmt(D->getBitWidth()));
1824 TRY_TO(TraverseDeclaratorHelper(D));
1825 if (D->isBitField())
1826 TRY_TO(TraverseStmt(D->getBitWidth()));
1830 template <typename Derived>
1831 bool RecursiveASTVisitor<Derived>::TraverseFunctionHelper(FunctionDecl *D) {
1832 TRY_TO(TraverseNestedNameSpecifierLoc(D->getQualifierLoc()));
1833 TRY_TO(TraverseDeclarationNameInfo(D->getNameInfo()));
1840 if (
const FunctionTemplateSpecializationInfo *FTSI =
1841 D->getTemplateSpecializationInfo()) {
1846 if (
const ASTTemplateArgumentListInfo *TALI =
1847 FTSI->TemplateArgumentsAsWritten) {
1848 TRY_TO(TraverseTemplateArgumentLocsHelper(TALI->getTemplateArgs(),
1849 TALI->NumTemplateArgs));
1858 if (TypeSourceInfo *TSI = D->getTypeSourceInfo()) {
1859 TRY_TO(TraverseTypeLoc(TSI->getTypeLoc()));
1860 }
else if (getDerived().shouldVisitImplicitCode()) {
1865 for (ParmVarDecl *Parameter : D->parameters()) {
1866 TRY_TO(TraverseDecl(Parameter));
1870 if (CXXConstructorDecl *Ctor = dyn_cast<CXXConstructorDecl>(D)) {
1872 for (
auto *
I : Ctor->inits()) {
1873 TRY_TO(TraverseConstructorInitializer(
I));
1877 if (D->isThisDeclarationADefinition()) {
1878 TRY_TO(TraverseStmt(D->getBody()));
1886 ShouldVisitChildren =
false;
1887 ReturnValue = TraverseFunctionHelper(D);
1893 ShouldVisitChildren =
false;
1894 ReturnValue = TraverseFunctionHelper(D);
1900 ShouldVisitChildren =
false;
1901 ReturnValue = TraverseFunctionHelper(D);
1909 ShouldVisitChildren =
false;
1910 ReturnValue = TraverseFunctionHelper(D);
1916 ShouldVisitChildren =
false;
1917 ReturnValue = TraverseFunctionHelper(D);
1920 template <typename Derived>
1921 bool RecursiveASTVisitor<Derived>::TraverseVarHelper(VarDecl *D) {
1922 TRY_TO(TraverseDeclaratorHelper(D));
1924 if (!isa<ParmVarDecl>(D) &&
1925 (!D->isCXXForRangeDecl() || getDerived().shouldVisitImplicitCode()))
1926 TRY_TO(TraverseStmt(D->getInit()));
1936 TRY_TO(TraverseDeclaratorHelper(D));
1937 if (D->hasDefaultArgument() && !D->defaultArgumentWasInherited())
1938 TRY_TO(TraverseStmt(D->getDefaultArgument()));
1942 TRY_TO(TraverseVarHelper(D));
1944 if (D->hasDefaultArg() && D->hasUninstantiatedDefaultArg() &&
1945 !D->hasUnparsedDefaultArg())
1946 TRY_TO(TraverseStmt(D->getUninstantiatedDefaultArg()));
1948 if (D->hasDefaultArg() && !D->hasUninstantiatedDefaultArg() &&
1949 !D->hasUnparsedDefaultArg())
1950 TRY_TO(TraverseStmt(D->getDefaultArg()));
1966 template <typename Derived>
\
1967 bool RecursiveASTVisitor<Derived>::Traverse##
STMT( \
1968 STMT *S, DataRecursionQueue *Queue) {
\
1969 bool ShouldVisitChildren =
true;
\
1970 bool ReturnValue =
true;
\
1971 if (!getDerived().shouldTraversePostOrder())
\
1974 if (ShouldVisitChildren) {
\
1975 for (
Stmt *SubStmt : S->children()) {
\
1979 if (!Queue && ReturnValue && getDerived().shouldTraversePostOrder())
\
1986 for (
unsigned I = 0, E = S->getNumInputs();
I <
E; ++
I) {
1989 for (
unsigned I = 0, E = S->getNumOutputs();
I <
E; ++
I) {
1992 for (
unsigned I = 0, E = S->getNumClobbers();
I <
E; ++
I) {
2005 TRY_TO(TraverseDecl(S->getExceptionDecl()));
2010 for (
auto *
I : S->decls()) {
2018 ShouldVisitChildren =
false;
2045 if (!getDerived().shouldVisitImplicitCode()) {
2050 ShouldVisitChildren =
false;
2054 TRY_TO(TraverseNestedNameSpecifierLoc(S->getQualifierLoc()));
2055 TRY_TO(TraverseDeclarationNameInfo(S->getNameInfo()));
2062 TRY_TO(TraverseNestedNameSpecifierLoc(S->getQualifierLoc()));
2063 TRY_TO(TraverseDeclarationNameInfo(S->getMemberNameInfo()));
2064 if (S->hasExplicitTemplateArgs()) {
2065 TRY_TO(TraverseTemplateArgumentLocsHelper(S->getTemplateArgs(),
2066 S->getNumTemplateArgs()));
2071 TRY_TO(TraverseNestedNameSpecifierLoc(S->getQualifierLoc()));
2072 TRY_TO(TraverseDeclarationNameInfo(S->getNameInfo()));
2073 TRY_TO(TraverseTemplateArgumentLocsHelper(S->getTemplateArgs(),
2074 S->getNumTemplateArgs()));
2078 TRY_TO(TraverseNestedNameSpecifierLoc(S->getQualifierLoc()));
2079 TRY_TO(TraverseDeclarationNameInfo(S->getNameInfo()));
2080 if (S->hasExplicitTemplateArgs()) {
2081 TRY_TO(TraverseTemplateArgumentLocsHelper(S->getTemplateArgs(),
2082 S->getNumTemplateArgs()));
2087 TRY_TO(TraverseNestedNameSpecifierLoc(S->getQualifierLoc()));
2088 TRY_TO(TraverseDeclarationNameInfo(S->getMemberNameInfo()));
2089 TRY_TO(TraverseTemplateArgumentLocsHelper(S->getTemplateArgs(),
2090 S->getNumTemplateArgs()));
2100 TRY_TO(TraverseTypeLoc(S->getTypeInfoAsWritten()->getTypeLoc()));
2104 TRY_TO(TraverseTypeLoc(S->getTypeInfoAsWritten()->getTypeLoc()));
2108 TRY_TO(TraverseTypeLoc(S->getTypeInfoAsWritten()->getTypeLoc()));
2112 TRY_TO(TraverseTypeLoc(S->getTypeInfoAsWritten()->getTypeLoc()));
2116 TRY_TO(TraverseTypeLoc(S->getTypeInfoAsWritten()->getTypeLoc()));
2120 TRY_TO(TraverseTypeLoc(S->getTypeInfoAsWritten()->getTypeLoc()));
2123 template <typename Derived>
2124 bool RecursiveASTVisitor<Derived>::TraverseSynOrSemInitListExpr(
2125 InitListExpr *S, DataRecursionQueue *Queue) {
2129 if (!getDerived().shouldTraversePostOrder())
2130 TRY_TO(WalkUpFromInitListExpr(S));
2133 for (
Stmt *SubStmt : S->children()) {
2147 TRY_TO(TraverseSynOrSemInitListExpr(
2148 S->isSemanticForm() ? S->getSyntacticForm() :
S, Queue));
2149 TRY_TO(TraverseSynOrSemInitListExpr(
2150 S->isSemanticForm() ? S : S->getSemanticForm(), Queue));
2151 ShouldVisitChildren =
false;
2158 TRY_TO(TraverseStmt(S->getControllingExpr()));
2159 for (
unsigned i = 0; i != S->getNumAssocs(); ++i) {
2160 if (TypeSourceInfo *TS = S->getAssocTypeSourceInfo(i))
2161 TRY_TO(TraverseTypeLoc(TS->getTypeLoc()));
2164 ShouldVisitChildren =
false;
2172 e = S->semantics_end();
2175 if (OpaqueValueExpr *OVE = dyn_cast<OpaqueValueExpr>(sub))
2176 sub = OVE->getSourceExpr();
2179 ShouldVisitChildren =
false;
2185 TRY_TO(TraverseTypeLoc(S->getTypeSourceInfo()->getTypeLoc()));
2190 TRY_TO(TraverseTypeLoc(S->getAllocatedTypeSourceInfo()->getTypeLoc()));
2198 TRY_TO(TraverseTypeLoc(S->getTypeSourceInfo()->getTypeLoc()));
2204 if (S->isArgumentType())
2205 TRY_TO(TraverseTypeLoc(S->getArgumentTypeInfo()->getTypeLoc()));
2211 if (S->isTypeOperand())
2212 TRY_TO(TraverseTypeLoc(S->getTypeOperandSourceInfo()->getTypeLoc()));
2216 TRY_TO(TraverseNestedNameSpecifierLoc(S->getQualifierLoc()));
2224 if (S->isTypeOperand())
2225 TRY_TO(TraverseTypeLoc(S->getTypeOperandSourceInfo()->getTypeLoc()));
2229 for (
unsigned I = 0, N = S->getNumArgs();
I != N; ++
I)
2230 TRY_TO(TraverseTypeLoc(S->getArg(
I)->getTypeLoc()));
2234 TRY_TO(TraverseTypeLoc(S->getQueriedTypeSourceInfo()->getTypeLoc()));
2242 TRY_TO(TraverseTypeLoc(S->getWrittenTypeInfo()->getTypeLoc()));
2247 TRY_TO(TraverseTypeLoc(S->getTypeSourceInfo()->getTypeLoc()));
2253 CEnd = S->explicit_capture_end();
2255 TRY_TO(TraverseLambdaCapture(S, C));
2258 TypeLoc TL = S->getCallOperator()->getTypeSourceInfo()->getTypeLoc();
2259 FunctionProtoTypeLoc Proto = TL.castAs<FunctionProtoTypeLoc>();
2261 if (S->hasExplicitParameters() && S->hasExplicitResultType()) {
2263 TRY_TO(TraverseTypeLoc(TL));
2265 if (S->hasExplicitParameters()) {
2267 for (
unsigned I = 0, N = Proto.getNumParams();
I != N; ++
I) {
2268 TRY_TO(TraverseDecl(Proto.getParam(
I)));
2270 }
else if (S->hasExplicitResultType()) {
2271 TRY_TO(TraverseTypeLoc(Proto.getReturnLoc()));
2274 auto *T = Proto.getTypePtr();
2275 for (
const auto &E : T->exceptions()) {
2279 if (Expr *NE = T->getNoexceptExpr())
2284 ShouldVisitChildren =
false;
2289 TRY_TO(TraverseTypeLoc(S->getTypeSourceInfo()->getTypeLoc()));
2304 TRY_TO(TraverseDecl(S->getBlockDecl()));
2309 TRY_TO(TraverseTypeLoc(S->getTypeSourceInfo()->getTypeLoc()));
2321 TRY_TO(TraverseNestedNameSpecifierLoc(S->getQualifierLoc()));
2322 if (TypeSourceInfo *ScopeInfo = S->getScopeTypeInfo())
2323 TRY_TO(TraverseTypeLoc(ScopeInfo->getTypeLoc()));
2324 if (TypeSourceInfo *DestroyedTypeInfo = S->getDestroyedTypeInfo())
2325 TRY_TO(TraverseTypeLoc(DestroyedTypeInfo->getTypeLoc()));
2338 if (TypeSourceInfo *TInfo = S->getEncodedTypeSourceInfo())
2339 TRY_TO(TraverseTypeLoc(TInfo->getTypeLoc()));
2344 if (TypeSourceInfo *TInfo = S->getClassReceiverTypeInfo())
2345 TRY_TO(TraverseTypeLoc(TInfo->getTypeLoc()));
2353 TRY_TO(TraverseTypeLoc(S->getTypeInfoAsWritten()->getTypeLoc()));
2363 TRY_TO(TraverseNestedNameSpecifierLoc(S->getQualifierLoc()));
2364 if (S->hasExplicitTemplateArgs()) {
2365 TRY_TO(TraverseTemplateArgumentLocsHelper(S->getTemplateArgs(),
2366 S->getNumTemplateArgs()));
2371 TRY_TO(TraverseNestedNameSpecifierLoc(S->getQualifierLoc()));
2372 if (S->hasExplicitTemplateArgs()) {
2373 TRY_TO(TraverseTemplateArgumentLocsHelper(S->getTemplateArgs(),
2374 S->getNumTemplateArgs()));
2410 if (!getDerived().shouldVisitImplicitCode()) {
2412 ShouldVisitChildren =
false;
2416 if (!getDerived().shouldVisitImplicitCode()) {
2418 ShouldVisitChildren =
false;
2422 if (!getDerived().shouldVisitImplicitCode()) {
2424 ShouldVisitChildren =
false;
2428 if (!getDerived().shouldVisitImplicitCode()) {
2430 ShouldVisitChildren =
false;
2449 template <typename Derived>
2450 bool RecursiveASTVisitor<Derived>::TraverseOMPExecutableDirective(
2451 OMPExecutableDirective *S) {
2452 for (
auto *C : S->clauses()) {
2453 TRY_TO(TraverseOMPClause(C));
2458 template <
typename Derived>
2460 RecursiveASTVisitor<Derived>::TraverseOMPLoopDirective(OMPLoopDirective *S) {
2461 return TraverseOMPExecutableDirective(S);
2465 {
TRY_TO(TraverseOMPExecutableDirective(S)); })
2468 {
TRY_TO(TraverseOMPExecutableDirective(S)); })
2471 {
TRY_TO(TraverseOMPExecutableDirective(S)); })
2474 {
TRY_TO(TraverseOMPExecutableDirective(S)); })
2477 {
TRY_TO(TraverseOMPExecutableDirective(S)); })
2480 {
TRY_TO(TraverseOMPExecutableDirective(S)); })
2483 {
TRY_TO(TraverseOMPExecutableDirective(S)); })
2486 {
TRY_TO(TraverseOMPExecutableDirective(S)); })
2489 TRY_TO(TraverseDeclarationNameInfo(S->getDirectiveName()));
2490 TRY_TO(TraverseOMPExecutableDirective(S));
2494 {
TRY_TO(TraverseOMPExecutableDirective(S)); })
2497 {
TRY_TO(TraverseOMPExecutableDirective(S)); })
2500 {
TRY_TO(TraverseOMPExecutableDirective(S)); })
2503 {
TRY_TO(TraverseOMPExecutableDirective(S)); })
2506 {
TRY_TO(TraverseOMPExecutableDirective(S)); })
2509 {
TRY_TO(TraverseOMPExecutableDirective(S)); })
2512 {
TRY_TO(TraverseOMPExecutableDirective(S)); })
2515 {
TRY_TO(TraverseOMPExecutableDirective(S)); })
2518 {
TRY_TO(TraverseOMPExecutableDirective(S)); })
2521 {
TRY_TO(TraverseOMPExecutableDirective(S)); })
2524 {
TRY_TO(TraverseOMPExecutableDirective(S)); })
2527 {
TRY_TO(TraverseOMPExecutableDirective(S)); })
2530 {
TRY_TO(TraverseOMPExecutableDirective(S)); })
2533 {
TRY_TO(TraverseOMPExecutableDirective(S)); })
2536 {
TRY_TO(TraverseOMPExecutableDirective(S)); })
2539 {
TRY_TO(TraverseOMPExecutableDirective(S)); })
2542 {
TRY_TO(TraverseOMPExecutableDirective(S)); })
2545 {
TRY_TO(TraverseOMPExecutableDirective(S)); })
2548 {
TRY_TO(TraverseOMPExecutableDirective(S)); })
2551 {
TRY_TO(TraverseOMPExecutableDirective(S)); })
2554 {
TRY_TO(TraverseOMPExecutableDirective(S)); })
2557 {
TRY_TO(TraverseOMPExecutableDirective(S)); })
2560 {
TRY_TO(TraverseOMPExecutableDirective(S)); })
2563 {
TRY_TO(TraverseOMPExecutableDirective(S)); })
2566 {
TRY_TO(TraverseOMPExecutableDirective(S)); })
2569 {
TRY_TO(TraverseOMPExecutableDirective(S)); })
2572 {
TRY_TO(TraverseOMPExecutableDirective(S)); })
2575 {
TRY_TO(TraverseOMPExecutableDirective(S)); })
2578 template <typename Derived>
2579 bool RecursiveASTVisitor<Derived>::TraverseOMPClause(
OMPClause *C) {
2582 switch (C->getClauseKind()) {
2583 #define OPENMP_CLAUSE(Name, Class) \
2585 TRY_TO(Visit##Class(static_cast<Class *>(C))); \
2587 #include "clang/Basic/OpenMPKinds.def"
2596 template <
typename Derived>
2597 bool RecursiveASTVisitor<Derived>::VisitOMPClauseWithPreInit(
2599 TRY_TO(TraverseStmt(Node->getPreInitStmt()));
2603 template <
typename Derived>
2604 bool RecursiveASTVisitor<Derived>::VisitOMPClauseWithPostUpdate(
2605 OMPClauseWithPostUpdate *Node) {
2606 TRY_TO(VisitOMPClauseWithPreInit(Node));
2607 TRY_TO(TraverseStmt(Node->getPostUpdateExpr()));
2611 template <
typename Derived>
2612 bool RecursiveASTVisitor<Derived>::VisitOMPIfClause(OMPIfClause *C) {
2613 TRY_TO(TraverseStmt(C->getCondition()));
2617 template <
typename Derived>
2618 bool RecursiveASTVisitor<Derived>::VisitOMPFinalClause(OMPFinalClause *C) {
2619 TRY_TO(TraverseStmt(C->getCondition()));
2623 template <
typename Derived>
2625 RecursiveASTVisitor<Derived>::VisitOMPNumThreadsClause(OMPNumThreadsClause *C) {
2626 TRY_TO(TraverseStmt(C->getNumThreads()));
2630 template <
typename Derived>
2631 bool RecursiveASTVisitor<Derived>::VisitOMPSafelenClause(OMPSafelenClause *C) {
2632 TRY_TO(TraverseStmt(C->getSafelen()));
2636 template <
typename Derived>
2637 bool RecursiveASTVisitor<Derived>::VisitOMPSimdlenClause(OMPSimdlenClause *C) {
2638 TRY_TO(TraverseStmt(C->getSimdlen()));
2642 template <
typename Derived>
2644 RecursiveASTVisitor<Derived>::VisitOMPCollapseClause(OMPCollapseClause *C) {
2645 TRY_TO(TraverseStmt(C->getNumForLoops()));
2649 template <
typename Derived>
2650 bool RecursiveASTVisitor<Derived>::VisitOMPDefaultClause(OMPDefaultClause *) {
2654 template <
typename Derived>
2655 bool RecursiveASTVisitor<Derived>::VisitOMPProcBindClause(OMPProcBindClause *) {
2659 template <
typename Derived>
2661 RecursiveASTVisitor<Derived>::VisitOMPScheduleClause(OMPScheduleClause *C) {
2662 TRY_TO(VisitOMPClauseWithPreInit(C));
2663 TRY_TO(TraverseStmt(C->getChunkSize()));
2667 template <
typename Derived>
2668 bool RecursiveASTVisitor<Derived>::VisitOMPOrderedClause(OMPOrderedClause *C) {
2669 TRY_TO(TraverseStmt(C->getNumForLoops()));
2673 template <
typename Derived>
2674 bool RecursiveASTVisitor<Derived>::VisitOMPNowaitClause(OMPNowaitClause *) {
2678 template <
typename Derived>
2679 bool RecursiveASTVisitor<Derived>::VisitOMPUntiedClause(OMPUntiedClause *) {
2683 template <
typename Derived>
2685 RecursiveASTVisitor<Derived>::VisitOMPMergeableClause(OMPMergeableClause *) {
2689 template <
typename Derived>
2690 bool RecursiveASTVisitor<Derived>::VisitOMPReadClause(OMPReadClause *) {
2694 template <
typename Derived>
2695 bool RecursiveASTVisitor<Derived>::VisitOMPWriteClause(OMPWriteClause *) {
2699 template <
typename Derived>
2700 bool RecursiveASTVisitor<Derived>::VisitOMPUpdateClause(OMPUpdateClause *) {
2704 template <
typename Derived>
2705 bool RecursiveASTVisitor<Derived>::VisitOMPCaptureClause(OMPCaptureClause *) {
2709 template <
typename Derived>
2710 bool RecursiveASTVisitor<Derived>::VisitOMPSeqCstClause(OMPSeqCstClause *) {
2714 template <
typename Derived>
2715 bool RecursiveASTVisitor<Derived>::VisitOMPThreadsClause(
OMPThreadsClause *) {
2719 template <
typename Derived>
2720 bool RecursiveASTVisitor<Derived>::VisitOMPSIMDClause(
OMPSIMDClause *) {
2724 template <
typename Derived>
2725 bool RecursiveASTVisitor<Derived>::VisitOMPNogroupClause(
OMPNogroupClause *) {
2729 template <
typename Derived>
2730 template <
typename T>
2731 bool RecursiveASTVisitor<Derived>::VisitOMPClauseList(T *Node) {
2732 for (
auto *E : Node->varlists()) {
2738 template <
typename Derived>
2739 bool RecursiveASTVisitor<Derived>::VisitOMPPrivateClause(OMPPrivateClause *C) {
2740 TRY_TO(VisitOMPClauseList(C));
2741 for (
auto *E : C->private_copies()) {
2747 template <
typename Derived>
2748 bool RecursiveASTVisitor<Derived>::VisitOMPFirstprivateClause(
2749 OMPFirstprivateClause *C) {
2750 TRY_TO(VisitOMPClauseList(C));
2751 TRY_TO(VisitOMPClauseWithPreInit(C));
2752 for (
auto *E : C->private_copies()) {
2755 for (
auto *E : C->inits()) {
2761 template <
typename Derived>
2762 bool RecursiveASTVisitor<Derived>::VisitOMPLastprivateClause(
2763 OMPLastprivateClause *C) {
2764 TRY_TO(VisitOMPClauseList(C));
2765 TRY_TO(VisitOMPClauseWithPostUpdate(C));
2766 for (
auto *E : C->private_copies()) {
2769 for (
auto *E : C->source_exprs()) {
2772 for (
auto *E : C->destination_exprs()) {
2775 for (
auto *E : C->assignment_ops()) {
2781 template <
typename Derived>
2782 bool RecursiveASTVisitor<Derived>::VisitOMPSharedClause(OMPSharedClause *C) {
2783 TRY_TO(VisitOMPClauseList(C));
2787 template <
typename Derived>
2788 bool RecursiveASTVisitor<Derived>::VisitOMPLinearClause(
OMPLinearClause *C) {
2789 TRY_TO(TraverseStmt(C->getStep()));
2790 TRY_TO(TraverseStmt(C->getCalcStep()));
2791 TRY_TO(VisitOMPClauseList(C));
2792 TRY_TO(VisitOMPClauseWithPostUpdate(C));
2793 for (
auto *E : C->privates()) {
2796 for (
auto *E : C->inits()) {
2799 for (
auto *E : C->updates()) {
2802 for (
auto *E : C->finals()) {
2808 template <
typename Derived>
2809 bool RecursiveASTVisitor<Derived>::VisitOMPAlignedClause(
OMPAlignedClause *C) {
2811 TRY_TO(VisitOMPClauseList(C));
2815 template <
typename Derived>
2816 bool RecursiveASTVisitor<Derived>::VisitOMPCopyinClause(
OMPCopyinClause *C) {
2817 TRY_TO(VisitOMPClauseList(C));
2830 template <
typename Derived>
2831 bool RecursiveASTVisitor<Derived>::VisitOMPCopyprivateClause(
2833 TRY_TO(VisitOMPClauseList(C));
2846 template <
typename Derived>
2848 RecursiveASTVisitor<Derived>::VisitOMPReductionClause(OMPReductionClause *C) {
2849 TRY_TO(TraverseNestedNameSpecifierLoc(C->getQualifierLoc()));
2850 TRY_TO(TraverseDeclarationNameInfo(C->getNameInfo()));
2851 TRY_TO(VisitOMPClauseList(C));
2852 TRY_TO(VisitOMPClauseWithPostUpdate(C));
2853 for (
auto *E : C->privates()) {
2856 for (
auto *E : C->lhs_exprs()) {
2859 for (
auto *E : C->rhs_exprs()) {
2862 for (
auto *E : C->reduction_ops()) {
2868 template <
typename Derived>
2869 bool RecursiveASTVisitor<Derived>::VisitOMPFlushClause(
OMPFlushClause *C) {
2870 TRY_TO(VisitOMPClauseList(C));
2874 template <
typename Derived>
2875 bool RecursiveASTVisitor<Derived>::VisitOMPDependClause(
OMPDependClause *C) {
2876 TRY_TO(VisitOMPClauseList(C));
2880 template <
typename Derived>
2881 bool RecursiveASTVisitor<Derived>::VisitOMPDeviceClause(
OMPDeviceClause *C) {
2886 template <
typename Derived>
2887 bool RecursiveASTVisitor<Derived>::VisitOMPMapClause(
OMPMapClause *C) {
2888 TRY_TO(VisitOMPClauseList(C));
2892 template <
typename Derived>
2893 bool RecursiveASTVisitor<Derived>::VisitOMPNumTeamsClause(
2899 template <
typename Derived>
2900 bool RecursiveASTVisitor<Derived>::VisitOMPThreadLimitClause(
2906 template <
typename Derived>
2907 bool RecursiveASTVisitor<Derived>::VisitOMPPriorityClause(
2913 template <
typename Derived>
2914 bool RecursiveASTVisitor<Derived>::VisitOMPGrainsizeClause(
2920 template <
typename Derived>
2921 bool RecursiveASTVisitor<Derived>::VisitOMPNumTasksClause(
2927 template <
typename Derived>
2928 bool RecursiveASTVisitor<Derived>::VisitOMPHintClause(
OMPHintClause *C) {
2933 template <
typename Derived>
2934 bool RecursiveASTVisitor<Derived>::VisitOMPDistScheduleClause(
2936 TRY_TO(VisitOMPClauseWithPreInit(C));
2941 template <
typename Derived>
2947 template <
typename Derived>
2948 bool RecursiveASTVisitor<Derived>::VisitOMPToClause(
OMPToClause *C) {
2949 TRY_TO(VisitOMPClauseList(C));
2953 template <
typename Derived>
2954 bool RecursiveASTVisitor<Derived>::VisitOMPFromClause(
OMPFromClause *C) {
2955 TRY_TO(VisitOMPClauseList(C));
2959 template <
typename Derived>
2960 bool RecursiveASTVisitor<Derived>::VisitOMPUseDevicePtrClause(
2962 TRY_TO(VisitOMPClauseList(C));
2966 template <
typename Derived>
2967 bool RecursiveASTVisitor<Derived>::VisitOMPIsDevicePtrClause(
2969 TRY_TO(VisitOMPClauseList(C));
2990 #undef DEF_TRAVERSE_STMT
2991 #undef TRAVERSE_STMT
2992 #undef TRAVERSE_STMT_BASE
2998 #endif // LLVM_CLANG_AST_RECURSIVEASTVISITOR_H
This represents 'thread_limit' clause in the '#pragma omp ...' directive.
bool TraverseLambdaBody(LambdaExpr *LE, DataRecursionQueue *Queue=nullptr)
Recursively visit the body of a lambda expression.
Expr * getSourceExpression() const
This represents clause 'copyin' in the '#pragma omp ...' directives.
A (possibly-)qualified type.
helper_expr_const_range source_exprs() const
#define DEF_TRAVERSE_TMPL_SPEC_DECL(TMPLDECLKIND)
Expr *const * semantics_iterator
C Language Family Type Representation.
Microsoft's '__super' specifier, stored as a CXXRecordDecl* of the class it appeared in...
The template argument is an expression, and we've not resolved it to one of the other forms yet...
#define TRY_TO_TRAVERSE_OR_ENQUEUE_STMT(S)
NestedNameSpecifierLoc getPrefix() const
Return the prefix of this nested-name-specifier.
This represents 'grainsize' clause in the '#pragma omp ...' directive.
Defines the C++ template declaration subclasses.
pack_iterator pack_begin() const
Iterator referencing the first argument of a template argument pack.
This represents 'priority' clause in the '#pragma omp ...' directive.
bool VisitTypeLoc(TypeLoc TL)
The base class of the type hierarchy.
DependentTemplateSpecializationType(ElaboratedTypeKeyword Keyword, NestedNameSpecifier *NNS, const IdentifierInfo *Name, ArrayRef< TemplateArgument > Args, QualType Canon)
The template argument is a declaration that was provided for a pointer, reference, or pointer to member non-type template parameter.
NestedNameSpecifier * getPrefix() const
Return the prefix of this nested name specifier.
A container of type source information.
Expr * getAsExpr() const
Retrieve the template argument as an expression.
bool TraverseTemplateName(TemplateName Template)
Recursively visit a template name and dispatch to the appropriate method.
Describes the capture of a variable or of this, or of a C++1y init-capture.
Expr * getAlignment()
Returns alignment.
An identifier, stored as an IdentifierInfo*.
TRY_TO(TraverseType(T->getPointeeType()))
VarDecl - An instance of this class is created to represent a variable declaration or definition...
Expr * getInit() const
Get the initializer.
Wrapper of type source information for a type with non-trivial direct qualifiers. ...
Derived & getDerived()
Return a reference to the derived class.
Represents an empty template argument, e.g., one that has not been deduced.
This represents 'defaultmap' clause in the '#pragma omp ...' directive.
bool dataTraverseStmtPre(Stmt *S)
Invoked before visiting a statement or expression via data recursion.
A namespace, stored as a NamespaceDecl*.
This represents implicit clause 'flush' for the '#pragma omp flush' directive.
Defines the Objective-C statement AST node classes.
Defines the clang::Expr interface and subclasses for C++ expressions.
SmallVectorImpl< llvm::PointerIntPair< Stmt *, 1, bool > > DataRecursionQueue
A queue used for performing data recursion over statements.
This represents 'nogroup' clause in the '#pragma omp ...' directive.
bool TraverseDecl(Decl *D)
Recursively visit a declaration, by dispatching to Traverse*Decl() based on the argument's dynamic ty...
Base wrapper for a particular "section" of type source info.
DeclarationName getName() const
getName - Returns the embedded declaration name.
return(__x >> __y)|(__x<< (32-__y))
A C++ nested-name-specifier augmented with source location information.
Represents a dependent template name that cannot be resolved prior to template instantiation.
This represents 'simd' clause in the '#pragma omp ...' directive.
bool shouldTraversePostOrder() const
Return whether this visitor should traverse post-order.
The template argument is an integral value stored in an llvm::APSInt that was provided for an integra...
#define TYPE(CLASS, BASE)
bool shouldVisitTemplateInstantiations() const
Return whether this visitor should recurse into template instantiations.
bool TraverseLambdaCapture(LambdaExpr *LE, const LambdaCapture *C)
Recursively visit a lambda capture.
Expr * getChunkSize()
Get chunk size.
This represents clause 'map' in the '#pragma omp ...' directives.
This represents clause 'to' in the '#pragma omp ...' directives.
bool TraverseSynOrSemInitListExpr(InitListExpr *S, DataRecursionQueue *Queue=nullptr)
Recursively visit the syntactic or semantic form of an initialization list.
Wrapper of type source information for a type with no direct qualifiers.
TypeSourceInfo * getTypeSourceInfo() const
Expr * getNumTeams()
Return NumTeams number.
TypeSourceInfo * getNamedTypeInfo() const
getNamedTypeInfo - Returns the source type info associated to the name.
#define DEF_TRAVERSE_TMPL_DECL(TMPLDECLKIND)
This represents clause 'copyprivate' in the '#pragma omp ...' directives.
Describes an C or C++ initializer list.
NamedDecl ** iterator
Iterates through the template parameters in this list.
bool TraverseDeclarationNameInfo(DeclarationNameInfo NameInfo)
Recursively visit a name with its location information.
#define DEF_TRAVERSE_DECL(DECL, CODE)
NestedNameSpecifierLoc getTemplateQualifierLoc() const
QualifiedTemplateName * getAsQualifiedTemplateName() const
Retrieve the underlying qualified template name structure, if any.
bool WalkUpFromType(Type *T)
TypeClass getTypeClass() const
VarDecl * getCapturedVar() const
Retrieve the declaration of the local variable being captured.
CompoundStmt * getBody() const
Retrieve the body of the lambda.
A C++ lambda expression, which produces a function object (of unspecified type) that can be invoked l...
bool WalkUpFromStmt(Stmt *S)
This represents clause 'is_device_ptr' in the '#pragma omp ...' directives.
A class that does preordor or postorder depth-first traversal on the entire Clang AST and visits each...
#define DEF_TRAVERSE_TMPL_PART_SPEC_DECL(TMPLDECLKIND, DECLKIND)
Expr * getHint() const
Returns number of threads.
bool isWritten() const
Determine whether this initializer is explicitly written in the source code.
detail::InMemoryDirectory::const_iterator I
This represents clause 'from' in the '#pragma omp ...' directives.
bool WalkUpFromTypeLoc(TypeLoc TL)
TypeLoc getTypeLoc() const
For a nested-name-specifier that refers to a type, retrieve the type with source-location information...
OMPLinearClause(SourceLocation StartLoc, SourceLocation LParenLoc, OpenMPLinearClauseKind Modifier, SourceLocation ModifierLoc, SourceLocation ColonLoc, SourceLocation EndLoc, unsigned NumVars)
Build 'linear' clause with given number of variables NumVars.
This represents 'threads' clause in the '#pragma omp ...' directive.
This represents clause 'aligned' in the '#pragma omp ...' directives.
DEF_TRAVERSE_TYPE(ComplexType,{TRY_TO(TraverseType(T->getElementType()));}) DEF_TRAVERSE_TYPE(PointerType
NameKind getNameKind() const
getNameKind - Determine what kind of name this is.
This represents implicit clause 'depend' for the '#pragma omp task' directive.
SpecifierKind getKind() const
Determine what kind of nested name specifier is stored.
bool TraverseConstructorInitializer(CXXCtorInitializer *Init)
Recursively visit a constructor initializer.
helper_expr_const_range assignment_ops() const
bool WalkUpFromDecl(Decl *D)
The template argument is a null pointer or null pointer to member that was provided for a non-type te...
bool WalkUpFromQualifiedTypeLoc(QualifiedTypeLoc TL)
bool shouldVisitImplicitCode() const
Return whether this visitor should recurse into implicit code, e.g., implicit constructors and destru...
ArgKind getKind() const
Return the kind of stored template argument.
bool VisitQualifiedTypeLoc(QualifiedTypeLoc TL)
Represents a C++ template name within the type system.
Defines the clang::TypeLoc interface and its subclasses.
A namespace alias, stored as a NamespaceAliasDecl*.
ArrayRef< VarDecl * > getArrayIndices()
TemplateName getAsTemplateOrTemplatePattern() const
Retrieve the template argument as a template name; if the argument is a pack expansion, return the pattern as a template name.
Expr * getDevice()
Return device number.
class LLVM_ALIGNAS(8) TemplateSpecializationType unsigned NumArgs
Represents a type template specialization; the template must be a class template, a type alias templa...
const Type * getAsType() const
Retrieve the type stored in this nested name specifier.
This template specialization was implicitly instantiated from a template.
A type, stored as a Type*.
DEF_TRAVERSE_TYPELOC(ComplexType,{TRY_TO(TraverseType(TL.getTypePtr() ->getElementType()));}) DEF_TRAVERSE_TYPELOC(PointerType
return TraverseArrayTypeLocHelper(TL)
const LambdaCapture * capture_iterator
An iterator that walks over the captures of the lambda, both implicit and explicit.
helper_expr_const_range destination_exprs() const
bool WalkUpFromUnqualTypeLoc(UnqualTypeLoc TL)
This represents 'num_teams' clause in the '#pragma omp ...' directive.
This represents 'hint' clause in the '#pragma omp ...' directive.
bool TraverseTypeLoc(TypeLoc TL)
Recursively visit a type with location, by dispatching to Traverse*TypeLoc() based on the argument ty...
#define TRAVERSE_STMT_BASE(NAME, CLASS, VAR, QUEUE)
bool TraverseNestedNameSpecifierLoc(NestedNameSpecifierLoc NNS)
Recursively visit a C++ nested-name-specifier with location information.
Expr * getPriority()
Return Priority number.
Represents a C++ nested name specifier, such as "\::std::vector<int>::".
This file defines OpenMP nodes for declarative directives.
bool isInitCapture(const LambdaCapture *Capture) const
Determine whether one of this lambda's captures is an init-capture.
bool TraverseStmt(Stmt *S, DataRecursionQueue *Queue=nullptr)
Recursively visit a statement or expression, by dispatching to Traverse*() based on the argument's dy...
TypeLocClass getTypeLocClass() const
This template specialization was instantiated from a template due to an explicit instantiation defini...
This template specialization was formed from a template-id but has not yet been declared, defined, or instantiated.
Expr * getGrainsize() const
Return safe iteration space distance.
bool TraverseType(QualType T)
Recursively visit a type, by dispatching to Traverse*Type() based on the argument's getTypeClass() pr...
ast_type_traits::DynTypedNode Node
if(T->getSizeExpr()) TRY_TO(TraverseStmt(T-> getSizeExpr()))
Represents a template argument.
QualType getAsType() const
Retrieve the type for a type template argument.
Represents a template name that was expressed as a qualified name.
TypeSourceInfo * getTypeSourceInfo() const
Returns the declarator information for a base class or delegating initializer.
This represents 'device' clause in the '#pragma omp ...' directive.
The template argument is a pack expansion of a template name that was provided for a template templat...
#define DEF_TRAVERSE_TMPL_INST(TMPLDECLKIND)
This template specialization was instantiated from a template due to an explicit instantiation declar...
Expr * getNumTasks() const
Return safe iteration space distance.
detail::InMemoryDirectory::const_iterator E
for(auto typeArg:T->getTypeArgsAsWritten())
DeclarationNameInfo - A collector data type for bundling together a DeclarationName and the correspnd...
A type that was preceded by the 'template' keyword, stored as a Type*.
Location wrapper for a TemplateArgument.
This file defines OpenMP AST classes for executable directives and clauses.
bool TraverseTemplateArgument(const TemplateArgument &Arg)
Recursively visit a template argument and dispatch to the appropriate method for the argument type...
Represents a C++ base or member initializer.
This template specialization was declared or defined by an explicit specialization (C++ [temp...
UnqualTypeLoc getUnqualifiedLoc() const
The template argument is a type.
bool TraverseNestedNameSpecifier(NestedNameSpecifier *NNS)
Recursively visit a C++ nested-name-specifier.
The template argument is actually a parameter pack.
DependentTemplateName * getAsDependentTemplateName() const
Retrieve the underlying dependent template name structure, if any.
helper_expr_const_range destination_exprs() const
Defines the C++ Decl subclasses, other than those for templates (found in DeclTemplate.h) and friends (in DeclFriend.h).
unsigned pack_size() const
The number of template arguments in the given template argument pack.
This represents 'num_tasks' clause in the '#pragma omp ...' directive.
The template argument is a template name that was provided for a template template parameter...
bool dataTraverseStmtPost(Stmt *S)
Invoked after visiting a statement or expression via data recursion.
NestedNameSpecifier * getNestedNameSpecifier() const
Retrieve the nested-name-specifier to which this instance refers.
Expr * getThreadLimit()
Return ThreadLimit number.
bool TraverseTemplateArguments(const TemplateArgument *Args, unsigned NumArgs)
Recursively visit a set of template arguments.
#define DEF_TRAVERSE_STMT(STMT, CODE)
This represents 'dist_schedule' clause in the '#pragma omp ...' directive.
bool TraverseAttr(Attr *At)
Recursively visit an attribute, by dispatching to Traverse*Attr() based on the argument's dynamic typ...
UnqualTypeLoc getUnqualifiedLoc() const
Skips past any qualifiers, if this is qualified.
bool VisitUnqualTypeLoc(UnqualTypeLoc TL)
bool isNull() const
Return true if this QualType doesn't point to a type yet.
The global specifier '::'. There is no stored value.
bool shouldWalkTypesOfTypeLocs() const
Return whether this visitor should recurse into the types of TypeLocs.
const TemplateArgument & getArgument() const
TemplateSpecializationType(TemplateName T, ArrayRef< TemplateArgument > Args, QualType Canon, QualType Aliased)
bool TraverseTemplateArgumentLoc(const TemplateArgumentLoc &ArgLoc)
Recursively visit a template argument location and dispatch to the appropriate method for the argumen...
Attr - This represents one attribute.
This represents clause 'use_device_ptr' in the '#pragma omp ...' directives.
helper_expr_const_range assignment_ops() const
#define STMT(CLASS, PARENT)
helper_expr_const_range source_exprs() const