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) {
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;
58 virtual void VisitType(
QualType T) = 0;
61 virtual void VisitName(
DeclarationName Name,
bool TreatAsDecl =
false) = 0;
83 class StmtProfilerWithPointers :
public StmtProfiler {
84 const ASTContext &Context;
87 StmtProfilerWithPointers(llvm::FoldingSetNodeID &ID,
88 const ASTContext &Context,
bool Canonical,
89 bool ProfileLambdaExpr)
90 : StmtProfiler(
ID, Canonical, ProfileLambdaExpr), Context(Context) {}
97 void VisitDecl(
const Decl *D)
override {
100 if (Canonical && D) {
101 if (
const NonTypeTemplateParmDecl *NTTP =
102 dyn_cast<NonTypeTemplateParmDecl>(D)) {
103 ID.AddInteger(NTTP->getDepth());
104 ID.AddInteger(NTTP->getIndex());
105 ID.AddBoolean(NTTP->isParameterPack());
114 VisitType(Context.getUnconstrainedType(NTTP->getType()));
118 if (
const ParmVarDecl *Parm = dyn_cast<ParmVarDecl>(D)) {
129 VisitType(Parm->getType());
130 ID.AddInteger(Parm->getFunctionScopeDepth());
131 ID.AddInteger(Parm->getFunctionScopeIndex());
135 if (
const TemplateTypeParmDecl *TTP =
136 dyn_cast<TemplateTypeParmDecl>(D)) {
137 ID.AddInteger(TTP->getDepth());
138 ID.AddInteger(TTP->getIndex());
139 ID.AddBoolean(TTP->isParameterPack());
143 if (
const TemplateTemplateParmDecl *TTP =
144 dyn_cast<TemplateTemplateParmDecl>(D)) {
145 ID.AddInteger(TTP->getDepth());
146 ID.AddInteger(TTP->getIndex());
147 ID.AddBoolean(TTP->isParameterPack());
155 void VisitType(QualType T)
override {
156 if (Canonical && !T.
isNull())
162 void VisitName(DeclarationName Name,
bool )
override {
166 void VisitIdentifierInfo(
const IdentifierInfo *II)
override {
170 void VisitNestedNameSpecifier(NestedNameSpecifier NNS)
override {
178 Name = Context.getCanonicalTemplateName(Name);
184 class StmtProfilerWithoutPointers :
public StmtProfiler {
187 StmtProfilerWithoutPointers(llvm::FoldingSetNodeID &ID, ODRHash &Hash)
193 if (SC == Stmt::UnresolvedLookupExprClass) {
196 ID.AddInteger(Stmt::DeclRefExprClass);
202 void VisitType(QualType T)
override {
206 void VisitName(DeclarationName Name,
bool TreatAsDecl)
override {
212 Hash.AddDeclarationName(Name, TreatAsDecl);
214 void VisitIdentifierInfo(
const IdentifierInfo *II)
override {
217 Hash.AddIdentifierInfo(II);
220 void VisitDecl(
const Decl *D)
override {
227 Hash.AddTemplateName(Name);
229 void VisitNestedNameSpecifier(NestedNameSpecifier NNS)
override {
230 ID.AddBoolean(
bool(NNS));
232 Hash.AddNestedNameSpecifier(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) {
277void StmtProfiler::VisitAttributedStmt(
const AttributedStmt *S) {
282void StmtProfiler::VisitIfStmt(
const IfStmt *S) {
287void StmtProfiler::VisitSwitchStmt(
const SwitchStmt *S) {
292void StmtProfiler::VisitWhileStmt(
const WhileStmt *S) {
297void StmtProfiler::VisitDoStmt(
const DoStmt *S) {
301void StmtProfiler::VisitForStmt(
const ForStmt *S) {
305void StmtProfiler::VisitGotoStmt(
const GotoStmt *S) {
310void StmtProfiler::VisitIndirectGotoStmt(
const IndirectGotoStmt *S) {
314void StmtProfiler::VisitContinueStmt(
const ContinueStmt *S) {
318void StmtProfiler::VisitBreakStmt(
const BreakStmt *S) {
322void StmtProfiler::VisitReturnStmt(
const ReturnStmt *S) {
326void StmtProfiler::VisitDeferStmt(
const DeferStmt *S) { VisitStmt(S); }
328void StmtProfiler::VisitGCCAsmStmt(
const GCCAsmStmt *S) {
339 for (
unsigned I = 0, N = S->
getNumInputs(); I != N; ++I) {
347 for (
auto *L : S->
labels())
348 VisitDecl(L->getLabel());
351void StmtProfiler::VisitMSAsmStmt(
const MSAsmStmt *S) {
356void StmtProfiler::VisitCXXCatchStmt(
const CXXCatchStmt *S) {
361void StmtProfiler::VisitCXXTryStmt(
const CXXTryStmt *S) {
365void StmtProfiler::VisitCXXForRangeStmt(
const CXXForRangeStmt *S) {
369void StmtProfiler::VisitMSDependentExistsStmt(
const MSDependentExistsStmt *S) {
376void StmtProfiler::VisitSEHTryStmt(
const SEHTryStmt *S) {
380void StmtProfiler::VisitSEHFinallyStmt(
const SEHFinallyStmt *S) {
384void StmtProfiler::VisitSEHExceptStmt(
const SEHExceptStmt *S) {
388void StmtProfiler::VisitSEHLeaveStmt(
const SEHLeaveStmt *S) {
392void StmtProfiler::VisitCapturedStmt(
const CapturedStmt *S) {
396void StmtProfiler::VisitSYCLKernelCallStmt(
const SYCLKernelCallStmt *S) {
400void StmtProfiler::VisitObjCForCollectionStmt(
const ObjCForCollectionStmt *S) {
404void StmtProfiler::VisitObjCAtCatchStmt(
const ObjCAtCatchStmt *S) {
411void StmtProfiler::VisitObjCAtFinallyStmt(
const ObjCAtFinallyStmt *S) {
415void StmtProfiler::VisitObjCAtTryStmt(
const ObjCAtTryStmt *S) {
420StmtProfiler::VisitObjCAtSynchronizedStmt(
const ObjCAtSynchronizedStmt *S) {
424void StmtProfiler::VisitObjCAtThrowStmt(
const ObjCAtThrowStmt *S) {
429StmtProfiler::VisitObjCAutoreleasePoolStmt(
const ObjCAutoreleasePoolStmt *S) {
434class OMPClauseProfiler :
public ConstOMPClauseVisitor<OMPClauseProfiler> {
435 StmtProfiler *Profiler;
437 template <
typename T>
438 void VisitOMPClauseList(T *Node);
441 OMPClauseProfiler(StmtProfiler *P) : Profiler(P) { }
442#define GEN_CLANG_CLAUSE_CLASS
443#define CLAUSE_CLASS(Enum, Str, Class) void Visit##Class(const Class *C);
444#include "llvm/Frontend/OpenMP/OMP.inc"
449void OMPClauseProfiler::VisitOMPClauseWithPreInit(
450 const OMPClauseWithPreInit *
C) {
451 if (
auto *S =
C->getPreInitStmt())
452 Profiler->VisitStmt(S);
455void OMPClauseProfiler::VisitOMPClauseWithPostUpdate(
456 const OMPClauseWithPostUpdate *
C) {
457 VisitOMPClauseWithPreInit(
C);
458 if (
auto *E =
C->getPostUpdateExpr())
459 Profiler->VisitStmt(E);
462void OMPClauseProfiler::VisitOMPIfClause(
const OMPIfClause *
C) {
463 VisitOMPClauseWithPreInit(
C);
464 if (
C->getCondition())
465 Profiler->VisitStmt(
C->getCondition());
468void OMPClauseProfiler::VisitOMPFinalClause(
const OMPFinalClause *
C) {
469 VisitOMPClauseWithPreInit(
C);
470 if (
C->getCondition())
471 Profiler->VisitStmt(
C->getCondition());
474void OMPClauseProfiler::VisitOMPNumThreadsClause(
const OMPNumThreadsClause *
C) {
475 VisitOMPClauseWithPreInit(
C);
476 if (
C->getNumThreads())
477 Profiler->VisitStmt(
C->getNumThreads());
480void OMPClauseProfiler::VisitOMPAlignClause(
const OMPAlignClause *
C) {
481 if (
C->getAlignment())
482 Profiler->VisitStmt(
C->getAlignment());
485void OMPClauseProfiler::VisitOMPSafelenClause(
const OMPSafelenClause *
C) {
487 Profiler->VisitStmt(
C->getSafelen());
490void OMPClauseProfiler::VisitOMPSimdlenClause(
const OMPSimdlenClause *
C) {
492 Profiler->VisitStmt(
C->getSimdlen());
495void OMPClauseProfiler::VisitOMPSizesClause(
const OMPSizesClause *
C) {
496 for (
auto *E :
C->getSizesRefs())
498 Profiler->VisitExpr(E);
501void OMPClauseProfiler::VisitOMPCountsClause(
const OMPCountsClause *
C) {
502 for (
auto *E :
C->getCountsRefs())
504 Profiler->VisitExpr(E);
507void OMPClauseProfiler::VisitOMPPermutationClause(
508 const OMPPermutationClause *
C) {
509 for (Expr *E :
C->getArgsRefs())
511 Profiler->VisitExpr(E);
514void OMPClauseProfiler::VisitOMPFullClause(
const OMPFullClause *
C) {}
516void OMPClauseProfiler::VisitOMPPartialClause(
const OMPPartialClause *
C) {
517 if (
const Expr *Factor =
C->getFactor())
518 Profiler->VisitExpr(Factor);
521void OMPClauseProfiler::VisitOMPLoopRangeClause(
const OMPLoopRangeClause *
C) {
522 if (
const Expr *
First =
C->getFirst())
523 Profiler->VisitExpr(
First);
524 if (
const Expr *Count =
C->getCount())
525 Profiler->VisitExpr(Count);
528void OMPClauseProfiler::VisitOMPAllocatorClause(
const OMPAllocatorClause *
C) {
529 if (
C->getAllocator())
530 Profiler->VisitStmt(
C->getAllocator());
533void OMPClauseProfiler::VisitOMPCollapseClause(
const OMPCollapseClause *
C) {
534 if (
C->getNumForLoops())
535 Profiler->VisitStmt(
C->getNumForLoops());
538void OMPClauseProfiler::VisitOMPDetachClause(
const OMPDetachClause *
C) {
539 if (Expr *Evt =
C->getEventHandler())
540 Profiler->VisitStmt(Evt);
543void OMPClauseProfiler::VisitOMPNovariantsClause(
const OMPNovariantsClause *
C) {
544 VisitOMPClauseWithPreInit(
C);
545 if (
C->getCondition())
546 Profiler->VisitStmt(
C->getCondition());
549void OMPClauseProfiler::VisitOMPNocontextClause(
const OMPNocontextClause *
C) {
550 VisitOMPClauseWithPreInit(
C);
551 if (
C->getCondition())
552 Profiler->VisitStmt(
C->getCondition());
555void OMPClauseProfiler::VisitOMPDefaultClause(
const OMPDefaultClause *
C) { }
557void OMPClauseProfiler::VisitOMPThreadsetClause(
const OMPThreadsetClause *
C) {}
559void OMPClauseProfiler::VisitOMPTransparentClause(
560 const OMPTransparentClause *
C) {
561 if (
C->getImpexType())
562 Profiler->VisitStmt(
C->getImpexType());
565void OMPClauseProfiler::VisitOMPProcBindClause(
const OMPProcBindClause *
C) { }
567void OMPClauseProfiler::VisitOMPUnifiedAddressClause(
568 const OMPUnifiedAddressClause *
C) {}
570void OMPClauseProfiler::VisitOMPUnifiedSharedMemoryClause(
571 const OMPUnifiedSharedMemoryClause *
C) {}
573void OMPClauseProfiler::VisitOMPReverseOffloadClause(
574 const OMPReverseOffloadClause *
C) {}
576void OMPClauseProfiler::VisitOMPDynamicAllocatorsClause(
577 const OMPDynamicAllocatorsClause *
C) {}
579void OMPClauseProfiler::VisitOMPAtomicDefaultMemOrderClause(
580 const OMPAtomicDefaultMemOrderClause *
C) {}
582void OMPClauseProfiler::VisitOMPSelfMapsClause(
const OMPSelfMapsClause *
C) {}
584void OMPClauseProfiler::VisitOMPAtClause(
const OMPAtClause *
C) {}
586void OMPClauseProfiler::VisitOMPSeverityClause(
const OMPSeverityClause *
C) {}
588void OMPClauseProfiler::VisitOMPMessageClause(
const OMPMessageClause *
C) {
589 if (
C->getMessageString())
590 Profiler->VisitStmt(
C->getMessageString());
593void OMPClauseProfiler::VisitOMPScheduleClause(
const OMPScheduleClause *
C) {
594 VisitOMPClauseWithPreInit(
C);
595 if (
auto *S =
C->getChunkSize())
596 Profiler->VisitStmt(S);
599void OMPClauseProfiler::VisitOMPOrderedClause(
const OMPOrderedClause *
C) {
600 if (
auto *
Num =
C->getNumForLoops())
601 Profiler->VisitStmt(
Num);
604void OMPClauseProfiler::VisitOMPNowaitClause(
const OMPNowaitClause *
C) {
605 if (
C->getCondition())
606 Profiler->VisitStmt(
C->getCondition());
609void OMPClauseProfiler::VisitOMPUntiedClause(
const OMPUntiedClause *) {}
611void OMPClauseProfiler::VisitOMPMergeableClause(
const OMPMergeableClause *) {}
613void OMPClauseProfiler::VisitOMPReadClause(
const OMPReadClause *) {}
615void OMPClauseProfiler::VisitOMPWriteClause(
const OMPWriteClause *) {}
617void OMPClauseProfiler::VisitOMPUpdateClause(
const OMPUpdateClause *) {}
619void OMPClauseProfiler::VisitOMPCaptureClause(
const OMPCaptureClause *) {}
621void OMPClauseProfiler::VisitOMPCompareClause(
const OMPCompareClause *) {}
623void OMPClauseProfiler::VisitOMPFailClause(
const OMPFailClause *) {}
625void OMPClauseProfiler::VisitOMPAbsentClause(
const OMPAbsentClause *) {}
627void OMPClauseProfiler::VisitOMPHoldsClause(
const OMPHoldsClause *) {}
629void OMPClauseProfiler::VisitOMPContainsClause(
const OMPContainsClause *) {}
631void OMPClauseProfiler::VisitOMPNoOpenMPClause(
const OMPNoOpenMPClause *) {}
633void OMPClauseProfiler::VisitOMPNoOpenMPRoutinesClause(
634 const OMPNoOpenMPRoutinesClause *) {}
636void OMPClauseProfiler::VisitOMPNoOpenMPConstructsClause(
637 const OMPNoOpenMPConstructsClause *) {}
639void OMPClauseProfiler::VisitOMPNoParallelismClause(
640 const OMPNoParallelismClause *) {}
642void OMPClauseProfiler::VisitOMPSeqCstClause(
const OMPSeqCstClause *) {}
644void OMPClauseProfiler::VisitOMPAcqRelClause(
const OMPAcqRelClause *) {}
646void OMPClauseProfiler::VisitOMPAcquireClause(
const OMPAcquireClause *) {}
648void OMPClauseProfiler::VisitOMPReleaseClause(
const OMPReleaseClause *) {}
650void OMPClauseProfiler::VisitOMPRelaxedClause(
const OMPRelaxedClause *) {}
652void OMPClauseProfiler::VisitOMPWeakClause(
const OMPWeakClause *) {}
654void OMPClauseProfiler::VisitOMPThreadsClause(
const OMPThreadsClause *) {}
656void OMPClauseProfiler::VisitOMPSIMDClause(
const OMPSIMDClause *) {}
658void OMPClauseProfiler::VisitOMPNogroupClause(
const OMPNogroupClause *) {}
660void OMPClauseProfiler::VisitOMPInitClause(
const OMPInitClause *
C) {
661 VisitOMPClauseList(
C);
664void OMPClauseProfiler::VisitOMPUseClause(
const OMPUseClause *
C) {
665 if (
C->getInteropVar())
666 Profiler->VisitStmt(
C->getInteropVar());
669void OMPClauseProfiler::VisitOMPDestroyClause(
const OMPDestroyClause *
C) {
670 if (
C->getInteropVar())
671 Profiler->VisitStmt(
C->getInteropVar());
674void OMPClauseProfiler::VisitOMPFilterClause(
const OMPFilterClause *
C) {
675 VisitOMPClauseWithPreInit(
C);
676 if (
C->getThreadID())
677 Profiler->VisitStmt(
C->getThreadID());
681void OMPClauseProfiler::VisitOMPClauseList(T *Node) {
682 for (
auto *E : Node->varlist()) {
684 Profiler->VisitStmt(E);
688void OMPClauseProfiler::VisitOMPPrivateClause(
const OMPPrivateClause *
C) {
689 VisitOMPClauseList(
C);
690 for (
auto *E :
C->private_copies()) {
692 Profiler->VisitStmt(E);
696OMPClauseProfiler::VisitOMPFirstprivateClause(
const OMPFirstprivateClause *
C) {
697 VisitOMPClauseList(
C);
698 VisitOMPClauseWithPreInit(
C);
699 for (
auto *E :
C->private_copies()) {
701 Profiler->VisitStmt(E);
703 for (
auto *E :
C->inits()) {
705 Profiler->VisitStmt(E);
709OMPClauseProfiler::VisitOMPLastprivateClause(
const OMPLastprivateClause *
C) {
710 VisitOMPClauseList(
C);
711 VisitOMPClauseWithPostUpdate(
C);
712 for (
auto *E :
C->source_exprs()) {
714 Profiler->VisitStmt(E);
716 for (
auto *E :
C->destination_exprs()) {
718 Profiler->VisitStmt(E);
720 for (
auto *E :
C->assignment_ops()) {
722 Profiler->VisitStmt(E);
725void OMPClauseProfiler::VisitOMPSharedClause(
const OMPSharedClause *
C) {
726 VisitOMPClauseList(
C);
728void OMPClauseProfiler::VisitOMPReductionClause(
729 const OMPReductionClause *
C) {
730 Profiler->VisitNestedNameSpecifier(
731 C->getQualifierLoc().getNestedNameSpecifier());
732 Profiler->VisitName(
C->getNameInfo().getName());
733 VisitOMPClauseList(
C);
734 VisitOMPClauseWithPostUpdate(
C);
735 for (
auto *E :
C->privates()) {
737 Profiler->VisitStmt(E);
739 for (
auto *E :
C->lhs_exprs()) {
741 Profiler->VisitStmt(E);
743 for (
auto *E :
C->rhs_exprs()) {
745 Profiler->VisitStmt(E);
747 for (
auto *E :
C->reduction_ops()) {
749 Profiler->VisitStmt(E);
751 if (
C->getModifier() == clang::OMPC_REDUCTION_inscan) {
752 for (
auto *E :
C->copy_ops()) {
754 Profiler->VisitStmt(E);
756 for (
auto *E :
C->copy_array_temps()) {
758 Profiler->VisitStmt(E);
760 for (
auto *E :
C->copy_array_elems()) {
762 Profiler->VisitStmt(E);
766void OMPClauseProfiler::VisitOMPTaskReductionClause(
767 const OMPTaskReductionClause *
C) {
768 Profiler->VisitNestedNameSpecifier(
769 C->getQualifierLoc().getNestedNameSpecifier());
770 Profiler->VisitName(
C->getNameInfo().getName());
771 VisitOMPClauseList(
C);
772 VisitOMPClauseWithPostUpdate(
C);
773 for (
auto *E :
C->privates()) {
775 Profiler->VisitStmt(E);
777 for (
auto *E :
C->lhs_exprs()) {
779 Profiler->VisitStmt(E);
781 for (
auto *E :
C->rhs_exprs()) {
783 Profiler->VisitStmt(E);
785 for (
auto *E :
C->reduction_ops()) {
787 Profiler->VisitStmt(E);
790void OMPClauseProfiler::VisitOMPInReductionClause(
791 const OMPInReductionClause *
C) {
792 Profiler->VisitNestedNameSpecifier(
793 C->getQualifierLoc().getNestedNameSpecifier());
794 Profiler->VisitName(
C->getNameInfo().getName());
795 VisitOMPClauseList(
C);
796 VisitOMPClauseWithPostUpdate(
C);
797 for (
auto *E :
C->privates()) {
799 Profiler->VisitStmt(E);
801 for (
auto *E :
C->lhs_exprs()) {
803 Profiler->VisitStmt(E);
805 for (
auto *E :
C->rhs_exprs()) {
807 Profiler->VisitStmt(E);
809 for (
auto *E :
C->reduction_ops()) {
811 Profiler->VisitStmt(E);
813 for (
auto *E :
C->taskgroup_descriptors()) {
815 Profiler->VisitStmt(E);
818void OMPClauseProfiler::VisitOMPLinearClause(
const OMPLinearClause *
C) {
819 VisitOMPClauseList(
C);
820 VisitOMPClauseWithPostUpdate(
C);
821 for (
auto *E :
C->privates()) {
823 Profiler->VisitStmt(E);
825 for (
auto *E :
C->inits()) {
827 Profiler->VisitStmt(E);
829 for (
auto *E :
C->updates()) {
831 Profiler->VisitStmt(E);
833 for (
auto *E :
C->finals()) {
835 Profiler->VisitStmt(E);
838 Profiler->VisitStmt(
C->getStep());
839 if (
C->getCalcStep())
840 Profiler->VisitStmt(
C->getCalcStep());
842void OMPClauseProfiler::VisitOMPAlignedClause(
const OMPAlignedClause *
C) {
843 VisitOMPClauseList(
C);
844 if (
C->getAlignment())
845 Profiler->VisitStmt(
C->getAlignment());
847void OMPClauseProfiler::VisitOMPCopyinClause(
const OMPCopyinClause *
C) {
848 VisitOMPClauseList(
C);
849 for (
auto *E :
C->source_exprs()) {
851 Profiler->VisitStmt(E);
853 for (
auto *E :
C->destination_exprs()) {
855 Profiler->VisitStmt(E);
857 for (
auto *E :
C->assignment_ops()) {
859 Profiler->VisitStmt(E);
863OMPClauseProfiler::VisitOMPCopyprivateClause(
const OMPCopyprivateClause *
C) {
864 VisitOMPClauseList(
C);
865 for (
auto *E :
C->source_exprs()) {
867 Profiler->VisitStmt(E);
869 for (
auto *E :
C->destination_exprs()) {
871 Profiler->VisitStmt(E);
873 for (
auto *E :
C->assignment_ops()) {
875 Profiler->VisitStmt(E);
878void OMPClauseProfiler::VisitOMPFlushClause(
const OMPFlushClause *
C) {
879 VisitOMPClauseList(
C);
881void OMPClauseProfiler::VisitOMPDepobjClause(
const OMPDepobjClause *
C) {
882 if (
const Expr *Depobj =
C->getDepobj())
883 Profiler->VisitStmt(Depobj);
885void OMPClauseProfiler::VisitOMPDependClause(
const OMPDependClause *
C) {
886 VisitOMPClauseList(
C);
888void OMPClauseProfiler::VisitOMPDeviceClause(
const OMPDeviceClause *
C) {
890 Profiler->VisitStmt(
C->getDevice());
892void OMPClauseProfiler::VisitOMPMapClause(
const OMPMapClause *
C) {
893 VisitOMPClauseList(
C);
895void OMPClauseProfiler::VisitOMPAllocateClause(
const OMPAllocateClause *
C) {
896 if (Expr *Allocator =
C->getAllocator())
897 Profiler->VisitStmt(Allocator);
898 VisitOMPClauseList(
C);
900void OMPClauseProfiler::VisitOMPNumTeamsClause(
const OMPNumTeamsClause *
C) {
901 VisitOMPClauseList(
C);
902 VisitOMPClauseWithPreInit(
C);
904void OMPClauseProfiler::VisitOMPThreadLimitClause(
905 const OMPThreadLimitClause *
C) {
906 VisitOMPClauseList(
C);
907 VisitOMPClauseWithPreInit(
C);
909void OMPClauseProfiler::VisitOMPPriorityClause(
const OMPPriorityClause *
C) {
910 VisitOMPClauseWithPreInit(
C);
911 if (
C->getPriority())
912 Profiler->VisitStmt(
C->getPriority());
914void OMPClauseProfiler::VisitOMPGrainsizeClause(
const OMPGrainsizeClause *
C) {
915 VisitOMPClauseWithPreInit(
C);
916 if (
C->getGrainsize())
917 Profiler->VisitStmt(
C->getGrainsize());
919void OMPClauseProfiler::VisitOMPNumTasksClause(
const OMPNumTasksClause *
C) {
920 VisitOMPClauseWithPreInit(
C);
921 if (
C->getNumTasks())
922 Profiler->VisitStmt(
C->getNumTasks());
924void OMPClauseProfiler::VisitOMPHintClause(
const OMPHintClause *
C) {
926 Profiler->VisitStmt(
C->getHint());
928void OMPClauseProfiler::VisitOMPToClause(
const OMPToClause *
C) {
929 VisitOMPClauseList(
C);
931void OMPClauseProfiler::VisitOMPFromClause(
const OMPFromClause *
C) {
932 VisitOMPClauseList(
C);
934void OMPClauseProfiler::VisitOMPUseDevicePtrClause(
935 const OMPUseDevicePtrClause *
C) {
936 VisitOMPClauseList(
C);
938void OMPClauseProfiler::VisitOMPUseDeviceAddrClause(
939 const OMPUseDeviceAddrClause *
C) {
940 VisitOMPClauseList(
C);
942void OMPClauseProfiler::VisitOMPIsDevicePtrClause(
943 const OMPIsDevicePtrClause *
C) {
944 VisitOMPClauseList(
C);
946void OMPClauseProfiler::VisitOMPHasDeviceAddrClause(
947 const OMPHasDeviceAddrClause *
C) {
948 VisitOMPClauseList(
C);
950void OMPClauseProfiler::VisitOMPNontemporalClause(
951 const OMPNontemporalClause *
C) {
952 VisitOMPClauseList(
C);
953 for (
auto *E :
C->private_refs())
954 Profiler->VisitStmt(E);
956void OMPClauseProfiler::VisitOMPInclusiveClause(
const OMPInclusiveClause *
C) {
957 VisitOMPClauseList(
C);
959void OMPClauseProfiler::VisitOMPExclusiveClause(
const OMPExclusiveClause *
C) {
960 VisitOMPClauseList(
C);
962void OMPClauseProfiler::VisitOMPUsesAllocatorsClause(
963 const OMPUsesAllocatorsClause *
C) {
964 for (
unsigned I = 0, E =
C->getNumberOfAllocators(); I < E; ++I) {
965 OMPUsesAllocatorsClause::Data D =
C->getAllocatorData(I);
971void OMPClauseProfiler::VisitOMPAffinityClause(
const OMPAffinityClause *
C) {
972 if (
const Expr *Modifier =
C->getModifier())
973 Profiler->VisitStmt(Modifier);
974 for (
const Expr *E :
C->varlist())
975 Profiler->VisitStmt(E);
977void OMPClauseProfiler::VisitOMPOrderClause(
const OMPOrderClause *
C) {}
978void OMPClauseProfiler::VisitOMPBindClause(
const OMPBindClause *
C) {}
979void OMPClauseProfiler::VisitOMPXDynCGroupMemClause(
980 const OMPXDynCGroupMemClause *
C) {
981 VisitOMPClauseWithPreInit(
C);
982 if (Expr *Size =
C->getSize())
983 Profiler->VisitStmt(Size);
985void OMPClauseProfiler::VisitOMPDynGroupprivateClause(
986 const OMPDynGroupprivateClause *
C) {
987 VisitOMPClauseWithPreInit(
C);
988 if (
auto *Size =
C->getSize())
989 Profiler->VisitStmt(Size);
991void OMPClauseProfiler::VisitOMPDoacrossClause(
const OMPDoacrossClause *
C) {
992 VisitOMPClauseList(
C);
994void OMPClauseProfiler::VisitOMPXAttributeClause(
const OMPXAttributeClause *
C) {
996void OMPClauseProfiler::VisitOMPXBareClause(
const OMPXBareClause *
C) {}
1000StmtProfiler::VisitOMPExecutableDirective(
const OMPExecutableDirective *S) {
1002 OMPClauseProfiler P(
this);
1003 ArrayRef<OMPClause *> Clauses = S->clauses();
1004 for (ArrayRef<OMPClause *>::iterator I = Clauses.begin(), E = Clauses.end();
1010void StmtProfiler::VisitOMPCanonicalLoop(
const OMPCanonicalLoop *L) {
1014void StmtProfiler::VisitOMPLoopBasedDirective(
const OMPLoopBasedDirective *S) {
1015 VisitOMPExecutableDirective(S);
1018void StmtProfiler::VisitOMPLoopDirective(
const OMPLoopDirective *S) {
1019 VisitOMPLoopBasedDirective(S);
1022void StmtProfiler::VisitOMPMetaDirective(
const OMPMetaDirective *S) {
1023 VisitOMPExecutableDirective(S);
1026void StmtProfiler::VisitOMPParallelDirective(
const OMPParallelDirective *S) {
1027 VisitOMPExecutableDirective(S);
1030void StmtProfiler::VisitOMPSimdDirective(
const OMPSimdDirective *S) {
1031 VisitOMPLoopDirective(S);
1034void StmtProfiler::VisitOMPCanonicalLoopNestTransformationDirective(
1035 const OMPCanonicalLoopNestTransformationDirective *S) {
1036 VisitOMPLoopBasedDirective(S);
1039void StmtProfiler::VisitOMPTileDirective(
const OMPTileDirective *S) {
1040 VisitOMPCanonicalLoopNestTransformationDirective(S);
1043void StmtProfiler::VisitOMPStripeDirective(
const OMPStripeDirective *S) {
1044 VisitOMPCanonicalLoopNestTransformationDirective(S);
1047void StmtProfiler::VisitOMPUnrollDirective(
const OMPUnrollDirective *S) {
1048 VisitOMPCanonicalLoopNestTransformationDirective(S);
1051void StmtProfiler::VisitOMPReverseDirective(
const OMPReverseDirective *S) {
1052 VisitOMPCanonicalLoopNestTransformationDirective(S);
1055void StmtProfiler::VisitOMPInterchangeDirective(
1056 const OMPInterchangeDirective *S) {
1057 VisitOMPCanonicalLoopNestTransformationDirective(S);
1060void StmtProfiler::VisitOMPSplitDirective(
const OMPSplitDirective *S) {
1061 VisitOMPCanonicalLoopNestTransformationDirective(S);
1064void StmtProfiler::VisitOMPCanonicalLoopSequenceTransformationDirective(
1065 const OMPCanonicalLoopSequenceTransformationDirective *S) {
1066 VisitOMPExecutableDirective(S);
1069void StmtProfiler::VisitOMPFuseDirective(
const OMPFuseDirective *S) {
1070 VisitOMPCanonicalLoopSequenceTransformationDirective(S);
1073void StmtProfiler::VisitOMPForDirective(
const OMPForDirective *S) {
1074 VisitOMPLoopDirective(S);
1077void StmtProfiler::VisitOMPForSimdDirective(
const OMPForSimdDirective *S) {
1078 VisitOMPLoopDirective(S);
1081void StmtProfiler::VisitOMPSectionsDirective(
const OMPSectionsDirective *S) {
1082 VisitOMPExecutableDirective(S);
1085void StmtProfiler::VisitOMPSectionDirective(
const OMPSectionDirective *S) {
1086 VisitOMPExecutableDirective(S);
1089void StmtProfiler::VisitOMPScopeDirective(
const OMPScopeDirective *S) {
1090 VisitOMPExecutableDirective(S);
1093void StmtProfiler::VisitOMPSingleDirective(
const OMPSingleDirective *S) {
1094 VisitOMPExecutableDirective(S);
1097void StmtProfiler::VisitOMPMasterDirective(
const OMPMasterDirective *S) {
1098 VisitOMPExecutableDirective(S);
1101void StmtProfiler::VisitOMPCriticalDirective(
const OMPCriticalDirective *S) {
1102 VisitOMPExecutableDirective(S);
1103 VisitName(S->getDirectiveName().getName());
1107StmtProfiler::VisitOMPParallelForDirective(
const OMPParallelForDirective *S) {
1108 VisitOMPLoopDirective(S);
1111void StmtProfiler::VisitOMPParallelForSimdDirective(
1112 const OMPParallelForSimdDirective *S) {
1113 VisitOMPLoopDirective(S);
1116void StmtProfiler::VisitOMPParallelMasterDirective(
1117 const OMPParallelMasterDirective *S) {
1118 VisitOMPExecutableDirective(S);
1121void StmtProfiler::VisitOMPParallelMaskedDirective(
1122 const OMPParallelMaskedDirective *S) {
1123 VisitOMPExecutableDirective(S);
1126void StmtProfiler::VisitOMPParallelSectionsDirective(
1127 const OMPParallelSectionsDirective *S) {
1128 VisitOMPExecutableDirective(S);
1131void StmtProfiler::VisitOMPTaskDirective(
const OMPTaskDirective *S) {
1132 VisitOMPExecutableDirective(S);
1135void StmtProfiler::VisitOMPTaskyieldDirective(
const OMPTaskyieldDirective *S) {
1136 VisitOMPExecutableDirective(S);
1139void StmtProfiler::VisitOMPBarrierDirective(
const OMPBarrierDirective *S) {
1140 VisitOMPExecutableDirective(S);
1143void StmtProfiler::VisitOMPTaskwaitDirective(
const OMPTaskwaitDirective *S) {
1144 VisitOMPExecutableDirective(S);
1147void StmtProfiler::VisitOMPAssumeDirective(
const OMPAssumeDirective *S) {
1148 VisitOMPExecutableDirective(S);
1151void StmtProfiler::VisitOMPErrorDirective(
const OMPErrorDirective *S) {
1152 VisitOMPExecutableDirective(S);
1154void StmtProfiler::VisitOMPTaskgroupDirective(
const OMPTaskgroupDirective *S) {
1155 VisitOMPExecutableDirective(S);
1156 if (
const Expr *E = S->getReductionRef())
1160void StmtProfiler::VisitOMPFlushDirective(
const OMPFlushDirective *S) {
1161 VisitOMPExecutableDirective(S);
1164void StmtProfiler::VisitOMPDepobjDirective(
const OMPDepobjDirective *S) {
1165 VisitOMPExecutableDirective(S);
1168void StmtProfiler::VisitOMPScanDirective(
const OMPScanDirective *S) {
1169 VisitOMPExecutableDirective(S);
1172void StmtProfiler::VisitOMPOrderedDirective(
const OMPOrderedDirective *S) {
1173 VisitOMPExecutableDirective(S);
1176void StmtProfiler::VisitOMPAtomicDirective(
const OMPAtomicDirective *S) {
1177 VisitOMPExecutableDirective(S);
1180void StmtProfiler::VisitOMPTargetDirective(
const OMPTargetDirective *S) {
1181 VisitOMPExecutableDirective(S);
1184void StmtProfiler::VisitOMPTargetDataDirective(
const OMPTargetDataDirective *S) {
1185 VisitOMPExecutableDirective(S);
1188void StmtProfiler::VisitOMPTargetEnterDataDirective(
1189 const OMPTargetEnterDataDirective *S) {
1190 VisitOMPExecutableDirective(S);
1193void StmtProfiler::VisitOMPTargetExitDataDirective(
1194 const OMPTargetExitDataDirective *S) {
1195 VisitOMPExecutableDirective(S);
1198void StmtProfiler::VisitOMPTargetParallelDirective(
1199 const OMPTargetParallelDirective *S) {
1200 VisitOMPExecutableDirective(S);
1203void StmtProfiler::VisitOMPTargetParallelForDirective(
1204 const OMPTargetParallelForDirective *S) {
1205 VisitOMPExecutableDirective(S);
1208void StmtProfiler::VisitOMPTeamsDirective(
const OMPTeamsDirective *S) {
1209 VisitOMPExecutableDirective(S);
1212void StmtProfiler::VisitOMPCancellationPointDirective(
1213 const OMPCancellationPointDirective *S) {
1214 VisitOMPExecutableDirective(S);
1217void StmtProfiler::VisitOMPCancelDirective(
const OMPCancelDirective *S) {
1218 VisitOMPExecutableDirective(S);
1221void StmtProfiler::VisitOMPTaskLoopDirective(
const OMPTaskLoopDirective *S) {
1222 VisitOMPLoopDirective(S);
1225void StmtProfiler::VisitOMPTaskLoopSimdDirective(
1226 const OMPTaskLoopSimdDirective *S) {
1227 VisitOMPLoopDirective(S);
1230void StmtProfiler::VisitOMPMasterTaskLoopDirective(
1231 const OMPMasterTaskLoopDirective *S) {
1232 VisitOMPLoopDirective(S);
1235void StmtProfiler::VisitOMPMaskedTaskLoopDirective(
1236 const OMPMaskedTaskLoopDirective *S) {
1237 VisitOMPLoopDirective(S);
1240void StmtProfiler::VisitOMPMasterTaskLoopSimdDirective(
1241 const OMPMasterTaskLoopSimdDirective *S) {
1242 VisitOMPLoopDirective(S);
1245void StmtProfiler::VisitOMPMaskedTaskLoopSimdDirective(
1246 const OMPMaskedTaskLoopSimdDirective *S) {
1247 VisitOMPLoopDirective(S);
1250void StmtProfiler::VisitOMPParallelMasterTaskLoopDirective(
1251 const OMPParallelMasterTaskLoopDirective *S) {
1252 VisitOMPLoopDirective(S);
1255void StmtProfiler::VisitOMPParallelMaskedTaskLoopDirective(
1256 const OMPParallelMaskedTaskLoopDirective *S) {
1257 VisitOMPLoopDirective(S);
1260void StmtProfiler::VisitOMPParallelMasterTaskLoopSimdDirective(
1261 const OMPParallelMasterTaskLoopSimdDirective *S) {
1262 VisitOMPLoopDirective(S);
1265void StmtProfiler::VisitOMPParallelMaskedTaskLoopSimdDirective(
1266 const OMPParallelMaskedTaskLoopSimdDirective *S) {
1267 VisitOMPLoopDirective(S);
1270void StmtProfiler::VisitOMPDistributeDirective(
1271 const OMPDistributeDirective *S) {
1272 VisitOMPLoopDirective(S);
1275void OMPClauseProfiler::VisitOMPDistScheduleClause(
1276 const OMPDistScheduleClause *
C) {
1277 VisitOMPClauseWithPreInit(
C);
1278 if (
auto *S =
C->getChunkSize())
1279 Profiler->VisitStmt(S);
1282void OMPClauseProfiler::VisitOMPDefaultmapClause(
const OMPDefaultmapClause *) {}
1284void StmtProfiler::VisitOMPTargetUpdateDirective(
1285 const OMPTargetUpdateDirective *S) {
1286 VisitOMPExecutableDirective(S);
1289void StmtProfiler::VisitOMPDistributeParallelForDirective(
1290 const OMPDistributeParallelForDirective *S) {
1291 VisitOMPLoopDirective(S);
1294void StmtProfiler::VisitOMPDistributeParallelForSimdDirective(
1295 const OMPDistributeParallelForSimdDirective *S) {
1296 VisitOMPLoopDirective(S);
1299void StmtProfiler::VisitOMPDistributeSimdDirective(
1300 const OMPDistributeSimdDirective *S) {
1301 VisitOMPLoopDirective(S);
1304void StmtProfiler::VisitOMPTargetParallelForSimdDirective(
1305 const OMPTargetParallelForSimdDirective *S) {
1306 VisitOMPLoopDirective(S);
1309void StmtProfiler::VisitOMPTargetSimdDirective(
1310 const OMPTargetSimdDirective *S) {
1311 VisitOMPLoopDirective(S);
1314void StmtProfiler::VisitOMPTeamsDistributeDirective(
1315 const OMPTeamsDistributeDirective *S) {
1316 VisitOMPLoopDirective(S);
1319void StmtProfiler::VisitOMPTeamsDistributeSimdDirective(
1320 const OMPTeamsDistributeSimdDirective *S) {
1321 VisitOMPLoopDirective(S);
1324void StmtProfiler::VisitOMPTeamsDistributeParallelForSimdDirective(
1325 const OMPTeamsDistributeParallelForSimdDirective *S) {
1326 VisitOMPLoopDirective(S);
1329void StmtProfiler::VisitOMPTeamsDistributeParallelForDirective(
1330 const OMPTeamsDistributeParallelForDirective *S) {
1331 VisitOMPLoopDirective(S);
1334void StmtProfiler::VisitOMPTargetTeamsDirective(
1335 const OMPTargetTeamsDirective *S) {
1336 VisitOMPExecutableDirective(S);
1339void StmtProfiler::VisitOMPTargetTeamsDistributeDirective(
1340 const OMPTargetTeamsDistributeDirective *S) {
1341 VisitOMPLoopDirective(S);
1344void StmtProfiler::VisitOMPTargetTeamsDistributeParallelForDirective(
1345 const OMPTargetTeamsDistributeParallelForDirective *S) {
1346 VisitOMPLoopDirective(S);
1349void StmtProfiler::VisitOMPTargetTeamsDistributeParallelForSimdDirective(
1350 const OMPTargetTeamsDistributeParallelForSimdDirective *S) {
1351 VisitOMPLoopDirective(S);
1354void StmtProfiler::VisitOMPTargetTeamsDistributeSimdDirective(
1355 const OMPTargetTeamsDistributeSimdDirective *S) {
1356 VisitOMPLoopDirective(S);
1359void StmtProfiler::VisitOMPInteropDirective(
const OMPInteropDirective *S) {
1360 VisitOMPExecutableDirective(S);
1363void StmtProfiler::VisitOMPDispatchDirective(
const OMPDispatchDirective *S) {
1364 VisitOMPExecutableDirective(S);
1367void StmtProfiler::VisitOMPMaskedDirective(
const OMPMaskedDirective *S) {
1368 VisitOMPExecutableDirective(S);
1371void StmtProfiler::VisitOMPGenericLoopDirective(
1372 const OMPGenericLoopDirective *S) {
1373 VisitOMPLoopDirective(S);
1376void StmtProfiler::VisitOMPTeamsGenericLoopDirective(
1377 const OMPTeamsGenericLoopDirective *S) {
1378 VisitOMPLoopDirective(S);
1381void StmtProfiler::VisitOMPTargetTeamsGenericLoopDirective(
1382 const OMPTargetTeamsGenericLoopDirective *S) {
1383 VisitOMPLoopDirective(S);
1386void StmtProfiler::VisitOMPParallelGenericLoopDirective(
1387 const OMPParallelGenericLoopDirective *S) {
1388 VisitOMPLoopDirective(S);
1391void StmtProfiler::VisitOMPTargetParallelGenericLoopDirective(
1392 const OMPTargetParallelGenericLoopDirective *S) {
1393 VisitOMPLoopDirective(S);
1396void StmtProfiler::VisitExpr(
const Expr *S) {
1400void StmtProfiler::VisitConstantExpr(
const ConstantExpr *S) {
1405void StmtProfiler::VisitDeclRefExpr(
const DeclRefExpr *S) {
1417void StmtProfiler::VisitSYCLUniqueStableNameExpr(
1418 const SYCLUniqueStableNameExpr *S) {
1423void StmtProfiler::VisitUnresolvedSYCLKernelCallStmt(
1424 const UnresolvedSYCLKernelCallStmt *S) {
1428void StmtProfiler::VisitPredefinedExpr(
const PredefinedExpr *S) {
1433void StmtProfiler::VisitOpenACCAsteriskSizeExpr(
1434 const OpenACCAsteriskSizeExpr *S) {
1438void StmtProfiler::VisitIntegerLiteral(
const IntegerLiteral *S) {
1446 if (
auto BitIntT = T->
getAs<BitIntType>())
1447 BitIntT->Profile(ID);
1449 ID.AddInteger(T->
castAs<BuiltinType>()->getKind());
1452void StmtProfiler::VisitFixedPointLiteral(
const FixedPointLiteral *S) {
1455 ID.AddInteger(S->
getType()->
castAs<BuiltinType>()->getKind());
1458void StmtProfiler::VisitCharacterLiteral(
const CharacterLiteral *S) {
1460 ID.AddInteger(llvm::to_underlying(S->
getKind()));
1464void StmtProfiler::VisitFloatingLiteral(
const FloatingLiteral *S) {
1468 ID.AddInteger(S->
getType()->
castAs<BuiltinType>()->getKind());
1471void StmtProfiler::VisitImaginaryLiteral(
const ImaginaryLiteral *S) {
1475void StmtProfiler::VisitStringLiteral(
const StringLiteral *S) {
1478 ID.AddInteger(llvm::to_underlying(S->
getKind()));
1481void StmtProfiler::VisitParenExpr(
const ParenExpr *S) {
1485void StmtProfiler::VisitParenListExpr(
const ParenListExpr *S) {
1489void StmtProfiler::VisitUnaryOperator(
const UnaryOperator *S) {
1494void StmtProfiler::VisitOffsetOfExpr(
const OffsetOfExpr *S) {
1497 for (
unsigned i = 0; i < n; ++i) {
1523StmtProfiler::VisitUnaryExprOrTypeTraitExpr(
const UnaryExprOrTypeTraitExpr *S) {
1530void StmtProfiler::VisitArraySubscriptExpr(
const ArraySubscriptExpr *S) {
1534void StmtProfiler::VisitMatrixSingleSubscriptExpr(
1535 const MatrixSingleSubscriptExpr *S) {
1539void StmtProfiler::VisitMatrixSubscriptExpr(
const MatrixSubscriptExpr *S) {
1543void StmtProfiler::VisitArraySectionExpr(
const ArraySectionExpr *S) {
1547void StmtProfiler::VisitOMPArrayShapingExpr(
const OMPArrayShapingExpr *S) {
1551void StmtProfiler::VisitOMPIteratorExpr(
const OMPIteratorExpr *S) {
1557void StmtProfiler::VisitCallExpr(
const CallExpr *S) {
1561void StmtProfiler::VisitMemberExpr(
const MemberExpr *S) {
1569void StmtProfiler::VisitCompoundLiteralExpr(
const CompoundLiteralExpr *S) {
1574void StmtProfiler::VisitCastExpr(
const CastExpr *S) {
1578void StmtProfiler::VisitImplicitCastExpr(
const ImplicitCastExpr *S) {
1583void StmtProfiler::VisitExplicitCastExpr(
const ExplicitCastExpr *S) {
1588void StmtProfiler::VisitCStyleCastExpr(
const CStyleCastExpr *S) {
1589 VisitExplicitCastExpr(S);
1592void StmtProfiler::VisitBinaryOperator(
const BinaryOperator *S) {
1598StmtProfiler::VisitCompoundAssignOperator(
const CompoundAssignOperator *S) {
1599 VisitBinaryOperator(S);
1602void StmtProfiler::VisitConditionalOperator(
const ConditionalOperator *S) {
1606void StmtProfiler::VisitBinaryConditionalOperator(
1607 const BinaryConditionalOperator *S) {
1611void StmtProfiler::VisitAddrLabelExpr(
const AddrLabelExpr *S) {
1616void StmtProfiler::VisitStmtExpr(
const StmtExpr *S) {
1620void StmtProfiler::VisitShuffleVectorExpr(
const ShuffleVectorExpr *S) {
1624void StmtProfiler::VisitConvertVectorExpr(
const ConvertVectorExpr *S) {
1628void StmtProfiler::VisitChooseExpr(
const ChooseExpr *S) {
1632void StmtProfiler::VisitGNUNullExpr(
const GNUNullExpr *S) {
1636void StmtProfiler::VisitVAArgExpr(
const VAArgExpr *S) {
1640void StmtProfiler::VisitInitListExpr(
const InitListExpr *S) {
1649void StmtProfiler::VisitDesignatedInitExpr(
const DesignatedInitExpr *S) {
1652 for (
const DesignatedInitExpr::Designator &D : S->
designators()) {
1653 if (D.isFieldDesignator()) {
1655 VisitName(D.getFieldName());
1659 if (D.isArrayDesignator()) {
1662 assert(D.isArrayRangeDesignator());
1665 ID.AddInteger(D.getArrayIndex());
1671void StmtProfiler::VisitDesignatedInitUpdateExpr(
1672 const DesignatedInitUpdateExpr *S) {
1673 llvm_unreachable(
"Unexpected DesignatedInitUpdateExpr in syntactic form of "
1677void StmtProfiler::VisitArrayInitLoopExpr(
const ArrayInitLoopExpr *S) {
1681void StmtProfiler::VisitArrayInitIndexExpr(
const ArrayInitIndexExpr *S) {
1685void StmtProfiler::VisitNoInitExpr(
const NoInitExpr *S) {
1686 llvm_unreachable(
"Unexpected NoInitExpr in syntactic form of initializer");
1689void StmtProfiler::VisitImplicitValueInitExpr(
const ImplicitValueInitExpr *S) {
1693void StmtProfiler::VisitExtVectorElementExpr(
const ExtVectorElementExpr *S) {
1698void StmtProfiler::VisitMatrixElementExpr(
const MatrixElementExpr *S) {
1703void StmtProfiler::VisitBlockExpr(
const BlockExpr *S) {
1708void StmtProfiler::VisitGenericSelectionExpr(
const GenericSelectionExpr *S) {
1712 QualType T = Assoc.getType();
1714 ID.AddPointer(
nullptr);
1717 VisitExpr(Assoc.getAssociationExpr());
1721void StmtProfiler::VisitPseudoObjectExpr(
const PseudoObjectExpr *S) {
1726 if (
const OpaqueValueExpr *OVE = dyn_cast<OpaqueValueExpr>(*i))
1727 Visit(OVE->getSourceExpr());
1730void StmtProfiler::VisitAtomicExpr(
const AtomicExpr *S) {
1732 ID.AddInteger(S->
getOp());
1735void StmtProfiler::VisitConceptSpecializationExpr(
1736 const ConceptSpecializationExpr *S) {
1740 VisitTemplateArgument(Arg);
1743void StmtProfiler::VisitRequiresExpr(
const RequiresExpr *S) {
1747 VisitDecl(LocalParam);
1750 if (
auto *TypeReq = dyn_cast<concepts::TypeRequirement>(Req)) {
1752 ID.AddBoolean(TypeReq->isSubstitutionFailure());
1753 if (!TypeReq->isSubstitutionFailure())
1754 VisitType(TypeReq->getType()->getType());
1755 }
else if (
auto *ExprReq = dyn_cast<concepts::ExprRequirement>(Req)) {
1757 ID.AddBoolean(ExprReq->isExprSubstitutionFailure());
1758 if (!ExprReq->isExprSubstitutionFailure())
1759 Visit(ExprReq->getExpr());
1764 ID.AddBoolean(ExprReq->getNoexceptLoc().isValid());
1765 const concepts::ExprRequirement::ReturnTypeRequirement &RetReq =
1766 ExprReq->getReturnTypeRequirement();
1779 ID.AddBoolean(NestedReq->hasInvalidConstraint());
1780 if (!NestedReq->hasInvalidConstraint())
1781 Visit(NestedReq->getConstraintExpr());
1789 unsigned &NumArgs) {
1795 case OO_Array_Delete:
1797 case OO_Conditional:
1799 llvm_unreachable(
"Invalid operator call kind");
1804 return Stmt::UnaryOperatorClass;
1808 return Stmt::BinaryOperatorClass;
1813 return Stmt::UnaryOperatorClass;
1817 return Stmt::BinaryOperatorClass;
1822 return Stmt::UnaryOperatorClass;
1826 return Stmt::BinaryOperatorClass;
1830 return Stmt::BinaryOperatorClass;
1834 return Stmt::BinaryOperatorClass;
1838 return Stmt::BinaryOperatorClass;
1842 UnaryOp = UO_AddrOf;
1843 return Stmt::UnaryOperatorClass;
1847 return Stmt::BinaryOperatorClass;
1851 return Stmt::BinaryOperatorClass;
1855 return Stmt::UnaryOperatorClass;
1859 return Stmt::UnaryOperatorClass;
1862 BinaryOp = BO_Assign;
1863 return Stmt::BinaryOperatorClass;
1867 return Stmt::BinaryOperatorClass;
1871 return Stmt::BinaryOperatorClass;
1874 BinaryOp = BO_AddAssign;
1875 return Stmt::CompoundAssignOperatorClass;
1878 BinaryOp = BO_SubAssign;
1879 return Stmt::CompoundAssignOperatorClass;
1882 BinaryOp = BO_MulAssign;
1883 return Stmt::CompoundAssignOperatorClass;
1886 BinaryOp = BO_DivAssign;
1887 return Stmt::CompoundAssignOperatorClass;
1889 case OO_PercentEqual:
1890 BinaryOp = BO_RemAssign;
1891 return Stmt::CompoundAssignOperatorClass;
1894 BinaryOp = BO_XorAssign;
1895 return Stmt::CompoundAssignOperatorClass;
1898 BinaryOp = BO_AndAssign;
1899 return Stmt::CompoundAssignOperatorClass;
1902 BinaryOp = BO_OrAssign;
1903 return Stmt::CompoundAssignOperatorClass;
1907 return Stmt::BinaryOperatorClass;
1909 case OO_GreaterGreater:
1911 return Stmt::BinaryOperatorClass;
1913 case OO_LessLessEqual:
1914 BinaryOp = BO_ShlAssign;
1915 return Stmt::CompoundAssignOperatorClass;
1917 case OO_GreaterGreaterEqual:
1918 BinaryOp = BO_ShrAssign;
1919 return Stmt::CompoundAssignOperatorClass;
1923 return Stmt::BinaryOperatorClass;
1925 case OO_ExclaimEqual:
1927 return Stmt::BinaryOperatorClass;
1931 return Stmt::BinaryOperatorClass;
1933 case OO_GreaterEqual:
1935 return Stmt::BinaryOperatorClass;
1939 return Stmt::BinaryOperatorClass;
1943 return Stmt::BinaryOperatorClass;
1947 return Stmt::BinaryOperatorClass;
1950 UnaryOp = NumArgs == 1 ? UO_PreInc : UO_PostInc;
1952 return Stmt::UnaryOperatorClass;
1955 UnaryOp = NumArgs == 1 ? UO_PreDec : UO_PostDec;
1957 return Stmt::UnaryOperatorClass;
1960 BinaryOp = BO_Comma;
1961 return Stmt::BinaryOperatorClass;
1964 BinaryOp = BO_PtrMemI;
1965 return Stmt::BinaryOperatorClass;
1968 return Stmt::ArraySubscriptExprClass;
1971 return Stmt::CallExprClass;
1974 UnaryOp = UO_Coawait;
1975 return Stmt::UnaryOperatorClass;
1978 llvm_unreachable(
"Invalid overloaded operator expression");
1981#if defined(_MSC_VER) && !defined(__clang__)
1986#pragma optimize("", off)
1990void StmtProfiler::VisitCXXOperatorCallExpr(
const CXXOperatorCallExpr *S) {
1998 return Visit(S->
getArg(0));
2006 for (
unsigned I = 0; I != NumArgs; ++I)
2008 if (SC == Stmt::UnaryOperatorClass)
2009 ID.AddInteger(UnaryOp);
2010 else if (SC == Stmt::BinaryOperatorClass ||
2011 SC == Stmt::CompoundAssignOperatorClass)
2012 ID.AddInteger(BinaryOp);
2014 assert(SC == Stmt::ArraySubscriptExprClass || SC == Stmt::CallExprClass);
2023void StmtProfiler::VisitCXXRewrittenBinaryOperator(
2024 const CXXRewrittenBinaryOperator *S) {
2028 "resolved rewritten operator should never be type-dependent");
2033#if defined(_MSC_VER) && !defined(__clang__)
2035#pragma optimize("", on)
2039void StmtProfiler::VisitCXXMemberCallExpr(
const CXXMemberCallExpr *S) {
2043void StmtProfiler::VisitCUDAKernelCallExpr(
const CUDAKernelCallExpr *S) {
2047void StmtProfiler::VisitAsTypeExpr(
const AsTypeExpr *S) {
2051void StmtProfiler::VisitCXXNamedCastExpr(
const CXXNamedCastExpr *S) {
2052 VisitExplicitCastExpr(S);
2055void StmtProfiler::VisitCXXStaticCastExpr(
const CXXStaticCastExpr *S) {
2056 VisitCXXNamedCastExpr(S);
2059void StmtProfiler::VisitCXXDynamicCastExpr(
const CXXDynamicCastExpr *S) {
2060 VisitCXXNamedCastExpr(S);
2064StmtProfiler::VisitCXXReinterpretCastExpr(
const CXXReinterpretCastExpr *S) {
2065 VisitCXXNamedCastExpr(S);
2068void StmtProfiler::VisitCXXConstCastExpr(
const CXXConstCastExpr *S) {
2069 VisitCXXNamedCastExpr(S);
2072void StmtProfiler::VisitBuiltinBitCastExpr(
const BuiltinBitCastExpr *S) {
2077void StmtProfiler::VisitCXXAddrspaceCastExpr(
const CXXAddrspaceCastExpr *S) {
2078 VisitCXXNamedCastExpr(S);
2081void StmtProfiler::VisitUserDefinedLiteral(
const UserDefinedLiteral *S) {
2085void StmtProfiler::VisitCXXBoolLiteralExpr(
const CXXBoolLiteralExpr *S) {
2090void StmtProfiler::VisitCXXNullPtrLiteralExpr(
const CXXNullPtrLiteralExpr *S) {
2094void StmtProfiler::VisitCXXStdInitializerListExpr(
2095 const CXXStdInitializerListExpr *S) {
2099void StmtProfiler::VisitCXXTypeidExpr(
const CXXTypeidExpr *S) {
2105void StmtProfiler::VisitCXXUuidofExpr(
const CXXUuidofExpr *S) {
2111void StmtProfiler::VisitMSPropertyRefExpr(
const MSPropertyRefExpr *S) {
2116void StmtProfiler::VisitMSPropertySubscriptExpr(
2117 const MSPropertySubscriptExpr *S) {
2121void StmtProfiler::VisitCXXThisExpr(
const CXXThisExpr *S) {
2127void StmtProfiler::VisitCXXThrowExpr(
const CXXThrowExpr *S) {
2131void StmtProfiler::VisitCXXDefaultArgExpr(
const CXXDefaultArgExpr *S) {
2136void StmtProfiler::VisitCXXDefaultInitExpr(
const CXXDefaultInitExpr *S) {
2141void StmtProfiler::VisitCXXBindTemporaryExpr(
const CXXBindTemporaryExpr *S) {
2147void StmtProfiler::VisitCXXConstructExpr(
const CXXConstructExpr *S) {
2153void StmtProfiler::VisitCXXInheritedCtorInitExpr(
2154 const CXXInheritedCtorInitExpr *S) {
2159void StmtProfiler::VisitCXXFunctionalCastExpr(
const CXXFunctionalCastExpr *S) {
2160 VisitExplicitCastExpr(S);
2164StmtProfiler::VisitCXXTemporaryObjectExpr(
const CXXTemporaryObjectExpr *S) {
2165 VisitCXXConstructExpr(S);
2169StmtProfiler::VisitLambdaExpr(
const LambdaExpr *S) {
2170 if (!ProfileLambdaExpr) {
2174 VisitStmtNoChildren(S);
2185 ID.AddInteger(
Capture.getCaptureKind());
2186 if (
Capture.capturesVariable())
2187 VisitDecl(
Capture.getCapturedVar());
2196 for (
auto *SubDecl : Lambda->
decls()) {
2197 FunctionDecl *
Call =
nullptr;
2198 if (
auto *FTD = dyn_cast<FunctionTemplateDecl>(SubDecl))
2199 Call = FTD->getTemplatedDecl();
2200 else if (
auto *FD = dyn_cast<FunctionDecl>(SubDecl))
2211void StmtProfiler::VisitCXXReflectExpr(
const CXXReflectExpr *E) {
2213 assert(
false &&
"not implemented yet");
2217StmtProfiler::VisitCXXScalarValueInitExpr(
const CXXScalarValueInitExpr *S) {
2221void StmtProfiler::VisitCXXDeleteExpr(
const CXXDeleteExpr *S) {
2228void StmtProfiler::VisitCXXNewExpr(
const CXXNewExpr *S) {
2241StmtProfiler::VisitCXXPseudoDestructorExpr(
const CXXPseudoDestructorExpr *S) {
2255void StmtProfiler::VisitOverloadExpr(
const OverloadExpr *S) {
2257 bool DescribingDependentVarTemplate =
2259 if (DescribingDependentVarTemplate) {
2263 VisitName(S->
getName(),
true);
2271StmtProfiler::VisitUnresolvedLookupExpr(
const UnresolvedLookupExpr *S) {
2272 VisitOverloadExpr(S);
2275void StmtProfiler::VisitTypeTraitExpr(
const TypeTraitExpr *S) {
2279 for (
unsigned I = 0, N = S->
getNumArgs(); I != N; ++I)
2283void StmtProfiler::VisitArrayTypeTraitExpr(
const ArrayTypeTraitExpr *S) {
2289void StmtProfiler::VisitExpressionTraitExpr(
const ExpressionTraitExpr *S) {
2295void StmtProfiler::VisitDependentScopeDeclRefExpr(
2296 const DependentScopeDeclRefExpr *S) {
2305void StmtProfiler::VisitExprWithCleanups(
const ExprWithCleanups *S) {
2309void StmtProfiler::VisitCXXUnresolvedConstructExpr(
2310 const CXXUnresolvedConstructExpr *S) {
2316void StmtProfiler::VisitCXXDependentScopeMemberExpr(
2317 const CXXDependentScopeMemberExpr *S) {
2330void StmtProfiler::VisitUnresolvedMemberExpr(
const UnresolvedMemberExpr *S) {
2343void StmtProfiler::VisitCXXNoexceptExpr(
const CXXNoexceptExpr *S) {
2347void StmtProfiler::VisitPackExpansionExpr(
const PackExpansionExpr *S) {
2351void StmtProfiler::VisitSizeOfPackExpr(
const SizeOfPackExpr *S) {
2355 ID.AddInteger(Args.size());
2356 for (
const auto &TA : Args)
2357 VisitTemplateArgument(TA);
2364void StmtProfiler::VisitPackIndexingExpr(
const PackIndexingExpr *E) {
2376void StmtProfiler::VisitSubstNonTypeTemplateParmPackExpr(
2377 const SubstNonTypeTemplateParmPackExpr *S) {
2383void StmtProfiler::VisitSubstNonTypeTemplateParmExpr(
2384 const SubstNonTypeTemplateParmExpr *E) {
2389void StmtProfiler::VisitFunctionParmPackExpr(
const FunctionParmPackExpr *S) {
2397void StmtProfiler::VisitMaterializeTemporaryExpr(
2398 const MaterializeTemporaryExpr *S) {
2402void StmtProfiler::VisitCXXFoldExpr(
const CXXFoldExpr *S) {
2435void StmtProfiler::VisitCXXParenListInitExpr(
const CXXParenListInitExpr *S) {
2439void StmtProfiler::VisitCoroutineBodyStmt(
const CoroutineBodyStmt *S) {
2443void StmtProfiler::VisitCoreturnStmt(
const CoreturnStmt *S) {
2447void StmtProfiler::VisitCoawaitExpr(
const CoawaitExpr *S) {
2451void StmtProfiler::VisitDependentCoawaitExpr(
const DependentCoawaitExpr *S) {
2455void StmtProfiler::VisitCoyieldExpr(
const CoyieldExpr *S) {
2459void StmtProfiler::VisitOpaqueValueExpr(
const OpaqueValueExpr *E) {
2463void StmtProfiler::VisitSourceLocExpr(
const SourceLocExpr *E) {
2467void StmtProfiler::VisitEmbedExpr(
const EmbedExpr *E) { VisitExpr(E); }
2469void StmtProfiler::VisitRecoveryExpr(
const RecoveryExpr *E) { VisitExpr(E); }
2471void StmtProfiler::VisitObjCObjectLiteral(
const ObjCObjectLiteral *E) {
2475void StmtProfiler::VisitObjCStringLiteral(
const ObjCStringLiteral *S) {
2476 VisitObjCObjectLiteral(S);
2479void StmtProfiler::VisitObjCBoxedExpr(
const ObjCBoxedExpr *E) {
2480 VisitObjCObjectLiteral(E);
2483void StmtProfiler::VisitObjCArrayLiteral(
const ObjCArrayLiteral *E) {
2484 VisitObjCObjectLiteral(E);
2487void StmtProfiler::VisitObjCDictionaryLiteral(
const ObjCDictionaryLiteral *E) {
2488 VisitObjCObjectLiteral(E);
2491void StmtProfiler::VisitObjCEncodeExpr(
const ObjCEncodeExpr *S) {
2496void StmtProfiler::VisitObjCSelectorExpr(
const ObjCSelectorExpr *S) {
2501void StmtProfiler::VisitObjCProtocolExpr(
const ObjCProtocolExpr *S) {
2506void StmtProfiler::VisitObjCIvarRefExpr(
const ObjCIvarRefExpr *S) {
2513void StmtProfiler::VisitObjCPropertyRefExpr(
const ObjCPropertyRefExpr *S) {
2527void StmtProfiler::VisitObjCSubscriptRefExpr(
const ObjCSubscriptRefExpr *S) {
2533void StmtProfiler::VisitObjCMessageExpr(
const ObjCMessageExpr *S) {
2539void StmtProfiler::VisitObjCIsaExpr(
const ObjCIsaExpr *S) {
2544void StmtProfiler::VisitObjCBoolLiteralExpr(
const ObjCBoolLiteralExpr *S) {
2549void StmtProfiler::VisitObjCIndirectCopyRestoreExpr(
2550 const ObjCIndirectCopyRestoreExpr *S) {
2555void StmtProfiler::VisitObjCBridgedCastExpr(
const ObjCBridgedCastExpr *S) {
2556 VisitExplicitCastExpr(S);
2560void StmtProfiler::VisitObjCAvailabilityCheckExpr(
2561 const ObjCAvailabilityCheckExpr *S) {
2565void StmtProfiler::VisitTemplateArguments(
const TemplateArgumentLoc *Args,
2567 ID.AddInteger(NumArgs);
2568 for (
unsigned I = 0; I != NumArgs; ++I)
2572void StmtProfiler::VisitTemplateArgument(
const TemplateArgument &Arg) {
2615 VisitTemplateArgument(P);
2621class OpenACCClauseProfiler
2622 :
public OpenACCClauseVisitor<OpenACCClauseProfiler> {
2623 StmtProfiler &Profiler;
2626 OpenACCClauseProfiler(StmtProfiler &P) : Profiler(P) {}
2628 void VisitOpenACCClauseList(ArrayRef<const OpenACCClause *> Clauses) {
2629 for (
const OpenACCClause *Clause : Clauses) {
2636 void VisitClauseWithVarList(
const OpenACCClauseWithVarList &Clause) {
2638 Profiler.VisitStmt(E);
2641#define VISIT_CLAUSE(CLAUSE_NAME) \
2642 void Visit##CLAUSE_NAME##Clause(const OpenACC##CLAUSE_NAME##Clause &Clause);
2644#include "clang/Basic/OpenACCClauses.def"
2648void OpenACCClauseProfiler::VisitDefaultClause(
2649 const OpenACCDefaultClause &Clause) {}
2651void OpenACCClauseProfiler::VisitIfClause(
const OpenACCIfClause &Clause) {
2653 "if clause requires a valid condition expr");
2657void OpenACCClauseProfiler::VisitCopyClause(
const OpenACCCopyClause &Clause) {
2658 VisitClauseWithVarList(Clause);
2661void OpenACCClauseProfiler::VisitLinkClause(
const OpenACCLinkClause &Clause) {
2662 VisitClauseWithVarList(Clause);
2665void OpenACCClauseProfiler::VisitDeviceResidentClause(
2666 const OpenACCDeviceResidentClause &Clause) {
2667 VisitClauseWithVarList(Clause);
2670void OpenACCClauseProfiler::VisitCopyInClause(
2671 const OpenACCCopyInClause &Clause) {
2672 VisitClauseWithVarList(Clause);
2675void OpenACCClauseProfiler::VisitCopyOutClause(
2676 const OpenACCCopyOutClause &Clause) {
2677 VisitClauseWithVarList(Clause);
2680void OpenACCClauseProfiler::VisitCreateClause(
2681 const OpenACCCreateClause &Clause) {
2682 VisitClauseWithVarList(Clause);
2685void OpenACCClauseProfiler::VisitHostClause(
const OpenACCHostClause &Clause) {
2686 VisitClauseWithVarList(Clause);
2689void OpenACCClauseProfiler::VisitDeviceClause(
2690 const OpenACCDeviceClause &Clause) {
2691 VisitClauseWithVarList(Clause);
2694void OpenACCClauseProfiler::VisitSelfClause(
const OpenACCSelfClause &Clause) {
2700 Profiler.VisitStmt(E);
2704void OpenACCClauseProfiler::VisitFinalizeClause(
2705 const OpenACCFinalizeClause &Clause) {}
2707void OpenACCClauseProfiler::VisitIfPresentClause(
2708 const OpenACCIfPresentClause &Clause) {}
2710void OpenACCClauseProfiler::VisitNumGangsClause(
2711 const OpenACCNumGangsClause &Clause) {
2713 Profiler.VisitStmt(E);
2716void OpenACCClauseProfiler::VisitTileClause(
const OpenACCTileClause &Clause) {
2718 Profiler.VisitStmt(E);
2721void OpenACCClauseProfiler::VisitNumWorkersClause(
2722 const OpenACCNumWorkersClause &Clause) {
2723 assert(Clause.
hasIntExpr() &&
"num_workers clause requires a valid int expr");
2727void OpenACCClauseProfiler::VisitCollapseClause(
2728 const OpenACCCollapseClause &Clause) {
2729 assert(Clause.
getLoopCount() &&
"collapse clause requires a valid int expr");
2733void OpenACCClauseProfiler::VisitPrivateClause(
2734 const OpenACCPrivateClause &Clause) {
2735 VisitClauseWithVarList(Clause);
2738 Profiler.VisitDecl(Recipe.AllocaDecl);
2742void OpenACCClauseProfiler::VisitFirstPrivateClause(
2743 const OpenACCFirstPrivateClause &Clause) {
2744 VisitClauseWithVarList(Clause);
2747 Profiler.VisitDecl(Recipe.AllocaDecl);
2748 Profiler.VisitDecl(Recipe.InitFromTemporary);
2752void OpenACCClauseProfiler::VisitAttachClause(
2753 const OpenACCAttachClause &Clause) {
2754 VisitClauseWithVarList(Clause);
2757void OpenACCClauseProfiler::VisitDetachClause(
2758 const OpenACCDetachClause &Clause) {
2759 VisitClauseWithVarList(Clause);
2762void OpenACCClauseProfiler::VisitDeleteClause(
2763 const OpenACCDeleteClause &Clause) {
2764 VisitClauseWithVarList(Clause);
2767void OpenACCClauseProfiler::VisitDevicePtrClause(
2768 const OpenACCDevicePtrClause &Clause) {
2769 VisitClauseWithVarList(Clause);
2772void OpenACCClauseProfiler::VisitNoCreateClause(
2773 const OpenACCNoCreateClause &Clause) {
2774 VisitClauseWithVarList(Clause);
2777void OpenACCClauseProfiler::VisitPresentClause(
2778 const OpenACCPresentClause &Clause) {
2779 VisitClauseWithVarList(Clause);
2782void OpenACCClauseProfiler::VisitUseDeviceClause(
2783 const OpenACCUseDeviceClause &Clause) {
2784 VisitClauseWithVarList(Clause);
2787void OpenACCClauseProfiler::VisitVectorLengthClause(
2788 const OpenACCVectorLengthClause &Clause) {
2790 "vector_length clause requires a valid int expr");
2794void OpenACCClauseProfiler::VisitAsyncClause(
const OpenACCAsyncClause &Clause) {
2799void OpenACCClauseProfiler::VisitDeviceNumClause(
2800 const OpenACCDeviceNumClause &Clause) {
2804void OpenACCClauseProfiler::VisitDefaultAsyncClause(
2805 const OpenACCDefaultAsyncClause &Clause) {
2809void OpenACCClauseProfiler::VisitWorkerClause(
2810 const OpenACCWorkerClause &Clause) {
2815void OpenACCClauseProfiler::VisitVectorClause(
2816 const OpenACCVectorClause &Clause) {
2821void OpenACCClauseProfiler::VisitWaitClause(
const OpenACCWaitClause &Clause) {
2825 Profiler.VisitStmt(E);
2829void OpenACCClauseProfiler::VisitDeviceTypeClause(
2830 const OpenACCDeviceTypeClause &Clause) {}
2832void OpenACCClauseProfiler::VisitAutoClause(
const OpenACCAutoClause &Clause) {}
2834void OpenACCClauseProfiler::VisitIndependentClause(
2835 const OpenACCIndependentClause &Clause) {}
2837void OpenACCClauseProfiler::VisitSeqClause(
const OpenACCSeqClause &Clause) {}
2838void OpenACCClauseProfiler::VisitNoHostClause(
2839 const OpenACCNoHostClause &Clause) {}
2841void OpenACCClauseProfiler::VisitGangClause(
const OpenACCGangClause &Clause) {
2842 for (
unsigned I = 0; I < Clause.
getNumExprs(); ++I) {
2843 Profiler.VisitStmt(Clause.
getExpr(I).second);
2847void OpenACCClauseProfiler::VisitReductionClause(
2848 const OpenACCReductionClause &Clause) {
2849 VisitClauseWithVarList(Clause);
2852 Profiler.VisitDecl(Recipe.AllocaDecl);
2857 static_assert(
sizeof(OpenACCReductionRecipe::CombinerRecipe) ==
2859 for (
auto &CombinerRecipe : Recipe.CombinerRecipes) {
2860 if (CombinerRecipe.Op) {
2861 Profiler.VisitDecl(CombinerRecipe.LHS);
2862 Profiler.VisitDecl(CombinerRecipe.RHS);
2863 Profiler.VisitStmt(CombinerRecipe.Op);
2869void OpenACCClauseProfiler::VisitBindClause(
const OpenACCBindClause &Clause) {
2870 assert(
false &&
"not implemented... what can we do about our expr?");
2874void StmtProfiler::VisitOpenACCComputeConstruct(
2879 OpenACCClauseProfiler P{*
this};
2880 P.VisitOpenACCClauseList(S->clauses());
2883void StmtProfiler::VisitOpenACCLoopConstruct(
const OpenACCLoopConstruct *S) {
2887 OpenACCClauseProfiler P{*
this};
2888 P.VisitOpenACCClauseList(S->clauses());
2891void StmtProfiler::VisitOpenACCCombinedConstruct(
2892 const OpenACCCombinedConstruct *S) {
2896 OpenACCClauseProfiler P{*
this};
2897 P.VisitOpenACCClauseList(S->clauses());
2900void StmtProfiler::VisitOpenACCDataConstruct(
const OpenACCDataConstruct *S) {
2903 OpenACCClauseProfiler P{*
this};
2904 P.VisitOpenACCClauseList(S->clauses());
2907void StmtProfiler::VisitOpenACCEnterDataConstruct(
2908 const OpenACCEnterDataConstruct *S) {
2911 OpenACCClauseProfiler P{*
this};
2912 P.VisitOpenACCClauseList(S->clauses());
2915void StmtProfiler::VisitOpenACCExitDataConstruct(
2916 const OpenACCExitDataConstruct *S) {
2919 OpenACCClauseProfiler P{*
this};
2920 P.VisitOpenACCClauseList(S->clauses());
2923void StmtProfiler::VisitOpenACCHostDataConstruct(
2924 const OpenACCHostDataConstruct *S) {
2927 OpenACCClauseProfiler P{*
this};
2928 P.VisitOpenACCClauseList(S->clauses());
2931void StmtProfiler::VisitOpenACCWaitConstruct(
const OpenACCWaitConstruct *S) {
2935 OpenACCClauseProfiler P{*
this};
2936 P.VisitOpenACCClauseList(S->clauses());
2939void StmtProfiler::VisitOpenACCCacheConstruct(
const OpenACCCacheConstruct *S) {
2944void StmtProfiler::VisitOpenACCInitConstruct(
const OpenACCInitConstruct *S) {
2946 OpenACCClauseProfiler P{*
this};
2947 P.VisitOpenACCClauseList(S->clauses());
2950void StmtProfiler::VisitOpenACCShutdownConstruct(
2951 const OpenACCShutdownConstruct *S) {
2953 OpenACCClauseProfiler P{*
this};
2954 P.VisitOpenACCClauseList(S->clauses());
2957void StmtProfiler::VisitOpenACCSetConstruct(
const OpenACCSetConstruct *S) {
2959 OpenACCClauseProfiler P{*
this};
2960 P.VisitOpenACCClauseList(S->clauses());
2963void StmtProfiler::VisitOpenACCUpdateConstruct(
2964 const OpenACCUpdateConstruct *S) {
2966 OpenACCClauseProfiler P{*
this};
2967 P.VisitOpenACCClauseList(S->clauses());
2970void StmtProfiler::VisitOpenACCAtomicConstruct(
2971 const OpenACCAtomicConstruct *S) {
2973 OpenACCClauseProfiler P{*
this};
2974 P.VisitOpenACCClauseList(S->clauses());
2977void StmtProfiler::VisitHLSLOutArgExpr(
const HLSLOutArgExpr *S) {
2982 bool Canonical,
bool ProfileLambdaExpr)
const {
2983 StmtProfilerWithPointers Profiler(ID, Context, Canonical, ProfileLambdaExpr);
2984 Profiler.Visit(
this);
2989 StmtProfilerWithoutPointers Profiler(ID, Hash);
2990 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)
llvm::APInt getValue() const
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 ...
LabelDecl * getLabel() const
ArrayTypeTrait getTrait() const
QualType getQueriedType() const
unsigned getNumClobbers() const
unsigned getNumOutputs() const
unsigned getNumInputs() const
const BlockDecl * getBlockDecl() const
CXXTemporary * getTemporary()
QualType getCaughtType() const
bool isElidable() const
Whether this construction is elidable.
CXXConstructorDecl * getConstructor() const
Get the constructor that this expression will (ultimately) call.
const ParmVarDecl * getParam() const
FieldDecl * getField()
Get the field whose initializer will be used.
FunctionDecl * getOperatorDelete() const
bool isGlobalDelete() const
bool isArrow() const
Determine whether this member expression used the '->' operator; otherwise, it used the '.
NestedNameSpecifier getQualifier() const
Retrieve the nested-name-specifier that qualifies the member name.
unsigned getNumTemplateArgs() const
Retrieve the number of template arguments provided as part of this template-id.
const TemplateArgumentLoc * getTemplateArgs() const
Retrieve the template arguments provided as part of this template-id.
bool hasExplicitTemplateArgs() const
Determines whether this member expression actually had a C++ template argument list explicitly specif...
DeclarationName getMember() const
Retrieve the name of the member that this expression refers to.
bool isImplicitAccess() const
True if this is an implicit access, i.e.
BinaryOperatorKind getOperator() const
CXXConstructorDecl * getConstructor() const
Get the constructor that this expression will call.
QualType getAllocatedType() const
CXXNewInitializationStyle getInitializationStyle() const
The kind of initializer this new-expression has.
FunctionDecl * getOperatorDelete() const
unsigned getNumPlacementArgs() const
bool isParenTypeId() const
FunctionDecl * getOperatorNew() const
A call to an overloaded operator written using operator syntax.
OverloadedOperatorKind getOperator() const
Returns the kind of overloaded operator that this expression refers to.
TypeSourceInfo * getDestroyedTypeInfo() const
Retrieve the source location information for the type being destroyed.
bool isArrow() const
Determine whether this pseudo-destructor expression was written using an '->' (otherwise,...
TypeSourceInfo * getScopeTypeInfo() const
Retrieve the scope type in a qualified pseudo-destructor expression.
QualType getDestroyedType() const
Retrieve the type being destroyed.
NestedNameSpecifier getQualifier() const
If the member name was qualified, retrieves the nested-name-specifier that precedes the member name.
const IdentifierInfo * getDestroyedTypeIdentifier() const
In a dependent pseudo-destructor expression for which we do not have full type information on the des...
capture_const_range captures() const
Expr * getSemanticForm()
Get an equivalent semantic form for this expression.
bool isReversed() const
Determine whether this expression was rewritten in reverse form.
const CXXDestructorDecl * getDestructor() const
bool isCapturedByCopyInLambdaWithExplicitObjectParameter() const
bool isTypeOperand() const
TypeSourceInfo * getTypeOperandSourceInfo() const
Retrieve source information for the type operand.
bool isListInitialization() const
Determine whether this expression models list-initialization.
QualType getTypeAsWritten() const
Retrieve the type that is being constructed, as specified in the source code.
bool isTypeOperand() const
TypeSourceInfo * getTypeOperandSourceInfo() const
Retrieve source information for the type operand.
Expr * getArg(unsigned Arg)
getArg - Return the specified argument.
unsigned getNumArgs() const
getNumArgs - Return the number of actual arguments to this call.
unsigned getValue() const
CharacterLiteralKind getKind() const
ArrayRef< TemplateArgument > getTemplateArguments() const
ConceptDecl * getNamedConcept() const
ConstStmtVisitor - This class implements a simple visitor for Stmt subclasses.
decl_range decls() const
decls_begin/decls_end - Iterate over the declarations stored in this context.
unsigned getNumTemplateArgs() const
Retrieve the number of template arguments provided as part of this template-id.
bool hasExplicitTemplateArgs() const
Determines whether this declaration reference was followed by an explicit template argument list.
NestedNameSpecifier getQualifier() const
If the name was qualified, retrieves the nested-name-specifier that precedes the name.
const TemplateArgumentLoc * getTemplateArgs() const
Retrieve the template arguments provided as part of this template-id.
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.
void * getAsOpaquePtr() const
Get the representation of this declaration name as an opaque pointer.
bool hasExplicitTemplateArgs() const
Determines whether this lookup had explicit template arguments.
NestedNameSpecifier getQualifier() const
Retrieve the nested-name-specifier that qualifies this declaration.
unsigned getNumTemplateArgs() const
DeclarationName getDeclName() const
Retrieve the name that this expression refers to.
TemplateArgumentLoc const * getTemplateArgs() const
bool usesGNUSyntax() const
Determines whether this designated initializer used the deprecated GNU syntax for designated initiali...
MutableArrayRef< Designator > designators()
IdentifierInfo & getAccessor() const
TypeSourceInfo * getTypeInfoAsWritten() const
getTypeInfoAsWritten - Returns the type source info for the type that this expression is casting to.
QualType getTypeAsWritten() const
getTypeAsWritten - Returns the type that this expression is casting to, as written in the source code...
ExprValueKind getValueKind() const
getValueKind - The value kind that this expression produces.
bool isTypeDependent() const
Determines whether the type of this expression depends on.
Expr * getQueriedExpression() const
ExpressionTrait getTrait() const
llvm::APInt getValue() const
Returns an internal integer representation of the literal.
llvm::APFloat getValue() const
const Expr * getSubExpr() const
ValueDecl *const * iterator
Iterators over the parameters which the parameter pack expanded into.
ValueDecl * getParameterPack() const
Get the parameter pack which this expression refers to.
unsigned getNumExpansions() const
Get the number of parameters in this parameter pack.
unsigned getNumLabels() const
const Expr * getOutputConstraintExpr(unsigned i) const
StringRef getInputName(unsigned i) const
StringRef getOutputName(unsigned i) const
const Expr * getInputConstraintExpr(unsigned i) const
const Expr * getAsmStringExpr() const
Expr * getClobberExpr(unsigned i)
association_range associations()
AssociationTy< true > ConstAssociation
LabelDecl * getLabel() const
One of these records is kept for each identifier that is lexed.
VarDecl * getConditionVariable()
Retrieve the variable declared in this "if" statement, if any.
InitListExpr * getSyntacticForm() const
LabelDecl * getDecl() const
CXXRecordDecl * getLambdaClass() const
Retrieve the class that corresponds to the lambda.
bool isIfExists() const
Determine whether this is an __if_exists statement.
DeclarationNameInfo getNameInfo() const
Retrieve the name of the entity we're testing for, along with location information.
NestedNameSpecifierLoc getQualifierLoc() const
Retrieve the nested-name-specifier that qualifies this name, if any.
MSPropertyDecl * getPropertyDecl() const
NestedNameSpecifier getQualifier() const
If the member name was qualified, retrieves the nested-name-specifier that precedes the member name.
ValueDecl * getMemberDecl() const
Retrieve the member declaration to which this expression refers.
NestedNameSpecifier getNestedNameSpecifier() const
Retrieve the nested-name-specifier to which this instance refers.
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
void AddFunctionDecl(const FunctionDecl *Function, bool SkipBody=false)
Class that handles post-update expression for some clauses, like 'lastprivate', 'reduction' etc.
Class that handles pre-initialization statement for some clauses, like 'schedule',...
unsigned numOfIterators() const
Returns number of iterator definitions.
Decl * getIteratorDecl(unsigned I)
Gets the iterator declaration for the given iterator.
const VarDecl * getCatchParamDecl() const
ObjCBridgeCastKind getBridgeKind() const
Determine which kind of bridge is being performed via this cast.
QualType getEncodedType() const
bool shouldCopy() const
shouldCopy - True if we should do the 'copy' part of the copy-restore.
Selector getSelector() const
const ObjCMethodDecl * getMethodDecl() const
ObjCPropertyDecl * getExplicitProperty() const
ObjCMethodDecl * getImplicitPropertyGetter() const
QualType getSuperReceiverType() const
bool isImplicitProperty() const
ObjCMethodDecl * getImplicitPropertySetter() const
bool isSuperReceiver() const
ObjCProtocolDecl * getProtocol() const
Selector getSelector() const
ObjCMethodDecl * getAtIndexMethodDecl() const
ObjCMethodDecl * setAtIndexMethodDecl() const
const OffsetOfNode & getComponent(unsigned Idx) const
TypeSourceInfo * getTypeSourceInfo() const
unsigned getNumComponents() const
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.
bool hasConditionExpr() const
const Expr * getConditionExpr() const
const Expr * getIntExpr() const
ArrayRef< Expr * > getVarList()
const Expr * getLoopCount() const
ArrayRef< OpenACCFirstPrivateRecipe > getInitRecipes()
unsigned getNumExprs() const
std::pair< OpenACCGangKind, const Expr * > getExpr(unsigned I) const
ArrayRef< Expr * > getIntExprs()
ArrayRef< OpenACCPrivateRecipe > getInitRecipes()
ArrayRef< OpenACCReductionRecipe > getRecipes()
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
bool hasExplicitTemplateArgs() const
Determines whether this expression had explicit template arguments.
NestedNameSpecifier getQualifier() const
Fetches the nested-name qualifier, if one was given.
decls_iterator decls_begin() const
unsigned getNumDecls() const
Gets the number of declarations in the unresolved set.
TemplateArgumentLoc const * getTemplateArgs() const
unsigned getNumTemplateArgs() const
DeclarationName getName() const
Gets the name looked up.
Expr * getIndexExpr() const
ArrayRef< Expr * > getExpressions() const
Return the trailing expressions, regardless of the expansion.
bool expandsToEmptyPack() const
Determine if the expression was expanded to empty.
Expr * getPackIdExpression() const
PredefinedIdentKind getIdentKind() const
semantics_iterator semantics_end()
semantics_iterator semantics_begin()
const Expr *const * const_semantics_iterator
A (possibly-)qualified type.
bool isNull() const
Return true if this QualType doesn't point to a type yet.
QualType getCanonicalType() const
void * getAsOpaquePtr() const
ArrayRef< concepts::Requirement * > getRequirements() const
ArrayRef< ParmVarDecl * > getLocalParameters() const
TypeSourceInfo * getTypeSourceInfo()
bool isPartiallySubstituted() const
Determine whether this represents a partially-substituted sizeof... expression, such as is produced f...
ArrayRef< TemplateArgument > getPartialArguments() const
Get.
NamedDecl * getPack() const
Retrieve the parameter pack.
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.
StmtClass getStmtClass() const
void Profile(llvm::FoldingSetNodeID &ID, const ASTContext &Context, bool Canonical, bool ProfileLambdaExpr=false) const
Produce a unique representation of the given statement.
StringLiteralKind getKind() const
StringRef getBytes() const
Allow access to clients that need the byte representation, such as ASTWriterStmt::VisitStringLiteral(...
Expr * getReplacement() const
TemplateArgument getArgumentPack() const
Retrieve the template argument pack containing the substituted template arguments.
NonTypeTemplateParmDecl * getParameterPack() const
Retrieve the non-type template parameter pack being substituted.
VarDecl * getConditionVariable()
Retrieve the variable declared in this "switch" statement, if any.
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.
void Profile(llvm::FoldingSetNodeID &ID)
Expr * getImmediatelyDeclaredConstraint() const
Get the immediately-declared constraint expression introduced by this type-constraint,...
QualType getType() const
Return the type wrapped by this type source info.
TypeSourceInfo * getArg(unsigned I) const
Retrieve the Ith argument.
unsigned getNumArgs() const
Determine the number of arguments to this type trait.
TypeTrait getTrait() const
Determine which type trait this expression uses.
const T * castAs() const
Member-template castAs<specific type>.
TypeClass getTypeClass() const
const T * getAs() const
Member-template getAs<specific type>'.
QualType getArgumentType() const
bool isArgumentType() const
UnaryExprOrTypeTrait getKind() const
DeclarationName getMemberName() const
Retrieve the name of the member that this expression refers to.
bool isArrow() const
Determine whether this member expression used the '->' operator; otherwise, it used the '.
bool isImplicitAccess() const
True if this is an implicit access, i.e., one in which the member being accessed was not written in t...
VarDecl * getConditionVariable()
Retrieve the variable declared in this "while" statement, if any.
bool isTypeConstraint() const
const TypeConstraint * getTypeConstraint() const
bool isSubstitutionFailure() const
The JSON file list parser is used to communicate input to InstallAPI.
@ OO_None
Not an overloaded operator.
@ NUM_OVERLOADED_OPERATORS
bool isa(CodeGen::Address addr)
@ TemplateName
The identifier is a template name. FIXME: Add an annotation for that.
OpenACCComputeConstruct(OpenACCDirectiveKind K, SourceLocation Start, SourceLocation DirectiveLoc, SourceLocation End, ArrayRef< const OpenACCClause * > Clauses, Stmt *StructuredBlock)
U cast(CodeGen::Address addr)
Expr * AllocatorTraits
Allocator traits.
Expr * Allocator
Allocator.
DeclarationName getName() const
getName - Returns the embedded declaration name.