23 #include "llvm/ADT/FoldingSet.h" 24 using namespace clang;
29 llvm::FoldingSetNodeID &
ID;
33 StmtProfiler(llvm::FoldingSetNodeID &ID,
bool Canonical)
34 : ID(ID), Canonical(Canonical) {}
36 virtual ~StmtProfiler() {}
38 void VisitStmt(
const Stmt *S);
42 #define STMT(Node, Base) void Visit##Node(const Node *S); 43 #include "clang/AST/StmtNodes.inc" 47 virtual void VisitDecl(
const Decl *D) = 0;
51 virtual void VisitType(
QualType T) = 0;
54 virtual void VisitName(
DeclarationName Name,
bool TreatAsDecl =
false) = 0;
76 class StmtProfilerWithPointers :
public StmtProfiler {
80 StmtProfilerWithPointers(llvm::FoldingSetNodeID &
ID,
82 : StmtProfiler(ID, Canonical), Context(Context) {}
88 void VisitDecl(
const Decl *D)
override {
93 dyn_cast<NonTypeTemplateParmDecl>(D)) {
94 ID.AddInteger(NTTP->getDepth());
95 ID.AddInteger(NTTP->getIndex());
96 ID.AddBoolean(NTTP->isParameterPack());
97 VisitType(NTTP->getType());
101 if (
const ParmVarDecl *Parm = dyn_cast<ParmVarDecl>(D)) {
109 VisitType(Parm->getType());
110 ID.AddInteger(Parm->getFunctionScopeDepth());
111 ID.AddInteger(Parm->getFunctionScopeIndex());
116 dyn_cast<TemplateTypeParmDecl>(D)) {
117 ID.AddInteger(TTP->getDepth());
118 ID.AddInteger(TTP->getIndex());
119 ID.AddBoolean(TTP->isParameterPack());
124 dyn_cast<TemplateTemplateParmDecl>(D)) {
125 ID.AddInteger(TTP->getDepth());
126 ID.AddInteger(TTP->getIndex());
127 ID.AddBoolean(TTP->isParameterPack());
135 void VisitType(
QualType T)
override {
136 if (Canonical && !T.
isNull())
164 class StmtProfilerWithoutPointers :
public StmtProfiler {
167 StmtProfilerWithoutPointers(llvm::FoldingSetNodeID &
ID,
ODRHash &Hash)
168 : StmtProfiler(ID,
false), Hash(Hash) {}
172 if (SC == Stmt::UnresolvedLookupExprClass) {
175 ID.AddInteger(Stmt::DeclRefExprClass);
181 void VisitType(
QualType T)
override {
199 void VisitDecl(
const Decl *D)
override {
217 void StmtProfiler::VisitStmt(
const Stmt *S) {
218 assert(S &&
"Requires non-null Stmt pointer");
230 void StmtProfiler::VisitDeclStmt(
const DeclStmt *S) {
232 for (
const auto *D : S->
decls())
236 void StmtProfiler::VisitNullStmt(
const NullStmt *S) {
240 void StmtProfiler::VisitCompoundStmt(
const CompoundStmt *S) {
244 void StmtProfiler::VisitCaseStmt(
const CaseStmt *S) {
248 void StmtProfiler::VisitDefaultStmt(
const DefaultStmt *S) {
252 void StmtProfiler::VisitLabelStmt(
const LabelStmt *S) {
262 void StmtProfiler::VisitIfStmt(
const IfStmt *S) {
267 void StmtProfiler::VisitSwitchStmt(
const SwitchStmt *S) {
272 void StmtProfiler::VisitWhileStmt(
const WhileStmt *S) {
277 void StmtProfiler::VisitDoStmt(
const DoStmt *S) {
281 void StmtProfiler::VisitForStmt(
const ForStmt *S) {
285 void StmtProfiler::VisitGotoStmt(
const GotoStmt *S) {
294 void StmtProfiler::VisitContinueStmt(
const ContinueStmt *S) {
298 void StmtProfiler::VisitBreakStmt(
const BreakStmt *S) {
302 void StmtProfiler::VisitReturnStmt(
const ReturnStmt *S) {
306 void StmtProfiler::VisitGCCAsmStmt(
const GCCAsmStmt *S) {
317 for (
unsigned I = 0, N = S->
getNumInputs(); I != N; ++I) {
325 for (
auto *L : S->
labels())
326 VisitDecl(L->getLabel());
329 void StmtProfiler::VisitMSAsmStmt(
const MSAsmStmt *S) {
334 void StmtProfiler::VisitCXXCatchStmt(
const CXXCatchStmt *S) {
339 void StmtProfiler::VisitCXXTryStmt(
const CXXTryStmt *S) {
354 void StmtProfiler::VisitSEHTryStmt(
const SEHTryStmt *S) {
362 void StmtProfiler::VisitSEHExceptStmt(
const SEHExceptStmt *S) {
366 void StmtProfiler::VisitSEHLeaveStmt(
const SEHLeaveStmt *S) {
370 void StmtProfiler::VisitCapturedStmt(
const CapturedStmt *S) {
389 void StmtProfiler::VisitObjCAtTryStmt(
const ObjCAtTryStmt *S) {
409 StmtProfiler *Profiler;
411 template <
typename T>
412 void VisitOMPClauseList(T *
Node);
415 OMPClauseProfiler(StmtProfiler *
P) : Profiler(P) { }
416 #define OPENMP_CLAUSE(Name, Class) \ 417 void Visit##Class(const Class *C); 418 #include "clang/Basic/OpenMPKinds.def" 423 void OMPClauseProfiler::VistOMPClauseWithPreInit(
426 Profiler->VisitStmt(S);
429 void OMPClauseProfiler::VistOMPClauseWithPostUpdate(
431 VistOMPClauseWithPreInit(C);
433 Profiler->VisitStmt(E);
436 void OMPClauseProfiler::VisitOMPIfClause(
const OMPIfClause *C) {
437 VistOMPClauseWithPreInit(C);
442 void OMPClauseProfiler::VisitOMPFinalClause(
const OMPFinalClause *C) {
443 VistOMPClauseWithPreInit(C);
449 VistOMPClauseWithPreInit(C);
474 void OMPClauseProfiler::VisitOMPDefaultClause(
const OMPDefaultClause *C) { }
478 void OMPClauseProfiler::VisitOMPUnifiedAddressClause(
481 void OMPClauseProfiler::VisitOMPUnifiedSharedMemoryClause(
484 void OMPClauseProfiler::VisitOMPReverseOffloadClause(
487 void OMPClauseProfiler::VisitOMPDynamicAllocatorsClause(
490 void OMPClauseProfiler::VisitOMPAtomicDefaultMemOrderClause(
494 VistOMPClauseWithPreInit(C);
496 Profiler->VisitStmt(S);
501 Profiler->VisitStmt(Num);
504 void OMPClauseProfiler::VisitOMPNowaitClause(
const OMPNowaitClause *) {}
506 void OMPClauseProfiler::VisitOMPUntiedClause(
const OMPUntiedClause *) {}
510 void OMPClauseProfiler::VisitOMPReadClause(
const OMPReadClause *) {}
512 void OMPClauseProfiler::VisitOMPWriteClause(
const OMPWriteClause *) {}
514 void OMPClauseProfiler::VisitOMPUpdateClause(
const OMPUpdateClause *) {}
518 void OMPClauseProfiler::VisitOMPSeqCstClause(
const OMPSeqCstClause *) {}
522 void OMPClauseProfiler::VisitOMPSIMDClause(
const OMPSIMDClause *) {}
527 void OMPClauseProfiler::VisitOMPClauseList(T *
Node) {
528 for (
auto *E : Node->varlists()) {
530 Profiler->VisitStmt(E);
535 VisitOMPClauseList(C);
538 Profiler->VisitStmt(E);
543 VisitOMPClauseList(C);
544 VistOMPClauseWithPreInit(C);
547 Profiler->VisitStmt(E);
549 for (
auto *E : C->
inits()) {
551 Profiler->VisitStmt(E);
556 VisitOMPClauseList(C);
557 VistOMPClauseWithPostUpdate(C);
560 Profiler->VisitStmt(E);
564 Profiler->VisitStmt(E);
568 Profiler->VisitStmt(E);
571 void OMPClauseProfiler::VisitOMPSharedClause(
const OMPSharedClause *C) {
572 VisitOMPClauseList(C);
574 void OMPClauseProfiler::VisitOMPReductionClause(
576 Profiler->VisitNestedNameSpecifier(
579 VisitOMPClauseList(C);
580 VistOMPClauseWithPostUpdate(C);
583 Profiler->VisitStmt(E);
587 Profiler->VisitStmt(E);
591 Profiler->VisitStmt(E);
595 Profiler->VisitStmt(E);
598 void OMPClauseProfiler::VisitOMPTaskReductionClause(
600 Profiler->VisitNestedNameSpecifier(
603 VisitOMPClauseList(C);
604 VistOMPClauseWithPostUpdate(C);
607 Profiler->VisitStmt(E);
611 Profiler->VisitStmt(E);
615 Profiler->VisitStmt(E);
619 Profiler->VisitStmt(E);
622 void OMPClauseProfiler::VisitOMPInReductionClause(
624 Profiler->VisitNestedNameSpecifier(
627 VisitOMPClauseList(C);
628 VistOMPClauseWithPostUpdate(C);
631 Profiler->VisitStmt(E);
635 Profiler->VisitStmt(E);
639 Profiler->VisitStmt(E);
643 Profiler->VisitStmt(E);
647 Profiler->VisitStmt(E);
650 void OMPClauseProfiler::VisitOMPLinearClause(
const OMPLinearClause *C) {
651 VisitOMPClauseList(C);
652 VistOMPClauseWithPostUpdate(C);
653 for (
auto *E : C->privates()) {
655 Profiler->VisitStmt(E);
657 for (
auto *E : C->inits()) {
659 Profiler->VisitStmt(E);
661 for (
auto *E : C->updates()) {
663 Profiler->VisitStmt(E);
665 for (
auto *E : C->finals()) {
667 Profiler->VisitStmt(E);
670 Profiler->VisitStmt(C->getStep());
671 if (C->getCalcStep())
672 Profiler->VisitStmt(C->getCalcStep());
675 VisitOMPClauseList(C);
679 void OMPClauseProfiler::VisitOMPCopyinClause(
const OMPCopyinClause *C) {
680 VisitOMPClauseList(C);
683 Profiler->VisitStmt(E);
687 Profiler->VisitStmt(E);
691 Profiler->VisitStmt(E);
696 VisitOMPClauseList(C);
699 Profiler->VisitStmt(E);
703 Profiler->VisitStmt(E);
707 Profiler->VisitStmt(E);
710 void OMPClauseProfiler::VisitOMPFlushClause(
const OMPFlushClause *C) {
711 VisitOMPClauseList(C);
713 void OMPClauseProfiler::VisitOMPDependClause(
const OMPDependClause *C) {
714 VisitOMPClauseList(C);
716 void OMPClauseProfiler::VisitOMPDeviceClause(
const OMPDeviceClause *C) {
720 void OMPClauseProfiler::VisitOMPMapClause(
const OMPMapClause *C) {
721 VisitOMPClauseList(C);
725 Profiler->VisitStmt(Allocator);
726 VisitOMPClauseList(C);
729 VistOMPClauseWithPreInit(C);
733 void OMPClauseProfiler::VisitOMPThreadLimitClause(
735 VistOMPClauseWithPreInit(C);
740 VistOMPClauseWithPreInit(C);
745 VistOMPClauseWithPreInit(C);
750 VistOMPClauseWithPreInit(C);
754 void OMPClauseProfiler::VisitOMPHintClause(
const OMPHintClause *C) {
756 Profiler->VisitStmt(C->
getHint());
758 void OMPClauseProfiler::VisitOMPToClause(
const OMPToClause *C) {
759 VisitOMPClauseList(C);
761 void OMPClauseProfiler::VisitOMPFromClause(
const OMPFromClause *C) {
762 VisitOMPClauseList(C);
764 void OMPClauseProfiler::VisitOMPUseDevicePtrClause(
766 VisitOMPClauseList(C);
768 void OMPClauseProfiler::VisitOMPIsDevicePtrClause(
770 VisitOMPClauseList(C);
772 void OMPClauseProfiler::VisitOMPNontemporalClause(
774 VisitOMPClauseList(C);
776 Profiler->VisitStmt(E);
783 OMPClauseProfiler
P(
this);
792 VisitOMPExecutableDirective(S);
796 VisitOMPExecutableDirective(S);
800 VisitOMPLoopDirective(S);
804 VisitOMPLoopDirective(S);
808 VisitOMPLoopDirective(S);
812 VisitOMPExecutableDirective(S);
816 VisitOMPExecutableDirective(S);
820 VisitOMPExecutableDirective(S);
824 VisitOMPExecutableDirective(S);
828 VisitOMPExecutableDirective(S);
834 VisitOMPLoopDirective(S);
837 void StmtProfiler::VisitOMPParallelForSimdDirective(
839 VisitOMPLoopDirective(S);
842 void StmtProfiler::VisitOMPParallelMasterDirective(
844 VisitOMPExecutableDirective(S);
847 void StmtProfiler::VisitOMPParallelSectionsDirective(
849 VisitOMPExecutableDirective(S);
853 VisitOMPExecutableDirective(S);
857 VisitOMPExecutableDirective(S);
861 VisitOMPExecutableDirective(S);
865 VisitOMPExecutableDirective(S);
869 VisitOMPExecutableDirective(S);
875 VisitOMPExecutableDirective(S);
879 VisitOMPExecutableDirective(S);
883 VisitOMPExecutableDirective(S);
887 VisitOMPExecutableDirective(S);
891 VisitOMPExecutableDirective(S);
894 void StmtProfiler::VisitOMPTargetEnterDataDirective(
896 VisitOMPExecutableDirective(S);
899 void StmtProfiler::VisitOMPTargetExitDataDirective(
901 VisitOMPExecutableDirective(S);
904 void StmtProfiler::VisitOMPTargetParallelDirective(
906 VisitOMPExecutableDirective(S);
909 void StmtProfiler::VisitOMPTargetParallelForDirective(
911 VisitOMPExecutableDirective(S);
915 VisitOMPExecutableDirective(S);
918 void StmtProfiler::VisitOMPCancellationPointDirective(
920 VisitOMPExecutableDirective(S);
924 VisitOMPExecutableDirective(S);
928 VisitOMPLoopDirective(S);
931 void StmtProfiler::VisitOMPTaskLoopSimdDirective(
933 VisitOMPLoopDirective(S);
936 void StmtProfiler::VisitOMPMasterTaskLoopDirective(
938 VisitOMPLoopDirective(S);
941 void StmtProfiler::VisitOMPMasterTaskLoopSimdDirective(
943 VisitOMPLoopDirective(S);
946 void StmtProfiler::VisitOMPParallelMasterTaskLoopDirective(
948 VisitOMPLoopDirective(S);
951 void StmtProfiler::VisitOMPParallelMasterTaskLoopSimdDirective(
953 VisitOMPLoopDirective(S);
956 void StmtProfiler::VisitOMPDistributeDirective(
958 VisitOMPLoopDirective(S);
961 void OMPClauseProfiler::VisitOMPDistScheduleClause(
963 VistOMPClauseWithPreInit(C);
965 Profiler->VisitStmt(S);
970 void StmtProfiler::VisitOMPTargetUpdateDirective(
972 VisitOMPExecutableDirective(S);
975 void StmtProfiler::VisitOMPDistributeParallelForDirective(
977 VisitOMPLoopDirective(S);
980 void StmtProfiler::VisitOMPDistributeParallelForSimdDirective(
982 VisitOMPLoopDirective(S);
985 void StmtProfiler::VisitOMPDistributeSimdDirective(
987 VisitOMPLoopDirective(S);
990 void StmtProfiler::VisitOMPTargetParallelForSimdDirective(
992 VisitOMPLoopDirective(S);
995 void StmtProfiler::VisitOMPTargetSimdDirective(
997 VisitOMPLoopDirective(S);
1000 void StmtProfiler::VisitOMPTeamsDistributeDirective(
1002 VisitOMPLoopDirective(S);
1005 void StmtProfiler::VisitOMPTeamsDistributeSimdDirective(
1007 VisitOMPLoopDirective(S);
1010 void StmtProfiler::VisitOMPTeamsDistributeParallelForSimdDirective(
1012 VisitOMPLoopDirective(S);
1015 void StmtProfiler::VisitOMPTeamsDistributeParallelForDirective(
1017 VisitOMPLoopDirective(S);
1020 void StmtProfiler::VisitOMPTargetTeamsDirective(
1022 VisitOMPExecutableDirective(S);
1025 void StmtProfiler::VisitOMPTargetTeamsDistributeDirective(
1027 VisitOMPLoopDirective(S);
1030 void StmtProfiler::VisitOMPTargetTeamsDistributeParallelForDirective(
1032 VisitOMPLoopDirective(S);
1035 void StmtProfiler::VisitOMPTargetTeamsDistributeParallelForSimdDirective(
1037 VisitOMPLoopDirective(S);
1040 void StmtProfiler::VisitOMPTargetTeamsDistributeSimdDirective(
1042 VisitOMPLoopDirective(S);
1045 void StmtProfiler::VisitExpr(
const Expr *S) {
1049 void StmtProfiler::VisitConstantExpr(
const ConstantExpr *S) {
1053 void StmtProfiler::VisitDeclRefExpr(
const DeclRefExpr *S) {
1065 void StmtProfiler::VisitPredefinedExpr(
const PredefinedExpr *S) {
1070 void StmtProfiler::VisitIntegerLiteral(
const IntegerLiteral *S) {
1099 void StmtProfiler::VisitStringLiteral(
const StringLiteral *S) {
1105 void StmtProfiler::VisitParenExpr(
const ParenExpr *S) {
1109 void StmtProfiler::VisitParenListExpr(
const ParenListExpr *S) {
1113 void StmtProfiler::VisitUnaryOperator(
const UnaryOperator *S) {
1118 void StmtProfiler::VisitOffsetOfExpr(
const OffsetOfExpr *S) {
1121 for (
unsigned i = 0; i < n; ++i) {
1162 void StmtProfiler::VisitCallExpr(
const CallExpr *S) {
1166 void StmtProfiler::VisitMemberExpr(
const MemberExpr *S) {
1179 void StmtProfiler::VisitCastExpr(
const CastExpr *S) {
1193 void StmtProfiler::VisitCStyleCastExpr(
const CStyleCastExpr *S) {
1194 VisitExplicitCastExpr(S);
1197 void StmtProfiler::VisitBinaryOperator(
const BinaryOperator *S) {
1204 VisitBinaryOperator(S);
1211 void StmtProfiler::VisitBinaryConditionalOperator(
1216 void StmtProfiler::VisitAddrLabelExpr(
const AddrLabelExpr *S) {
1221 void StmtProfiler::VisitStmtExpr(
const StmtExpr *S) {
1233 void StmtProfiler::VisitChooseExpr(
const ChooseExpr *S) {
1237 void StmtProfiler::VisitGNUNullExpr(
const GNUNullExpr *S) {
1241 void StmtProfiler::VisitVAArgExpr(
const VAArgExpr *S) {
1245 void StmtProfiler::VisitInitListExpr(
const InitListExpr *S) {
1258 if (D.isFieldDesignator()) {
1260 VisitName(D.getFieldName());
1264 if (D.isArrayDesignator()) {
1267 assert(D.isArrayRangeDesignator());
1270 ID.AddInteger(D.getFirstExprIndex());
1276 void StmtProfiler::VisitDesignatedInitUpdateExpr(
1278 llvm_unreachable(
"Unexpected DesignatedInitUpdateExpr in syntactic form of " 1290 void StmtProfiler::VisitNoInitExpr(
const NoInitExpr *S) {
1291 llvm_unreachable(
"Unexpected NoInitExpr in syntactic form of initializer");
1303 void StmtProfiler::VisitBlockExpr(
const BlockExpr *S) {
1314 ID.AddPointer(
nullptr);
1317 VisitExpr(Assoc.getAssociationExpr());
1327 Visit(OVE->getSourceExpr());
1330 void StmtProfiler::VisitAtomicExpr(
const AtomicExpr *S) {
1335 void StmtProfiler::VisitConceptSpecializationExpr(
1340 VisitTemplateArgument(Arg);
1343 void StmtProfiler::VisitRequiresExpr(
const RequiresExpr *S) {
1347 VisitDecl(LocalParam);
1350 if (
auto *TypeReq = dyn_cast<concepts::TypeRequirement>(Req)) {
1352 ID.AddBoolean(TypeReq->isSubstitutionFailure());
1353 if (!TypeReq->isSubstitutionFailure())
1354 VisitType(TypeReq->getType()->getType());
1355 }
else if (
auto *ExprReq = dyn_cast<concepts::ExprRequirement>(Req)) {
1357 ID.AddBoolean(ExprReq->isExprSubstitutionFailure());
1358 if (!ExprReq->isExprSubstitutionFailure())
1359 Visit(ExprReq->getExpr());
1364 ID.AddBoolean(ExprReq->getNoexceptLoc().isValid());
1366 ExprReq->getReturnTypeRequirement();
1378 auto *NestedReq = cast<concepts::NestedRequirement>(Req);
1379 ID.AddBoolean(NestedReq->isSubstitutionFailure());
1380 if (!NestedReq->isSubstitutionFailure())
1381 Visit(NestedReq->getConstraintExpr());
1394 case OO_Array_Delete:
1397 case OO_Conditional:
1399 llvm_unreachable(
"Invalid operator call kind");
1404 return Stmt::UnaryOperatorClass;
1408 return Stmt::BinaryOperatorClass;
1413 return Stmt::UnaryOperatorClass;
1417 return Stmt::BinaryOperatorClass;
1422 return Stmt::UnaryOperatorClass;
1426 return Stmt::BinaryOperatorClass;
1430 return Stmt::BinaryOperatorClass;
1434 return Stmt::BinaryOperatorClass;
1438 return Stmt::BinaryOperatorClass;
1442 UnaryOp = UO_AddrOf;
1443 return Stmt::UnaryOperatorClass;
1447 return Stmt::BinaryOperatorClass;
1451 return Stmt::BinaryOperatorClass;
1455 return Stmt::UnaryOperatorClass;
1459 return Stmt::UnaryOperatorClass;
1462 BinaryOp = BO_Assign;
1463 return Stmt::BinaryOperatorClass;
1467 return Stmt::BinaryOperatorClass;
1471 return Stmt::BinaryOperatorClass;
1474 BinaryOp = BO_AddAssign;
1475 return Stmt::CompoundAssignOperatorClass;
1478 BinaryOp = BO_SubAssign;
1479 return Stmt::CompoundAssignOperatorClass;
1482 BinaryOp = BO_MulAssign;
1483 return Stmt::CompoundAssignOperatorClass;
1486 BinaryOp = BO_DivAssign;
1487 return Stmt::CompoundAssignOperatorClass;
1489 case OO_PercentEqual:
1490 BinaryOp = BO_RemAssign;
1491 return Stmt::CompoundAssignOperatorClass;
1494 BinaryOp = BO_XorAssign;
1495 return Stmt::CompoundAssignOperatorClass;
1498 BinaryOp = BO_AndAssign;
1499 return Stmt::CompoundAssignOperatorClass;
1502 BinaryOp = BO_OrAssign;
1503 return Stmt::CompoundAssignOperatorClass;
1507 return Stmt::BinaryOperatorClass;
1509 case OO_GreaterGreater:
1511 return Stmt::BinaryOperatorClass;
1513 case OO_LessLessEqual:
1514 BinaryOp = BO_ShlAssign;
1515 return Stmt::CompoundAssignOperatorClass;
1517 case OO_GreaterGreaterEqual:
1518 BinaryOp = BO_ShrAssign;
1519 return Stmt::CompoundAssignOperatorClass;
1523 return Stmt::BinaryOperatorClass;
1525 case OO_ExclaimEqual:
1527 return Stmt::BinaryOperatorClass;
1531 return Stmt::BinaryOperatorClass;
1533 case OO_GreaterEqual:
1535 return Stmt::BinaryOperatorClass;
1539 return Stmt::BinaryOperatorClass;
1543 return Stmt::BinaryOperatorClass;
1547 return Stmt::BinaryOperatorClass;
1552 return Stmt::UnaryOperatorClass;
1557 return Stmt::UnaryOperatorClass;
1560 BinaryOp = BO_Comma;
1561 return Stmt::BinaryOperatorClass;
1564 BinaryOp = BO_PtrMemI;
1565 return Stmt::BinaryOperatorClass;
1568 return Stmt::ArraySubscriptExprClass;
1571 UnaryOp = UO_Coawait;
1572 return Stmt::UnaryOperatorClass;
1575 llvm_unreachable(
"Invalid overloaded operator expression");
1578 #if defined(_MSC_VER) && !defined(__clang__) 1579 #if _MSC_VER == 1911 1583 #pragma optimize("", off) 1595 return Visit(S->
getArg(0));
1602 for (
unsigned I = 0, N = S->
getNumArgs(); I != N; ++I)
1604 if (SC == Stmt::UnaryOperatorClass)
1605 ID.AddInteger(UnaryOp);
1606 else if (SC == Stmt::BinaryOperatorClass ||
1607 SC == Stmt::CompoundAssignOperatorClass)
1608 ID.AddInteger(BinaryOp);
1610 assert(SC == Stmt::ArraySubscriptExprClass);
1619 void StmtProfiler::VisitCXXRewrittenBinaryOperator(
1624 "resolved rewritten operator should never be type-dependent");
1629 #if defined(_MSC_VER) && !defined(__clang__) 1630 #if _MSC_VER == 1911 1631 #pragma optimize("", on) 1643 void StmtProfiler::VisitAsTypeExpr(
const AsTypeExpr *S) {
1648 VisitExplicitCastExpr(S);
1652 VisitCXXNamedCastExpr(S);
1656 VisitCXXNamedCastExpr(S);
1661 VisitCXXNamedCastExpr(S);
1665 VisitCXXNamedCastExpr(S);
1686 void StmtProfiler::VisitCXXStdInitializerListExpr(
1691 void StmtProfiler::VisitCXXTypeidExpr(
const CXXTypeidExpr *S) {
1697 void StmtProfiler::VisitCXXUuidofExpr(
const CXXUuidofExpr *S) {
1708 void StmtProfiler::VisitMSPropertySubscriptExpr(
1713 void StmtProfiler::VisitCXXThisExpr(
const CXXThisExpr *S) {
1718 void StmtProfiler::VisitCXXThrowExpr(
const CXXThrowExpr *S) {
1744 void StmtProfiler::VisitCXXInheritedCtorInitExpr(
1751 VisitExplicitCastExpr(S);
1756 VisitCXXConstructExpr(S);
1760 StmtProfiler::VisitLambdaExpr(
const LambdaExpr *S) {
1765 if (C->capturesVLAType())
1768 ID.AddInteger(C->getCaptureKind());
1769 switch (C->getCaptureKind()) {
1775 VisitDecl(C->getCapturedVar());
1776 ID.AddBoolean(C->isPackExpansion());
1779 llvm_unreachable(
"VLA type in explicit captures.");
1793 void StmtProfiler::VisitCXXDeleteExpr(
const CXXDeleteExpr *S) {
1800 void StmtProfiler::VisitCXXNewExpr(
const CXXNewExpr *S) {
1827 void StmtProfiler::VisitOverloadExpr(
const OverloadExpr *S) {
1830 VisitName(S->
getName(),
true);
1838 VisitOverloadExpr(S);
1841 void StmtProfiler::VisitTypeTraitExpr(
const TypeTraitExpr *S) {
1845 for (
unsigned I = 0, N = S->
getNumArgs(); I != N; ++I)
1861 void StmtProfiler::VisitDependentScopeDeclRefExpr(
1875 void StmtProfiler::VisitCXXUnresolvedConstructExpr(
1882 void StmtProfiler::VisitCXXDependentScopeMemberExpr(
1917 void StmtProfiler::VisitSizeOfPackExpr(
const SizeOfPackExpr *S) {
1922 ID.AddInteger(Args.size());
1923 for (
const auto &TA : Args)
1924 VisitTemplateArgument(TA);
1930 void StmtProfiler::VisitSubstNonTypeTemplateParmPackExpr(
1937 void StmtProfiler::VisitSubstNonTypeTemplateParmExpr(
1951 void StmtProfiler::VisitMaterializeTemporaryExpr(
1956 void StmtProfiler::VisitCXXFoldExpr(
const CXXFoldExpr *S) {
1965 void StmtProfiler::VisitCoreturnStmt(
const CoreturnStmt *S) {
1969 void StmtProfiler::VisitCoawaitExpr(
const CoawaitExpr *S) {
1977 void StmtProfiler::VisitCoyieldExpr(
const CoyieldExpr *S) {
1985 void StmtProfiler::VisitTypoExpr(
const TypoExpr *E) {
1989 void StmtProfiler::VisitSourceLocExpr(
const SourceLocExpr *E) {
1997 void StmtProfiler::VisitObjCBoxedExpr(
const ObjCBoxedExpr *E) {
2009 void StmtProfiler::VisitObjCEncodeExpr(
const ObjCEncodeExpr *S) {
2057 void StmtProfiler::VisitObjCIsaExpr(
const ObjCIsaExpr *S) {
2067 void StmtProfiler::VisitObjCIndirectCopyRestoreExpr(
2074 VisitExplicitCastExpr(S);
2078 void StmtProfiler::VisitObjCAvailabilityCheckExpr(
2085 ID.AddInteger(NumArgs);
2086 for (
unsigned I = 0; I != NumArgs; ++I)
2125 VisitTemplateArgument(
P);
2131 bool Canonical)
const {
2132 StmtProfilerWithPointers Profiler(ID, Context, Canonical);
2133 Profiler.Visit(
this);
2138 StmtProfilerWithoutPointers Profiler(ID, Hash);
2139 Profiler.Visit(
this);
ObjCPropertyRefExpr - A dot-syntax expression to access an ObjC property.
ObjCIndirectCopyRestoreExpr - Represents the passing of a function argument by indirect copy-restore ...
A call to an overloaded operator written using operator syntax.
Represents a single C99 designator.
unsigned getNumTemplateArgs() const
Retrieve the number of template arguments provided as part of this template-id.
Expr * getImmediatelyDeclaredConstraint() const
Get the immediately-declared constraint expression introduced by this type-constraint, that is - the constraint expression that is added to the associated constraints of the enclosing declaration in practice.
Defines the clang::ASTContext interface.
const BlockDecl * getBlockDecl() const
This represents '#pragma omp distribute simd' composite directive.
This represents '#pragma omp master' directive.
TypeSourceInfo * getTypeOperandSourceInfo() const
Retrieve source information for the type operand.
The null pointer literal (C++11 [lex.nullptr])
const CXXDestructorDecl * getDestructor() const
capture_iterator explicit_capture_end() const
Retrieve an iterator pointing past the end of the sequence of explicit lambda captures.
This represents '#pragma omp task' directive.
This represents a GCC inline-assembly statement extension.
Represents a 'co_await' expression while the type of the promise is dependent.
helper_expr_const_range reduction_ops() const
This represents 'thread_limit' clause in the '#pragma omp ...' directive.
bool hasExplicitTemplateArgs() const
Determines whether this expression had explicit template arguments.
unsigned getNumInputs() const
const TemplateArgumentLoc * getTemplateArgs() const
Retrieve the template arguments provided as part of this template-id.
helper_expr_const_range lhs_exprs() const
This represents clause 'copyin' in the '#pragma omp ...' directives.
A (possibly-)qualified type.
StringKind getKind() const
ValueDecl * getMemberDecl() const
Retrieve the member declaration to which this expression refers.
ArrayRef< OMPClause * > clauses()
Expr * getArg(unsigned Arg)
getArg - Return the specified argument.
ObjCMethodDecl * getAtIndexMethodDecl() const
static const TemplateArgument & getArgument(const TemplateArgument &A)
Selector getSelector() const
void AddDeclarationName(DeclarationName Name, bool TreatAsDecl=false)
ConstStmtVisitor - This class implements a simple visitor for Stmt subclasses.
This file contains the declaration of the ODRHash class, which calculates a hash based on AST nodes...
bool isSuperReceiver() const
A type trait used in the implementation of various C++11 and Library TR1 trait templates.
ArrayRef< ParmVarDecl * > getLocalParameters() const
VarDecl * getParameterPack() const
Get the parameter pack which this expression refers to.
This represents 'atomic_default_mem_order' clause in the '#pragma omp requires' directive.
bool isListInitialization() const
Determine whether this expression models list-initialization.
helper_expr_const_range rhs_exprs() const
private_copies_range private_copies()
ObjCProtocolDecl * getProtocol() const
Represents a 'co_return' statement in the C++ Coroutines TS.
Stmt - This represents one statement.
unsigned getNumArgs() const
getNumArgs - Return the number of actual arguments to this call.
This represents clause 'in_reduction' in the '#pragma omp task' directives.
void AddQualType(QualType T)
IfStmt - This represents an if/then/else.
TemplateArgumentLoc const * getTemplateArgs() const
Class that handles pre-initialization statement for some clauses, like 'shedule', 'firstprivate' etc...
ObjCMethodDecl * setAtIndexMethodDecl() const
unsigned getNumOutputs() const
This represents '#pragma omp for simd' directive.
The template argument is an expression, and we've not resolved it to one of the other forms yet...
Expr * getAllocator() const
Returns allocator.
const StringLiteral * getAsmString() const
helper_expr_const_range rhs_exprs() const
Decl - This represents one declaration (or definition), e.g.
This represents 'grainsize' clause in the '#pragma omp ...' directive.
This represents '#pragma omp teams distribute parallel for' composite directive.
llvm::APFloat getValue() const
ObjCMethodDecl * getImplicitPropertySetter() const
Represents the index of the current element of an array being initialized by an ArrayInitLoopExpr.
FunctionDecl * getOperatorNew() const
A reference to a name which we were able to look up during parsing but could not resolve to a specifi...
This represents 'if' clause in the '#pragma omp ...' directive.
DeclarationNameInfo getNameInfo() const
Retrieve the name of the entity we're testing for, along with location information.
Defines the C++ template declaration subclasses.
This represents '#pragma omp parallel master' directive.
Represents an attribute applied to a statement.
ParenExpr - This represents a parethesized expression, e.g.
helper_expr_const_range assignment_ops() const
NestedNameSpecifierLoc getQualifierLoc() const
Retrieve the nested-name-specifier that qualifies this name, if any.
This represents 'priority' clause in the '#pragma omp ...' directive.
This represents '#pragma omp target teams distribute' combined directive.
helper_expr_const_range lhs_exprs() const
NestedNameSpecifier * getQualifier() const
Retrieve the nested-name-specifier that qualifies this declaration.
Represents Objective-C's @throw statement.
bool hasExplicitTemplateArgs() const
Determines whether this declaration reference was followed by an explicit template argument list...
The template argument is a declaration that was provided for a pointer, reference, or pointer to member non-type template parameter.
Represents a call to a C++ constructor.
ObjCSubscriptRefExpr - used for array and dictionary subscripting.
TypeSourceInfo * getTypeInfoAsWritten() const
getTypeInfoAsWritten - Returns the type source info for the type that this expression is casting to...
An Embarcadero array type trait, as used in the implementation of __array_rank and __array_extent...
Expr * getCondition() const
Returns condition.
This represents 'update' clause in the '#pragma omp atomic' directive.
NestedNameSpecifier * getQualifier() const
If the member name was qualified, retrieves the nested-name-specifier that precedes the member name...
Expr * getCondition() const
Returns condition.
This represents '#pragma omp parallel for' directive.
MS property subscript expression.
IdentKind getIdentKind() const
This represents '#pragma omp target teams distribute parallel for' combined directive.
Describes the capture of a variable or of this, or of a C++1y init-capture.
Represents a prvalue temporary that is written into memory so that a reference can bind to it...
Expr * getAlignment()
Returns alignment.
Expr * getNumForLoops() const
Return the number of associated for-loops.
This represents '#pragma omp target exit data' directive.
This represents 'read' clause in the '#pragma omp atomic' directive.
helper_expr_const_range assignment_ops() const
This represents clause 'private' in the '#pragma omp ...' directives.
ObjCIsaExpr - Represent X->isa and X.isa when X is an ObjC 'id' type.
CompoundLiteralExpr - [C99 6.5.2.5].
This represents 'num_threads' clause in the '#pragma omp ...' directive.
unsigned getNumArgs() const
Determine the number of arguments to this type trait.
Represents an empty template argument, e.g., one that has not been deduced.
This represents 'defaultmap' clause in the '#pragma omp ...' directive.
void Profile(llvm::FoldingSetNodeID &ID, const ASTContext &Context, bool Canonical) const
Produce a unique representation of the given statement.
void * getAsOpaquePtr() const
Get the representation of this declaration name as an opaque pointer.
DeclarationName getName() const
Gets the name looked up.
Implicit construction of a std::initializer_list<T> object from an array temporary within list-initia...
unsigned getNumPlacementArgs() const
This represents implicit clause 'flush' for the '#pragma omp flush' directive.
const DeclarationNameInfo & getNameInfo() const
Gets the name info for specified reduction identifier.
CXXConstructorDecl * getConstructor() const
Get the constructor that this expression will call.
A C++ throw-expression (C++ [except.throw]).
Represents an expression – generally a full-expression – that introduces cleanups to be run at the ...
This represents 'reverse_offload' clause in the '#pragma omp requires' directive. ...
TypeSourceInfo * getArg(unsigned I) const
Retrieve the Ith argument.
Represents a parameter to a function.
Defines the clang::Expr interface and subclasses for C++ expressions.
QualType getIntegralType() const
Retrieve the type of the integral value.
StringRef getInputName(unsigned i) const
Expr * getGrainsize() const
Return safe iteration space distance.
This represents 'nogroup' clause in the '#pragma omp ...' directive.
This represents 'allocator' clause in the '#pragma omp ...' directive.
This represents 'safelen' clause in the '#pragma omp ...' directive.
ObjCPropertyDecl * getExplicitProperty() const
A C++ static_cast expression (C++ [expr.static.cast]).
LabelStmt - Represents a label, which has a substatement.
Represents a C99 designated initializer expression.
Expr * getSemanticForm()
Get an equivalent semantic form for this expression.
TypeSourceInfo * getScopeTypeInfo() const
Retrieve the scope type in a qualified pseudo-destructor expression.
One of these records is kept for each identifier that is lexed.
FieldDecl * getField() const
For a field offsetof node, returns the field.
Represents a function call to one of __builtin_LINE(), __builtin_COLUMN(), __builtin_FUNCTION(), or __builtin_FILE().
C++2a [expr.prim.req]: A requires-expression provides a concise way to express requirements on templa...
This represents '#pragma omp parallel' directive.
ShuffleVectorExpr - clang-specific builtin-in function __builtin_shufflevector.
Expr * getAsExpr() const
Retrieve the template argument as an expression.
Holds long-lived AST nodes (such as types and decls) that can be referred to throughout the semantic ...
QualType getCaughtType() const
This represents 'simd' clause in the '#pragma omp ...' directive.
The template argument is an integral value stored in an llvm::APSInt that was provided for an integra...
This represents clause 'lastprivate' in the '#pragma omp ...' directives.
This represents clause 'allocate' in the '#pragma omp ...' directives.
Represents a place-holder for an object not to be initialized by anything.
CompoundStmt * getBody() const
Retrieve the body of the lambda.
Expr * getChunkSize()
Get chunk size.
GNUNullExpr - Implements the GNU __null extension, which is a name for a null pointer constant that h...
This represents clause 'map' in the '#pragma omp ...' directives.
QualType getDestroyedType() const
Retrieve the type being destroyed.
This represents clause 'to' in the '#pragma omp ...' directives.
This represents '#pragma omp target simd' directive.
Represents a C++ member access expression for which lookup produced a set of overloaded functions...
ExtVectorElementExpr - This represents access to specific elements of a vector, and may occur on the ...
Expr * getSafelen() const
Return safe iteration space distance.
This represents '#pragma omp barrier' directive.
ObjCArrayLiteral - used for objective-c array containers; as in: @["Hello", NSApp, [NSNumber numberWithInt:42]];.
This is a common base class for loop directives ('omp simd', 'omp for', 'omp for simd' etc...
Expr * getNumTeams()
Return NumTeams number.
Represents a reference to a non-type template parameter pack that has been substituted with a non-tem...
This represents '#pragma omp critical' directive.
bool hasExplicitTemplateArgs() const
Determines whether this lookup had explicit template arguments.
Selector getSelector() const
const Expr *const * const_semantics_iterator
Represents Objective-C's @catch statement.
This represents clause 'copyprivate' in the '#pragma omp ...' directives.
IndirectGotoStmt - This represents an indirect goto.
Describes an C or C++ initializer list.
A C++ typeid expression (C++ [expr.typeid]), which gets the type_info that corresponds to the supplie...
This represents '#pragma omp distribute parallel for' composite directive.
This represents '#pragma omp teams distribute parallel for simd' composite directive.
AssociationTy< true > ConstAssociation
unsigned getNumExpansions() const
Get the number of parameters in this parameter pack.
ForStmt - This represents a 'for (init;cond;inc)' stmt.
NestedNameSpecifierLoc getQualifierLoc() const
Gets the nested name specifier.
FunctionDecl * getOperatorDelete() const
TemplateArgument getArgumentPack() const
Retrieve the template argument pack containing the substituted template arguments.
bool isElidable() const
Whether this construction is elidable.
void AddDecl(const Decl *D)
< Capturing the *this object by copy
LabelDecl * getDecl() const
QualType getNullPtrType() const
Retrieve the type for null non-type template argument.
ExprValueKind getValueKind() const
getValueKind - The value kind that this expression produces.
const Stmt * getPreInitStmt() const
Get pre-initialization statement for the clause.
semantics_iterator semantics_end()
unsigned getNumTemplateArgs() const
Retrieve the number of template arguments provided as part of this template-id.
static Stmt::StmtClass DecodeOperatorCall(const CXXOperatorCallExpr *S, UnaryOperatorKind &UnaryOp, BinaryOperatorKind &BinaryOp)
A builtin binary operation expression such as "x + y" or "x <= y".
const StringLiteral * getInputConstraintLiteral(unsigned i) const
CXXForRangeStmt - This represents C++0x [stmt.ranged]'s ranged for statement, represented as 'for (ra...
ConceptDecl * getNamedConcept() const
Class that handles post-update expression for some clauses, like 'lastprivate', 'reduction' etc...
This represents '#pragma omp cancellation point' directive.
This represents 'default' clause in the '#pragma omp ...' directive.
ObjCStringLiteral, used for Objective-C string literals i.e.
CaseStmt - Represent a case statement.
TypoExpr - Internal placeholder for expressions where typo correction still needs to be performed and...
This represents 'final' clause in the '#pragma omp ...' directive.
This represents 'mergeable' clause in the '#pragma omp ...' directive.
This represents '#pragma omp teams' directive.
NestedNameSpecifier * getQualifier() const
Fetches the nested-name qualifier, if one was given.
CastExpr - Base class for type casts, including both implicit casts (ImplicitCastExpr) and explicit c...
This represents clause 'reduction' in the '#pragma omp ...' directives.
FieldDecl * getField()
Get the field whose initializer will be used.
Helper class for OffsetOfExpr.
This represents '#pragma omp teams distribute simd' combined directive.
Represents binding an expression to a temporary.
StringLiteral * getClobberStringLiteral(unsigned i)
StringRef getOutputName(unsigned i) const
CXXTemporary * getTemporary()
A C++ lambda expression, which produces a function object (of unspecified type) that can be invoked l...
bool isTypeDependent() const
isTypeDependent - Determines whether this expression is type-dependent (C++ [temp.dep.expr]), which means that its type could change from one template instantiation to the next.
helper_expr_const_range source_exprs() const
void * getAsOpaquePtr() const
DeclarationName getDeclName() const
Retrieve the name that this expression refers to.
Represents a C++ member access expression where the actual member referenced could not be resolved be...
This represents clause 'is_device_ptr' in the '#pragma omp ...' directives.
helper_expr_const_range source_exprs() const
A default argument (C++ [dcl.fct.default]).
virtual Decl * getCanonicalDecl()
Retrieves the "canonical" declaration of the given declaration.
bool isTypeOperand() const
helper_expr_const_range privates() const
This represents clause 'from' in the '#pragma omp ...' directives.
Represents the this expression in C++.
DeclarationName getMemberName() const
Retrieve the name of the member that this expression refers to.
void AddTemplateName(TemplateName Name)
helper_expr_const_range reduction_ops() const
This represents '#pragma omp target parallel for simd' directive.
QualType getTypeAsWritten() const
getTypeAsWritten - Returns the type that this expression is casting to, as written in the source code...
OpenMP 4.0 [2.4, Array Sections].
This represents 'dynamic_allocators' clause in the '#pragma omp requires' directive.
ConditionalOperator - The ?: ternary operator.
Represents a C++ pseudo-destructor (C++ [expr.pseudo]).
CompoundStmt - This represents a group of statements like { stmt stmt }.
QualType getQueriedType() const
This represents 'threads' clause in the '#pragma omp ...' directive.
This represents '#pragma omp taskgroup' directive.
helper_expr_const_range destination_exprs() const
Expr * getSimdlen() const
Return safe iteration space distance.
CXXConstructorDecl * getConstructor() const
Get the constructor that this expression will (ultimately) call.
helper_expr_const_range source_exprs() const
NestedNameSpecifier * getQualifier() const
If the member name was qualified, retrieves the nested-name-specifier that precedes the member name...
This represents clause 'aligned' in the '#pragma omp ...' directives.
const TemplateArgumentLoc * getTemplateArgs() const
Retrieve the template arguments provided as part of this template-id.
UnaryExprOrTypeTraitExpr - expression with either a type or (unevaluated) expression operand...
This represents clause 'task_reduction' in the '#pragma omp taskgroup' directives.
ConstantExpr - An expression that occurs in a constant context and optionally the result of evaluatin...
Represents a call to the builtin function __builtin_va_arg.
ValueDecl * getAsDecl() const
Retrieve the declaration for a declaration non-type template argument.
helper_expr_const_range destination_exprs() const
bool isImplicitAccess() const
True if this is an implicit access, i.e.
unsigned getValue() const
This represents '#pragma omp distribute' directive.
This represents implicit clause 'depend' for the '#pragma omp task' directive.
An expression "T()" which creates a value-initialized rvalue of type T, which is a non-class type...
llvm::MutableArrayRef< Designator > designators()
This represents 'proc_bind' clause in the '#pragma omp ...' directive.
This represents 'capture' clause in the '#pragma omp atomic' directive.
This represents one expression.
TemplateArgumentLoc const * getTemplateArgs() const
IdentifierInfo * getFieldName() const
For a field or identifier offsetof node, returns the name of the field.
bool isArrow() const
Determine whether this member expression used the '->' operator; otherwise, it used the '...
This represents 'simdlen' clause in the '#pragma omp ...' directive.
Declaration of a template type parameter.
Expr * getNumTasks() const
Return safe iteration space distance.
bool isImplicitAccess() const
True if this is an implicit access, i.e., one in which the member being accessed was not written in t...
This represents '#pragma omp master taskloop' directive.
const T * castAs() const
Member-template castAs<specific type>.
Represents a C++ functional cast expression that builds a temporary object.
The template argument is a null pointer or null pointer to member that was provided for a non-type te...
A C++ const_cast expression (C++ [expr.const.cast]).
BlockExpr - Adaptor class for mixing a BlockDecl with expressions.
IdentifierInfo * getDestroyedTypeIdentifier() const
In a dependent pseudo-destructor expression for which we do not have full type information on the des...
This represents '#pragma omp target teams distribute parallel for simd' combined directive.
QualType getArgumentType() const
bool isArrow() const
Determine whether this pseudo-destructor expression was written using an '->' (otherwise, it used a '.
Expr * getAllocator() const
Returns the allocator expression or nullptr, if no allocator is specified.
unsigned getNumTemplateArgs() const
ObjCDictionaryLiteral - AST node to represent objective-c dictionary literals; as in:"name" : NSUserN...
Represents Objective-C's @synchronized statement.
ObjCSelectorExpr used for @selector in Objective-C.
TypeSourceInfo * getTypeSourceInfo() const
Represents an expression that computes the length of a parameter pack.
CXXTryStmt - A C++ try block, including all handlers.
AsTypeExpr - Clang builtin function __builtin_astype [OpenCL 6.2.4.2] This AST node provides support ...
void ProcessODRHash(llvm::FoldingSetNodeID &ID, ODRHash &Hash) const
Calculate a unique representation for a statement that is stable across compiler invocations.
NonTypeTemplateParmDecl - Declares a non-type template parameter, e.g., "Size" in.
IdentifierInfo & getAccessor() const
Represents a C++ template name within the type system.
This represents '#pragma omp target teams distribute simd' combined directive.
ArrayTypeTrait getTrait() const
helper_expr_const_range rhs_exprs() const
This represents 'ordered' clause in the '#pragma omp ...' directive.
Kind getKind() const
Determine what kind of offsetof node this is.
bool isTypeConstraint() const
This represents '#pragma omp for' directive.
LabelDecl * getLabel() const
Represents a folding of a pack over an operator.
QualType getEncodedType() const
ReturnStmt - This represents a return, optionally of an expression: return; return 4;...
This represents '#pragma omp target teams' directive.
An expression that sends a message to the given Objective-C object or class.
This represents a Microsoft inline-assembly statement extension.
ObjCMethodDecl * getImplicitPropertyGetter() const
UnaryOperator - This represents the unary-expression's (except sizeof and alignof), the postinc/postdec operators from postfix-expression, and various extensions.
bool usesGNUSyntax() const
Determines whether this designated initializer used the deprecated GNU syntax for designated initiali...
A member reference to an MSPropertyDecl.
TemplateTemplateParmDecl - Declares a template template parameter, e.g., "T" in.
Represents a reference to a non-type template parameter that has been substituted with a template arg...
const OffsetOfNode & getComponent(unsigned Idx) const
Expr * getDevice()
Return device number.
This represents '#pragma omp cancel' directive.
This represents 'collapse' clause in the '#pragma omp ...' directive.
This represents clause 'firstprivate' in the '#pragma omp ...' directives.
ObjCBridgeCastKind getBridgeKind() const
Determine which kind of bridge is being performed via this cast.
CStyleCastExpr - An explicit cast in C (C99 6.5.4) or a C-style cast in C++ (C++ [expr.cast]), which uses the syntax (Type)expr.
bool isNull() const
Return true if this QualType doesn't point to a type yet.
ImaginaryLiteral - We support imaginary integer and floating point literals, like "1...
This represents '#pragma omp flush' directive.
ArrayRef< concepts::Requirement * > getRequirements() const
This represents '#pragma omp parallel for simd' directive.
DoStmt - This represents a 'do/while' stmt.
This represents 'seq_cst' clause in the '#pragma omp atomic' directive.
helper_expr_const_range assignment_ops() const
This represents 'untied' clause in the '#pragma omp ...' directive.
NestedNameSpecifier * getQualifier() const
Retrieve the nested-name-specifier that qualifies the member name.
This represents '#pragma omp parallel master taskloop' directive.
This represents 'unified_address' clause in the '#pragma omp requires' directive. ...
This represents '#pragma omp target enter data' directive.
This represents '#pragma omp master taskloop simd' directive.
This represents 'num_teams' clause in the '#pragma omp ...' directive.
A C++ dynamic_cast expression (C++ [expr.dynamic.cast]).
OpaqueValueExpr - An expression referring to an opaque object of a fixed type and value class...
ConvertVectorExpr - Clang builtin function __builtin_convertvector This AST node provides support for...
A reference to an overloaded function set, either an UnresolvedLookupExpr or an UnresolvedMemberExpr...
A field in a dependent type, known only by its name.
This captures a statement into a function.
Represents a call to an inherited base class constructor from an inheriting constructor.
ExpressionTrait getTrait() const
PseudoObjectExpr - An expression which accesses a pseudo-object l-value.
bool isImplicitProperty() const
helper_expr_const_range taskgroup_descriptors() const
This represents '#pragma omp single' directive.
capture_iterator explicit_capture_begin() const
Retrieve an iterator pointing to the first explicit lambda capture.
This represents 'hint' clause in the '#pragma omp ...' directive.
bool hasExplicitTemplateArgs() const
Determines whether this member expression actually had a C++ template argument list explicitly specif...
This is a basic class for representing single OpenMP executable directive.
private_copies_range private_copies()
Represents a new-expression for memory allocation and constructor calls, e.g: "new CXXNewExpr(foo)"...
A call to a literal operator (C++11 [over.literal]) written as a user-defined literal (C++11 [lit...
DeclarationName getName() const
getName - Returns the embedded declaration name.
Represents a C++2a __builtin_bit_cast(T, v) expression.
This represents 'schedule' clause in the '#pragma omp ...' directive.
Represents a call to a member function that may be written either with member call syntax (e...
void AddIdentifierInfo(const IdentifierInfo *II)
DeclStmt - Adaptor class for mixing declarations with statements and expressions. ...
This represents clause 'shared' in the '#pragma omp ...' directives.
DeclarationNameInfo getDirectiveName() const
Return name of the directive.
Expr * getPriority()
Return Priority number.
Represents a C++ nested name specifier, such as "\::std::vector<int>::".
This represents '#pragma omp taskwait' directive.
QualType getAllocatedType() const
AtomicExpr - Variadic atomic builtins: __atomic_exchange, __atomic_fetch_*, __atomic_load, __atomic_store, and __atomic_compare_exchange_*, for the similarly-named C++11 instructions, and __c11 variants for <stdatomic.h>, and corresponding __opencl_atomic_* for OpenCL 2.0.
UnaryExprOrTypeTrait getKind() const
void Profile(llvm::FoldingSetNodeID &ID)
ObjCProtocolExpr used for protocol expression in Objective-C.
const StringLiteral * getOutputConstraintLiteral(unsigned i) const
ImplicitCastExpr - Allows us to explicitly represent implicit type conversions, which have no direct ...
CharacterKind getKind() const
This represents '#pragma omp target' directive.
Expr * getNumForLoops() const
Return the number of associated for-loops.
bool isParenTypeId() const
void AddNestedNameSpecifier(const NestedNameSpecifier *NNS)
llvm::APSInt getAsIntegral() const
Retrieve the template argument as an integral value.
An expression trait intrinsic.
const ObjCMethodDecl * getMethodDecl() const
A static requirement that can be used in a requires-expression to check properties of types and expre...
VarDecl * getConditionVariable()
Retrieve the variable declared in this "switch" statement, if any.
This represents '#pragma omp ordered' directive.
StmtExpr - This is the GNU Statement Expression extension: ({int X=4; X;}).
This represents '#pragma omp target update' directive.
ObjCBoxedExpr - used for generalized expression boxing.
bool isArgumentType() const
helper_expr_const_range lhs_exprs() const
FunctionDecl * getOperatorDelete() const
This represents '#pragma omp parallel master taskloop simd' directive.
Representation of a Microsoft __if_exists or __if_not_exists statement with a dependent name...
A qualified reference to a name whose declaration cannot yet be resolved.
InitializationStyle getInitializationStyle() const
The kind of initializer this new-expression has.
ArrayRef< TemplateArgument > pack_elements() const
Iterator range referencing all of the elements of a template argument pack.
CompoundAssignOperator - For compound assignments (e.g.
Represents a C11 generic selection.
ArrayRef< TemplateArgument > getPartialArguments() const
Get.
bool isReversed() const
Determine whether this expression was rewritten in reverse form.
AddrLabelExpr - The GNU address of label extension, representing &&label.
An Objective-C "bridged" cast expression, which casts between Objective-C pointers and C pointers...
ast_type_traits::DynTypedNode Node
Represents a reference to a function parameter pack or init-capture pack that has been substituted bu...
Represents a template argument.
TypeSourceInfo * getDestroyedTypeInfo() const
Retrieve the source location information for the type being destroyed.
NullStmt - This is the null statement ";": C99 6.8.3p3.
bool isTypeOperand() const
Dataflow Directional Tag Classes.
This represents 'device' clause in the '#pragma omp ...' directive.
NestedNameSpecifier * getNestedNameSpecifier() const
Retrieve the nested-name-specifier to which this instance refers.
VarDecl * getConditionVariable()
Retrieve the variable declared in this "while" statement, if any.
[C99 6.4.2.2] - A predefined identifier such as func.
Represents a delete expression for memory deallocation and destructor calls, e.g. ...
OverloadedOperatorKind getOperator() const
Returns the kind of overloaded operator that this expression refers to.
helper_expr_const_range privates() const
NonTypeTemplateParmDecl * getParameterPack() const
Retrieve the non-type template parameter pack being substituted.
MSPropertyDecl * getPropertyDecl() const
The template argument is a pack expansion of a template name that was provided for a template templat...
This represents '#pragma omp section' directive.
This represents '#pragma omp teams distribute' directive.
A runtime availability query.
VarDecl *const * iterator
Iterators over the parameters which the parameter pack expanded into.
A C++ reinterpret_cast expression (C++ [expr.reinterpret.cast]).
This represents '#pragma omp simd' directive.
Represents a 'co_yield' expression.
DeclarationName getMember() const
Retrieve the name of the member that this expression refers to.
The name of a declaration.
StmtClass getStmtClass() const
const Expr * getReductionRef() const
Returns reference to the task_reduction return variable.
Represents a C++11 pack expansion that produces a sequence of expressions.
This represents 'unified_shared_memory' clause in the '#pragma omp requires' directive.
This represents clause 'linear' in the '#pragma omp ...' directives.
semantics_iterator semantics_begin()
bool isIfExists() const
Determine whether this is an __if_exists statement.
ExplicitCastExpr - An explicit cast written in the source code.
This represents '#pragma omp atomic' directive.
TypeSourceInfo * getTypeOperandSourceInfo() const
Retrieve source information for the type operand.
llvm::APInt getValue() const
Represents a __leave statement.
LabelDecl * getLabel() const
helper_expr_const_range privates() const
Represents a C++11 noexcept expression (C++ [expr.unary.noexcept]).
SwitchStmt - This represents a 'switch' stmt.
Capturing variable-length array type.
Not an overloaded operator.
Represents the body of a coroutine.
Location wrapper for a TemplateArgument.
ArraySubscriptExpr - [C99 6.5.2.1] Array Subscripting.
Represents Objective-C's collection statement.
ObjCEncodeExpr, used for @encode in Objective-C.
helper_expr_const_range destination_exprs() const
An implicit indirection through a C++ base class, when the field found is in a base class...
bool isSubstitutionFailure() const
Represents a call to a CUDA kernel function.
Represents a 'co_await' expression.
Expr * getReplacement() const
StringRef getBytes() const
Allow access to clients that need the byte representation, such as ASTWriterStmt::VisitStringLiteral(...
Represents Objective-C's @finally statement.
The template argument is a type.
child_range private_refs()
The template argument is actually a parameter pack.
bool isArrow() const
Determine whether this member expression used the '->' operator; otherwise, it used the '...
const DeclarationNameInfo & getNameInfo() const
Gets the name info for specified reduction identifier.
Capturing the *this object by reference.
This represents 'write' clause in the '#pragma omp atomic' directive.
unsigned getNumClobbers() const
ObjCIvarRefExpr - A reference to an ObjC instance variable.
bool isPartiallySubstituted() const
Determine whether this represents a partially-substituted sizeof...
Describes an explicit type conversion that uses functional notion but could not be resolved because o...
CanQualType getCanonicalType(QualType T) const
Return the canonical (structural) type corresponding to the specified potentially non-canonical type ...
GotoStmt - This represents a direct goto.
A use of a default initializer in a constructor or in aggregate initialization.
ArgKind getKind() const
Return the kind of stored template argument.
QualType getSuperReceiverType() const
Defines the C++ Decl subclasses, other than those for templates (found in DeclTemplate.h) and friends (in DeclFriend.h).
const DeclarationNameInfo & getNameInfo() const
Gets the name info for specified reduction identifier.
VarDecl * getConditionVariable()
Retrieve the variable declared in this "if" statement, if any.
MemberExpr - [C99 6.5.2.3] Structure and Union Members.
This represents '#pragma omp target parallel' directive.
This represents 'nowait' clause in the '#pragma omp ...' directive.
ArrayRef< TemplateArgument > getTemplateArguments() const
ContinueStmt - This represents a continue.
Represents a loop initializing the elements of an array.
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...
ChooseExpr - GNU builtin-in function __builtin_choose_expr.
TemplateName getCanonicalTemplateName(TemplateName Name) const
Retrieves the "canonical" template name that refers to a given template.
BinaryConditionalOperator - The GNU extension to the conditional operator which allows the middle ope...
CXXCatchStmt - This represents a C++ catch block.
Represents an explicit C++ type conversion that uses "functional" notation (C++ [expr.type.conv]).
WhileStmt - This represents a 'while' stmt.
Represents the specialization of a concept - evaluates to a prvalue of type bool. ...
helper_expr_const_range reduction_ops() const
Expr * getThreadLimit()
Return ThreadLimit number.
This class is used for builtin types like 'int'.
bool shouldCopy() const
shouldCopy - True if we should do the 'copy' part of the copy-restore.
Represents Objective-C's @try ... @catch ... @finally statement.
bool isGlobalDelete() const
This represents '#pragma omp taskloop simd' directive.
StringLiteral - This represents a string literal expression, e.g.
CallExpr - Represents a function call (C99 6.5.2.2, C++ [expr.call]).
This represents 'dist_schedule' clause in the '#pragma omp ...' directive.
static Decl::Kind getKind(const Decl *D)
Abstract class common to all of the C++ "named"/"keyword" casts.
This represents '#pragma omp sections' directive.
Expr * getHint() const
Returns number of threads.
NestedNameSpecifierLoc getQualifierLoc() const
Gets the nested name specifier.
ObjCBoolLiteralExpr - Objective-C Boolean Literal.
unsigned getNumComponents() const
This represents '#pragma omp target data' directive.
const ParmVarDecl * getParam() const
QualType getAsType() const
Retrieve the type for a type template argument.
A rewritten comparison expression that was originally written using operator syntax.
A reference to a declared variable, function, enum, etc.
NestedNameSpecifierLoc getQualifierLoc() const
Gets the nested name specifier.
BreakStmt - This represents a break.
Expr * getChunkSize()
Get chunk size.
const VarDecl * getCatchParamDecl() const
unsigned getNumLabels() const
Expr * getNumThreads() const
Returns number of threads.
QualType getTypeAsWritten() const
Retrieve the type that is being constructed, as specified in the source code.
This represents '#pragma omp taskyield' directive.
This represents '#pragma omp distribute parallel for simd' composite directive.
A boolean literal, per ([C++ lex.bool] Boolean literals).
const TypeConstraint * getTypeConstraint() const
NestedNameSpecifier * getQualifier() const
If the name was qualified, retrieves the nested-name-specifier that precedes the name.
OffsetOfExpr - [C99 7.17] - This represents an expression of the form offsetof(record-type, member-designator).
Expr * getQueriedExpression() const
This represents '#pragma omp parallel sections' directive.
A Microsoft C++ __uuidof expression, which gets the _GUID that corresponds to the supplied type or ex...
unsigned getNumTemplateArgs() const
const Expr * getPostUpdateExpr() const
Get post-update expression for the clause.
NestedNameSpecifier * getCanonicalNestedNameSpecifier(NestedNameSpecifier *NNS) const
Retrieves the "canonical" nested name specifier for a given nested name specifier.
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.
BinaryOperatorKind getOperator() const
This represents clause 'nontemporal' in the '#pragma omp ...' directives.
NamedDecl * getPack() const
Retrieve the parameter pack.
Represents Objective-C's @autoreleasepool Statement.
InitListExpr * getSyntacticForm() const
Represents an implicitly-generated value initialization of an object of a given type.
This represents '#pragma omp target parallel for' directive.
This represents clause 'use_device_ptr' in the '#pragma omp ...' directives.
QualType getType() const
Return the type wrapped by this type source info.
TypeTrait getTrait() const
Determine which type trait this expression uses.
association_range associations()
This represents '#pragma omp taskloop' directive.