24#include "llvm/ADT/FoldingSet.h"
30 llvm::FoldingSetNodeID &
ID;
32 bool ProfileLambdaExpr;
35 StmtProfiler(llvm::FoldingSetNodeID &ID,
bool Canonical,
36 bool ProfileLambdaExpr)
37 :
ID(
ID), Canonical(Canonical), ProfileLambdaExpr(ProfileLambdaExpr) {}
39 virtual ~StmtProfiler() {}
41 void VisitStmt(
const Stmt *S);
43 void VisitStmtNoChildren(
const Stmt *S) {
44 HandleStmtClass(S->getStmtClass());
49#define STMT(Node, Base) void Visit##Node(const Node *S);
50#include "clang/AST/StmtNodes.inc"
54 virtual void VisitDecl(
const Decl *
D) = 0;
61 virtual void VisitName(
DeclarationName Name,
bool TreatAsDecl =
false) = 0;
83 class StmtProfilerWithPointers :
public StmtProfiler {
87 StmtProfilerWithPointers(llvm::FoldingSetNodeID &ID,
89 bool ProfileLambdaExpr)
90 : StmtProfiler(
ID, Canonical, ProfileLambdaExpr), Context(Context) {}
97 void VisitDecl(
const Decl *
D)
override {
100 if (Canonical &&
D) {
102 dyn_cast<NonTypeTemplateParmDecl>(
D)) {
103 ID.AddInteger(NTTP->getDepth());
104 ID.AddInteger(NTTP->getIndex());
105 ID.AddBoolean(NTTP->isParameterPack());
118 if (
const ParmVarDecl *Parm = dyn_cast<ParmVarDecl>(
D)) {
129 VisitType(Parm->getType());
130 ID.AddInteger(Parm->getFunctionScopeDepth());
131 ID.AddInteger(Parm->getFunctionScopeIndex());
136 dyn_cast<TemplateTypeParmDecl>(
D)) {
137 ID.AddInteger(TTP->getDepth());
138 ID.AddInteger(TTP->getIndex());
139 ID.AddBoolean(TTP->isParameterPack());
144 dyn_cast<TemplateTemplateParmDecl>(
D)) {
145 ID.AddInteger(TTP->getDepth());
146 ID.AddInteger(TTP->getIndex());
147 ID.AddBoolean(TTP->isParameterPack());
156 if (Canonical && !
T.isNull())
159 ID.AddPointer(
T.getAsOpaquePtr());
163 ID.AddPointer(Name.getAsOpaquePtr());
184 class StmtProfilerWithoutPointers :
public StmtProfiler {
187 StmtProfilerWithoutPointers(llvm::FoldingSetNodeID &ID,
ODRHash &Hash)
193 if (SC == Stmt::UnresolvedLookupExprClass) {
196 ID.AddInteger(Stmt::DeclRefExprClass);
220 void VisitDecl(
const Decl *
D)
override {
230 ID.AddBoolean(
bool(NNS));
237void StmtProfiler::VisitStmt(
const Stmt *S) {
238 assert(S &&
"Requires non-null Stmt pointer");
240 VisitStmtNoChildren(S);
242 for (
const Stmt *SubStmt : S->children()) {
250void StmtProfiler::VisitDeclStmt(
const DeclStmt *S) {
252 for (
const auto *
D : S->decls())
256void StmtProfiler::VisitNullStmt(
const NullStmt *S) {
260void StmtProfiler::VisitCompoundStmt(
const CompoundStmt *S) {
264void StmtProfiler::VisitCaseStmt(
const CaseStmt *S) {
268void StmtProfiler::VisitDefaultStmt(
const DefaultStmt *S) {
272void StmtProfiler::VisitLabelStmt(
const LabelStmt *S) {
274 VisitDecl(S->getDecl());
282void StmtProfiler::VisitIfStmt(
const IfStmt *S) {
284 VisitDecl(S->getConditionVariable());
287void StmtProfiler::VisitSwitchStmt(
const SwitchStmt *S) {
289 VisitDecl(S->getConditionVariable());
292void StmtProfiler::VisitWhileStmt(
const WhileStmt *S) {
294 VisitDecl(S->getConditionVariable());
297void StmtProfiler::VisitDoStmt(
const DoStmt *S) {
301void StmtProfiler::VisitForStmt(
const ForStmt *S) {
305void StmtProfiler::VisitGotoStmt(
const GotoStmt *S) {
307 VisitDecl(S->getLabel());
314void StmtProfiler::VisitContinueStmt(
const ContinueStmt *S) {
318void StmtProfiler::VisitBreakStmt(
const BreakStmt *S) {
322void StmtProfiler::VisitReturnStmt(
const ReturnStmt *S) {
326void StmtProfiler::VisitGCCAsmStmt(
const GCCAsmStmt *S) {
328 ID.AddBoolean(S->isVolatile());
329 ID.AddBoolean(S->isSimple());
330 VisitExpr(S->getAsmStringExpr());
331 ID.AddInteger(S->getNumOutputs());
332 for (
unsigned I = 0, N = S->getNumOutputs(); I != N; ++I) {
333 ID.AddString(S->getOutputName(I));
334 VisitExpr(S->getOutputConstraintExpr(I));
336 ID.AddInteger(S->getNumInputs());
337 for (
unsigned I = 0, N = S->getNumInputs(); I != N; ++I) {
338 ID.AddString(S->getInputName(I));
339 VisitExpr(S->getInputConstraintExpr(I));
341 ID.AddInteger(S->getNumClobbers());
342 for (
unsigned I = 0, N = S->getNumClobbers(); I != N; ++I)
343 VisitExpr(S->getClobberExpr(I));
344 ID.AddInteger(S->getNumLabels());
345 for (
auto *L : S->labels())
346 VisitDecl(L->getLabel());
349void StmtProfiler::VisitMSAsmStmt(
const MSAsmStmt *S) {
354void StmtProfiler::VisitCXXCatchStmt(
const CXXCatchStmt *S) {
356 VisitType(S->getCaughtType());
359void StmtProfiler::VisitCXXTryStmt(
const CXXTryStmt *S) {
369 ID.AddBoolean(S->isIfExists());
370 VisitNestedNameSpecifier(S->getQualifierLoc().getNestedNameSpecifier());
371 VisitName(S->getNameInfo().getName());
374void StmtProfiler::VisitSEHTryStmt(
const SEHTryStmt *S) {
382void StmtProfiler::VisitSEHExceptStmt(
const SEHExceptStmt *S) {
386void StmtProfiler::VisitSEHLeaveStmt(
const SEHLeaveStmt *S) {
390void StmtProfiler::VisitCapturedStmt(
const CapturedStmt *S) {
404 ID.AddBoolean(S->hasEllipsis());
405 if (S->getCatchParamDecl())
406 VisitType(S->getCatchParamDecl()->getType());
413void StmtProfiler::VisitObjCAtTryStmt(
const ObjCAtTryStmt *S) {
433 StmtProfiler *Profiler;
435 template <
typename T>
436 void VisitOMPClauseList(
T *
Node);
439 OMPClauseProfiler(StmtProfiler *
P) : Profiler(
P) { }
440#define GEN_CLANG_CLAUSE_CLASS
441#define CLAUSE_CLASS(Enum, Str, Class) void Visit##Class(const Class *C);
442#include "llvm/Frontend/OpenMP/OMP.inc"
447void OMPClauseProfiler::VisitOMPClauseWithPreInit(
449 if (
auto *S =
C->getPreInitStmt())
450 Profiler->VisitStmt(S);
453void OMPClauseProfiler::VisitOMPClauseWithPostUpdate(
455 VisitOMPClauseWithPreInit(
C);
456 if (
auto *
E =
C->getPostUpdateExpr())
457 Profiler->VisitStmt(
E);
460void OMPClauseProfiler::VisitOMPIfClause(
const OMPIfClause *
C) {
461 VisitOMPClauseWithPreInit(
C);
462 if (
C->getCondition())
463 Profiler->VisitStmt(
C->getCondition());
467 VisitOMPClauseWithPreInit(
C);
468 if (
C->getCondition())
469 Profiler->VisitStmt(
C->getCondition());
473 VisitOMPClauseWithPreInit(
C);
474 if (
C->getNumThreads())
475 Profiler->VisitStmt(
C->getNumThreads());
479 if (
C->getAlignment())
480 Profiler->VisitStmt(
C->getAlignment());
485 Profiler->VisitStmt(
C->getSafelen());
490 Profiler->VisitStmt(
C->getSimdlen());
494 for (
auto *
E :
C->getSizesRefs())
496 Profiler->VisitExpr(
E);
499void OMPClauseProfiler::VisitOMPPermutationClause(
501 for (
Expr *
E :
C->getArgsRefs())
503 Profiler->VisitExpr(
E);
506void OMPClauseProfiler::VisitOMPFullClause(
const OMPFullClause *
C) {}
509 if (
const Expr *Factor =
C->getFactor())
510 Profiler->VisitExpr(Factor);
514 if (
C->getAllocator())
515 Profiler->VisitStmt(
C->getAllocator());
519 if (
C->getNumForLoops())
520 Profiler->VisitStmt(
C->getNumForLoops());
524 if (
Expr *Evt =
C->getEventHandler())
525 Profiler->VisitStmt(Evt);
529 VisitOMPClauseWithPreInit(
C);
530 if (
C->getCondition())
531 Profiler->VisitStmt(
C->getCondition());
535 VisitOMPClauseWithPreInit(
C);
536 if (
C->getCondition())
537 Profiler->VisitStmt(
C->getCondition());
544void OMPClauseProfiler::VisitOMPUnifiedAddressClause(
547void OMPClauseProfiler::VisitOMPUnifiedSharedMemoryClause(
550void OMPClauseProfiler::VisitOMPReverseOffloadClause(
553void OMPClauseProfiler::VisitOMPDynamicAllocatorsClause(
556void OMPClauseProfiler::VisitOMPAtomicDefaultMemOrderClause(
561void OMPClauseProfiler::VisitOMPAtClause(
const OMPAtClause *
C) {}
566 if (
C->getMessageString())
567 Profiler->VisitStmt(
C->getMessageString());
571 VisitOMPClauseWithPreInit(
C);
572 if (
auto *S =
C->getChunkSize())
573 Profiler->VisitStmt(S);
577 if (
auto *
Num =
C->getNumForLoops())
578 Profiler->VisitStmt(
Num);
581void OMPClauseProfiler::VisitOMPNowaitClause(
const OMPNowaitClause *) {}
583void OMPClauseProfiler::VisitOMPUntiedClause(
const OMPUntiedClause *) {}
587void OMPClauseProfiler::VisitOMPReadClause(
const OMPReadClause *) {}
589void OMPClauseProfiler::VisitOMPWriteClause(
const OMPWriteClause *) {}
591void OMPClauseProfiler::VisitOMPUpdateClause(
const OMPUpdateClause *) {}
597void OMPClauseProfiler::VisitOMPFailClause(
const OMPFailClause *) {}
599void OMPClauseProfiler::VisitOMPAbsentClause(
const OMPAbsentClause *) {}
601void OMPClauseProfiler::VisitOMPHoldsClause(
const OMPHoldsClause *) {}
607void OMPClauseProfiler::VisitOMPNoOpenMPRoutinesClause(
610void OMPClauseProfiler::VisitOMPNoOpenMPConstructsClause(
613void OMPClauseProfiler::VisitOMPNoParallelismClause(
616void OMPClauseProfiler::VisitOMPSeqCstClause(
const OMPSeqCstClause *) {}
618void OMPClauseProfiler::VisitOMPAcqRelClause(
const OMPAcqRelClause *) {}
626void OMPClauseProfiler::VisitOMPWeakClause(
const OMPWeakClause *) {}
630void OMPClauseProfiler::VisitOMPSIMDClause(
const OMPSIMDClause *) {}
634void OMPClauseProfiler::VisitOMPInitClause(
const OMPInitClause *
C) {
635 VisitOMPClauseList(
C);
638void OMPClauseProfiler::VisitOMPUseClause(
const OMPUseClause *
C) {
639 if (
C->getInteropVar())
640 Profiler->VisitStmt(
C->getInteropVar());
644 if (
C->getInteropVar())
645 Profiler->VisitStmt(
C->getInteropVar());
649 VisitOMPClauseWithPreInit(
C);
650 if (
C->getThreadID())
651 Profiler->VisitStmt(
C->getThreadID());
655void OMPClauseProfiler::VisitOMPClauseList(
T *
Node) {
656 for (
auto *
E :
Node->varlist()) {
658 Profiler->VisitStmt(
E);
663 VisitOMPClauseList(
C);
664 for (
auto *
E :
C->private_copies()) {
666 Profiler->VisitStmt(
E);
671 VisitOMPClauseList(
C);
672 VisitOMPClauseWithPreInit(
C);
673 for (
auto *
E :
C->private_copies()) {
675 Profiler->VisitStmt(
E);
677 for (
auto *
E :
C->inits()) {
679 Profiler->VisitStmt(
E);
684 VisitOMPClauseList(
C);
685 VisitOMPClauseWithPostUpdate(
C);
686 for (
auto *
E :
C->source_exprs()) {
688 Profiler->VisitStmt(
E);
690 for (
auto *
E :
C->destination_exprs()) {
692 Profiler->VisitStmt(
E);
694 for (
auto *
E :
C->assignment_ops()) {
696 Profiler->VisitStmt(
E);
700 VisitOMPClauseList(
C);
702void OMPClauseProfiler::VisitOMPReductionClause(
704 Profiler->VisitNestedNameSpecifier(
705 C->getQualifierLoc().getNestedNameSpecifier());
706 Profiler->VisitName(
C->getNameInfo().getName());
707 VisitOMPClauseList(
C);
708 VisitOMPClauseWithPostUpdate(
C);
709 for (
auto *
E :
C->privates()) {
711 Profiler->VisitStmt(
E);
713 for (
auto *
E :
C->lhs_exprs()) {
715 Profiler->VisitStmt(
E);
717 for (
auto *
E :
C->rhs_exprs()) {
719 Profiler->VisitStmt(
E);
721 for (
auto *
E :
C->reduction_ops()) {
723 Profiler->VisitStmt(
E);
725 if (
C->getModifier() == clang::OMPC_REDUCTION_inscan) {
726 for (
auto *
E :
C->copy_ops()) {
728 Profiler->VisitStmt(
E);
730 for (
auto *
E :
C->copy_array_temps()) {
732 Profiler->VisitStmt(
E);
734 for (
auto *
E :
C->copy_array_elems()) {
736 Profiler->VisitStmt(
E);
740void OMPClauseProfiler::VisitOMPTaskReductionClause(
742 Profiler->VisitNestedNameSpecifier(
743 C->getQualifierLoc().getNestedNameSpecifier());
744 Profiler->VisitName(
C->getNameInfo().getName());
745 VisitOMPClauseList(
C);
746 VisitOMPClauseWithPostUpdate(
C);
747 for (
auto *
E :
C->privates()) {
749 Profiler->VisitStmt(
E);
751 for (
auto *
E :
C->lhs_exprs()) {
753 Profiler->VisitStmt(
E);
755 for (
auto *
E :
C->rhs_exprs()) {
757 Profiler->VisitStmt(
E);
759 for (
auto *
E :
C->reduction_ops()) {
761 Profiler->VisitStmt(
E);
764void OMPClauseProfiler::VisitOMPInReductionClause(
766 Profiler->VisitNestedNameSpecifier(
767 C->getQualifierLoc().getNestedNameSpecifier());
768 Profiler->VisitName(
C->getNameInfo().getName());
769 VisitOMPClauseList(
C);
770 VisitOMPClauseWithPostUpdate(
C);
771 for (
auto *
E :
C->privates()) {
773 Profiler->VisitStmt(
E);
775 for (
auto *
E :
C->lhs_exprs()) {
777 Profiler->VisitStmt(
E);
779 for (
auto *
E :
C->rhs_exprs()) {
781 Profiler->VisitStmt(
E);
783 for (
auto *
E :
C->reduction_ops()) {
785 Profiler->VisitStmt(
E);
787 for (
auto *
E :
C->taskgroup_descriptors()) {
789 Profiler->VisitStmt(
E);
793 VisitOMPClauseList(
C);
794 VisitOMPClauseWithPostUpdate(
C);
795 for (
auto *
E :
C->privates()) {
797 Profiler->VisitStmt(
E);
799 for (
auto *
E :
C->inits()) {
801 Profiler->VisitStmt(
E);
803 for (
auto *
E :
C->updates()) {
805 Profiler->VisitStmt(
E);
807 for (
auto *
E :
C->finals()) {
809 Profiler->VisitStmt(
E);
812 Profiler->VisitStmt(
C->getStep());
813 if (
C->getCalcStep())
814 Profiler->VisitStmt(
C->getCalcStep());
817 VisitOMPClauseList(
C);
818 if (
C->getAlignment())
819 Profiler->VisitStmt(
C->getAlignment());
822 VisitOMPClauseList(
C);
823 for (
auto *
E :
C->source_exprs()) {
825 Profiler->VisitStmt(
E);
827 for (
auto *
E :
C->destination_exprs()) {
829 Profiler->VisitStmt(
E);
831 for (
auto *
E :
C->assignment_ops()) {
833 Profiler->VisitStmt(
E);
838 VisitOMPClauseList(
C);
839 for (
auto *
E :
C->source_exprs()) {
841 Profiler->VisitStmt(
E);
843 for (
auto *
E :
C->destination_exprs()) {
845 Profiler->VisitStmt(
E);
847 for (
auto *
E :
C->assignment_ops()) {
849 Profiler->VisitStmt(
E);
853 VisitOMPClauseList(
C);
856 if (
const Expr *Depobj =
C->getDepobj())
857 Profiler->VisitStmt(Depobj);
860 VisitOMPClauseList(
C);
864 Profiler->VisitStmt(
C->getDevice());
866void OMPClauseProfiler::VisitOMPMapClause(
const OMPMapClause *
C) {
867 VisitOMPClauseList(
C);
870 if (
Expr *Allocator =
C->getAllocator())
871 Profiler->VisitStmt(Allocator);
872 VisitOMPClauseList(
C);
875 VisitOMPClauseList(
C);
876 VisitOMPClauseWithPreInit(
C);
878void OMPClauseProfiler::VisitOMPThreadLimitClause(
880 VisitOMPClauseList(
C);
881 VisitOMPClauseWithPreInit(
C);
884 VisitOMPClauseWithPreInit(
C);
885 if (
C->getPriority())
886 Profiler->VisitStmt(
C->getPriority());
889 VisitOMPClauseWithPreInit(
C);
890 if (
C->getGrainsize())
891 Profiler->VisitStmt(
C->getGrainsize());
894 VisitOMPClauseWithPreInit(
C);
895 if (
C->getNumTasks())
896 Profiler->VisitStmt(
C->getNumTasks());
898void OMPClauseProfiler::VisitOMPHintClause(
const OMPHintClause *
C) {
900 Profiler->VisitStmt(
C->getHint());
902void OMPClauseProfiler::VisitOMPToClause(
const OMPToClause *
C) {
903 VisitOMPClauseList(
C);
905void OMPClauseProfiler::VisitOMPFromClause(
const OMPFromClause *
C) {
906 VisitOMPClauseList(
C);
908void OMPClauseProfiler::VisitOMPUseDevicePtrClause(
910 VisitOMPClauseList(
C);
912void OMPClauseProfiler::VisitOMPUseDeviceAddrClause(
914 VisitOMPClauseList(
C);
916void OMPClauseProfiler::VisitOMPIsDevicePtrClause(
918 VisitOMPClauseList(
C);
920void OMPClauseProfiler::VisitOMPHasDeviceAddrClause(
922 VisitOMPClauseList(
C);
924void OMPClauseProfiler::VisitOMPNontemporalClause(
926 VisitOMPClauseList(
C);
927 for (
auto *
E :
C->private_refs())
928 Profiler->VisitStmt(
E);
931 VisitOMPClauseList(
C);
934 VisitOMPClauseList(
C);
936void OMPClauseProfiler::VisitOMPUsesAllocatorsClause(
938 for (
unsigned I = 0,
E =
C->getNumberOfAllocators(); I <
E; ++I) {
940 Profiler->VisitStmt(
D.Allocator);
941 if (
D.AllocatorTraits)
942 Profiler->VisitStmt(
D.AllocatorTraits);
946 if (
const Expr *Modifier =
C->getModifier())
947 Profiler->VisitStmt(Modifier);
948 for (
const Expr *
E :
C->varlist())
949 Profiler->VisitStmt(
E);
952void OMPClauseProfiler::VisitOMPBindClause(
const OMPBindClause *
C) {}
953void OMPClauseProfiler::VisitOMPXDynCGroupMemClause(
955 VisitOMPClauseWithPreInit(
C);
956 if (
Expr *Size =
C->getSize())
957 Profiler->VisitStmt(Size);
960 VisitOMPClauseList(
C);
970 OMPClauseProfiler
P(
this);
983 VisitOMPExecutableDirective(S);
987 VisitOMPLoopBasedDirective(S);
991 VisitOMPExecutableDirective(S);
995 VisitOMPExecutableDirective(S);
999 VisitOMPLoopDirective(S);
1002void StmtProfiler::VisitOMPLoopTransformationDirective(
1004 VisitOMPLoopBasedDirective(S);
1008 VisitOMPLoopTransformationDirective(S);
1012 VisitOMPLoopTransformationDirective(S);
1016 VisitOMPLoopTransformationDirective(S);
1020 VisitOMPLoopTransformationDirective(S);
1023void StmtProfiler::VisitOMPInterchangeDirective(
1025 VisitOMPLoopTransformationDirective(S);
1029 VisitOMPLoopDirective(S);
1033 VisitOMPLoopDirective(S);
1037 VisitOMPExecutableDirective(S);
1041 VisitOMPExecutableDirective(S);
1045 VisitOMPExecutableDirective(S);
1049 VisitOMPExecutableDirective(S);
1053 VisitOMPExecutableDirective(S);
1057 VisitOMPExecutableDirective(S);
1058 VisitName(S->getDirectiveName().getName());
1063 VisitOMPLoopDirective(S);
1066void StmtProfiler::VisitOMPParallelForSimdDirective(
1068 VisitOMPLoopDirective(S);
1071void StmtProfiler::VisitOMPParallelMasterDirective(
1073 VisitOMPExecutableDirective(S);
1076void StmtProfiler::VisitOMPParallelMaskedDirective(
1078 VisitOMPExecutableDirective(S);
1081void StmtProfiler::VisitOMPParallelSectionsDirective(
1083 VisitOMPExecutableDirective(S);
1087 VisitOMPExecutableDirective(S);
1091 VisitOMPExecutableDirective(S);
1095 VisitOMPExecutableDirective(S);
1099 VisitOMPExecutableDirective(S);
1103 VisitOMPExecutableDirective(S);
1107 VisitOMPExecutableDirective(S);
1110 VisitOMPExecutableDirective(S);
1111 if (
const Expr *
E = S->getReductionRef())
1116 VisitOMPExecutableDirective(S);
1120 VisitOMPExecutableDirective(S);
1124 VisitOMPExecutableDirective(S);
1128 VisitOMPExecutableDirective(S);
1132 VisitOMPExecutableDirective(S);
1136 VisitOMPExecutableDirective(S);
1140 VisitOMPExecutableDirective(S);
1143void StmtProfiler::VisitOMPTargetEnterDataDirective(
1145 VisitOMPExecutableDirective(S);
1148void StmtProfiler::VisitOMPTargetExitDataDirective(
1150 VisitOMPExecutableDirective(S);
1153void StmtProfiler::VisitOMPTargetParallelDirective(
1155 VisitOMPExecutableDirective(S);
1158void StmtProfiler::VisitOMPTargetParallelForDirective(
1160 VisitOMPExecutableDirective(S);
1164 VisitOMPExecutableDirective(S);
1167void StmtProfiler::VisitOMPCancellationPointDirective(
1169 VisitOMPExecutableDirective(S);
1173 VisitOMPExecutableDirective(S);
1177 VisitOMPLoopDirective(S);
1180void StmtProfiler::VisitOMPTaskLoopSimdDirective(
1182 VisitOMPLoopDirective(S);
1185void StmtProfiler::VisitOMPMasterTaskLoopDirective(
1187 VisitOMPLoopDirective(S);
1190void StmtProfiler::VisitOMPMaskedTaskLoopDirective(
1192 VisitOMPLoopDirective(S);
1195void StmtProfiler::VisitOMPMasterTaskLoopSimdDirective(
1197 VisitOMPLoopDirective(S);
1200void StmtProfiler::VisitOMPMaskedTaskLoopSimdDirective(
1202 VisitOMPLoopDirective(S);
1205void StmtProfiler::VisitOMPParallelMasterTaskLoopDirective(
1207 VisitOMPLoopDirective(S);
1210void StmtProfiler::VisitOMPParallelMaskedTaskLoopDirective(
1212 VisitOMPLoopDirective(S);
1215void StmtProfiler::VisitOMPParallelMasterTaskLoopSimdDirective(
1217 VisitOMPLoopDirective(S);
1220void StmtProfiler::VisitOMPParallelMaskedTaskLoopSimdDirective(
1222 VisitOMPLoopDirective(S);
1225void StmtProfiler::VisitOMPDistributeDirective(
1227 VisitOMPLoopDirective(S);
1230void OMPClauseProfiler::VisitOMPDistScheduleClause(
1232 VisitOMPClauseWithPreInit(
C);
1233 if (
auto *S =
C->getChunkSize())
1234 Profiler->VisitStmt(S);
1239void StmtProfiler::VisitOMPTargetUpdateDirective(
1241 VisitOMPExecutableDirective(S);
1244void StmtProfiler::VisitOMPDistributeParallelForDirective(
1246 VisitOMPLoopDirective(S);
1249void StmtProfiler::VisitOMPDistributeParallelForSimdDirective(
1251 VisitOMPLoopDirective(S);
1254void StmtProfiler::VisitOMPDistributeSimdDirective(
1256 VisitOMPLoopDirective(S);
1259void StmtProfiler::VisitOMPTargetParallelForSimdDirective(
1261 VisitOMPLoopDirective(S);
1264void StmtProfiler::VisitOMPTargetSimdDirective(
1266 VisitOMPLoopDirective(S);
1269void StmtProfiler::VisitOMPTeamsDistributeDirective(
1271 VisitOMPLoopDirective(S);
1274void StmtProfiler::VisitOMPTeamsDistributeSimdDirective(
1276 VisitOMPLoopDirective(S);
1279void StmtProfiler::VisitOMPTeamsDistributeParallelForSimdDirective(
1281 VisitOMPLoopDirective(S);
1284void StmtProfiler::VisitOMPTeamsDistributeParallelForDirective(
1286 VisitOMPLoopDirective(S);
1289void StmtProfiler::VisitOMPTargetTeamsDirective(
1291 VisitOMPExecutableDirective(S);
1294void StmtProfiler::VisitOMPTargetTeamsDistributeDirective(
1296 VisitOMPLoopDirective(S);
1299void StmtProfiler::VisitOMPTargetTeamsDistributeParallelForDirective(
1301 VisitOMPLoopDirective(S);
1304void StmtProfiler::VisitOMPTargetTeamsDistributeParallelForSimdDirective(
1306 VisitOMPLoopDirective(S);
1309void StmtProfiler::VisitOMPTargetTeamsDistributeSimdDirective(
1311 VisitOMPLoopDirective(S);
1315 VisitOMPExecutableDirective(S);
1319 VisitOMPExecutableDirective(S);
1323 VisitOMPExecutableDirective(S);
1326void StmtProfiler::VisitOMPGenericLoopDirective(
1328 VisitOMPLoopDirective(S);
1331void StmtProfiler::VisitOMPTeamsGenericLoopDirective(
1333 VisitOMPLoopDirective(S);
1336void StmtProfiler::VisitOMPTargetTeamsGenericLoopDirective(
1338 VisitOMPLoopDirective(S);
1341void StmtProfiler::VisitOMPParallelGenericLoopDirective(
1343 VisitOMPLoopDirective(S);
1346void StmtProfiler::VisitOMPTargetParallelGenericLoopDirective(
1348 VisitOMPLoopDirective(S);
1351void StmtProfiler::VisitExpr(
const Expr *S) {
1355void StmtProfiler::VisitConstantExpr(
const ConstantExpr *S) {
1359void StmtProfiler::VisitDeclRefExpr(
const DeclRefExpr *S) {
1362 VisitNestedNameSpecifier(S->getQualifier());
1363 VisitDecl(S->getDecl());
1365 ID.AddBoolean(S->hasExplicitTemplateArgs());
1366 if (S->hasExplicitTemplateArgs())
1367 VisitTemplateArguments(S->getTemplateArgs(), S->getNumTemplateArgs());
1371void StmtProfiler::VisitSYCLUniqueStableNameExpr(
1374 VisitType(S->getTypeSourceInfo()->getType());
1379 ID.AddInteger(llvm::to_underlying(S->getIdentKind()));
1382void StmtProfiler::VisitOpenACCAsteriskSizeExpr(
1389 S->getValue().Profile(ID);
1393 T =
T.getCanonicalType();
1396 BitIntT->Profile(ID);
1403 S->getValue().Profile(ID);
1409 ID.AddInteger(llvm::to_underlying(S->getKind()));
1410 ID.AddInteger(S->getValue());
1415 S->getValue().Profile(ID);
1416 ID.AddBoolean(S->isExact());
1424void StmtProfiler::VisitStringLiteral(
const StringLiteral *S) {
1426 ID.AddString(S->getBytes());
1427 ID.AddInteger(llvm::to_underlying(S->getKind()));
1430void StmtProfiler::VisitParenExpr(
const ParenExpr *S) {
1434void StmtProfiler::VisitParenListExpr(
const ParenListExpr *S) {
1438void StmtProfiler::VisitUnaryOperator(
const UnaryOperator *S) {
1440 ID.AddInteger(S->getOpcode());
1443void StmtProfiler::VisitOffsetOfExpr(
const OffsetOfExpr *S) {
1444 VisitType(S->getTypeSourceInfo()->getType());
1445 unsigned n = S->getNumComponents();
1446 for (
unsigned i = 0; i < n; ++i) {
1474 ID.AddInteger(S->getKind());
1475 if (S->isArgumentType())
1476 VisitType(S->getArgumentType());
1497 for (
unsigned I = 0,
E = S->numOfIterators(); I <
E; ++I)
1498 VisitDecl(S->getIteratorDecl(I));
1501void StmtProfiler::VisitCallExpr(
const CallExpr *S) {
1505void StmtProfiler::VisitMemberExpr(
const MemberExpr *S) {
1507 VisitDecl(S->getMemberDecl());
1509 VisitNestedNameSpecifier(S->getQualifier());
1510 ID.AddBoolean(S->isArrow());
1515 ID.AddBoolean(S->isFileScope());
1518void StmtProfiler::VisitCastExpr(
const CastExpr *S) {
1524 ID.AddInteger(S->getValueKind());
1529 VisitType(S->getTypeAsWritten());
1533 VisitExplicitCastExpr(S);
1538 ID.AddInteger(S->getOpcode());
1543 VisitBinaryOperator(S);
1550void StmtProfiler::VisitBinaryConditionalOperator(
1555void StmtProfiler::VisitAddrLabelExpr(
const AddrLabelExpr *S) {
1557 VisitDecl(S->getLabel());
1560void StmtProfiler::VisitStmtExpr(
const StmtExpr *S) {
1572void StmtProfiler::VisitChooseExpr(
const ChooseExpr *S) {
1576void StmtProfiler::VisitGNUNullExpr(
const GNUNullExpr *S) {
1580void StmtProfiler::VisitVAArgExpr(
const VAArgExpr *S) {
1584void StmtProfiler::VisitInitListExpr(
const InitListExpr *S) {
1585 if (S->getSyntacticForm()) {
1586 VisitInitListExpr(S->getSyntacticForm());
1595 ID.AddBoolean(S->usesGNUSyntax());
1597 if (
D.isFieldDesignator()) {
1599 VisitName(
D.getFieldName());
1603 if (
D.isArrayDesignator()) {
1606 assert(
D.isArrayRangeDesignator());
1609 ID.AddInteger(
D.getArrayIndex());
1615void StmtProfiler::VisitDesignatedInitUpdateExpr(
1617 llvm_unreachable(
"Unexpected DesignatedInitUpdateExpr in syntactic form of "
1629void StmtProfiler::VisitNoInitExpr(
const NoInitExpr *S) {
1630 llvm_unreachable(
"Unexpected NoInitExpr in syntactic form of initializer");
1639 VisitName(&S->getAccessor());
1642void StmtProfiler::VisitBlockExpr(
const BlockExpr *S) {
1644 VisitDecl(S->getBlockDecl());
1650 S->associations()) {
1653 ID.AddPointer(
nullptr);
1656 VisitExpr(Assoc.getAssociationExpr());
1663 i = S->semantics_begin(), e = S->semantics_end(); i != e; ++i)
1666 Visit(OVE->getSourceExpr());
1669void StmtProfiler::VisitAtomicExpr(
const AtomicExpr *S) {
1671 ID.AddInteger(S->getOp());
1674void StmtProfiler::VisitConceptSpecializationExpr(
1677 VisitDecl(S->getNamedConcept());
1679 VisitTemplateArgument(Arg);
1682void StmtProfiler::VisitRequiresExpr(
const RequiresExpr *S) {
1684 ID.AddInteger(S->getLocalParameters().size());
1685 for (
ParmVarDecl *LocalParam : S->getLocalParameters())
1686 VisitDecl(LocalParam);
1687 ID.AddInteger(S->getRequirements().size());
1689 if (
auto *TypeReq = dyn_cast<concepts::TypeRequirement>(Req)) {
1691 ID.AddBoolean(TypeReq->isSubstitutionFailure());
1692 if (!TypeReq->isSubstitutionFailure())
1693 VisitType(TypeReq->getType()->getType());
1694 }
else if (
auto *ExprReq = dyn_cast<concepts::ExprRequirement>(Req)) {
1696 ID.AddBoolean(ExprReq->isExprSubstitutionFailure());
1697 if (!ExprReq->isExprSubstitutionFailure())
1698 Visit(ExprReq->getExpr());
1703 ID.AddBoolean(ExprReq->getNoexceptLoc().isValid());
1705 ExprReq->getReturnTypeRequirement();
1717 auto *NestedReq = cast<concepts::NestedRequirement>(Req);
1718 ID.AddBoolean(NestedReq->hasInvalidConstraint());
1719 if (!NestedReq->hasInvalidConstraint())
1720 Visit(NestedReq->getConstraintExpr());
1728 unsigned &NumArgs) {
1729 switch (S->getOperator()) {
1734 case OO_Array_Delete:
1736 case OO_Conditional:
1738 llvm_unreachable(
"Invalid operator call kind");
1743 return Stmt::UnaryOperatorClass;
1747 return Stmt::BinaryOperatorClass;
1752 return Stmt::UnaryOperatorClass;
1756 return Stmt::BinaryOperatorClass;
1761 return Stmt::UnaryOperatorClass;
1765 return Stmt::BinaryOperatorClass;
1769 return Stmt::BinaryOperatorClass;
1773 return Stmt::BinaryOperatorClass;
1777 return Stmt::BinaryOperatorClass;
1781 UnaryOp = UO_AddrOf;
1782 return Stmt::UnaryOperatorClass;
1786 return Stmt::BinaryOperatorClass;
1790 return Stmt::BinaryOperatorClass;
1794 return Stmt::UnaryOperatorClass;
1798 return Stmt::UnaryOperatorClass;
1801 BinaryOp = BO_Assign;
1802 return Stmt::BinaryOperatorClass;
1806 return Stmt::BinaryOperatorClass;
1810 return Stmt::BinaryOperatorClass;
1813 BinaryOp = BO_AddAssign;
1814 return Stmt::CompoundAssignOperatorClass;
1817 BinaryOp = BO_SubAssign;
1818 return Stmt::CompoundAssignOperatorClass;
1821 BinaryOp = BO_MulAssign;
1822 return Stmt::CompoundAssignOperatorClass;
1825 BinaryOp = BO_DivAssign;
1826 return Stmt::CompoundAssignOperatorClass;
1828 case OO_PercentEqual:
1829 BinaryOp = BO_RemAssign;
1830 return Stmt::CompoundAssignOperatorClass;
1833 BinaryOp = BO_XorAssign;
1834 return Stmt::CompoundAssignOperatorClass;
1837 BinaryOp = BO_AndAssign;
1838 return Stmt::CompoundAssignOperatorClass;
1841 BinaryOp = BO_OrAssign;
1842 return Stmt::CompoundAssignOperatorClass;
1846 return Stmt::BinaryOperatorClass;
1848 case OO_GreaterGreater:
1850 return Stmt::BinaryOperatorClass;
1852 case OO_LessLessEqual:
1853 BinaryOp = BO_ShlAssign;
1854 return Stmt::CompoundAssignOperatorClass;
1856 case OO_GreaterGreaterEqual:
1857 BinaryOp = BO_ShrAssign;
1858 return Stmt::CompoundAssignOperatorClass;
1862 return Stmt::BinaryOperatorClass;
1864 case OO_ExclaimEqual:
1866 return Stmt::BinaryOperatorClass;
1870 return Stmt::BinaryOperatorClass;
1872 case OO_GreaterEqual:
1874 return Stmt::BinaryOperatorClass;
1878 return Stmt::BinaryOperatorClass;
1882 return Stmt::BinaryOperatorClass;
1886 return Stmt::BinaryOperatorClass;
1889 UnaryOp = NumArgs == 1 ? UO_PreInc : UO_PostInc;
1891 return Stmt::UnaryOperatorClass;
1894 UnaryOp = NumArgs == 1 ? UO_PreDec : UO_PostDec;
1896 return Stmt::UnaryOperatorClass;
1899 BinaryOp = BO_Comma;
1900 return Stmt::BinaryOperatorClass;
1903 BinaryOp = BO_PtrMemI;
1904 return Stmt::BinaryOperatorClass;
1907 return Stmt::ArraySubscriptExprClass;
1910 return Stmt::CallExprClass;
1913 UnaryOp = UO_Coawait;
1914 return Stmt::UnaryOperatorClass;
1917 llvm_unreachable(
"Invalid overloaded operator expression");
1920#if defined(_MSC_VER) && !defined(__clang__)
1925#pragma optimize("", off)
1930 if (S->isTypeDependent()) {
1936 if (S->getOperator() == OO_Arrow)
1937 return Visit(S->getArg(0));
1941 unsigned NumArgs = S->getNumArgs();
1945 for (
unsigned I = 0; I != NumArgs; ++I)
1946 Visit(S->getArg(I));
1947 if (SC == Stmt::UnaryOperatorClass)
1948 ID.AddInteger(UnaryOp);
1949 else if (SC == Stmt::BinaryOperatorClass ||
1950 SC == Stmt::CompoundAssignOperatorClass)
1951 ID.AddInteger(BinaryOp);
1953 assert(SC == Stmt::ArraySubscriptExprClass || SC == Stmt::CallExprClass);
1959 ID.AddInteger(S->getOperator());
1962void StmtProfiler::VisitCXXRewrittenBinaryOperator(
1966 assert(!S->isTypeDependent() &&
1967 "resolved rewritten operator should never be type-dependent");
1968 ID.AddBoolean(S->isReversed());
1969 VisitExpr(S->getSemanticForm());
1972#if defined(_MSC_VER) && !defined(__clang__)
1974#pragma optimize("", on)
1986void StmtProfiler::VisitAsTypeExpr(
const AsTypeExpr *S) {
1991 VisitExplicitCastExpr(S);
1995 VisitCXXNamedCastExpr(S);
1999 VisitCXXNamedCastExpr(S);
2004 VisitCXXNamedCastExpr(S);
2008 VisitCXXNamedCastExpr(S);
2013 VisitType(S->getTypeInfoAsWritten()->getType());
2017 VisitCXXNamedCastExpr(S);
2026 ID.AddBoolean(S->getValue());
2033void StmtProfiler::VisitCXXStdInitializerListExpr(
2038void StmtProfiler::VisitCXXTypeidExpr(
const CXXTypeidExpr *S) {
2040 if (S->isTypeOperand())
2041 VisitType(S->getTypeOperandSourceInfo()->getType());
2044void StmtProfiler::VisitCXXUuidofExpr(
const CXXUuidofExpr *S) {
2046 if (S->isTypeOperand())
2047 VisitType(S->getTypeOperandSourceInfo()->getType());
2052 VisitDecl(S->getPropertyDecl());
2055void StmtProfiler::VisitMSPropertySubscriptExpr(
2060void StmtProfiler::VisitCXXThisExpr(
const CXXThisExpr *S) {
2062 ID.AddBoolean(S->isImplicit());
2063 ID.AddBoolean(S->isCapturedByCopyInLambdaWithExplicitObjectParameter());
2066void StmtProfiler::VisitCXXThrowExpr(
const CXXThrowExpr *S) {
2072 VisitDecl(S->getParam());
2077 VisitDecl(S->getField());
2088 VisitDecl(S->getConstructor());
2089 ID.AddBoolean(S->isElidable());
2092void StmtProfiler::VisitCXXInheritedCtorInitExpr(
2095 VisitDecl(S->getConstructor());
2099 VisitExplicitCastExpr(S);
2104 VisitCXXConstructExpr(S);
2108StmtProfiler::VisitLambdaExpr(
const LambdaExpr *S) {
2109 if (!ProfileLambdaExpr) {
2113 VisitStmtNoChildren(S);
2117 VisitDecl(S->getLambdaClass());
2124 ID.AddInteger(
Capture.getCaptureKind());
2125 if (
Capture.capturesVariable())
2126 VisitDecl(
Capture.getCapturedVar());
2135 for (
auto *SubDecl : Lambda->
decls()) {
2137 if (
auto *FTD = dyn_cast<FunctionTemplateDecl>(SubDecl))
2138 Call = FTD->getTemplatedDecl();
2139 else if (
auto *FD = dyn_cast<FunctionDecl>(SubDecl))
2155void StmtProfiler::VisitCXXDeleteExpr(
const CXXDeleteExpr *S) {
2157 ID.AddBoolean(S->isGlobalDelete());
2158 ID.AddBoolean(S->isArrayForm());
2159 VisitDecl(S->getOperatorDelete());
2162void StmtProfiler::VisitCXXNewExpr(
const CXXNewExpr *S) {
2164 VisitType(S->getAllocatedType());
2165 VisitDecl(S->getOperatorNew());
2166 VisitDecl(S->getOperatorDelete());
2167 ID.AddBoolean(S->isArray());
2168 ID.AddInteger(S->getNumPlacementArgs());
2169 ID.AddBoolean(S->isGlobalNew());
2170 ID.AddBoolean(S->isParenTypeId());
2171 ID.AddInteger(llvm::to_underlying(S->getInitializationStyle()));
2177 ID.AddBoolean(S->isArrow());
2178 VisitNestedNameSpecifier(S->getQualifier());
2179 ID.AddBoolean(S->getScopeTypeInfo() !=
nullptr);
2180 if (S->getScopeTypeInfo())
2181 VisitType(S->getScopeTypeInfo()->getType());
2182 ID.AddBoolean(S->getDestroyedTypeInfo() !=
nullptr);
2183 if (S->getDestroyedTypeInfo())
2184 VisitType(S->getDestroyedType());
2186 VisitIdentifierInfo(S->getDestroyedTypeIdentifier());
2189void StmtProfiler::VisitOverloadExpr(
const OverloadExpr *S) {
2191 bool DescribingDependentVarTemplate =
2192 S->getNumDecls() == 1 && isa<VarTemplateDecl>(*S->decls_begin());
2193 if (DescribingDependentVarTemplate) {
2194 VisitDecl(*S->decls_begin());
2196 VisitNestedNameSpecifier(S->getQualifier());
2197 VisitName(S->getName(),
true);
2199 ID.AddBoolean(S->hasExplicitTemplateArgs());
2200 if (S->hasExplicitTemplateArgs())
2201 VisitTemplateArguments(S->getTemplateArgs(), S->getNumTemplateArgs());
2206 VisitOverloadExpr(S);
2209void StmtProfiler::VisitTypeTraitExpr(
const TypeTraitExpr *S) {
2211 ID.AddInteger(S->getTrait());
2212 ID.AddInteger(S->getNumArgs());
2213 for (
unsigned I = 0, N = S->getNumArgs(); I != N; ++I)
2214 VisitType(S->getArg(I)->getType());
2219 ID.AddInteger(S->getTrait());
2220 VisitType(S->getQueriedType());
2225 ID.AddInteger(S->getTrait());
2226 VisitExpr(S->getQueriedExpression());
2229void StmtProfiler::VisitDependentScopeDeclRefExpr(
2232 VisitName(S->getDeclName());
2233 VisitNestedNameSpecifier(S->getQualifier());
2234 ID.AddBoolean(S->hasExplicitTemplateArgs());
2235 if (S->hasExplicitTemplateArgs())
2236 VisitTemplateArguments(S->getTemplateArgs(), S->getNumTemplateArgs());
2243void StmtProfiler::VisitCXXUnresolvedConstructExpr(
2246 VisitType(S->getTypeAsWritten());
2247 ID.AddInteger(S->isListInitialization());
2250void StmtProfiler::VisitCXXDependentScopeMemberExpr(
2252 ID.AddBoolean(S->isImplicitAccess());
2253 if (!S->isImplicitAccess()) {
2255 ID.AddBoolean(S->isArrow());
2257 VisitNestedNameSpecifier(S->getQualifier());
2258 VisitName(S->getMember());
2259 ID.AddBoolean(S->hasExplicitTemplateArgs());
2260 if (S->hasExplicitTemplateArgs())
2261 VisitTemplateArguments(S->getTemplateArgs(), S->getNumTemplateArgs());
2265 ID.AddBoolean(S->isImplicitAccess());
2266 if (!S->isImplicitAccess()) {
2268 ID.AddBoolean(S->isArrow());
2270 VisitNestedNameSpecifier(S->getQualifier());
2271 VisitName(S->getMemberName());
2272 ID.AddBoolean(S->hasExplicitTemplateArgs());
2273 if (S->hasExplicitTemplateArgs())
2274 VisitTemplateArguments(S->getTemplateArgs(), S->getNumTemplateArgs());
2287 if (S->isPartiallySubstituted()) {
2288 auto Args = S->getPartialArguments();
2289 ID.AddInteger(Args.size());
2290 for (
const auto &TA : Args)
2291 VisitTemplateArgument(TA);
2293 VisitDecl(S->getPack());
2299 VisitExpr(
E->getIndexExpr());
2301 if (
E->expandsToEmptyPack() ||
E->getExpressions().size() != 0) {
2302 ID.AddInteger(
E->getExpressions().size());
2303 for (
const Expr *Sub :
E->getExpressions())
2306 VisitExpr(
E->getPackIdExpression());
2310void StmtProfiler::VisitSubstNonTypeTemplateParmPackExpr(
2313 VisitDecl(S->getParameterPack());
2314 VisitTemplateArgument(S->getArgumentPack());
2317void StmtProfiler::VisitSubstNonTypeTemplateParmExpr(
2320 Visit(
E->getReplacement());
2325 VisitDecl(S->getParameterPack());
2326 ID.AddInteger(S->getNumExpansions());
2331void StmtProfiler::VisitMaterializeTemporaryExpr(
2336void StmtProfiler::VisitCXXFoldExpr(
const CXXFoldExpr *S) {
2338 ID.AddInteger(S->getOperator());
2349void StmtProfiler::VisitCoreturnStmt(
const CoreturnStmt *S) {
2353void StmtProfiler::VisitCoawaitExpr(
const CoawaitExpr *S) {
2361void StmtProfiler::VisitCoyieldExpr(
const CoyieldExpr *S) {
2373void StmtProfiler::VisitEmbedExpr(
const EmbedExpr *
E) { VisitExpr(
E); }
2375void StmtProfiler::VisitRecoveryExpr(
const RecoveryExpr *
E) { VisitExpr(
E); }
2395 VisitType(S->getEncodedType());
2400 VisitName(S->getSelector());
2405 VisitDecl(S->getProtocol());
2410 VisitDecl(S->getDecl());
2411 ID.AddBoolean(S->isArrow());
2412 ID.AddBoolean(S->isFreeIvar());
2417 if (S->isImplicitProperty()) {
2418 VisitDecl(S->getImplicitPropertyGetter());
2419 VisitDecl(S->getImplicitPropertySetter());
2421 VisitDecl(S->getExplicitProperty());
2423 if (S->isSuperReceiver()) {
2424 ID.AddBoolean(S->isSuperReceiver());
2425 VisitType(S->getSuperReceiverType());
2431 VisitDecl(S->getAtIndexMethodDecl());
2432 VisitDecl(S->setAtIndexMethodDecl());
2437 VisitName(S->getSelector());
2438 VisitDecl(S->getMethodDecl());
2441void StmtProfiler::VisitObjCIsaExpr(
const ObjCIsaExpr *S) {
2443 ID.AddBoolean(S->isArrow());
2448 ID.AddBoolean(S->getValue());
2451void StmtProfiler::VisitObjCIndirectCopyRestoreExpr(
2454 ID.AddBoolean(S->shouldCopy());
2458 VisitExplicitCastExpr(S);
2459 ID.AddBoolean(S->getBridgeKind());
2462void StmtProfiler::VisitObjCAvailabilityCheckExpr(
2469 ID.AddInteger(NumArgs);
2470 for (
unsigned I = 0; I != NumArgs; ++I)
2517 VisitTemplateArgument(
P);
2523class OpenACCClauseProfiler
2525 StmtProfiler &Profiler;
2528 OpenACCClauseProfiler(StmtProfiler &
P) : Profiler(
P) {}
2540 Profiler.VisitStmt(
E);
2543#define VISIT_CLAUSE(CLAUSE_NAME) \
2544 void Visit##CLAUSE_NAME##Clause(const OpenACC##CLAUSE_NAME##Clause &Clause);
2546#include "clang/Basic/OpenACCClauses.def"
2550void OpenACCClauseProfiler::VisitDefaultClause(
2553void OpenACCClauseProfiler::VisitIfClause(
const OpenACCIfClause &Clause) {
2555 "if clause requires a valid condition expr");
2560 VisitClauseWithVarList(Clause);
2564 VisitClauseWithVarList(Clause);
2567void OpenACCClauseProfiler::VisitDeviceResidentClause(
2569 VisitClauseWithVarList(Clause);
2572void OpenACCClauseProfiler::VisitCopyInClause(
2574 VisitClauseWithVarList(Clause);
2577void OpenACCClauseProfiler::VisitCopyOutClause(
2579 VisitClauseWithVarList(Clause);
2582void OpenACCClauseProfiler::VisitCreateClause(
2584 VisitClauseWithVarList(Clause);
2588 VisitClauseWithVarList(Clause);
2591void OpenACCClauseProfiler::VisitDeviceClause(
2593 VisitClauseWithVarList(Clause);
2602 Profiler.VisitStmt(
E);
2606void OpenACCClauseProfiler::VisitFinalizeClause(
2609void OpenACCClauseProfiler::VisitIfPresentClause(
2612void OpenACCClauseProfiler::VisitNumGangsClause(
2615 Profiler.VisitStmt(
E);
2620 Profiler.VisitStmt(
E);
2623void OpenACCClauseProfiler::VisitNumWorkersClause(
2625 assert(Clause.
hasIntExpr() &&
"num_workers clause requires a valid int expr");
2629void OpenACCClauseProfiler::VisitCollapseClause(
2631 assert(Clause.
getLoopCount() &&
"collapse clause requires a valid int expr");
2635void OpenACCClauseProfiler::VisitPrivateClause(
2637 VisitClauseWithVarList(Clause);
2640 Profiler.VisitDecl(VD);
2643void OpenACCClauseProfiler::VisitFirstPrivateClause(
2645 VisitClauseWithVarList(Clause);
2648 Profiler.VisitDecl(Recipe.RecipeDecl);
2649 Profiler.VisitDecl(Recipe.InitFromTemporary);
2653void OpenACCClauseProfiler::VisitAttachClause(
2655 VisitClauseWithVarList(Clause);
2658void OpenACCClauseProfiler::VisitDetachClause(
2660 VisitClauseWithVarList(Clause);
2663void OpenACCClauseProfiler::VisitDeleteClause(
2665 VisitClauseWithVarList(Clause);
2668void OpenACCClauseProfiler::VisitDevicePtrClause(
2670 VisitClauseWithVarList(Clause);
2673void OpenACCClauseProfiler::VisitNoCreateClause(
2675 VisitClauseWithVarList(Clause);
2678void OpenACCClauseProfiler::VisitPresentClause(
2680 VisitClauseWithVarList(Clause);
2683void OpenACCClauseProfiler::VisitUseDeviceClause(
2685 VisitClauseWithVarList(Clause);
2688void OpenACCClauseProfiler::VisitVectorLengthClause(
2691 "vector_length clause requires a valid int expr");
2700void OpenACCClauseProfiler::VisitDeviceNumClause(
2705void OpenACCClauseProfiler::VisitDefaultAsyncClause(
2710void OpenACCClauseProfiler::VisitWorkerClause(
2716void OpenACCClauseProfiler::VisitVectorClause(
2726 Profiler.VisitStmt(
E);
2730void OpenACCClauseProfiler::VisitDeviceTypeClause(
2735void OpenACCClauseProfiler::VisitIndependentClause(
2738void OpenACCClauseProfiler::VisitSeqClause(
const OpenACCSeqClause &Clause) {}
2739void OpenACCClauseProfiler::VisitNoHostClause(
2743 for (
unsigned I = 0; I < Clause.
getNumExprs(); ++I) {
2744 Profiler.VisitStmt(Clause.
getExpr(I).second);
2748void OpenACCClauseProfiler::VisitReductionClause(
2750 VisitClauseWithVarList(Clause);
2753 Profiler.VisitDecl(Recipe.RecipeDecl);
2762 assert(
false &&
"not implemented... what can we do about our expr?");
2766void StmtProfiler::VisitOpenACCComputeConstruct(
2771 OpenACCClauseProfiler
P{*
this};
2772 P.VisitOpenACCClauseList(S->clauses());
2779 OpenACCClauseProfiler
P{*
this};
2780 P.VisitOpenACCClauseList(S->clauses());
2783void StmtProfiler::VisitOpenACCCombinedConstruct(
2788 OpenACCClauseProfiler
P{*
this};
2789 P.VisitOpenACCClauseList(S->clauses());
2795 OpenACCClauseProfiler
P{*
this};
2796 P.VisitOpenACCClauseList(S->clauses());
2799void StmtProfiler::VisitOpenACCEnterDataConstruct(
2803 OpenACCClauseProfiler
P{*
this};
2804 P.VisitOpenACCClauseList(S->clauses());
2807void StmtProfiler::VisitOpenACCExitDataConstruct(
2811 OpenACCClauseProfiler
P{*
this};
2812 P.VisitOpenACCClauseList(S->clauses());
2815void StmtProfiler::VisitOpenACCHostDataConstruct(
2819 OpenACCClauseProfiler
P{*
this};
2820 P.VisitOpenACCClauseList(S->clauses());
2827 OpenACCClauseProfiler
P{*
this};
2828 P.VisitOpenACCClauseList(S->clauses());
2838 OpenACCClauseProfiler
P{*
this};
2839 P.VisitOpenACCClauseList(S->clauses());
2842void StmtProfiler::VisitOpenACCShutdownConstruct(
2845 OpenACCClauseProfiler
P{*
this};
2846 P.VisitOpenACCClauseList(S->clauses());
2851 OpenACCClauseProfiler
P{*
this};
2852 P.VisitOpenACCClauseList(S->clauses());
2855void StmtProfiler::VisitOpenACCUpdateConstruct(
2858 OpenACCClauseProfiler
P{*
this};
2859 P.VisitOpenACCClauseList(S->clauses());
2862void StmtProfiler::VisitOpenACCAtomicConstruct(
2865 OpenACCClauseProfiler
P{*
this};
2866 P.VisitOpenACCClauseList(S->clauses());
2874 bool Canonical,
bool ProfileLambdaExpr)
const {
2875 StmtProfilerWithPointers Profiler(ID, Context, Canonical, ProfileLambdaExpr);
2876 Profiler.Visit(
this);
2881 StmtProfilerWithoutPointers Profiler(ID, Hash);
2882 Profiler.Visit(
this);
Defines the clang::ASTContext interface.
Defines the C++ Decl subclasses, other than those for templates (found in DeclTemplate....
Defines the C++ template declaration subclasses.
Defines the clang::Expr interface and subclasses for C++ expressions.
This file contains the declaration of the ODRHash class, which calculates a hash based on AST nodes,...
This file defines OpenMP AST classes for clauses.
static Stmt::StmtClass DecodeOperatorCall(const CXXOperatorCallExpr *S, UnaryOperatorKind &UnaryOp, BinaryOperatorKind &BinaryOp, unsigned &NumArgs)
static const TemplateArgument & getArgument(const TemplateArgument &A)
void Profile(llvm::FoldingSetNodeID &ID) const
profile this value.
Holds long-lived AST nodes (such as types and decls) that can be referred to throughout the semantic ...
CanQualType getCanonicalType(QualType T) const
Return the canonical (structural) type corresponding to the specified potentially non-canonical type ...
TemplateName getCanonicalTemplateName(TemplateName Name, bool IgnoreDeduced=false) const
Retrieves the "canonical" template name that refers to a given template.
QualType getUnconstrainedType(QualType T) const
Remove any type constraints from a template parameter type, for equivalence comparison of template pa...
AddrLabelExpr - The GNU address of label extension, representing &&label.
Represents the index of the current element of an array being initialized by an ArrayInitLoopExpr.
Represents a loop initializing the elements of an array.
This class represents BOTH the OpenMP Array Section and OpenACC 'subarray', with a boolean differenti...
ArraySubscriptExpr - [C99 6.5.2.1] Array Subscripting.
An Embarcadero array type trait, as used in the implementation of __array_rank and __array_extent.
AsTypeExpr - Clang builtin function __builtin_astype [OpenCL 6.2.4.2] This AST node provides support ...
AtomicExpr - Variadic atomic builtins: __atomic_exchange, __atomic_fetch_*, __atomic_load,...
Represents an attribute applied to a statement.
BinaryConditionalOperator - The GNU extension to the conditional operator which allows the middle ope...
A builtin binary operation expression such as "x + y" or "x <= y".
A fixed int type of a specified bitwidth.
BlockExpr - Adaptor class for mixing a BlockDecl with expressions.
BreakStmt - This represents a break.
Represents a C++2a __builtin_bit_cast(T, v) expression.
This class is used for builtin types like 'int'.
CStyleCastExpr - An explicit cast in C (C99 6.5.4) or a C-style cast in C++ (C++ [expr....
Represents a call to a CUDA kernel function.
A C++ addrspace_cast expression (currently only enabled for OpenCL).
Represents binding an expression to a temporary.
A boolean literal, per ([C++ lex.bool] Boolean literals).
CXXCatchStmt - This represents a C++ catch block.
A C++ const_cast expression (C++ [expr.const.cast]).
Represents a call to a C++ constructor.
A default argument (C++ [dcl.fct.default]).
A use of a default initializer in a constructor or in aggregate initialization.
Represents a delete expression for memory deallocation and destructor calls, e.g.
Represents a C++ member access expression where the actual member referenced could not be resolved be...
Represents a C++ destructor within a class.
A C++ dynamic_cast expression (C++ [expr.dynamic.cast]).
Represents a folding of a pack over an operator.
CXXForRangeStmt - This represents C++0x [stmt.ranged]'s ranged for statement, represented as 'for (ra...
Represents an explicit C++ type conversion that uses "functional" notation (C++ [expr....
Represents a call to an inherited base class constructor from an inheriting constructor.
Represents a call to a member function that may be written either with member call syntax (e....
Abstract class common to all of the C++ "named"/"keyword" casts.
Represents a new-expression for memory allocation and constructor calls, e.g: "new CXXNewExpr(foo)".
Represents a C++11 noexcept expression (C++ [expr.unary.noexcept]).
The null pointer literal (C++11 [lex.nullptr])
A call to an overloaded operator written using operator syntax.
Represents a list-initialization with parenthesis.
Represents a C++ pseudo-destructor (C++ [expr.pseudo]).
Represents a C++ struct/union/class.
capture_const_range captures() const
A C++ reinterpret_cast expression (C++ [expr.reinterpret.cast]).
A rewritten comparison expression that was originally written using operator syntax.
An expression "T()" which creates an rvalue of a non-class type T.
A C++ static_cast expression (C++ [expr.static.cast]).
Implicit construction of a std::initializer_list<T> object from an array temporary within list-initia...
Represents a C++ functional cast expression that builds a temporary object.
Represents the this expression in C++.
A C++ throw-expression (C++ [except.throw]).
CXXTryStmt - A C++ try block, including all handlers.
A C++ typeid expression (C++ [expr.typeid]), which gets the type_info that corresponds to the supplie...
Describes an explicit type conversion that uses functional notion but could not be resolved because o...
A Microsoft C++ __uuidof expression, which gets the _GUID that corresponds to the supplied type or ex...
CallExpr - Represents a function call (C99 6.5.2.2, C++ [expr.call]).
This captures a statement into a function.
CaseStmt - Represent a case statement.
CastExpr - Base class for type casts, including both implicit casts (ImplicitCastExpr) and explicit c...
ChooseExpr - GNU builtin-in function __builtin_choose_expr.
Represents a 'co_await' expression.
CompoundAssignOperator - For compound assignments (e.g.
CompoundLiteralExpr - [C99 6.5.2.5].
CompoundStmt - This represents a group of statements like { stmt stmt }.
Represents the specialization of a concept - evaluates to a prvalue of type bool.
ConditionalOperator - The ?: ternary operator.
ConstStmtVisitor - This class implements a simple visitor for Stmt subclasses.
ConstantExpr - An expression that occurs in a constant context and optionally the result of evaluatin...
ContinueStmt - This represents a continue.
ConvertVectorExpr - Clang builtin function __builtin_convertvector This AST node provides support for...
Represents a 'co_return' statement in the C++ Coroutines TS.
Represents the body of a coroutine.
Represents a 'co_yield' expression.
decl_range decls() const
decls_begin/decls_end - Iterate over the declarations stored in this context.
A reference to a declared variable, function, enum, etc.
DeclStmt - Adaptor class for mixing declarations with statements and expressions.
Decl - This represents one declaration (or definition), e.g.
virtual Decl * getCanonicalDecl()
Retrieves the "canonical" declaration of the given declaration.
The name of a declaration.
Represents a 'co_await' expression while the type of the promise is dependent.
A qualified reference to a name whose declaration cannot yet be resolved.
Represents a single C99 designator.
Represents a C99 designated initializer expression.
DoStmt - This represents a 'do/while' stmt.
Represents a reference to #emded data.
ExplicitCastExpr - An explicit cast written in the source code.
Represents an expression – generally a full-expression – that introduces cleanups to be run at the en...
This represents one expression.
An expression trait intrinsic.
ExtVectorElementExpr - This represents access to specific elements of a vector, and may occur on the ...
ForStmt - This represents a 'for (init;cond;inc)' stmt.
Represents a function declaration or definition.
Represents a reference to a function parameter pack, init-capture pack, or binding pack that has been...
ValueDecl *const * iterator
Iterators over the parameters which the parameter pack expanded into.
This represents a GCC inline-assembly statement extension.
GNUNullExpr - Implements the GNU __null extension, which is a name for a null pointer constant that h...
Represents a C11 generic selection.
AssociationTy< true > ConstAssociation
GotoStmt - This represents a direct goto.
This class represents temporary values used to represent inout and out arguments in HLSL.
One of these records is kept for each identifier that is lexed.
IfStmt - This represents an if/then/else.
ImaginaryLiteral - We support imaginary integer and floating point literals, like "1....
ImplicitCastExpr - Allows us to explicitly represent implicit type conversions, which have no direct ...
Represents an implicitly-generated value initialization of an object of a given type.
IndirectGotoStmt - This represents an indirect goto.
Describes an C or C++ initializer list.
LabelStmt - Represents a label, which has a substatement.
A C++ lambda expression, which produces a function object (of unspecified type) that can be invoked l...
This represents a Microsoft inline-assembly statement extension.
Representation of a Microsoft __if_exists or __if_not_exists statement with a dependent name.
A member reference to an MSPropertyDecl.
MS property subscript expression.
Represents a prvalue temporary that is written into memory so that a reference can bind to it.
MatrixSubscriptExpr - Matrix subscript expression for the MatrixType extension.
MemberExpr - [C99 6.5.2.3] Structure and Union Members.
Represents a C++ nested name specifier, such as "\::std::vector<int>::".
NestedNameSpecifier getCanonical() const
Retrieves the "canonical" nested name specifier for a given nested name specifier.
void Profile(llvm::FoldingSetNodeID &ID) const
Represents a place-holder for an object not to be initialized by anything.
NonTypeTemplateParmDecl - Declares a non-type template parameter, e.g., "Size" in.
NullStmt - This is the null statement ";": C99 6.8.3p3.
void AddDecl(const Decl *D)
void AddDeclarationName(DeclarationName Name, bool TreatAsDecl=false)
void AddIdentifierInfo(const IdentifierInfo *II)
void AddFunctionDecl(const FunctionDecl *Function, bool SkipBody=false)
void AddTemplateName(TemplateName Name)
void AddNestedNameSpecifier(NestedNameSpecifier NNS)
void AddQualType(QualType T)
This represents the 'absent' clause in the '#pragma omp assume' directive.
This represents 'acq_rel' clause in the '#pragma omp atomic|flush' directives.
This represents 'acquire' clause in the '#pragma omp atomic|flush' directives.
This represents clause 'affinity' in the '#pragma omp task'-based directives.
This represents the 'align' clause in the '#pragma omp allocate' directive.
This represents clause 'aligned' in the '#pragma omp ...' directives.
This represents clause 'allocate' in the '#pragma omp ...' directives.
This represents 'allocator' clause in the '#pragma omp ...' directive.
An explicit cast in C or a C-style cast in C++, which uses the syntax ([s1][s2]......
This represents 'at' clause in the '#pragma omp error' directive.
This represents 'atomic_default_mem_order' clause in the '#pragma omp requires' directive.
This represents '#pragma omp atomic' directive.
This represents '#pragma omp barrier' directive.
This represents 'bind' clause in the '#pragma omp ...' directives.
This represents '#pragma omp cancel' directive.
This represents '#pragma omp cancellation point' directive.
Representation of an OpenMP canonical loop.
This represents 'capture' clause in the '#pragma omp atomic' directive.
Class that handles post-update expression for some clauses, like 'lastprivate', 'reduction' etc.
Class that handles pre-initialization statement for some clauses, like 'schedule',...
This represents 'collapse' clause in the '#pragma omp ...' directive.
This represents 'compare' clause in the '#pragma omp atomic' directive.
This represents the 'contains' clause in the '#pragma omp assume' directive.
This represents clause 'copyin' in the '#pragma omp ...' directives.
This represents clause 'copyprivate' in the '#pragma omp ...' directives.
This represents '#pragma omp critical' directive.
This represents 'default' clause in the '#pragma omp ...' directive.
This represents 'defaultmap' clause in the '#pragma omp ...' directive.
This represents implicit clause 'depend' for the '#pragma omp task' directive.
This represents implicit clause 'depobj' for the '#pragma omp depobj' directive.
This represents '#pragma omp depobj' directive.
This represents 'destroy' clause in the '#pragma omp depobj' directive or the '#pragma omp interop' d...
This represents 'detach' clause in the '#pragma omp task' directive.
This represents 'device' clause in the '#pragma omp ...' directive.
This represents '#pragma omp dispatch' directive.
This represents 'dist_schedule' clause in the '#pragma omp ...' directive.
This represents '#pragma omp distribute' directive.
This represents '#pragma omp distribute parallel for' composite directive.
This represents '#pragma omp distribute parallel for simd' composite directive.
This represents '#pragma omp distribute simd' composite directive.
This represents the 'doacross' clause for the '#pragma omp ordered' directive.
This represents 'dynamic_allocators' clause in the '#pragma omp requires' directive.
This represents '#pragma omp error' directive.
This represents clause 'exclusive' in the '#pragma omp scan' directive.
This is a basic class for representing single OpenMP executable directive.
This represents 'fail' clause in the '#pragma omp atomic' directive.
This represents 'filter' clause in the '#pragma omp ...' directive.
This represents 'final' clause in the '#pragma omp ...' directive.
This represents clause 'firstprivate' in the '#pragma omp ...' directives.
This represents implicit clause 'flush' for the '#pragma omp flush' directive.
This represents '#pragma omp flush' directive.
This represents '#pragma omp for' directive.
This represents '#pragma omp for simd' directive.
This represents clause 'from' in the '#pragma omp ...' directives.
Representation of the 'full' clause of the '#pragma omp unroll' directive.
This represents '#pragma omp loop' directive.
This represents 'grainsize' clause in the '#pragma omp ...' directive.
This represents clause 'has_device_ptr' in the '#pragma omp ...' directives.
This represents 'hint' clause in the '#pragma omp ...' directive.
This represents the 'holds' clause in the '#pragma omp assume' directive.
This represents 'if' clause in the '#pragma omp ...' directive.
This represents clause 'in_reduction' in the '#pragma omp task' directives.
This represents clause 'inclusive' in the '#pragma omp scan' directive.
This represents the 'init' clause in '#pragma omp ...' directives.
Represents the '#pragma omp interchange' loop transformation directive.
This represents '#pragma omp interop' directive.
This represents clause 'is_device_ptr' in the '#pragma omp ...' directives.
OpenMP 5.0 [2.1.6 Iterators] Iterators are identifiers that expand to multiple values in the clause o...
This represents clause 'lastprivate' in the '#pragma omp ...' directives.
This represents clause 'linear' in the '#pragma omp ...' directives.
The base class for all loop-based directives, including loop transformation directives.
This is a common base class for loop directives ('omp simd', 'omp for', 'omp for simd' etc....
This represents clause 'map' in the '#pragma omp ...' directives.
This represents '#pragma omp masked' directive.
This represents '#pragma omp masked taskloop' directive.
This represents '#pragma omp masked taskloop simd' directive.
This represents '#pragma omp master' directive.
This represents '#pragma omp master taskloop' directive.
This represents '#pragma omp master taskloop simd' directive.
This represents 'mergeable' clause in the '#pragma omp ...' directive.
This represents the 'message' clause in the '#pragma omp error' and the '#pragma omp parallel' direct...
This represents the 'no_openmp' clause in the '#pragma omp assume' directive.
This represents the 'no_openmp_constructs' clause in the.
This represents the 'no_openmp_routines' clause in the '#pragma omp assume' directive.
This represents the 'no_parallelism' clause in the '#pragma omp assume' directive.
This represents 'nocontext' clause in the '#pragma omp ...' directive.
This represents 'nogroup' clause in the '#pragma omp ...' directive.
This represents clause 'nontemporal' in the '#pragma omp ...' directives.
This represents 'novariants' clause in the '#pragma omp ...' directive.
This represents 'nowait' clause in the '#pragma omp ...' directive.
This represents 'num_tasks' clause in the '#pragma omp ...' directive.
This represents 'num_teams' clause in the '#pragma omp ...' directive.
This represents 'num_threads' clause in the '#pragma omp ...' directive.
This represents 'order' clause in the '#pragma omp ...' directive.
This represents 'ordered' clause in the '#pragma omp ...' directive.
This represents '#pragma omp ordered' directive.
This represents '#pragma omp parallel' directive.
This represents '#pragma omp parallel for' directive.
This represents '#pragma omp parallel for simd' directive.
This represents '#pragma omp parallel loop' directive.
This represents '#pragma omp parallel masked' directive.
This represents '#pragma omp parallel masked taskloop' directive.
This represents '#pragma omp parallel masked taskloop simd' directive.
This represents '#pragma omp parallel master' directive.
This represents '#pragma omp parallel master taskloop' directive.
This represents '#pragma omp parallel master taskloop simd' directive.
This represents '#pragma omp parallel sections' directive.
Representation of the 'partial' clause of the '#pragma omp unroll' directive.
This class represents the 'permutation' clause in the '#pragma omp interchange' directive.
This represents 'priority' clause in the '#pragma omp ...' directive.
This represents clause 'private' in the '#pragma omp ...' directives.
This represents 'proc_bind' clause in the '#pragma omp ...' directive.
This represents 'read' clause in the '#pragma omp atomic' directive.
This represents clause 'reduction' in the '#pragma omp ...' directives.
This represents 'relaxed' clause in the '#pragma omp atomic' directives.
This represents 'release' clause in the '#pragma omp atomic|flush' directives.
Represents the '#pragma omp reverse' loop transformation directive.
This represents 'reverse_offload' clause in the '#pragma omp requires' directive.
This represents 'simd' clause in the '#pragma omp ...' directive.
This represents 'safelen' clause in the '#pragma omp ...' directive.
This represents '#pragma omp scan' directive.
This represents 'schedule' clause in the '#pragma omp ...' directive.
This represents '#pragma omp scope' directive.
This represents '#pragma omp section' directive.
This represents '#pragma omp sections' directive.
This represents 'self_maps' clause in the '#pragma omp requires' directive.
This represents 'seq_cst' clause in the '#pragma omp atomic|flush' directives.
This represents the 'severity' clause in the '#pragma omp error' and the '#pragma omp parallel' direc...
This represents clause 'shared' in the '#pragma omp ...' directives.
This represents '#pragma omp simd' directive.
This represents 'simdlen' clause in the '#pragma omp ...' directive.
This represents '#pragma omp single' directive.
This represents the 'sizes' clause in the '#pragma omp tile' directive.
This represents the '#pragma omp stripe' loop transformation directive.
This represents '#pragma omp target data' directive.
This represents '#pragma omp target' directive.
This represents '#pragma omp target enter data' directive.
This represents '#pragma omp target exit data' directive.
This represents '#pragma omp target parallel' directive.
This represents '#pragma omp target parallel for' directive.
This represents '#pragma omp target parallel for simd' directive.
This represents '#pragma omp target parallel loop' directive.
This represents '#pragma omp target simd' directive.
This represents '#pragma omp target teams' directive.
This represents '#pragma omp target teams distribute' combined directive.
This represents '#pragma omp target teams distribute parallel for' combined directive.
This represents '#pragma omp target teams distribute parallel for simd' combined directive.
This represents '#pragma omp target teams distribute simd' combined directive.
This represents '#pragma omp target teams loop' directive.
This represents '#pragma omp target update' directive.
This represents '#pragma omp task' directive.
This represents '#pragma omp taskloop' directive.
This represents '#pragma omp taskloop simd' directive.
This represents clause 'task_reduction' in the '#pragma omp taskgroup' directives.
This represents '#pragma omp taskgroup' directive.
This represents '#pragma omp taskwait' directive.
This represents '#pragma omp taskyield' directive.
This represents '#pragma omp teams' directive.
This represents '#pragma omp teams distribute' directive.
This represents '#pragma omp teams distribute parallel for' composite directive.
This represents '#pragma omp teams distribute parallel for simd' composite directive.
This represents '#pragma omp teams distribute simd' combined directive.
This represents '#pragma omp teams loop' directive.
This represents 'thread_limit' clause in the '#pragma omp ...' directive.
This represents 'threads' clause in the '#pragma omp ...' directive.
This represents the '#pragma omp tile' loop transformation directive.
This represents clause 'to' in the '#pragma omp ...' directives.
This represents 'unified_address' clause in the '#pragma omp requires' directive.
This represents 'unified_shared_memory' clause in the '#pragma omp requires' directive.
This represents the '#pragma omp unroll' loop transformation directive.
This represents 'untied' clause in the '#pragma omp ...' directive.
This represents 'update' clause in the '#pragma omp atomic' directive.
This represents the 'use' clause in '#pragma omp ...' directives.
This represents clause 'use_device_addr' in the '#pragma omp ...' directives.
This represents clause 'use_device_ptr' in the '#pragma omp ...' directives.
This represents clause 'uses_allocators' in the '#pragma omp target'-based directives.
This represents 'weak' clause in the '#pragma omp atomic' directives.
This represents 'write' clause in the '#pragma omp atomic' directive.
This represents 'ompx_attribute' clause in a directive that might generate an outlined function.
This represents 'ompx_bare' clause in the '#pragma omp target teams ...' directive.
This represents 'ompx_dyn_cgroup_mem' clause in the '#pragma omp target ...' directive.
ObjCArrayLiteral - used for objective-c array containers; as in: @["Hello", NSApp,...
Represents Objective-C's @catch statement.
Represents Objective-C's @finally statement.
Represents Objective-C's @synchronized statement.
Represents Objective-C's @throw statement.
Represents Objective-C's @try ... @catch ... @finally statement.
Represents Objective-C's @autoreleasepool Statement.
A runtime availability query.
ObjCBoolLiteralExpr - Objective-C Boolean Literal.
ObjCBoxedExpr - used for generalized expression boxing.
An Objective-C "bridged" cast expression, which casts between Objective-C pointers and C pointers,...
ObjCDictionaryLiteral - AST node to represent objective-c dictionary literals; as in:"name" : NSUserN...
ObjCEncodeExpr, used for @encode in Objective-C.
Represents Objective-C's collection statement.
ObjCIndirectCopyRestoreExpr - Represents the passing of a function argument by indirect copy-restore ...
ObjCIsaExpr - Represent X->isa and X.isa when X is an ObjC 'id' type.
ObjCIvarRefExpr - A reference to an ObjC instance variable.
An expression that sends a message to the given Objective-C object or class.
ObjCPropertyRefExpr - A dot-syntax expression to access an ObjC property.
ObjCProtocolExpr used for protocol expression in Objective-C.
ObjCSelectorExpr used for @selector in Objective-C.
ObjCStringLiteral, used for Objective-C string literals i.e.
ObjCSubscriptRefExpr - used for array and dictionary subscripting.
OffsetOfExpr - [C99 7.17] - This represents an expression of the form offsetof(record-type,...
Helper class for OffsetOfExpr.
FieldDecl * getField() const
For a field offsetof node, returns the field.
IdentifierInfo * getFieldName() const
For a field or identifier offsetof node, returns the name of the field.
@ Array
An index into an array.
@ Identifier
A field in a dependent type, known only by its name.
@ Base
An implicit indirection through a C++ base class, when the field found is in a base class.
Kind getKind() const
Determine what kind of offsetof node this is.
OpaqueValueExpr - An expression referring to an opaque object of a fixed type and value class.
This expression type represents an asterisk in an OpenACC Size-Expr, used in the 'tile' and 'gang' cl...
void Visit(const OpenACCClause *C)
bool hasConditionExpr() const
const Expr * getConditionExpr() const
const Expr * getIntExpr() const
Represents a clause with one or more 'var' objects, represented as an expr, as its arguments.
ArrayRef< Expr * > getVarList()
This is the base type for all OpenACC Clauses.
Represents a 'collapse' clause on a 'loop' construct.
const Expr * getLoopCount() const
This class represents a compute construct, representing a 'Kind' of ‘parallel’, 'serial',...
A 'default' clause, has the optional 'none' or 'present' argument.
A 'device_type' or 'dtype' clause, takes a list of either an 'asterisk' or an identifier.
ArrayRef< OpenACCFirstPrivateRecipe > getInitRecipes()
unsigned getNumExprs() const
std::pair< OpenACCGangKind, const Expr * > getExpr(unsigned I) const
An 'if' clause, which has a required condition expression.
This class represents a 'loop' construct.
ArrayRef< Expr * > getIntExprs()
ArrayRef< VarDecl * > getInitRecipes()
ArrayRef< OpenACCReductionRecipe > getRecipes()
A 'self' clause, which has an optional condition expression, or, in the event of an 'update' directiv...
const Expr * getConditionExpr() const
bool isConditionExprClause() const
ArrayRef< Expr * > getVarList()
bool hasConditionExpr() const
ArrayRef< Expr * > getSizeExprs()
ArrayRef< Expr * > getQueueIdExprs()
Expr * getDevNumExpr() const
bool hasDevNumExpr() const
A reference to an overloaded function set, either an UnresolvedLookupExpr or an UnresolvedMemberExpr.
Represents a C++11 pack expansion that produces a sequence of expressions.
ParenExpr - This represents a parenthesized expression, e.g.
Represents a parameter to a function.
[C99 6.4.2.2] - A predefined identifier such as func.
PseudoObjectExpr - An expression which accesses a pseudo-object l-value.
const Expr *const * const_semantics_iterator
A (possibly-)qualified type.
Frontend produces RecoveryExprs on semantic errors that prevent creating other well-formed expression...
C++2a [expr.prim.req]: A requires-expression provides a concise way to express requirements on templa...
ReturnStmt - This represents a return, optionally of an expression: return; return 4;.
Represents a __leave statement.
SYCLKernelCallStmt represents the transformation that is applied to the body of a function declared w...
ShuffleVectorExpr - clang-specific builtin-in function __builtin_shufflevector.
Represents an expression that computes the length of a parameter pack.
Represents a function call to one of __builtin_LINE(), __builtin_COLUMN(), __builtin_FUNCTION(),...
StmtExpr - This is the GNU Statement Expression extension: ({int X=4; X;}).
Stmt - This represents one statement.
void ProcessODRHash(llvm::FoldingSetNodeID &ID, ODRHash &Hash) const
Calculate a unique representation for a statement that is stable across compiler invocations.
void Profile(llvm::FoldingSetNodeID &ID, const ASTContext &Context, bool Canonical, bool ProfileLambdaExpr=false) const
Produce a unique representation of the given statement.
StringLiteral - This represents a string literal expression, e.g.
Represents a reference to a non-type template parameter that has been substituted with a template arg...
Represents a reference to a non-type template parameter pack that has been substituted with a non-tem...
SwitchStmt - This represents a 'switch' stmt.
Location wrapper for a TemplateArgument.
Represents a template argument.
QualType getStructuralValueType() const
Get the type of a StructuralValue.
QualType getParamTypeForDecl() const
Expr * getAsExpr() const
Retrieve the template argument as an expression.
QualType getAsType() const
Retrieve the type for a type template argument.
llvm::APSInt getAsIntegral() const
Retrieve the template argument as an integral value.
QualType getNullPtrType() const
Retrieve the type for null non-type template argument.
QualType getIntegralType() const
Retrieve the type of the integral value.
ValueDecl * getAsDecl() const
Retrieve the declaration for a declaration non-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.
@ StructuralValue
The template argument is a non-type template argument that can't be represented by the special-case D...
@ 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,...
const APValue & getAsStructuralValue() const
Get the value of a StructuralValue.
Represents a C++ template name within the type system.
TemplateTemplateParmDecl - Declares a template template parameter, e.g., "T" in.
Declaration of a template type parameter.
Expr * getImmediatelyDeclaredConstraint() const
Get the immediately-declared constraint expression introduced by this type-constraint,...
A type trait used in the implementation of various C++11 and Library TR1 trait templates.
const T * castAs() const
Member-template castAs<specific type>.
TypeClass getTypeClass() const
const T * getAs() const
Member-template getAs<specific type>'.
UnaryExprOrTypeTraitExpr - expression with either a type or (unevaluated) expression operand.
UnaryOperator - This represents the unary-expression's (except sizeof and alignof),...
A reference to a name which we were able to look up during parsing but could not resolve to a specifi...
Represents a C++ member access expression for which lookup produced a set of overloaded functions.
A call to a literal operator (C++11 [over.literal]) written as a user-defined literal (C++11 [lit....
Represents a call to the builtin function __builtin_va_arg.
WhileStmt - This represents a 'while' stmt.
bool isTypeConstraint() const
const TypeConstraint * getTypeConstraint() const
bool isSubstitutionFailure() const
A static requirement that can be used in a requires-expression to check properties of types and expre...
The JSON file list parser is used to communicate input to InstallAPI.
@ OO_None
Not an overloaded operator.
@ NUM_OVERLOADED_OPERATORS
const FunctionProtoType * T
Data for list of allocators.