13#ifndef LLVM_CLANG_AST_RECURSIVEASTVISITOR_H
14#define LLVM_CLANG_AST_RECURSIVEASTVISITOR_H
45#include "llvm/ADT/PointerIntPair.h"
46#include "llvm/ADT/SmallVector.h"
47#include "llvm/Support/Casting.h"
58#define TRY_TO(CALL_EXPR) \
60 if (!getDerived().CALL_EXPR) \
66template <
typename T,
typename U>
68template <
typename T,
typename U,
typename R,
typename...
P>
74template <
typename FirstMethodPtrTy,
typename SecondMethodPtrTy>
75LLVM_ATTRIBUTE_ALWAYS_INLINE LLVM_ATTRIBUTE_NODEBUG
auto
77 [[maybe_unused]] SecondMethodPtrTy SecondMethodPtr)
80 SecondMethodPtrTy>::value)
81 return FirstMethodPtr == SecondMethodPtr;
163 Derived &
getDerived() {
return *
static_cast<Derived *
>(
this); }
321#define ATTR_VISITOR_DECLS_ONLY
322#include "clang/AST/AttrVisitor.inc"
323#undef ATTR_VISITOR_DECLS_ONLY
335#define TRAVERSE_STMT_BASE(NAME, CLASS, VAR, QUEUE) \
336 (::clang::detail::has_same_member_pointer_type< \
337 decltype(&RecursiveASTVisitor::Traverse##NAME), \
338 decltype(&Derived::Traverse##NAME)>::value \
339 ? static_cast<std::conditional_t< \
340 ::clang::detail::has_same_member_pointer_type< \
341 decltype(&RecursiveASTVisitor::Traverse##NAME), \
342 decltype(&Derived::Traverse##NAME)>::value, \
343 Derived &, RecursiveASTVisitor &>>(*this) \
344 .Traverse##NAME(static_cast<CLASS *>(VAR), QUEUE) \
345 : getDerived().Traverse##NAME(static_cast<CLASS *>(VAR)))
350#define TRY_TO_TRAVERSE_OR_ENQUEUE_STMT(S) \
352 if (!TRAVERSE_STMT_BASE(Stmt, Stmt, S, Queue)) \
358#define ABSTRACT_STMT(STMT)
359#define STMT(CLASS, PARENT) \
360 bool Traverse##CLASS(CLASS *S, DataRecursionQueue *Queue = nullptr);
361#include "clang/AST/StmtNodes.inc"
367#define STMT(CLASS, PARENT) \
368 bool WalkUpFrom##CLASS(CLASS *S) { \
369 TRY_TO(WalkUpFrom##PARENT(S)); \
370 TRY_TO(Visit##CLASS(S)); \
373 bool Visit##CLASS(CLASS *S) { return true; }
374#include "clang/AST/StmtNodes.inc"
380#define ABSTRACT_TYPE(CLASS, BASE)
381#define TYPE(CLASS, BASE) bool Traverse##CLASS##Type(CLASS##Type *T);
382#include "clang/AST/TypeNodes.inc"
388#define TYPE(CLASS, BASE) \
389 bool WalkUpFrom##CLASS##Type(CLASS##Type *T) { \
390 TRY_TO(WalkUpFrom##BASE(T)); \
391 TRY_TO(Visit##CLASS##Type(T)); \
394 bool Visit##CLASS##Type(CLASS##Type *T) { return true; }
395#include "clang/AST/TypeNodes.inc"
401#define ABSTRACT_TYPELOC(CLASS, BASE)
402#define TYPELOC(CLASS, BASE) bool Traverse##CLASS##TypeLoc(CLASS##TypeLoc TL);
403#include "clang/AST/TypeLocNodes.def"
422#define TYPE(CLASS, BASE) \
423 bool WalkUpFrom##CLASS##TypeLoc(CLASS##TypeLoc TL) { \
424 TRY_TO(WalkUpFrom##BASE##Loc(TL)); \
425 TRY_TO(Visit##CLASS##TypeLoc(TL)); \
428 bool Visit##CLASS##TypeLoc(CLASS##TypeLoc TL) { return true; }
429#include "clang/AST/TypeNodes.inc"
434#define ABSTRACT_DECL(DECL)
435#define DECL(CLASS, BASE) bool Traverse##CLASS##Decl(CLASS##Decl *D);
436#include "clang/AST/DeclNodes.inc"
442#define DECL(CLASS, BASE) \
443 bool WalkUpFrom##CLASS##Decl(CLASS##Decl *D) { \
444 TRY_TO(WalkUpFrom##BASE(D)); \
445 TRY_TO(Visit##CLASS##Decl(D)); \
448 bool Visit##CLASS##Decl(CLASS##Decl *D) { return true; }
449#include "clang/AST/DeclNodes.inc"
453#define DEF_TRAVERSE_TMPL_INST(TMPLDECLKIND) \
454 bool TraverseTemplateInstantiations(TMPLDECLKIND##TemplateDecl *D);
458#undef DEF_TRAVERSE_TMPL_INST
477 template <
typename T>
478 bool TraverseDeclTemplateParameterLists(T *D);
490 bool TraverseVarHelper(
VarDecl *D);
494#define GEN_CLANG_CLAUSE_CLASS
495#define CLAUSE_CLASS(Enum, Str, Class) bool Visit##Class(Class *C);
496#include "llvm/Frontend/OpenMP/OMP.inc"
498 template <
typename T>
bool VisitOMPClauseList(T *
Node);
500 bool VisitOMPClauseWithPreInit(OMPClauseWithPreInit *
Node);
501 bool VisitOMPClauseWithPostUpdate(OMPClauseWithPostUpdate *
Node);
503 bool PostVisitStmt(Stmt *S);
506template <
typename Derived>
509 if (!getDerived().shouldVisitImplicitCode()) {
510 TRY_TO(TraverseConceptReferenceHelper(*
C));
513 if (
Expr *IDC =
C->getImmediatelyDeclaredConstraint()) {
514 TRY_TO(TraverseStmt(IDC));
520 TRY_TO(TraverseConceptReferenceHelper(*
C));
525template <
typename Derived>
530 return getDerived().TraverseConceptTypeRequirement(
531 cast<concepts::TypeRequirement>(R));
534 return getDerived().TraverseConceptExprRequirement(
535 cast<concepts::ExprRequirement>(R));
537 return getDerived().TraverseConceptNestedRequirement(
538 cast<concepts::NestedRequirement>(R));
540 llvm_unreachable(
"unexpected case");
543template <
typename Derived>
546 TRY_TO(TraverseNestedNameSpecifierLoc(
C.getNestedNameSpecifierLoc()));
547 TRY_TO(TraverseDeclarationNameInfo(
C.getConceptNameInfo()));
548 if (
C.hasExplicitTemplateArgs())
549 TRY_TO(TraverseTemplateArgumentLocsHelper(
550 C.getTemplateArgsAsWritten()->getTemplateArgs(),
551 C.getTemplateArgsAsWritten()->NumTemplateArgs));
555template <
typename Derived>
559 switch (S->getStmtClass()) {
562#define ABSTRACT_STMT(STMT)
563#define STMT(CLASS, PARENT) \
564 case Stmt::CLASS##Class: \
565 return TRAVERSE_STMT_BASE(CLASS, CLASS, S, Queue);
566#include "clang/AST/StmtNodes.inc"
574template <
typename Derived>
582template <
typename Derived>
588 if (RetReq.isTypeConstraint()) {
589 if (getDerived().shouldVisitImplicitCode()) {
590 TRY_TO(TraverseTemplateParameterListHelper(
591 RetReq.getTypeConstraintTemplateParameterList()));
594 TRY_TO(TraverseTypeConstraint(RetReq.getTypeConstraint()));
600template <
typename Derived>
608template <
typename Derived>
626 switch (S->getStmtClass()) {
629#define ABSTRACT_STMT(STMT)
630#define STMT(CLASS, PARENT) \
631 case Stmt::CLASS##Class: \
632 if (::clang::detail::isSameMethod(&RecursiveASTVisitor::Traverse##CLASS, \
633 &Derived::Traverse##CLASS)) { \
634 TRY_TO(WalkUpFrom##CLASS(static_cast<CLASS *>(S))); \
637#define INITLISTEXPR(CLASS, PARENT) \
638 case Stmt::CLASS##Class: \
639 if (::clang::detail::isSameMethod(&RecursiveASTVisitor::Traverse##CLASS, \
640 &Derived::Traverse##CLASS)) { \
641 auto ILE = static_cast<CLASS *>(S); \
642 if (auto Syn = ILE->isSemanticForm() ? ILE->getSyntacticForm() : ILE) \
643 TRY_TO(WalkUpFrom##CLASS(Syn)); \
644 if (auto Sem = ILE->isSemanticForm() ? ILE : ILE->getSemanticForm()) \
645 TRY_TO(WalkUpFrom##CLASS(Sem)); \
648#include "clang/AST/StmtNodes.inc"
656template <
typename Derived>
663 Queue->push_back({S,
false});
668 LocalQueue.push_back({S,
false});
670 while (!LocalQueue.empty()) {
671 auto &CurrSAndVisited = LocalQueue.back();
672 Stmt *CurrS = CurrSAndVisited.getPointer();
673 bool Visited = CurrSAndVisited.getInt();
675 LocalQueue.pop_back();
676 TRY_TO(dataTraverseStmtPost(CurrS));
677 if (getDerived().shouldTraversePostOrder()) {
678 TRY_TO(PostVisitStmt(CurrS));
683 if (getDerived().dataTraverseStmtPre(CurrS)) {
684 CurrSAndVisited.setInt(
true);
685 size_t N = LocalQueue.size();
686 TRY_TO(dataTraverseNode(CurrS, &LocalQueue));
688 std::reverse(LocalQueue.begin() + N, LocalQueue.end());
690 LocalQueue.pop_back();
697template <
typename Derived>
703#define ABSTRACT_TYPE(CLASS, BASE)
704#define TYPE(CLASS, BASE) \
706 return getDerived().Traverse##CLASS##Type( \
707 static_cast<CLASS##Type *>(const_cast<Type *>(T.getTypePtr())));
708#include "clang/AST/TypeNodes.inc"
714template <
typename Derived>
720#define ABSTRACT_TYPELOC(CLASS, BASE)
721#define TYPELOC(CLASS, BASE) \
722 case TypeLoc::CLASS: \
723 return getDerived().Traverse##CLASS##TypeLoc(TL.castAs<CLASS##TypeLoc>());
724#include "clang/AST/TypeLocNodes.def"
731#define VISITORCLASS RecursiveASTVisitor
732#include "clang/AST/AttrVisitor.inc"
735template <
typename Derived>
742 if (!getDerived().shouldVisitImplicitCode() && D->
isImplicit()) {
746 if (
auto *TTPD = dyn_cast<TemplateTypeParmDecl>(D))
747 return TraverseTemplateTypeParamDeclConstraints(TTPD);
752#define ABSTRACT_DECL(DECL)
753#define DECL(CLASS, BASE) \
755 if (!getDerived().Traverse##CLASS##Decl(static_cast<CLASS##Decl *>(D))) \
758#include "clang/AST/DeclNodes.inc"
763template <
typename Derived>
788template <
typename Derived>
795 TRY_TO(TraverseNestedNameSpecifierLoc(Prefix));
814template <
typename Derived>
822 TRY_TO(TraverseTypeLoc(TSInfo->getTypeLoc()));
826 TRY_TO(TraverseTemplateName(
843template <
typename Derived>
846 TRY_TO(TraverseNestedNameSpecifier(DTN->getQualifier()));
848 TRY_TO(TraverseNestedNameSpecifier(QTN->getQualifier()));
853template <
typename Derived>
864 return getDerived().TraverseType(Arg.
getAsType());
868 return getDerived().TraverseTemplateName(
872 return getDerived().TraverseStmt(Arg.
getAsExpr());
875 return getDerived().TraverseTemplateArguments(Arg.
pack_elements());
883template <
typename Derived>
898 return getDerived().TraverseTypeLoc(TSI->getTypeLoc());
900 return getDerived().TraverseType(Arg.
getAsType());
906 TRY_TO(getDerived().TraverseNestedNameSpecifierLoc(
908 return getDerived().TraverseTemplateName(
915 return getDerived().TraverseTemplateArguments(Arg.
pack_elements());
921template <
typename Derived>
925 TRY_TO(TraverseTemplateArgument(Arg));
930template <
typename Derived>
934 TRY_TO(TraverseTypeLoc(TInfo->getTypeLoc()));
936 if (Init->isWritten() || getDerived().shouldVisitImplicitCode())
937 TRY_TO(TraverseStmt(Init->getInit()));
942template <
typename Derived>
947 if (LE->isInitCapture(
C))
948 TRY_TO(TraverseDecl(
C->getCapturedVar()));
950 TRY_TO(TraverseStmt(Init));
957#define DEF_TRAVERSE_TYPE(TYPE, CODE) \
958 template <typename Derived> \
959 bool RecursiveASTVisitor<Derived>::Traverse##TYPE(TYPE *T) { \
960 if (!getDerived().shouldTraversePostOrder()) \
961 TRY_TO(WalkUpFrom##TYPE(T)); \
963 if (getDerived().shouldTraversePostOrder()) \
964 TRY_TO(WalkUpFrom##TYPE(T)); \
975 {
TRY_TO(TraverseType(T->getPointeeType())); })
978 {
TRY_TO(TraverseType(T->getPointeeType())); })
981 {
TRY_TO(TraverseType(T->getPointeeType())); })
984 TRY_TO(TraverseType(QualType(T->getClass(), 0)));
985 TRY_TO(TraverseType(T->getPointeeType()));
993 TRY_TO(TraverseType(T->getElementType()));
994 if (T->getSizeExpr())
995 TRY_TO(TraverseStmt(
const_cast<Expr*
>(T->getSizeExpr())));
999 {
TRY_TO(TraverseType(T->getElementType())); })
1002 TRY_TO(TraverseType(T->getElementType()));
1003 TRY_TO(TraverseStmt(T->getSizeExpr()));
1007 TRY_TO(TraverseType(T->getElementType()));
1008 if (T->getSizeExpr())
1009 TRY_TO(TraverseStmt(T->getSizeExpr()));
1013 TRY_TO(TraverseStmt(T->getAddrSpaceExpr()));
1014 TRY_TO(TraverseType(T->getPointeeType()));
1018 if (T->getSizeExpr())
1019 TRY_TO(TraverseStmt(T->getSizeExpr()));
1024 if (T->getSizeExpr())
1025 TRY_TO(TraverseStmt(T->getSizeExpr()));
1026 TRY_TO(TraverseType(T->getElementType()));
1034 {
TRY_TO(TraverseType(T->getElementType())); })
1037 if (T->getRowExpr())
1038 TRY_TO(TraverseStmt(T->getRowExpr()));
1039 if (T->getColumnExpr())
1040 TRY_TO(TraverseStmt(T->getColumnExpr()));
1041 TRY_TO(TraverseType(T->getElementType()));
1045 {
TRY_TO(TraverseType(T->getReturnType())); })
1048 TRY_TO(TraverseType(T->getReturnType()));
1050 for (
const auto &A : T->param_types()) {
1054 for (
const auto &E : T->exceptions()) {
1058 if (
Expr *NE = T->getNoexceptExpr())
1059 TRY_TO(TraverseStmt(NE));
1067 {
TRY_TO(TraverseStmt(T->getUnderlyingExpr())); })
1072 {
TRY_TO(TraverseStmt(T->getUnderlyingExpr())); })
1075 TRY_TO(TraverseType(T->getBaseType()));
1076 TRY_TO(TraverseType(T->getUnderlyingType()));
1080 TRY_TO(TraverseType(T->getDeducedType()));
1081 if (T->isConstrained()) {
1082 TRY_TO(TraverseTemplateArguments(T->getTypeConstraintArguments()));
1086 TRY_TO(TraverseTemplateName(T->getTemplateName()));
1087 TRY_TO(TraverseType(T->getDeducedType()));
1094 TRY_TO(TraverseType(T->getReplacementType()));
1097 TRY_TO(TraverseTemplateArgument(T->getArgumentPack()));
1101 TRY_TO(TraverseTemplateName(T->getTemplateName()));
1102 TRY_TO(TraverseTemplateArguments(T->template_arguments()));
1108 {
TRY_TO(TraverseType(T->getModifiedType())); })
1111 {
TRY_TO(TraverseType(T->getWrappedType())); })
1116 {
TRY_TO(TraverseType(T->getUnderlyingType())); })
1119 if (T->getQualifier()) {
1120 TRY_TO(TraverseNestedNameSpecifier(T->getQualifier()));
1122 TRY_TO(TraverseType(T->getNamedType()));
1126 {
TRY_TO(TraverseNestedNameSpecifier(T->getQualifier())); })
1129 TRY_TO(TraverseNestedNameSpecifier(T->getQualifier()));
1130 TRY_TO(TraverseTemplateArguments(T->template_arguments()));
1142 if (T->getBaseType().getTypePtr() != T)
1143 TRY_TO(TraverseType(T->getBaseType()));
1144 for (
auto typeArg : T->getTypeArgsAsWritten()) {
1145 TRY_TO(TraverseType(typeArg));
1150 {
TRY_TO(TraverseType(T->getPointeeType())); })
1158 {
TRY_TO(TraverseStmt(T->getNumBitsExpr())); })
1170 template <
typename Derived> \
1171 bool RecursiveASTVisitor<Derived>::Traverse##
TYPE##Loc(
TYPE##Loc TL) { \
1172 if (!getDerived().shouldTraversePostOrder()) { \
1173 TRY_TO(WalkUpFrom##
TYPE##Loc(TL)); \
1174 if (getDerived().shouldWalkTypesOfTypeLocs()) \
1175 TRY_TO(WalkUpFrom##
TYPE(
const_cast<TYPE *
>(TL.getTypePtr()))); \
1178 if (getDerived().shouldTraversePostOrder()) { \
1179 TRY_TO(WalkUpFrom##
TYPE##Loc(TL)); \
1180 if (getDerived().shouldWalkTypesOfTypeLocs()) \
1181 TRY_TO(WalkUpFrom##
TYPE(
const_cast<TYPE *
>(TL.getTypePtr()))); \
1186template <
typename Derived>
1188RecursiveASTVisitor<Derived>::TraverseQualifiedTypeLoc(QualifiedTypeLoc TL) {
1204 return TraverseTypeLoc(TL.getUnqualifiedLoc());
1211 TRY_TO(TraverseType(TL.getTypePtr()->getElementType()));
1215 {
TRY_TO(TraverseTypeLoc(TL.getPointeeLoc())); })
1218 {
TRY_TO(TraverseTypeLoc(TL.getPointeeLoc())); })
1221 {
TRY_TO(TraverseTypeLoc(TL.getPointeeLoc())); })
1224 {
TRY_TO(TraverseTypeLoc(TL.getPointeeLoc())); })
1229 if (
auto *TSI = TL.getClassTInfo())
1230 TRY_TO(TraverseTypeLoc(TSI->getTypeLoc()));
1237 {
TRY_TO(TraverseTypeLoc(TL.getOriginalLoc())); })
1240 {
TRY_TO(TraverseTypeLoc(TL.getOriginalLoc())); })
1242template <typename Derived>
1243bool RecursiveASTVisitor<Derived>::TraverseArrayTypeLocHelper(ArrayTypeLoc TL) {
1245 TRY_TO(TraverseStmt(TL.getSizeExpr()));
1250 TRY_TO(TraverseTypeLoc(TL.getElementLoc()));
1251 TRY_TO(TraverseArrayTypeLocHelper(TL));
1255 TRY_TO(TraverseTypeLoc(TL.getElementLoc()));
1260 TRY_TO(TraverseTypeLoc(TL.getElementLoc()));
1261 TRY_TO(TraverseArrayTypeLocHelper(TL));
1265 TRY_TO(TraverseTypeLoc(TL.getElementLoc()));
1266 TRY_TO(TraverseArrayTypeLocHelper(TL));
1270 TRY_TO(TraverseStmt(TL.getTypePtr()->getAddrSpaceExpr()));
1271 TRY_TO(TraverseType(TL.getTypePtr()->getPointeeType()));
1277 if (TL.getTypePtr()->getSizeExpr())
1278 TRY_TO(TraverseStmt(TL.getTypePtr()->getSizeExpr()));
1279 TRY_TO(TraverseType(TL.getTypePtr()->getElementType()));
1284 TRY_TO(TraverseType(TL.getTypePtr()->getElementType()));
1288 if (TL.getTypePtr()->getSizeExpr())
1289 TRY_TO(TraverseStmt(TL.getTypePtr()->getSizeExpr()));
1290 TRY_TO(TraverseType(TL.getTypePtr()->getElementType()));
1296 TRY_TO(TraverseType(TL.getTypePtr()->getElementType()));
1300 TRY_TO(TraverseStmt(TL.getAttrRowOperand()));
1301 TRY_TO(TraverseStmt(TL.getAttrColumnOperand()));
1302 TRY_TO(TraverseType(TL.getTypePtr()->getElementType()));
1306 TRY_TO(TraverseStmt(TL.getAttrRowOperand()));
1307 TRY_TO(TraverseStmt(TL.getAttrColumnOperand()));
1308 TRY_TO(TraverseType(TL.getTypePtr()->getElementType()));
1312 {
TRY_TO(TraverseTypeLoc(TL.getReturnLoc())); })
1316 TRY_TO(TraverseTypeLoc(TL.getReturnLoc()));
1320 for (
unsigned I = 0, E = TL.getNumParams(); I != E; ++I) {
1321 if (TL.getParam(I)) {
1322 TRY_TO(TraverseDecl(TL.getParam(I)));
1323 }
else if (I < T->getNumParams()) {
1333 TRY_TO(TraverseStmt(NE));
1341 {
TRY_TO(TraverseStmt(TL.getUnderlyingExpr())); })
1344 TRY_TO(TraverseTypeLoc(TL.getUnmodifiedTInfo()->getTypeLoc()));
1349 TRY_TO(TraverseStmt(TL.getTypePtr()->getUnderlyingExpr()));
1353 TRY_TO(TraverseTypeLoc(TL.getUnderlyingTInfo()->getTypeLoc()));
1357 TRY_TO(TraverseType(TL.getTypePtr()->getDeducedType()));
1358 if (TL.isConstrained()) {
1359 TRY_TO(TraverseNestedNameSpecifierLoc(TL.getNestedNameSpecifierLoc()));
1360 TRY_TO(TraverseDeclarationNameInfo(TL.getConceptNameInfo()));
1361 for (
unsigned I = 0, E = TL.getNumArgs(); I != E; ++I)
1362 TRY_TO(TraverseTemplateArgumentLoc(TL.getArgLoc(I)));
1367 TRY_TO(TraverseTemplateName(TL.getTypePtr()->getTemplateName()));
1368 TRY_TO(TraverseType(TL.getTypePtr()->getDeducedType()));
1375 TRY_TO(TraverseType(TL.getTypePtr()->getReplacementType()));
1378 TRY_TO(TraverseTemplateArgument(TL.getTypePtr()->getArgumentPack()));
1383 TRY_TO(TraverseTemplateName(TL.getTypePtr()->getTemplateName()));
1384 for (
unsigned I = 0, E = TL.getNumArgs(); I != E; ++I) {
1385 TRY_TO(TraverseTemplateArgumentLoc(TL.getArgLoc(I)));
1394 {
TRY_TO(TraverseTypeLoc(TL.getInnerLoc())); })
1397 {
TRY_TO(TraverseTypeLoc(TL.getModifiedLoc())); })
1400 {
TRY_TO(TraverseTypeLoc(TL.getWrappedLoc())); })
1403 if (TL.getQualifierLoc()) {
1404 TRY_TO(TraverseNestedNameSpecifierLoc(TL.getQualifierLoc()));
1406 TRY_TO(TraverseTypeLoc(TL.getNamedTypeLoc()));
1410 TRY_TO(TraverseNestedNameSpecifierLoc(TL.getQualifierLoc()));
1414 if (TL.getQualifierLoc()) {
1415 TRY_TO(TraverseNestedNameSpecifierLoc(TL.getQualifierLoc()));
1418 for (
unsigned I = 0, E = TL.getNumArgs(); I != E; ++I) {
1419 TRY_TO(TraverseTemplateArgumentLoc(TL.getArgLoc(I)));
1424 {
TRY_TO(TraverseTypeLoc(TL.getPatternLoc())); })
1427 for (
unsigned I = 0, N = TL.getNumProtocols(); I != N; ++I) {
1429 TRY_TO(TraverseObjCProtocolLoc(ProtocolLoc));
1438 if (TL.getTypePtr()->getBaseType().getTypePtr() != TL.getTypePtr())
1439 TRY_TO(TraverseTypeLoc(TL.getBaseLoc()));
1440 for (
unsigned i = 0, n = TL.getNumTypeArgs(); i != n; ++i)
1441 TRY_TO(TraverseTypeLoc(TL.getTypeArgTInfo(i)->getTypeLoc()));
1442 for (
unsigned I = 0, N = TL.getNumProtocols(); I != N; ++I) {
1444 TRY_TO(TraverseObjCProtocolLoc(ProtocolLoc));
1449 {
TRY_TO(TraverseTypeLoc(TL.getPointeeLoc())); })
1457 TRY_TO(TraverseStmt(TL.getTypePtr()->getNumBitsExpr()));
1469template <typename Derived>
1471 const Decl *Child) {
1474 if (isa<BlockDecl>(Child) || isa<CapturedDecl>(Child))
1477 if (
const CXXRecordDecl* Cls = dyn_cast<CXXRecordDecl>(Child))
1478 return Cls->isLambda();
1482template <
typename Derived>
1487 for (
auto *Child : DC->
decls()) {
1488 if (!canIgnoreChildDeclWhileTraversingDeclContext(Child))
1489 TRY_TO(TraverseDecl(Child));
1496#define DEF_TRAVERSE_DECL(DECL, CODE) \
1497 template <typename Derived> \
1498 bool RecursiveASTVisitor<Derived>::Traverse##DECL(DECL *D) { \
1499 bool ShouldVisitChildren = true; \
1500 bool ReturnValue = true; \
1501 if (!getDerived().shouldTraversePostOrder()) \
1502 TRY_TO(WalkUpFrom##DECL(D)); \
1504 if (ReturnValue && ShouldVisitChildren) \
1505 TRY_TO(TraverseDeclContextHelper(dyn_cast<DeclContext>(D))); \
1506 if (ReturnValue) { \
1508 for (auto *I : D->attrs()) \
1509 TRY_TO(getDerived().TraverseAttr(I)); \
1511 if (ReturnValue && getDerived().shouldTraversePostOrder()) \
1512 TRY_TO(WalkUpFrom##DECL(D)); \
1513 return ReturnValue; \
1520 TRY_TO(TraverseTypeLoc(TInfo->getTypeLoc()));
1521 TRY_TO(TraverseStmt(D->getBody()));
1522 for (
const auto &I : D->captures()) {
1523 if (I.hasCopyExpr()) {
1524 TRY_TO(TraverseStmt(I.getCopyExpr()));
1531 TRY_TO(TraverseStmt(D->getBody()));
1540 TRY_TO(TraverseStmt(D->getTemporaryExpr()));
1544 {
TRY_TO(TraverseStmt(D->getAsmString())); })
1552 if (D->getFriendType()) {
1553 TRY_TO(TraverseTypeLoc(D->getFriendType()->getTypeLoc()));
1556 if (
auto *ET = D->getFriendType()->getType()->getAs<ElaboratedType>())
1557 TRY_TO(TraverseDecl(ET->getOwnedTagDecl()));
1559 TRY_TO(TraverseDecl(D->getFriendDecl()));
1564 if (D->getFriendType())
1565 TRY_TO(TraverseTypeLoc(D->getFriendType()->getTypeLoc()));
1567 TRY_TO(TraverseDecl(D->getFriendDecl()));
1568 for (
unsigned I = 0, E = D->getNumTemplateParameters(); I < E; ++I) {
1569 TemplateParameterList *TPL = D->getTemplateParameterList(I);
1570 for (TemplateParameterList::iterator ITPL = TPL->begin(), ETPL = TPL->end();
1571 ITPL != ETPL; ++ITPL) {
1572 TRY_TO(TraverseDecl(*ITPL));
1578 TRY_TO(TraverseDecl(D->getSpecialization()));
1580 if (D->hasExplicitTemplateArgs()) {
1581 TRY_TO(TraverseTemplateArgumentLocsHelper(
1582 D->getTemplateArgsAsWritten()->getTemplateArgs(),
1583 D->getTemplateArgsAsWritten()->NumTemplateArgs));
1595 TRY_TO(TraverseStmt(D->getAssertExpr()));
1596 TRY_TO(TraverseStmt(D->getMessage()));
1606 auto Scope = D->getASTContext().getTraversalScope();
1607 bool HasLimitedScope =
1608 Scope.size() != 1 || !isa<TranslationUnitDecl>(Scope.front());
1609 if (HasLimitedScope) {
1611 for (
auto *Child : Scope) {
1612 if (!canIgnoreChildDeclWhileTraversingDeclContext(Child))
1613 TRY_TO(TraverseDecl(Child));
1625 TRY_TO(TraverseNestedNameSpecifierLoc(D->getQualifierLoc()));
1646 if (ObjCTypeParamList *typeParamList = D->getTypeParamList()) {
1647 for (
auto typeParam : *typeParamList) {
1648 TRY_TO(TraverseObjCTypeParamDecl(typeParam));
1651 for (
auto It : llvm::zip(D->protocols(), D->protocol_locs())) {
1652 ObjCProtocolLoc ProtocolLoc(std::get<0>(It), std::get<1>(It));
1653 TRY_TO(TraverseObjCProtocolLoc(ProtocolLoc));
1664 if (ObjCTypeParamList *typeParamList = D->getTypeParamListAsWritten()) {
1665 for (
auto typeParam : *typeParamList) {
1666 TRY_TO(TraverseObjCTypeParamDecl(typeParam));
1670 if (TypeSourceInfo *superTInfo = D->getSuperClassTInfo()) {
1671 TRY_TO(TraverseTypeLoc(superTInfo->getTypeLoc()));
1673 if (D->isThisDeclarationADefinition()) {
1674 for (
auto It : llvm::zip(D->protocols(), D->protocol_locs())) {
1675 ObjCProtocolLoc ProtocolLoc(std::get<0>(It), std::get<1>(It));
1676 TRY_TO(TraverseObjCProtocolLoc(ProtocolLoc));
1682 if (D->isThisDeclarationADefinition()) {
1683 for (
auto It : llvm::zip(D->protocols(), D->protocol_locs())) {
1684 ObjCProtocolLoc ProtocolLoc(std::get<0>(It), std::get<1>(It));
1685 TRY_TO(TraverseObjCProtocolLoc(ProtocolLoc));
1691 if (D->getReturnTypeSourceInfo()) {
1692 TRY_TO(TraverseTypeLoc(D->getReturnTypeSourceInfo()->getTypeLoc()));
1694 for (ParmVarDecl *Parameter : D->parameters()) {
1695 TRY_TO(TraverseDecl(Parameter));
1697 if (D->isThisDeclarationADefinition()) {
1698 TRY_TO(TraverseStmt(D->getBody()));
1704 if (D->hasExplicitBound()) {
1705 TRY_TO(TraverseTypeLoc(D->getTypeSourceInfo()->getTypeLoc()));
1713 if (D->getTypeSourceInfo())
1714 TRY_TO(TraverseTypeLoc(D->getTypeSourceInfo()->getTypeLoc()));
1716 TRY_TO(TraverseType(D->getType()));
1721 TRY_TO(TraverseNestedNameSpecifierLoc(D->getQualifierLoc()));
1722 TRY_TO(TraverseDeclarationNameInfo(D->getNameInfo()));
1726 {
TRY_TO(TraverseTypeLoc(D->getEnumTypeLoc())); })
1731 TRY_TO(TraverseNestedNameSpecifierLoc(D->getQualifierLoc()));
1739 for (
auto *I : D->varlists()) {
1745 for (
auto *C : D->clauselists()) {
1746 TRY_TO(TraverseOMPClause(C));
1751 TRY_TO(TraverseStmt(D->getCombiner()));
1752 if (
auto *Initializer = D->getInitializer())
1753 TRY_TO(TraverseStmt(Initializer));
1754 TRY_TO(TraverseType(D->getType()));
1759 for (
auto *C : D->clauselists())
1760 TRY_TO(TraverseOMPClause(C));
1761 TRY_TO(TraverseType(D->getType()));
1768 for (
auto *I : D->varlists())
1770 for (
auto *C : D->clauselists())
1771 TRY_TO(TraverseOMPClause(C));
1775template <typename Derived>
1776bool RecursiveASTVisitor<Derived>::TraverseTemplateParameterListHelper(
1777 TemplateParameterList *TPL) {
1779 for (NamedDecl *D : *TPL) {
1782 if (Expr *RequiresClause = TPL->getRequiresClause()) {
1783 TRY_TO(TraverseStmt(RequiresClause));
1789template <
typename Derived>
1790template <
typename T>
1791bool RecursiveASTVisitor<Derived>::TraverseDeclTemplateParameterLists(T *D) {
1792 for (
unsigned i = 0; i < D->getNumTemplateParameterLists(); i++) {
1793 TemplateParameterList *TPL = D->getTemplateParameterList(i);
1794 TraverseTemplateParameterListHelper(TPL);
1799template <
typename Derived>
1800bool RecursiveASTVisitor<Derived>::TraverseTemplateInstantiations(
1801 ClassTemplateDecl *D) {
1802 for (
auto *SD : D->specializations()) {
1803 for (
auto *RD : SD->redecls()) {
1804 assert(!cast<CXXRecordDecl>(RD)->isInjectedClassName());
1806 cast<ClassTemplateSpecializationDecl>(RD)->getSpecializationKind()) {
1810 TRY_TO(TraverseDecl(RD));
1827template <
typename Derived>
1828bool RecursiveASTVisitor<Derived>::TraverseTemplateInstantiations(
1829 VarTemplateDecl *D) {
1830 for (
auto *SD : D->specializations()) {
1831 for (
auto *RD : SD->redecls()) {
1833 cast<VarTemplateSpecializationDecl>(RD)->getSpecializationKind()) {
1836 TRY_TO(TraverseDecl(RD));
1852template <
typename Derived>
1853bool RecursiveASTVisitor<Derived>::TraverseTemplateInstantiations(
1854 FunctionTemplateDecl *D) {
1855 for (
auto *FD : D->specializations()) {
1856 for (
auto *RD : FD->redecls()) {
1857 switch (RD->getTemplateSpecializationKind()) {
1861 TRY_TO(TraverseDecl(RD));
1868 TRY_TO(TraverseDecl(RD));
1882#define DEF_TRAVERSE_TMPL_DECL(TMPLDECLKIND) \
1883 DEF_TRAVERSE_DECL(TMPLDECLKIND##TemplateDecl, { \
1884 TRY_TO(TraverseTemplateParameterListHelper(D->getTemplateParameters())); \
1885 TRY_TO(TraverseDecl(D->getTemplatedDecl())); \
1893 if (getDerived().shouldVisitTemplateInstantiations() && \
1894 D == D->getCanonicalDecl()) \
1895 TRY_TO(TraverseTemplateInstantiations(D)); \
1909 TRY_TO(TraverseDecl(D->getTemplatedDecl()));
1910 if (D->hasDefaultArgument() && !D->defaultArgumentWasInherited())
1911 TRY_TO(TraverseTemplateArgumentLoc(D->getDefaultArgument()));
1912 TRY_TO(TraverseTemplateParameterListHelper(D->getTemplateParameters()));
1916 TRY_TO(TraverseTemplateParameterListHelper(D->getTemplateParameters()));
1919template <typename Derived>
1920bool RecursiveASTVisitor<Derived>::TraverseTemplateTypeParamDeclConstraints(
1921 const TemplateTypeParmDecl *D) {
1922 if (
const auto *TC = D->getTypeConstraint())
1923 TRY_TO(TraverseTypeConstraint(TC));
1929 if (D->getTypeForDecl())
1930 TRY_TO(TraverseType(QualType(D->getTypeForDecl(), 0)));
1931 TRY_TO(TraverseTemplateTypeParamDeclConstraints(D));
1932 if (D->hasDefaultArgument() && !D->defaultArgumentWasInherited())
1933 TRY_TO(TraverseTypeLoc(D->getDefaultArgumentInfo()->getTypeLoc()));
1937 TRY_TO(TraverseTypeLoc(D->getTypeSourceInfo()->getTypeLoc()));
1944 TRY_TO(TraverseTypeLoc(D->getTypeSourceInfo()->getTypeLoc()));
1951 TRY_TO(TraverseDecl(D->getTemplatedDecl()));
1952 TRY_TO(TraverseTemplateParameterListHelper(D->getTemplateParameters()));
1956 TRY_TO(TraverseTemplateParameterListHelper(D->getTemplateParameters()));
1957 TRY_TO(TraverseStmt(D->getConstraintExpr()));
1963 TRY_TO(TraverseNestedNameSpecifierLoc(D->getQualifierLoc()));
1972 TRY_TO(TraverseDeclTemplateParameterLists(D));
1974 TRY_TO(TraverseNestedNameSpecifierLoc(D->getQualifierLoc()));
1975 if (
auto *TSI = D->getIntegerTypeSourceInfo())
1976 TRY_TO(TraverseTypeLoc(TSI->getTypeLoc()));
1982template <typename Derived>
1983bool RecursiveASTVisitor<Derived>::TraverseRecordHelper(RecordDecl *D) {
1987 TRY_TO(TraverseDeclTemplateParameterLists(D));
1988 TRY_TO(TraverseNestedNameSpecifierLoc(D->getQualifierLoc()));
1992template <
typename Derived>
1993bool RecursiveASTVisitor<Derived>::TraverseCXXBaseSpecifier(
1994 const CXXBaseSpecifier &
Base) {
1995 TRY_TO(TraverseTypeLoc(
Base.getTypeSourceInfo()->getTypeLoc()));
1999template <
typename Derived>
2000bool RecursiveASTVisitor<Derived>::TraverseCXXRecordHelper(CXXRecordDecl *D) {
2001 if (!TraverseRecordHelper(D))
2003 if (D->isCompleteDefinition()) {
2004 for (
const auto &I : D->bases()) {
2005 TRY_TO(TraverseCXXBaseSpecifier(I));
2018 DEF_TRAVERSE_DECL(TMPLDECLKIND##TemplateSpecializationDecl, { \
2027 if (TypeSourceInfo *TSI = D->getTypeAsWritten()) \
2028 TRY_TO(TraverseTypeLoc(TSI->getTypeLoc())); \
2030 if (getDerived().shouldVisitTemplateInstantiations() || \
2031 D->getTemplateSpecializationKind() == TSK_ExplicitSpecialization) { \
2033 TRY_TO(Traverse##DECLKIND##Helper(D)); \
2035 TRY_TO(TraverseNestedNameSpecifierLoc(D->getQualifierLoc())); \
2048template <
typename Derived>
2049bool RecursiveASTVisitor<Derived>::TraverseTemplateArgumentLocsHelper(
2050 const TemplateArgumentLoc *TAL,
unsigned Count) {
2051 for (
unsigned I = 0; I < Count; ++I) {
2052 TRY_TO(TraverseTemplateArgumentLoc(TAL[I]));
2057#define DEF_TRAVERSE_TMPL_PART_SPEC_DECL(TMPLDECLKIND, DECLKIND) \
2058 DEF_TRAVERSE_DECL(TMPLDECLKIND##TemplatePartialSpecializationDecl, { \
2060 if (TemplateParameterList *TPL = D->getTemplateParameters()) { \
2061 for (TemplateParameterList::iterator I = TPL->begin(), E = TPL->end(); \
2063 TRY_TO(TraverseDecl(*I)); \
2067 TRY_TO(TraverseTemplateArgumentLocsHelper( \
2068 D->getTemplateArgsAsWritten()->getTemplateArgs(), \
2069 D->getTemplateArgsAsWritten()->NumTemplateArgs)); \
2074 TRY_TO(Traverse##DECLKIND##Helper(D)); \
2087 TRY_TO(TraverseNestedNameSpecifierLoc(D->getQualifierLoc()));
2088 TRY_TO(TraverseDeclarationNameInfo(D->getNameInfo()));
2093template <typename Derived>
2094bool RecursiveASTVisitor<Derived>::TraverseDeclaratorHelper(DeclaratorDecl *D) {
2095 TRY_TO(TraverseDeclTemplateParameterLists(D));
2096 TRY_TO(TraverseNestedNameSpecifierLoc(D->getQualifierLoc()));
2097 if (D->getTypeSourceInfo())
2098 TRY_TO(TraverseTypeLoc(D->getTypeSourceInfo()->getTypeLoc()));
2100 TRY_TO(TraverseType(D->getType()));
2105 TRY_TO(TraverseVarHelper(D));
2106 for (
auto *Binding : D->bindings()) {
2107 TRY_TO(TraverseDecl(Binding));
2112 if (getDerived().shouldVisitImplicitCode())
2113 TRY_TO(TraverseStmt(D->getBinding()));
2124 TRY_TO(TraverseDeclaratorHelper(D));
2125 if (D->isBitField())
2126 TRY_TO(TraverseStmt(D->getBitWidth()));
2127 else if (D->hasInClassInitializer())
2128 TRY_TO(TraverseStmt(D->getInClassInitializer()));
2132 TRY_TO(TraverseDeclaratorHelper(D));
2133 if (D->isBitField())
2134 TRY_TO(TraverseStmt(D->getBitWidth()));
2139 TRY_TO(TraverseDeclaratorHelper(D));
2140 if (D->isBitField())
2141 TRY_TO(TraverseStmt(D->getBitWidth()));
2145template <typename Derived>
2146bool RecursiveASTVisitor<Derived>::TraverseFunctionHelper(FunctionDecl *D) {
2147 TRY_TO(TraverseDeclTemplateParameterLists(D));
2148 TRY_TO(TraverseNestedNameSpecifierLoc(D->getQualifierLoc()));
2149 TRY_TO(TraverseDeclarationNameInfo(D->getNameInfo()));
2156 if (
const FunctionTemplateSpecializationInfo *FTSI =
2157 D->getTemplateSpecializationInfo()) {
2158 if (FTSI->getTemplateSpecializationKind() != TSK_Undeclared &&
2159 FTSI->getTemplateSpecializationKind() != TSK_ImplicitInstantiation) {
2162 if (
const ASTTemplateArgumentListInfo *TALI =
2163 FTSI->TemplateArgumentsAsWritten) {
2164 TRY_TO(TraverseTemplateArgumentLocsHelper(TALI->getTemplateArgs(),
2165 TALI->NumTemplateArgs));
2174 if (TypeSourceInfo *TSI = D->getTypeSourceInfo()) {
2175 TRY_TO(TraverseTypeLoc(TSI->getTypeLoc()));
2176 }
else if (getDerived().shouldVisitImplicitCode()) {
2181 for (ParmVarDecl *Parameter : D->parameters()) {
2182 TRY_TO(TraverseDecl(Parameter));
2187 if (Expr *TrailingRequiresClause = D->getTrailingRequiresClause()) {
2188 TRY_TO(TraverseStmt(TrailingRequiresClause));
2191 if (CXXConstructorDecl *Ctor = dyn_cast<CXXConstructorDecl>(D)) {
2193 for (
auto *I : Ctor->inits()) {
2194 if (I->isWritten() || getDerived().shouldVisitImplicitCode())
2195 TRY_TO(TraverseConstructorInitializer(I));
2200 D->isThisDeclarationADefinition() &&
2203 (!D->isDefaulted() || getDerived().shouldVisitImplicitCode());
2205 if (
const auto *MD = dyn_cast<CXXMethodDecl>(D)) {
2206 if (
const CXXRecordDecl *RD = MD->getParent()) {
2207 if (RD->isLambda() &&
2209 VisitBody = VisitBody && getDerived().shouldVisitLambdaBody();
2215 TRY_TO(TraverseStmt(D->getBody()));
2218 for (
auto *Child : D->decls()) {
2219 if (isa<UsingShadowDecl>(Child))
2220 TRY_TO(TraverseDecl(Child));
2270template <typename Derived>
2271bool RecursiveASTVisitor<Derived>::TraverseVarHelper(VarDecl *D) {
2272 TRY_TO(TraverseDeclaratorHelper(D));
2274 if (!isa<ParmVarDecl>(D) &&
2275 (!D->isCXXForRangeDecl() || getDerived().shouldVisitImplicitCode()))
2276 TRY_TO(TraverseStmt(D->getInit()));
2286 TRY_TO(TraverseDeclaratorHelper(D));
2287 if (D->hasDefaultArgument() && !D->defaultArgumentWasInherited())
2288 TRY_TO(TraverseStmt(D->getDefaultArgument()));
2292 TRY_TO(TraverseVarHelper(D));
2294 if (D->hasDefaultArg() && D->hasUninstantiatedDefaultArg() &&
2295 !D->hasUnparsedDefaultArg())
2296 TRY_TO(TraverseStmt(D->getUninstantiatedDefaultArg()));
2298 if (D->hasDefaultArg() && !D->hasUninstantiatedDefaultArg() &&
2299 !D->hasUnparsedDefaultArg())
2300 TRY_TO(TraverseStmt(D->getDefaultArg()));
2306 TRY_TO(TraverseTemplateArguments(D->getTemplateArguments()));
2322 template <
typename Derived> \
2323 bool RecursiveASTVisitor<Derived>::Traverse##
STMT( \
2324 STMT *S, DataRecursionQueue *Queue) { \
2327 if (!getDerived().shouldTraversePostOrder()) \
2328 TRY_TO(WalkUpFrom##
STMT(S)); \
2330 if (ShouldVisitChildren) { \
2331 for (Stmt * SubStmt : getDerived().getStmtChildren(S)) { \
2332 TRY_TO_TRAVERSE_OR_ENQUEUE_STMT(SubStmt); \
2339 if (!Queue && ReturnValue && getDerived().shouldTraversePostOrder()) { \
2340 TRY_TO(WalkUpFrom##
STMT(S)); \
2347 for (
unsigned I = 0, E = S->getNumInputs(); I < E; ++I) {
2350 for (
unsigned I = 0, E = S->getNumOutputs(); I < E; ++I) {
2353 for (
unsigned I = 0, E = S->getNumClobbers(); I < E; ++I) {
2366 TRY_TO(TraverseDecl(S->getExceptionDecl()));
2371 for (
auto *I : S->decls()) {
2407 if (!getDerived().shouldVisitImplicitCode()) {
2419 TRY_TO(TraverseNestedNameSpecifierLoc(S->getQualifierLoc()));
2420 TRY_TO(TraverseDeclarationNameInfo(S->getNameInfo()));
2430 TRY_TO(TraverseNestedNameSpecifierLoc(S->getQualifierLoc()));
2431 TRY_TO(TraverseDeclarationNameInfo(S->getMemberNameInfo()));
2432 if (S->hasExplicitTemplateArgs()) {
2433 TRY_TO(TraverseTemplateArgumentLocsHelper(S->getTemplateArgs(),
2434 S->getNumTemplateArgs()));
2439 TRY_TO(TraverseNestedNameSpecifierLoc(S->getQualifierLoc()));
2440 TRY_TO(TraverseDeclarationNameInfo(S->getNameInfo()));
2441 TRY_TO(TraverseTemplateArgumentLocsHelper(S->getTemplateArgs(),
2442 S->getNumTemplateArgs()));
2446 TRY_TO(TraverseNestedNameSpecifierLoc(S->getQualifierLoc()));
2447 TRY_TO(TraverseDeclarationNameInfo(S->getNameInfo()));
2448 if (S->hasExplicitTemplateArgs()) {
2449 TRY_TO(TraverseTemplateArgumentLocsHelper(S->getTemplateArgs(),
2450 S->getNumTemplateArgs()));
2455 TRY_TO(TraverseNestedNameSpecifierLoc(S->getQualifierLoc()));
2456 TRY_TO(TraverseDeclarationNameInfo(S->getMemberNameInfo()));
2457 TRY_TO(TraverseTemplateArgumentLocsHelper(S->getTemplateArgs(),
2458 S->getNumTemplateArgs()));
2468 TRY_TO(TraverseTypeLoc(S->getTypeInfoAsWritten()->getTypeLoc()));
2472 TRY_TO(TraverseTypeLoc(S->getTypeInfoAsWritten()->getTypeLoc()));
2476 TRY_TO(TraverseTypeLoc(S->getTypeInfoAsWritten()->getTypeLoc()));
2480 TRY_TO(TraverseTypeLoc(S->getTypeInfoAsWritten()->getTypeLoc()));
2484 TRY_TO(TraverseTypeLoc(S->getTypeInfoAsWritten()->getTypeLoc()));
2488 TRY_TO(TraverseTypeLoc(S->getTypeInfoAsWritten()->getTypeLoc()));
2492 TRY_TO(TraverseTypeLoc(S->getTypeInfoAsWritten()->getTypeLoc()));
2496 TRY_TO(TraverseTypeLoc(S->getTypeInfoAsWritten()->getTypeLoc()));
2499template <typename Derived>
2500bool RecursiveASTVisitor<Derived>::TraverseSynOrSemInitListExpr(
2501 InitListExpr *S, DataRecursionQueue *Queue) {
2505 if (!getDerived().shouldTraversePostOrder())
2506 TRY_TO(WalkUpFromInitListExpr(S));
2509 for (Stmt *SubStmt : S->children()) {
2513 if (!Queue && getDerived().shouldTraversePostOrder())
2514 TRY_TO(WalkUpFromInitListExpr(S));
2519template <
typename Derived>
2520bool RecursiveASTVisitor<Derived>::TraverseObjCProtocolLoc(
2521 ObjCProtocolLoc ProtocolLoc) {
2533template <
typename Derived>
2534bool RecursiveASTVisitor<Derived>::TraverseInitListExpr(
2535 InitListExpr *S, DataRecursionQueue *Queue) {
2536 if (S->isSemanticForm() && S->isSyntacticForm()) {
2538 TRY_TO(TraverseSynOrSemInitListExpr(S, Queue));
2541 TRY_TO(TraverseSynOrSemInitListExpr(
2542 S->isSemanticForm() ? S->getSyntacticForm() : S, Queue));
2543 if (getDerived().shouldVisitImplicitCode()) {
2546 TRY_TO(TraverseSynOrSemInitListExpr(
2547 S->isSemanticForm() ? S : S->getSemanticForm(), Queue));
2556 TRY_TO(TraverseStmt(S->getControllingExpr()));
2557 for (
const GenericSelectionExpr::Association Assoc : S->associations()) {
2558 if (TypeSourceInfo *TSI = Assoc.getTypeSourceInfo())
2559 TRY_TO(TraverseTypeLoc(TSI->getTypeLoc()));
2569 for (PseudoObjectExpr::semantics_iterator i = S->semantics_begin(),
2570 e = S->semantics_end();
2573 if (OpaqueValueExpr *OVE = dyn_cast<OpaqueValueExpr>(sub))
2574 sub = OVE->getSourceExpr();
2583 TRY_TO(TraverseTypeLoc(S->getTypeSourceInfo()->getTypeLoc()));
2588 TRY_TO(TraverseTypeLoc(S->getAllocatedTypeSourceInfo()->getTypeLoc()));
2596 TRY_TO(TraverseTypeLoc(S->getTypeSourceInfo()->getTypeLoc()));
2602 if (S->isArgumentType())
2603 TRY_TO(TraverseTypeLoc(S->getArgumentTypeInfo()->getTypeLoc()));
2609 if (S->isTypeOperand())
2610 TRY_TO(TraverseTypeLoc(S->getTypeOperandSourceInfo()->getTypeLoc()));
2614 TRY_TO(TraverseNestedNameSpecifierLoc(S->getQualifierLoc()));
2622 if (S->isTypeOperand())
2623 TRY_TO(TraverseTypeLoc(S->getTypeOperandSourceInfo()->getTypeLoc()));
2627 for (
unsigned I = 0, N = S->getNumArgs(); I != N; ++I)
2628 TRY_TO(TraverseTypeLoc(S->getArg(I)->getTypeLoc()));
2632 TRY_TO(TraverseTypeLoc(S->getQueriedTypeSourceInfo()->getTypeLoc()));
2640 TRY_TO(TraverseTypeLoc(S->getWrittenTypeInfo()->getTypeLoc()));
2645 TRY_TO(TraverseTypeLoc(S->getTypeSourceInfo()->getTypeLoc()));
2651 for (
unsigned I = 0, N = S->capture_size(); I != N; ++I) {
2652 const LambdaCapture *
C = S->capture_begin() + I;
2653 if (
C->isExplicit() || getDerived().shouldVisitImplicitCode()) {
2654 TRY_TO(TraverseLambdaCapture(S, C, S->capture_init_begin()[I]));
2658 if (getDerived().shouldVisitImplicitCode()) {
2660 TRY_TO(TraverseDecl(S->getLambdaClass()));
2663 TypeLoc TL = S->getCallOperator()->getTypeSourceInfo()->getTypeLoc();
2664 FunctionProtoTypeLoc Proto = TL.getAsAdjusted<FunctionProtoTypeLoc>();
2666 TRY_TO(TraverseTemplateParameterListHelper(S->getTemplateParameterList()));
2667 if (S->hasExplicitParameters()) {
2669 for (
unsigned I = 0, N = Proto.getNumParams(); I != N; ++I)
2670 TRY_TO(TraverseDecl(Proto.getParam(I)));
2673 auto *T = Proto.getTypePtr();
2674 for (
const auto &E : T->exceptions())
2677 if (Expr *NE = T->getNoexceptExpr())
2680 if (S->hasExplicitResultType())
2681 TRY_TO(TraverseTypeLoc(Proto.getReturnLoc()));
2691 TRY_TO(TraverseTypeLoc(S->getTypeSourceInfo()->getTypeLoc()));
2710 TRY_TO(TraverseDecl(S->getBlockDecl()));
2716 TRY_TO(TraverseTypeLoc(S->getTypeSourceInfo()->getTypeLoc()));
2722 if (getDerived().shouldVisitImplicitCode())
2723 TRY_TO(TraverseStmt(S->getExpr()));
2734 TRY_TO(TraverseNestedNameSpecifierLoc(S->getQualifierLoc()));
2735 if (TypeSourceInfo *ScopeInfo = S->getScopeTypeInfo())
2736 TRY_TO(TraverseTypeLoc(ScopeInfo->getTypeLoc()));
2737 if (TypeSourceInfo *DestroyedTypeInfo = S->getDestroyedTypeInfo())
2738 TRY_TO(TraverseTypeLoc(DestroyedTypeInfo->getTypeLoc()));
2753 if (OpaqueValueExpr *OVE = S->getCommonExpr())
2760 if (TypeSourceInfo *TInfo = S->getEncodedTypeSourceInfo())
2761 TRY_TO(TraverseTypeLoc(TInfo->getTypeLoc()));
2768 if (TypeSourceInfo *TInfo = S->getClassReceiverTypeInfo())
2769 TRY_TO(TraverseTypeLoc(TInfo->getTypeLoc()));
2773 if (S->isClassReceiver()) {
2774 ObjCInterfaceDecl *IDecl = S->getClassReceiver();
2775 QualType
Type = IDecl->getASTContext().getObjCInterfaceType(IDecl);
2776 ObjCInterfaceLocInfo
Data;
2777 Data.NameLoc = S->getReceiverLocation();
2788 TRY_TO(TraverseTypeLoc(S->getTypeInfoAsWritten()->getTypeLoc()));
2795 TRY_TO(TraverseTypeLoc(S->getTypeSourceInfo()->getTypeLoc()));
2804 TRY_TO(TraverseNestedNameSpecifierLoc(S->getQualifierLoc()));
2805 if (S->hasExplicitTemplateArgs()) {
2806 TRY_TO(TraverseTemplateArgumentLocsHelper(S->getTemplateArgs(),
2807 S->getNumTemplateArgs()));
2812 TRY_TO(TraverseNestedNameSpecifierLoc(S->getQualifierLoc()));
2813 if (S->hasExplicitTemplateArgs()) {
2814 TRY_TO(TraverseTemplateArgumentLocsHelper(S->getTemplateArgs(),
2815 S->getNumTemplateArgs()));
2827 if (!getDerived().shouldVisitImplicitCode()) {
2828 CXXRewrittenBinaryOperator::DecomposedForm Decomposed =
2829 S->getDecomposedForm();
2830 TRY_TO(TraverseStmt(
const_cast<Expr*
>(Decomposed.LHS)));
2831 TRY_TO(TraverseStmt(
const_cast<Expr*
>(Decomposed.RHS)));
2858 if (S->getLifetimeExtendedTemporaryDecl()) {
2859 TRY_TO(TraverseLifetimeExtendedTemporaryDecl(
2860 S->getLifetimeExtendedTemporaryDecl()));
2868 if (!getDerived().shouldVisitImplicitCode()) {
2874 if (!getDerived().shouldVisitImplicitCode()) {
2880 if (!getDerived().shouldVisitImplicitCode()) {
2886 if (!getDerived().shouldVisitImplicitCode()) {
2892 if (!getDerived().shouldVisitImplicitCode()) {
2899 {
TRY_TO(TraverseConceptReferenceHelper(*S)); })
2902 TRY_TO(TraverseDecl(S->getBody()));
2903 for (ParmVarDecl *Parm : S->getLocalParameters())
2904 TRY_TO(TraverseDecl(Parm));
2905 for (concepts::Requirement *Req : S->getRequirements())
2906 TRY_TO(TraverseConceptRequirement(Req));
2925template <typename Derived>
2926bool RecursiveASTVisitor<Derived>::TraverseOMPExecutableDirective(
2927 OMPExecutableDirective *S) {
2928 for (
auto *C : S->clauses()) {
2929 TRY_TO(TraverseOMPClause(C));
2935 if (!getDerived().shouldVisitImplicitCode()) {
2937 TRY_TO(TraverseStmt(S->getLoopStmt()));
2942template <typename Derived>
2944RecursiveASTVisitor<Derived>::TraverseOMPLoopDirective(OMPLoopDirective *S) {
2945 return TraverseOMPExecutableDirective(S);
2949 {
TRY_TO(TraverseOMPExecutableDirective(S)); })
2952 {
TRY_TO(TraverseOMPExecutableDirective(S)); })
2955 {
TRY_TO(TraverseOMPExecutableDirective(S)); })
2958 {
TRY_TO(TraverseOMPExecutableDirective(S)); })
2961 {
TRY_TO(TraverseOMPExecutableDirective(S)); })
2964 {
TRY_TO(TraverseOMPExecutableDirective(S)); })
2967 {
TRY_TO(TraverseOMPExecutableDirective(S)); })
2970 {
TRY_TO(TraverseOMPExecutableDirective(S)); })
2973 {
TRY_TO(TraverseOMPExecutableDirective(S)); })
2976 {
TRY_TO(TraverseOMPExecutableDirective(S)); })
2979 {
TRY_TO(TraverseOMPExecutableDirective(S)); })
2982 TRY_TO(TraverseDeclarationNameInfo(S->getDirectiveName()));
2983 TRY_TO(TraverseOMPExecutableDirective(S));
2987 {
TRY_TO(TraverseOMPExecutableDirective(S)); })
2990 {
TRY_TO(TraverseOMPExecutableDirective(S)); })
2993 {
TRY_TO(TraverseOMPExecutableDirective(S)); })
2996 {
TRY_TO(TraverseOMPExecutableDirective(S)); })
2999 {
TRY_TO(TraverseOMPExecutableDirective(S)); })
3002 {
TRY_TO(TraverseOMPExecutableDirective(S)); })
3005 {
TRY_TO(TraverseOMPExecutableDirective(S)); })
3008 {
TRY_TO(TraverseOMPExecutableDirective(S)); })
3011 {
TRY_TO(TraverseOMPExecutableDirective(S)); })
3014 {
TRY_TO(TraverseOMPExecutableDirective(S)); })
3017 {
TRY_TO(TraverseOMPExecutableDirective(S)); })
3020 {
TRY_TO(TraverseOMPExecutableDirective(S)); })
3023 {
TRY_TO(TraverseOMPExecutableDirective(S)); })
3026 {
TRY_TO(TraverseOMPExecutableDirective(S)); })
3029 {
TRY_TO(TraverseOMPExecutableDirective(S)); })
3032 {
TRY_TO(TraverseOMPExecutableDirective(S)); })
3035 {
TRY_TO(TraverseOMPExecutableDirective(S)); })
3038 {
TRY_TO(TraverseOMPExecutableDirective(S)); })
3041 {
TRY_TO(TraverseOMPExecutableDirective(S)); })
3044 {
TRY_TO(TraverseOMPExecutableDirective(S)); })
3047 {
TRY_TO(TraverseOMPExecutableDirective(S)); })
3050 {
TRY_TO(TraverseOMPExecutableDirective(S)); })
3053 {
TRY_TO(TraverseOMPExecutableDirective(S)); })
3056 {
TRY_TO(TraverseOMPExecutableDirective(S)); })
3059 {
TRY_TO(TraverseOMPExecutableDirective(S)); })
3062 {
TRY_TO(TraverseOMPExecutableDirective(S)); })
3065 {
TRY_TO(TraverseOMPExecutableDirective(S)); })
3068 {
TRY_TO(TraverseOMPExecutableDirective(S)); })
3071 {
TRY_TO(TraverseOMPExecutableDirective(S)); })
3074 {
TRY_TO(TraverseOMPExecutableDirective(S)); })
3077 {
TRY_TO(TraverseOMPExecutableDirective(S)); })
3080 {
TRY_TO(TraverseOMPExecutableDirective(S)); })
3083 {
TRY_TO(TraverseOMPExecutableDirective(S)); })
3086 {
TRY_TO(TraverseOMPExecutableDirective(S)); })
3089 {
TRY_TO(TraverseOMPExecutableDirective(S)); })
3092 {
TRY_TO(TraverseOMPExecutableDirective(S)); })
3095 {
TRY_TO(TraverseOMPExecutableDirective(S)); })
3098 {
TRY_TO(TraverseOMPExecutableDirective(S)); })
3101 {
TRY_TO(TraverseOMPExecutableDirective(S)); })
3104 {
TRY_TO(TraverseOMPExecutableDirective(S)); })
3107 {
TRY_TO(TraverseOMPExecutableDirective(S)); })
3110 {
TRY_TO(TraverseOMPExecutableDirective(S)); })
3113 {
TRY_TO(TraverseOMPExecutableDirective(S)); })
3116 {
TRY_TO(TraverseOMPExecutableDirective(S)); })
3119 {
TRY_TO(TraverseOMPExecutableDirective(S)); })
3122 {
TRY_TO(TraverseOMPExecutableDirective(S)); })
3125 {
TRY_TO(TraverseOMPExecutableDirective(S)); })
3128 {
TRY_TO(TraverseOMPExecutableDirective(S)); })
3131 {
TRY_TO(TraverseOMPExecutableDirective(S)); })
3134 {
TRY_TO(TraverseOMPExecutableDirective(S)); })
3137 {
TRY_TO(TraverseOMPExecutableDirective(S)); })
3140 {
TRY_TO(TraverseOMPExecutableDirective(S)); })
3143 {
TRY_TO(TraverseOMPExecutableDirective(S)); })
3146 {
TRY_TO(TraverseOMPExecutableDirective(S)); })
3149 {
TRY_TO(TraverseOMPExecutableDirective(S)); })
3152 {
TRY_TO(TraverseOMPExecutableDirective(S)); })
3155 {
TRY_TO(TraverseOMPExecutableDirective(S)); })
3158 {
TRY_TO(TraverseOMPExecutableDirective(S)); })
3161 {
TRY_TO(TraverseOMPExecutableDirective(S)); })
3164template <typename Derived>
3165bool RecursiveASTVisitor<Derived>::TraverseOMPClause(OMPClause *C) {
3168 switch (
C->getClauseKind()) {
3169#define GEN_CLANG_CLAUSE_CLASS
3170#define CLAUSE_CLASS(Enum, Str, Class) \
3171 case llvm::omp::Clause::Enum: \
3172 TRY_TO(Visit##Class(static_cast<Class *>(C))); \
3174#define CLAUSE_NO_CLASS(Enum, Str) \
3175 case llvm::omp::Clause::Enum: \
3177#include "llvm/Frontend/OpenMP/OMP.inc"
3182template <
typename Derived>
3183bool RecursiveASTVisitor<Derived>::VisitOMPClauseWithPreInit(
3184 OMPClauseWithPreInit *
Node) {
3185 TRY_TO(TraverseStmt(
Node->getPreInitStmt()));
3189template <
typename Derived>
3190bool RecursiveASTVisitor<Derived>::VisitOMPClauseWithPostUpdate(
3191 OMPClauseWithPostUpdate *
Node) {
3193 TRY_TO(TraverseStmt(
Node->getPostUpdateExpr()));
3197template <
typename Derived>
3198bool RecursiveASTVisitor<Derived>::VisitOMPAllocatorClause(
3199 OMPAllocatorClause *C) {
3200 TRY_TO(TraverseStmt(
C->getAllocator()));
3204template <
typename Derived>
3205bool RecursiveASTVisitor<Derived>::VisitOMPAllocateClause(OMPAllocateClause *C) {
3206 TRY_TO(TraverseStmt(
C->getAllocator()));
3207 TRY_TO(VisitOMPClauseList(C));
3211template <
typename Derived>
3212bool RecursiveASTVisitor<Derived>::VisitOMPIfClause(OMPIfClause *C) {
3213 TRY_TO(VisitOMPClauseWithPreInit(C));
3214 TRY_TO(TraverseStmt(
C->getCondition()));
3218template <
typename Derived>
3219bool RecursiveASTVisitor<Derived>::VisitOMPFinalClause(OMPFinalClause *C) {
3220 TRY_TO(VisitOMPClauseWithPreInit(C));
3221 TRY_TO(TraverseStmt(
C->getCondition()));
3225template <
typename Derived>
3227RecursiveASTVisitor<Derived>::VisitOMPNumThreadsClause(OMPNumThreadsClause *C) {
3228 TRY_TO(VisitOMPClauseWithPreInit(C));
3229 TRY_TO(TraverseStmt(
C->getNumThreads()));
3233template <
typename Derived>
3234bool RecursiveASTVisitor<Derived>::VisitOMPAlignClause(OMPAlignClause *C) {
3235 TRY_TO(TraverseStmt(
C->getAlignment()));
3239template <
typename Derived>
3240bool RecursiveASTVisitor<Derived>::VisitOMPSafelenClause(OMPSafelenClause *C) {
3241 TRY_TO(TraverseStmt(
C->getSafelen()));
3245template <
typename Derived>
3246bool RecursiveASTVisitor<Derived>::VisitOMPSimdlenClause(OMPSimdlenClause *C) {
3247 TRY_TO(TraverseStmt(
C->getSimdlen()));
3251template <
typename Derived>
3252bool RecursiveASTVisitor<Derived>::VisitOMPSizesClause(OMPSizesClause *C) {
3253 for (Expr *E :
C->getSizesRefs())
3258template <
typename Derived>
3259bool RecursiveASTVisitor<Derived>::VisitOMPFullClause(OMPFullClause *C) {
3263template <
typename Derived>
3264bool RecursiveASTVisitor<Derived>::VisitOMPPartialClause(OMPPartialClause *C) {
3265 TRY_TO(TraverseStmt(
C->getFactor()));
3269template <
typename Derived>
3271RecursiveASTVisitor<Derived>::VisitOMPCollapseClause(OMPCollapseClause *C) {
3272 TRY_TO(TraverseStmt(
C->getNumForLoops()));
3276template <
typename Derived>
3277bool RecursiveASTVisitor<Derived>::VisitOMPDefaultClause(OMPDefaultClause *) {
3281template <
typename Derived>
3282bool RecursiveASTVisitor<Derived>::VisitOMPProcBindClause(OMPProcBindClause *) {
3286template <
typename Derived>
3287bool RecursiveASTVisitor<Derived>::VisitOMPUnifiedAddressClause(
3288 OMPUnifiedAddressClause *) {
3292template <
typename Derived>
3293bool RecursiveASTVisitor<Derived>::VisitOMPUnifiedSharedMemoryClause(
3294 OMPUnifiedSharedMemoryClause *) {
3298template <
typename Derived>
3299bool RecursiveASTVisitor<Derived>::VisitOMPReverseOffloadClause(
3300 OMPReverseOffloadClause *) {
3304template <
typename Derived>
3305bool RecursiveASTVisitor<Derived>::VisitOMPDynamicAllocatorsClause(
3306 OMPDynamicAllocatorsClause *) {
3310template <
typename Derived>
3311bool RecursiveASTVisitor<Derived>::VisitOMPAtomicDefaultMemOrderClause(
3312 OMPAtomicDefaultMemOrderClause *) {
3316template <
typename Derived>
3317bool RecursiveASTVisitor<Derived>::VisitOMPAtClause(OMPAtClause *) {
3321template <
typename Derived>
3322bool RecursiveASTVisitor<Derived>::VisitOMPSeverityClause(OMPSeverityClause *) {
3326template <
typename Derived>
3327bool RecursiveASTVisitor<Derived>::VisitOMPMessageClause(OMPMessageClause *C) {
3328 TRY_TO(TraverseStmt(
C->getMessageString()));
3332template <
typename Derived>
3334RecursiveASTVisitor<Derived>::VisitOMPScheduleClause(OMPScheduleClause *C) {
3335 TRY_TO(VisitOMPClauseWithPreInit(C));
3336 TRY_TO(TraverseStmt(
C->getChunkSize()));
3340template <
typename Derived>
3341bool RecursiveASTVisitor<Derived>::VisitOMPOrderedClause(OMPOrderedClause *C) {
3342 TRY_TO(TraverseStmt(
C->getNumForLoops()));
3346template <
typename Derived>
3347bool RecursiveASTVisitor<Derived>::VisitOMPNowaitClause(OMPNowaitClause *) {
3351template <
typename Derived>
3352bool RecursiveASTVisitor<Derived>::VisitOMPUntiedClause(OMPUntiedClause *) {
3356template <
typename Derived>
3358RecursiveASTVisitor<Derived>::VisitOMPMergeableClause(OMPMergeableClause *) {
3362template <
typename Derived>
3363bool RecursiveASTVisitor<Derived>::VisitOMPReadClause(OMPReadClause *) {
3367template <
typename Derived>
3368bool RecursiveASTVisitor<Derived>::VisitOMPWriteClause(OMPWriteClause *) {
3372template <
typename Derived>
3373bool RecursiveASTVisitor<Derived>::VisitOMPUpdateClause(OMPUpdateClause *) {
3377template <
typename Derived>
3378bool RecursiveASTVisitor<Derived>::VisitOMPCaptureClause(OMPCaptureClause *) {
3382template <
typename Derived>
3383bool RecursiveASTVisitor<Derived>::VisitOMPCompareClause(OMPCompareClause *) {
3387template <
typename Derived>
3388bool RecursiveASTVisitor<Derived>::VisitOMPSeqCstClause(OMPSeqCstClause *) {
3392template <
typename Derived>
3393bool RecursiveASTVisitor<Derived>::VisitOMPAcqRelClause(OMPAcqRelClause *) {
3397template <
typename Derived>
3398bool RecursiveASTVisitor<Derived>::VisitOMPAcquireClause(OMPAcquireClause *) {
3402template <
typename Derived>
3403bool RecursiveASTVisitor<Derived>::VisitOMPReleaseClause(OMPReleaseClause *) {
3407template <
typename Derived>
3408bool RecursiveASTVisitor<Derived>::VisitOMPRelaxedClause(OMPRelaxedClause *) {
3412template <
typename Derived>
3413bool RecursiveASTVisitor<Derived>::VisitOMPThreadsClause(OMPThreadsClause *) {
3417template <
typename Derived>
3418bool RecursiveASTVisitor<Derived>::VisitOMPSIMDClause(OMPSIMDClause *) {
3422template <
typename Derived>
3423bool RecursiveASTVisitor<Derived>::VisitOMPNogroupClause(OMPNogroupClause *) {
3427template <
typename Derived>
3428bool RecursiveASTVisitor<Derived>::VisitOMPInitClause(OMPInitClause *C) {
3429 TRY_TO(VisitOMPClauseList(C));
3433template <
typename Derived>
3434bool RecursiveASTVisitor<Derived>::VisitOMPUseClause(OMPUseClause *C) {
3435 TRY_TO(TraverseStmt(
C->getInteropVar()));
3439template <
typename Derived>
3440bool RecursiveASTVisitor<Derived>::VisitOMPDestroyClause(OMPDestroyClause *C) {
3441 TRY_TO(TraverseStmt(
C->getInteropVar()));
3445template <
typename Derived>
3446bool RecursiveASTVisitor<Derived>::VisitOMPNovariantsClause(
3447 OMPNovariantsClause *C) {
3448 TRY_TO(VisitOMPClauseWithPreInit(C));
3449 TRY_TO(TraverseStmt(
C->getCondition()));
3453template <
typename Derived>
3454bool RecursiveASTVisitor<Derived>::VisitOMPNocontextClause(
3455 OMPNocontextClause *C) {
3456 TRY_TO(VisitOMPClauseWithPreInit(C));
3457 TRY_TO(TraverseStmt(
C->getCondition()));
3461template <
typename Derived>
3462template <
typename T>
3463bool RecursiveASTVisitor<Derived>::VisitOMPClauseList(T *
Node) {
3464 for (
auto *E :
Node->varlists()) {
3470template <
typename Derived>
3471bool RecursiveASTVisitor<Derived>::VisitOMPInclusiveClause(
3472 OMPInclusiveClause *C) {
3473 TRY_TO(VisitOMPClauseList(C));
3477template <
typename Derived>
3478bool RecursiveASTVisitor<Derived>::VisitOMPExclusiveClause(
3479 OMPExclusiveClause *C) {
3480 TRY_TO(VisitOMPClauseList(C));
3484template <
typename Derived>
3485bool RecursiveASTVisitor<Derived>::VisitOMPPrivateClause(OMPPrivateClause *C) {
3486 TRY_TO(VisitOMPClauseList(C));
3487 for (
auto *E :
C->private_copies()) {
3493template <
typename Derived>
3494bool RecursiveASTVisitor<Derived>::VisitOMPFirstprivateClause(
3495 OMPFirstprivateClause *C) {
3496 TRY_TO(VisitOMPClauseList(C));
3497 TRY_TO(VisitOMPClauseWithPreInit(C));
3498 for (
auto *E :
C->private_copies()) {
3501 for (
auto *E :
C->inits()) {
3507template <
typename Derived>
3508bool RecursiveASTVisitor<Derived>::VisitOMPLastprivateClause(
3509 OMPLastprivateClause *C) {
3510 TRY_TO(VisitOMPClauseList(C));
3511 TRY_TO(VisitOMPClauseWithPostUpdate(C));
3512 for (
auto *E :
C->private_copies()) {
3515 for (
auto *E :
C->source_exprs()) {
3518 for (
auto *E :
C->destination_exprs()) {
3521 for (
auto *E :
C->assignment_ops()) {
3527template <
typename Derived>
3528bool RecursiveASTVisitor<Derived>::VisitOMPSharedClause(OMPSharedClause *C) {
3529 TRY_TO(VisitOMPClauseList(C));
3533template <
typename Derived>
3534bool RecursiveASTVisitor<Derived>::VisitOMPLinearClause(OMPLinearClause *C) {
3535 TRY_TO(TraverseStmt(
C->getStep()));
3536 TRY_TO(TraverseStmt(
C->getCalcStep()));
3537 TRY_TO(VisitOMPClauseList(C));
3538 TRY_TO(VisitOMPClauseWithPostUpdate(C));
3539 for (
auto *E :
C->privates()) {
3542 for (
auto *E :
C->inits()) {
3545 for (
auto *E :
C->updates()) {
3548 for (
auto *E :
C->finals()) {
3554template <
typename Derived>
3555bool RecursiveASTVisitor<Derived>::VisitOMPAlignedClause(OMPAlignedClause *C) {
3556 TRY_TO(TraverseStmt(
C->getAlignment()));
3557 TRY_TO(VisitOMPClauseList(C));
3561template <
typename Derived>
3562bool RecursiveASTVisitor<Derived>::VisitOMPCopyinClause(OMPCopyinClause *C) {
3563 TRY_TO(VisitOMPClauseList(C));
3564 for (
auto *E :
C->source_exprs()) {
3567 for (
auto *E :
C->destination_exprs()) {
3570 for (
auto *E :
C->assignment_ops()) {
3576template <
typename Derived>
3577bool RecursiveASTVisitor<Derived>::VisitOMPCopyprivateClause(
3578 OMPCopyprivateClause *C) {
3579 TRY_TO(VisitOMPClauseList(C));
3580 for (
auto *E :
C->source_exprs()) {
3583 for (
auto *E :
C->destination_exprs()) {
3586 for (
auto *E :
C->assignment_ops()) {
3592template <
typename Derived>
3594RecursiveASTVisitor<Derived>::VisitOMPReductionClause(OMPReductionClause *C) {
3595 TRY_TO(TraverseNestedNameSpecifierLoc(
C->getQualifierLoc()));
3596 TRY_TO(TraverseDeclarationNameInfo(
C->getNameInfo()));
3597 TRY_TO(VisitOMPClauseList(C));
3598 TRY_TO(VisitOMPClauseWithPostUpdate(C));
3599 for (
auto *E :
C->privates()) {
3602 for (
auto *E :
C->lhs_exprs()) {
3605 for (
auto *E :
C->rhs_exprs()) {
3608 for (
auto *E :
C->reduction_ops()) {
3611 if (
C->getModifier() == OMPC_REDUCTION_inscan) {
3612 for (
auto *E :
C->copy_ops()) {
3615 for (
auto *E :
C->copy_array_temps()) {
3618 for (
auto *E :
C->copy_array_elems()) {
3625template <
typename Derived>
3626bool RecursiveASTVisitor<Derived>::VisitOMPTaskReductionClause(
3627 OMPTaskReductionClause *C) {
3628 TRY_TO(TraverseNestedNameSpecifierLoc(
C->getQualifierLoc()));
3629 TRY_TO(TraverseDeclarationNameInfo(
C->getNameInfo()));
3630 TRY_TO(VisitOMPClauseList(C));
3631 TRY_TO(VisitOMPClauseWithPostUpdate(C));
3632 for (
auto *E :
C->privates()) {
3635 for (
auto *E :
C->lhs_exprs()) {
3638 for (
auto *E :
C->rhs_exprs()) {
3641 for (
auto *E :
C->reduction_ops()) {
3647template <
typename Derived>
3648bool RecursiveASTVisitor<Derived>::VisitOMPInReductionClause(
3649 OMPInReductionClause *C) {
3650 TRY_TO(TraverseNestedNameSpecifierLoc(
C->getQualifierLoc()));
3651 TRY_TO(TraverseDeclarationNameInfo(
C->getNameInfo()));
3652 TRY_TO(VisitOMPClauseList(C));
3653 TRY_TO(VisitOMPClauseWithPostUpdate(C));
3654 for (
auto *E :
C->privates()) {
3657 for (
auto *E :
C->lhs_exprs()) {
3660 for (
auto *E :
C->rhs_exprs()) {
3663 for (
auto *E :
C->reduction_ops()) {
3666 for (
auto *E :
C->taskgroup_descriptors())
3671template <
typename Derived>
3672bool RecursiveASTVisitor<Derived>::VisitOMPFlushClause(OMPFlushClause *C) {
3673 TRY_TO(VisitOMPClauseList(C));
3677template <
typename Derived>
3678bool RecursiveASTVisitor<Derived>::VisitOMPDepobjClause(OMPDepobjClause *C) {
3679 TRY_TO(TraverseStmt(
C->getDepobj()));
3683template <
typename Derived>
3684bool RecursiveASTVisitor<Derived>::VisitOMPDependClause(OMPDependClause *C) {
3685 TRY_TO(VisitOMPClauseList(C));
3689template <
typename Derived>
3690bool RecursiveASTVisitor<Derived>::VisitOMPDeviceClause(OMPDeviceClause *C) {
3691 TRY_TO(VisitOMPClauseWithPreInit(C));
3692 TRY_TO(TraverseStmt(
C->getDevice()));
3696template <
typename Derived>
3697bool RecursiveASTVisitor<Derived>::VisitOMPMapClause(OMPMapClause *C) {
3698 TRY_TO(VisitOMPClauseList(C));
3702template <
typename Derived>
3703bool RecursiveASTVisitor<Derived>::VisitOMPNumTeamsClause(
3704 OMPNumTeamsClause *C) {
3705 TRY_TO(VisitOMPClauseWithPreInit(C));
3706 TRY_TO(TraverseStmt(
C->getNumTeams()));
3710template <
typename Derived>
3711bool RecursiveASTVisitor<Derived>::VisitOMPThreadLimitClause(
3712 OMPThreadLimitClause *C) {
3713 TRY_TO(VisitOMPClauseWithPreInit(C));
3714 TRY_TO(TraverseStmt(
C->getThreadLimit()));
3718template <
typename Derived>
3719bool RecursiveASTVisitor<Derived>::VisitOMPPriorityClause(
3720 OMPPriorityClause *C) {
3721 TRY_TO(VisitOMPClauseWithPreInit(C));
3722 TRY_TO(TraverseStmt(
C->getPriority()));
3726template <
typename Derived>
3727bool RecursiveASTVisitor<Derived>::VisitOMPGrainsizeClause(
3728 OMPGrainsizeClause *C) {
3729 TRY_TO(VisitOMPClauseWithPreInit(C));
3730 TRY_TO(TraverseStmt(
C->getGrainsize()));
3734template <
typename Derived>
3735bool RecursiveASTVisitor<Derived>::VisitOMPNumTasksClause(
3736 OMPNumTasksClause *C) {
3737 TRY_TO(VisitOMPClauseWithPreInit(C));
3738 TRY_TO(TraverseStmt(
C->getNumTasks()));
3742template <
typename Derived>
3743bool RecursiveASTVisitor<Derived>::VisitOMPHintClause(OMPHintClause *C) {
3744 TRY_TO(TraverseStmt(
C->getHint()));
3748template <
typename Derived>
3749bool RecursiveASTVisitor<Derived>::VisitOMPDistScheduleClause(
3750 OMPDistScheduleClause *C) {
3751 TRY_TO(VisitOMPClauseWithPreInit(C));
3752 TRY_TO(TraverseStmt(
C->getChunkSize()));
3756template <
typename Derived>
3758RecursiveASTVisitor<Derived>::VisitOMPDefaultmapClause(OMPDefaultmapClause *C) {
3762template <
typename Derived>
3763bool RecursiveASTVisitor<Derived>::VisitOMPToClause(OMPToClause *C) {
3764 TRY_TO(VisitOMPClauseList(C));
3768template <
typename Derived>
3769bool RecursiveASTVisitor<Derived>::VisitOMPFromClause(OMPFromClause *C) {
3770 TRY_TO(VisitOMPClauseList(C));
3774template <
typename Derived>
3775bool RecursiveASTVisitor<Derived>::VisitOMPUseDevicePtrClause(
3776 OMPUseDevicePtrClause *C) {
3777 TRY_TO(VisitOMPClauseList(C));
3781template <
typename Derived>
3782bool RecursiveASTVisitor<Derived>::VisitOMPUseDeviceAddrClause(
3783 OMPUseDeviceAddrClause *C) {
3784 TRY_TO(VisitOMPClauseList(C));
3788template <
typename Derived>
3789bool RecursiveASTVisitor<Derived>::VisitOMPIsDevicePtrClause(
3790 OMPIsDevicePtrClause *C) {
3791 TRY_TO(VisitOMPClauseList(C));
3795template <
typename Derived>
3796bool RecursiveASTVisitor<Derived>::VisitOMPHasDeviceAddrClause(
3797 OMPHasDeviceAddrClause *C) {
3798 TRY_TO(VisitOMPClauseList(C));
3802template <
typename Derived>
3803bool RecursiveASTVisitor<Derived>::VisitOMPNontemporalClause(
3804 OMPNontemporalClause *C) {
3805 TRY_TO(VisitOMPClauseList(C));
3806 for (
auto *E :
C->private_refs()) {
3812template <
typename Derived>
3813bool RecursiveASTVisitor<Derived>::VisitOMPOrderClause(OMPOrderClause *) {
3817template <
typename Derived>
3818bool RecursiveASTVisitor<Derived>::VisitOMPDetachClause(OMPDetachClause *C) {
3819 TRY_TO(TraverseStmt(
C->getEventHandler()));
3823template <
typename Derived>
3824bool RecursiveASTVisitor<Derived>::VisitOMPUsesAllocatorsClause(
3825 OMPUsesAllocatorsClause *C) {
3826 for (
unsigned I = 0, E =
C->getNumberOfAllocators(); I < E; ++I) {
3827 const OMPUsesAllocatorsClause::Data
Data =
C->getAllocatorData(I);
3834template <
typename Derived>
3835bool RecursiveASTVisitor<Derived>::VisitOMPAffinityClause(
3836 OMPAffinityClause *C) {
3837 TRY_TO(TraverseStmt(
C->getModifier()));
3838 for (Expr *E :
C->varlists())
3843template <
typename Derived>
3844bool RecursiveASTVisitor<Derived>::VisitOMPFilterClause(OMPFilterClause *C) {
3845 TRY_TO(VisitOMPClauseWithPreInit(C));
3846 TRY_TO(TraverseStmt(
C->getThreadID()));
3850template <
typename Derived>
3851bool RecursiveASTVisitor<Derived>::VisitOMPBindClause(OMPBindClause *C) {
3855template <
typename Derived>
3856bool RecursiveASTVisitor<Derived>::VisitOMPXDynCGroupMemClause(
3857 OMPXDynCGroupMemClause *C) {
3858 TRY_TO(VisitOMPClauseWithPreInit(C));
3859 TRY_TO(TraverseStmt(
C->getSize()));
3880#undef DEF_TRAVERSE_STMT
3882#undef TRAVERSE_STMT_BASE
This file provides AST data structures related to concepts.
#define TYPE(DERIVED, BASE)
Defines the C++ Decl subclasses, other than those for templates (found in DeclTemplate....
This file defines OpenMP nodes for declarative directives.
Defines the C++ template declaration subclasses.
Defines the clang::Expr interface and subclasses for C++ expressions.
Defines Expressions and AST nodes for C++2a concepts.
Forward-declares and imports various common LLVM datatypes that clang wants to use unqualified.
Defines the LambdaCapture class.
This file defines OpenMP AST classes for clauses.
Defines some OpenMP-specific enums and functions.
#define DEF_TRAVERSE_TMPL_INST(TMPLDECLKIND)
#define DEF_TRAVERSE_TMPL_PART_SPEC_DECL(TMPLDECLKIND, DECLKIND)
#define DEF_TRAVERSE_TYPE(TYPE, CODE)
#define DEF_TRAVERSE_TYPELOC(TYPE, CODE)
#define TRY_TO_TRAVERSE_OR_ENQUEUE_STMT(S)
#define STMT(CLASS, PARENT)
#define DEF_TRAVERSE_TMPL_SPEC_DECL(TMPLDECLKIND, DECLKIND)
#define DEF_TRAVERSE_DECL(DECL, CODE)
#define DEF_TRAVERSE_STMT(STMT, CODE)
#define DEF_TRAVERSE_TMPL_DECL(TMPLDECLKIND)
#define TRY_TO(CALL_EXPR)
Defines various enumerations that describe declaration and type specifiers.
Defines the Objective-C statement AST node classes.
This file defines OpenMP AST classes for executable directives and clauses.
Defines the clang::TypeLoc interface and its subclasses.
C Language Family Type Representation.
Holds long-lived AST nodes (such as types and decls) that can be referred to throughout the semantic ...
TranslationUnitDecl * getTranslationUnitDecl() const
Represents a type which was implicitly adjusted by the semantic engine for arbitrary reasons.
Wrapper for source info for arrays.
Attr - This represents one attribute.
An attributed type is a type to which a type attribute has been applied.
Represents a block literal declaration, which is like an unnamed FunctionDecl.
Represents a base class of a C++ class.
Represents a C++ base or member initializer.
Represents a C++ struct/union/class.
Complex values, per C99 6.2.5p11.
Common data class for constructs that reference concepts with template arguments.
Represents the canonical version of C arrays with a specified constant size.
DeclContext - This is used only as base class of specific decl types that can act as declaration cont...
decl_range decls() const
decls_begin/decls_end - Iterate over the declarations stored in this context.
Decl - This represents one declaration (or definition), e.g.
bool isImplicit() const
isImplicit - Indicates whether the declaration was implicitly generated by the implementation.
TemplateDecl * getCXXDeductionGuideTemplate() const
If this name is the name of a C++ deduction guide, return the template associated with that name.
@ CXXConversionFunctionName
NameKind getNameKind() const
Determine what kind of name this is.
Represents a ValueDecl that came out of a declarator.
Represents a C++17 deduced template specialization type.
Represents an extended address space qualifier where the input address space value is dependent.
Represents an extended vector type where either the type or size is dependent.
Represents a matrix type where the type and the number of rows and columns is dependent on a template...
Represents a dependent template name that cannot be resolved prior to template instantiation.
Represents a template specialization type whose template cannot be resolved, e.g.
Represents a type that was referred to using an elaborated type keyword, e.g., struct S,...
This represents one expression.
ExtVectorType - Extended vector type.
Represents a function declaration or definition.
Represents a prototype with parameter type info, e.g.
QualType getParamType(unsigned i) const
Expr * getNoexceptExpr() const
Return the expression inside noexcept(expression), or a null pointer if there is none (because the ex...
ArrayRef< QualType > exceptions() const
Describes an C or C++ initializer list.
Describes the capture of a variable or of this, or of a C++1y init-capture.
A C++ lambda expression, which produces a function object (of unspecified type) that can be invoked l...
Implicit declaration of a temporary that was materialized by a MaterializeTemporaryExpr and lifetime-...
A C++ nested-name-specifier augmented with source location information.
TypeLoc getTypeLoc() const
For a nested-name-specifier that refers to a type, retrieve the type with source-location information...
NestedNameSpecifierLoc getPrefix() const
Return the prefix of this nested-name-specifier.
NestedNameSpecifier * getNestedNameSpecifier() const
Retrieve the nested-name-specifier to which this instance refers.
Represents a C++ nested name specifier, such as "\::std::vector<int>::".
SpecifierKind getKind() const
Determine what kind of nested name specifier is stored.
NestedNameSpecifier * getPrefix() const
Return the prefix of this nested name specifier.
@ NamespaceAlias
A namespace alias, stored as a NamespaceAliasDecl*.
@ TypeSpec
A type, stored as a Type*.
@ TypeSpecWithTemplate
A type that was preceded by the 'template' keyword, stored as a Type*.
@ Super
Microsoft's '__super' specifier, stored as a CXXRecordDecl* of the class it appeared in.
@ Identifier
An identifier, stored as an IdentifierInfo*.
@ Global
The global specifier '::'. There is no stored value.
@ Namespace
A namespace, stored as a NamespaceDecl*.
const Type * getAsType() const
Retrieve the type stored in this nested name specifier.
This is a basic class for representing single OpenMP clause.
This is a basic class for representing single OpenMP executable directive.
This is a common base class for loop directives ('omp simd', 'omp for', 'omp for simd' etc....
Represents a pointer to an Objective C object.
Represents a class type in Objective C.
Represents a type parameter type in Objective C.
Sugar for parentheses used when specifying types.
A (possibly-)qualified type.
bool isNull() const
Return true if this QualType doesn't point to a type yet.
Represents a template name that was expressed as a qualified name.
Wrapper of type source information for a type with non-trivial direct qualifiers.
UnqualTypeLoc getUnqualifiedLoc() const
An rvalue reference type, per C++11 [dcl.ref].
Represents a struct/union/class.
A class that does preorder or postorder depth-first traversal on the entire Clang AST and visits each...
bool TraverseTemplateArgument(const TemplateArgument &Arg)
Recursively visit a template argument and dispatch to the appropriate method for the argument type.
bool WalkUpFromDecl(Decl *D)
bool TraverseConceptRequirement(concepts::Requirement *R)
bool TraverseType(QualType T)
Recursively visit a type, by dispatching to Traverse*Type() based on the argument's getTypeClass() pr...
bool dataTraverseStmtPre(Stmt *S)
Invoked before visiting a statement or expression via data recursion.
bool TraverseObjCProtocolLoc(ObjCProtocolLoc ProtocolLoc)
Recursively visit an Objective-C protocol reference with location information.
bool VisitUnqualTypeLoc(UnqualTypeLoc TL)
bool TraverseConceptExprRequirement(concepts::ExprRequirement *R)
bool TraverseAST(ASTContext &AST)
Recursively visits an entire AST, starting from the TranslationUnitDecl.
bool shouldVisitTemplateInstantiations() const
Return whether this visitor should recurse into template instantiations.
bool TraverseTemplateArgumentLoc(const TemplateArgumentLoc &ArgLoc)
Recursively visit a template argument location and dispatch to the appropriate method for the argumen...
bool canIgnoreChildDeclWhileTraversingDeclContext(const Decl *Child)
bool WalkUpFromType(Type *T)
bool dataTraverseStmtPost(Stmt *S)
Invoked after visiting a statement or expression via data recursion.
bool WalkUpFromTypeLoc(TypeLoc TL)
bool TraverseNestedNameSpecifierLoc(NestedNameSpecifierLoc NNS)
Recursively visit a C++ nested-name-specifier with location information.
bool TraverseTemplateName(TemplateName Template)
Recursively visit a template name and dispatch to the appropriate method.
Stmt::child_range getStmtChildren(Stmt *S)
bool TraverseNestedNameSpecifier(NestedNameSpecifier *NNS)
Recursively visit a C++ nested-name-specifier.
bool shouldVisitImplicitCode() const
Return whether this visitor should recurse into implicit code, e.g., implicit constructors and destru...
bool TraverseTemplateArguments(ArrayRef< TemplateArgument > Args)
Recursively visit a set of template arguments.
bool TraverseStmt(Stmt *S, DataRecursionQueue *Queue=nullptr)
Recursively visit a statement or expression, by dispatching to Traverse*() based on the argument's dy...
bool WalkUpFromUnqualTypeLoc(UnqualTypeLoc TL)
bool dataTraverseNode(Stmt *S, DataRecursionQueue *Queue)
bool TraverseDecl(Decl *D)
Recursively visit a declaration, by dispatching to Traverse*Decl() based on the argument's dynamic ty...
bool WalkUpFromStmt(Stmt *S)
bool TraverseTypeLoc(TypeLoc TL)
Recursively visit a type with location, by dispatching to Traverse*TypeLoc() based on the argument ty...
bool TraverseTypeConstraint(const TypeConstraint *C)
bool WalkUpFromQualifiedTypeLoc(QualifiedTypeLoc TL)
bool VisitTypeLoc(TypeLoc TL)
bool TraverseLambdaCapture(LambdaExpr *LE, const LambdaCapture *C, Expr *Init)
Recursively visit a lambda capture.
bool shouldTraversePostOrder() const
Return whether this visitor should traverse post-order.
SmallVectorImpl< llvm::PointerIntPair< Stmt *, 1, bool > > DataRecursionQueue
A queue used for performing data recursion over statements.
bool shouldVisitLambdaBody() const
Return whether this visitor should recurse into lambda body.
bool TraverseSynOrSemInitListExpr(InitListExpr *S, DataRecursionQueue *Queue=nullptr)
Recursively visit the syntactic or semantic form of an initialization list.
bool TraverseAttr(Attr *At)
Recursively visit an attribute, by dispatching to Traverse*Attr() based on the argument's dynamic typ...
bool TraverseConceptNestedRequirement(concepts::NestedRequirement *R)
bool VisitQualifiedTypeLoc(QualifiedTypeLoc TL)
bool shouldWalkTypesOfTypeLocs() const
Return whether this visitor should recurse into the types of TypeLocs.
bool TraverseDeclarationNameInfo(DeclarationNameInfo NameInfo)
Recursively visit a name with its location information.
bool TraverseCXXBaseSpecifier(const CXXBaseSpecifier &Base)
Recursively visit a base specifier.
Derived & getDerived()
Return a reference to the derived class.
bool TraverseConceptTypeRequirement(concepts::TypeRequirement *R)
bool TraverseConstructorInitializer(CXXCtorInitializer *Init)
Recursively visit a constructor initializer.
Stmt - This represents one statement.
llvm::iterator_range< child_iterator > child_range
Represents the result of substituting a set of types for a template type parameter pack.
Location wrapper for a TemplateArgument.
const TemplateArgument & getArgument() const
TypeSourceInfo * getTypeSourceInfo() const
NestedNameSpecifierLoc getTemplateQualifierLoc() const
Expr * getSourceExpression() const
Represents a template argument.
Expr * getAsExpr() const
Retrieve the template argument as an expression.
QualType getAsType() const
Retrieve the type for a type template argument.
ArrayRef< TemplateArgument > pack_elements() const
Iterator range referencing all of the elements of a template argument pack.
@ Declaration
The template argument is a declaration that was provided for a pointer, reference,...
@ Template
The template argument is a template name that was provided for a template template parameter.
@ Pack
The template argument is actually a parameter pack.
@ TemplateExpansion
The template argument is a pack expansion of a template name that was provided for a template templat...
@ NullPtr
The template argument is a null pointer or null pointer to member that was provided for a non-type te...
@ Type
The template argument is a type.
@ Null
Represents an empty template argument, e.g., one that has not been deduced.
@ Integral
The template argument is an integral value stored in an llvm::APSInt that was provided for an integra...
@ Expression
The template argument is an expression, and we've not resolved it to one of the other forms yet,...
ArgKind getKind() const
Return the kind of stored template argument.
TemplateName getAsTemplateOrTemplatePattern() const
Retrieve the template argument as a template name; if the argument is a pack expansion,...
Represents a C++ template name within the type system.
DependentTemplateName * getAsDependentTemplateName() const
Retrieve the underlying dependent template name structure, if any.
QualifiedTemplateName * getAsQualifiedTemplateName() const
Retrieve the underlying qualified template name structure, if any.
Stores a list of template parameters for a TemplateDecl and its derived classes.
Declaration of a template type parameter.
A declaration that models statements at global scope.
Base wrapper for a particular "section" of type source info.
UnqualTypeLoc getUnqualifiedLoc() const
Skips past any qualifiers, if this is qualified.
TypeLocClass getTypeLocClass() const
Represents typeof(type), a C2x feature and GCC extension, or `typeof_unqual(type),...
A container of type source information.
TypeLoc getTypeLoc() const
Return the TypeLoc wrapper for the type source info.
The base class of the type hierarchy.
TypeClass getTypeClass() const
Wrapper of type source information for a type with no direct qualifiers.
Represents a variable declaration or definition.
Represents a C array with a specified size that is not an integer-constant-expression.
Represents a GCC generic vector type.
A requires-expression requirement which queries the validity and properties of an expression ('simple...
bool isExprSubstitutionFailure() const
const ReturnTypeRequirement & getReturnTypeRequirement() const
A requires-expression requirement which is satisfied when a general constraint expression is satisfie...
bool hasInvalidConstraint() const
Expr * getConstraintExpr() const
A static requirement that can be used in a requires-expression to check properties of types and expre...
RequirementKind getKind() const
A requires-expression requirement which queries the existence of a type name or type template special...
bool isSubstitutionFailure() const
TypeSourceInfo * getType() const
LLVM_ATTRIBUTE_ALWAYS_INLINE LLVM_ATTRIBUTE_NODEBUG auto isSameMethod(FirstMethodPtrTy FirstMethodPtr, SecondMethodPtrTy SecondMethodPtr) -> bool
Returns true if and only if FirstMethodPtr and SecondMethodPtr are pointers to the same non-static me...
bool ReturnValue(const T &V, APValue &R)
Convert a value to an APValue.
for(unsigned I=0, E=TL.getNumArgs();I !=E;++I)
@ C
Languages that the frontend can parse and compile.
bool declaresSameEntity(const Decl *D1, const Decl *D2)
Determine whether two declarations declare the same entity.
@ TSK_ExplicitInstantiationDefinition
This template specialization was instantiated from a template due to an explicit instantiation defini...
@ TSK_ExplicitInstantiationDeclaration
This template specialization was instantiated from a template due to an explicit instantiation declar...
@ TSK_ExplicitSpecialization
This template specialization was declared or defined by an explicit specialization (C++ [temp....
@ TSK_ImplicitInstantiation
This template specialization was implicitly instantiated from a template.
@ TSK_Undeclared
This template specialization was formed from a template-id but has not yet been declared,...
DeclarationNameInfo - A collector data type for bundling together a DeclarationName and the correspnd...
DeclarationName getName() const
getName - Returns the embedded declaration name.
TypeSourceInfo * getNamedTypeInfo() const
getNamedTypeInfo - Returns the source type info associated to the name.