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::VisitOMPPermutationClause(
502 const OMPPermutationClause *
C) {
503 for (Expr *E :
C->getArgsRefs())
505 Profiler->VisitExpr(E);
508void OMPClauseProfiler::VisitOMPFullClause(
const OMPFullClause *
C) {}
510void OMPClauseProfiler::VisitOMPPartialClause(
const OMPPartialClause *
C) {
511 if (
const Expr *Factor =
C->getFactor())
512 Profiler->VisitExpr(Factor);
515void OMPClauseProfiler::VisitOMPLoopRangeClause(
const OMPLoopRangeClause *
C) {
516 if (
const Expr *
First =
C->getFirst())
517 Profiler->VisitExpr(
First);
518 if (
const Expr *Count =
C->getCount())
519 Profiler->VisitExpr(Count);
522void OMPClauseProfiler::VisitOMPAllocatorClause(
const OMPAllocatorClause *
C) {
523 if (
C->getAllocator())
524 Profiler->VisitStmt(
C->getAllocator());
527void OMPClauseProfiler::VisitOMPCollapseClause(
const OMPCollapseClause *
C) {
528 if (
C->getNumForLoops())
529 Profiler->VisitStmt(
C->getNumForLoops());
532void OMPClauseProfiler::VisitOMPDetachClause(
const OMPDetachClause *
C) {
533 if (Expr *Evt =
C->getEventHandler())
534 Profiler->VisitStmt(Evt);
537void OMPClauseProfiler::VisitOMPNovariantsClause(
const OMPNovariantsClause *
C) {
538 VisitOMPClauseWithPreInit(
C);
539 if (
C->getCondition())
540 Profiler->VisitStmt(
C->getCondition());
543void OMPClauseProfiler::VisitOMPNocontextClause(
const OMPNocontextClause *
C) {
544 VisitOMPClauseWithPreInit(
C);
545 if (
C->getCondition())
546 Profiler->VisitStmt(
C->getCondition());
549void OMPClauseProfiler::VisitOMPDefaultClause(
const OMPDefaultClause *
C) { }
551void OMPClauseProfiler::VisitOMPThreadsetClause(
const OMPThreadsetClause *
C) {}
553void OMPClauseProfiler::VisitOMPTransparentClause(
554 const OMPTransparentClause *
C) {
555 if (
C->getImpexType())
556 Profiler->VisitStmt(
C->getImpexType());
559void OMPClauseProfiler::VisitOMPProcBindClause(
const OMPProcBindClause *
C) { }
561void OMPClauseProfiler::VisitOMPUnifiedAddressClause(
562 const OMPUnifiedAddressClause *
C) {}
564void OMPClauseProfiler::VisitOMPUnifiedSharedMemoryClause(
565 const OMPUnifiedSharedMemoryClause *
C) {}
567void OMPClauseProfiler::VisitOMPReverseOffloadClause(
568 const OMPReverseOffloadClause *
C) {}
570void OMPClauseProfiler::VisitOMPDynamicAllocatorsClause(
571 const OMPDynamicAllocatorsClause *
C) {}
573void OMPClauseProfiler::VisitOMPAtomicDefaultMemOrderClause(
574 const OMPAtomicDefaultMemOrderClause *
C) {}
576void OMPClauseProfiler::VisitOMPSelfMapsClause(
const OMPSelfMapsClause *
C) {}
578void OMPClauseProfiler::VisitOMPAtClause(
const OMPAtClause *
C) {}
580void OMPClauseProfiler::VisitOMPSeverityClause(
const OMPSeverityClause *
C) {}
582void OMPClauseProfiler::VisitOMPMessageClause(
const OMPMessageClause *
C) {
583 if (
C->getMessageString())
584 Profiler->VisitStmt(
C->getMessageString());
587void OMPClauseProfiler::VisitOMPScheduleClause(
const OMPScheduleClause *
C) {
588 VisitOMPClauseWithPreInit(
C);
589 if (
auto *S =
C->getChunkSize())
590 Profiler->VisitStmt(S);
593void OMPClauseProfiler::VisitOMPOrderedClause(
const OMPOrderedClause *
C) {
594 if (
auto *
Num =
C->getNumForLoops())
595 Profiler->VisitStmt(
Num);
598void OMPClauseProfiler::VisitOMPNowaitClause(
const OMPNowaitClause *
C) {
599 if (
C->getCondition())
600 Profiler->VisitStmt(
C->getCondition());
603void OMPClauseProfiler::VisitOMPUntiedClause(
const OMPUntiedClause *) {}
605void OMPClauseProfiler::VisitOMPMergeableClause(
const OMPMergeableClause *) {}
607void OMPClauseProfiler::VisitOMPReadClause(
const OMPReadClause *) {}
609void OMPClauseProfiler::VisitOMPWriteClause(
const OMPWriteClause *) {}
611void OMPClauseProfiler::VisitOMPUpdateClause(
const OMPUpdateClause *) {}
613void OMPClauseProfiler::VisitOMPCaptureClause(
const OMPCaptureClause *) {}
615void OMPClauseProfiler::VisitOMPCompareClause(
const OMPCompareClause *) {}
617void OMPClauseProfiler::VisitOMPFailClause(
const OMPFailClause *) {}
619void OMPClauseProfiler::VisitOMPAbsentClause(
const OMPAbsentClause *) {}
621void OMPClauseProfiler::VisitOMPHoldsClause(
const OMPHoldsClause *) {}
623void OMPClauseProfiler::VisitOMPContainsClause(
const OMPContainsClause *) {}
625void OMPClauseProfiler::VisitOMPNoOpenMPClause(
const OMPNoOpenMPClause *) {}
627void OMPClauseProfiler::VisitOMPNoOpenMPRoutinesClause(
628 const OMPNoOpenMPRoutinesClause *) {}
630void OMPClauseProfiler::VisitOMPNoOpenMPConstructsClause(
631 const OMPNoOpenMPConstructsClause *) {}
633void OMPClauseProfiler::VisitOMPNoParallelismClause(
634 const OMPNoParallelismClause *) {}
636void OMPClauseProfiler::VisitOMPSeqCstClause(
const OMPSeqCstClause *) {}
638void OMPClauseProfiler::VisitOMPAcqRelClause(
const OMPAcqRelClause *) {}
640void OMPClauseProfiler::VisitOMPAcquireClause(
const OMPAcquireClause *) {}
642void OMPClauseProfiler::VisitOMPReleaseClause(
const OMPReleaseClause *) {}
644void OMPClauseProfiler::VisitOMPRelaxedClause(
const OMPRelaxedClause *) {}
646void OMPClauseProfiler::VisitOMPWeakClause(
const OMPWeakClause *) {}
648void OMPClauseProfiler::VisitOMPThreadsClause(
const OMPThreadsClause *) {}
650void OMPClauseProfiler::VisitOMPSIMDClause(
const OMPSIMDClause *) {}
652void OMPClauseProfiler::VisitOMPNogroupClause(
const OMPNogroupClause *) {}
654void OMPClauseProfiler::VisitOMPInitClause(
const OMPInitClause *
C) {
655 VisitOMPClauseList(
C);
658void OMPClauseProfiler::VisitOMPUseClause(
const OMPUseClause *
C) {
659 if (
C->getInteropVar())
660 Profiler->VisitStmt(
C->getInteropVar());
663void OMPClauseProfiler::VisitOMPDestroyClause(
const OMPDestroyClause *
C) {
664 if (
C->getInteropVar())
665 Profiler->VisitStmt(
C->getInteropVar());
668void OMPClauseProfiler::VisitOMPFilterClause(
const OMPFilterClause *
C) {
669 VisitOMPClauseWithPreInit(
C);
670 if (
C->getThreadID())
671 Profiler->VisitStmt(
C->getThreadID());
675void OMPClauseProfiler::VisitOMPClauseList(T *Node) {
676 for (
auto *E : Node->varlist()) {
678 Profiler->VisitStmt(E);
682void OMPClauseProfiler::VisitOMPPrivateClause(
const OMPPrivateClause *
C) {
683 VisitOMPClauseList(
C);
684 for (
auto *E :
C->private_copies()) {
686 Profiler->VisitStmt(E);
690OMPClauseProfiler::VisitOMPFirstprivateClause(
const OMPFirstprivateClause *
C) {
691 VisitOMPClauseList(
C);
692 VisitOMPClauseWithPreInit(
C);
693 for (
auto *E :
C->private_copies()) {
695 Profiler->VisitStmt(E);
697 for (
auto *E :
C->inits()) {
699 Profiler->VisitStmt(E);
703OMPClauseProfiler::VisitOMPLastprivateClause(
const OMPLastprivateClause *
C) {
704 VisitOMPClauseList(
C);
705 VisitOMPClauseWithPostUpdate(
C);
706 for (
auto *E :
C->source_exprs()) {
708 Profiler->VisitStmt(E);
710 for (
auto *E :
C->destination_exprs()) {
712 Profiler->VisitStmt(E);
714 for (
auto *E :
C->assignment_ops()) {
716 Profiler->VisitStmt(E);
719void OMPClauseProfiler::VisitOMPSharedClause(
const OMPSharedClause *
C) {
720 VisitOMPClauseList(
C);
722void OMPClauseProfiler::VisitOMPReductionClause(
723 const OMPReductionClause *
C) {
724 Profiler->VisitNestedNameSpecifier(
725 C->getQualifierLoc().getNestedNameSpecifier());
726 Profiler->VisitName(
C->getNameInfo().getName());
727 VisitOMPClauseList(
C);
728 VisitOMPClauseWithPostUpdate(
C);
729 for (
auto *E :
C->privates()) {
731 Profiler->VisitStmt(E);
733 for (
auto *E :
C->lhs_exprs()) {
735 Profiler->VisitStmt(E);
737 for (
auto *E :
C->rhs_exprs()) {
739 Profiler->VisitStmt(E);
741 for (
auto *E :
C->reduction_ops()) {
743 Profiler->VisitStmt(E);
745 if (
C->getModifier() == clang::OMPC_REDUCTION_inscan) {
746 for (
auto *E :
C->copy_ops()) {
748 Profiler->VisitStmt(E);
750 for (
auto *E :
C->copy_array_temps()) {
752 Profiler->VisitStmt(E);
754 for (
auto *E :
C->copy_array_elems()) {
756 Profiler->VisitStmt(E);
760void OMPClauseProfiler::VisitOMPTaskReductionClause(
761 const OMPTaskReductionClause *
C) {
762 Profiler->VisitNestedNameSpecifier(
763 C->getQualifierLoc().getNestedNameSpecifier());
764 Profiler->VisitName(
C->getNameInfo().getName());
765 VisitOMPClauseList(
C);
766 VisitOMPClauseWithPostUpdate(
C);
767 for (
auto *E :
C->privates()) {
769 Profiler->VisitStmt(E);
771 for (
auto *E :
C->lhs_exprs()) {
773 Profiler->VisitStmt(E);
775 for (
auto *E :
C->rhs_exprs()) {
777 Profiler->VisitStmt(E);
779 for (
auto *E :
C->reduction_ops()) {
781 Profiler->VisitStmt(E);
784void OMPClauseProfiler::VisitOMPInReductionClause(
785 const OMPInReductionClause *
C) {
786 Profiler->VisitNestedNameSpecifier(
787 C->getQualifierLoc().getNestedNameSpecifier());
788 Profiler->VisitName(
C->getNameInfo().getName());
789 VisitOMPClauseList(
C);
790 VisitOMPClauseWithPostUpdate(
C);
791 for (
auto *E :
C->privates()) {
793 Profiler->VisitStmt(E);
795 for (
auto *E :
C->lhs_exprs()) {
797 Profiler->VisitStmt(E);
799 for (
auto *E :
C->rhs_exprs()) {
801 Profiler->VisitStmt(E);
803 for (
auto *E :
C->reduction_ops()) {
805 Profiler->VisitStmt(E);
807 for (
auto *E :
C->taskgroup_descriptors()) {
809 Profiler->VisitStmt(E);
812void OMPClauseProfiler::VisitOMPLinearClause(
const OMPLinearClause *
C) {
813 VisitOMPClauseList(
C);
814 VisitOMPClauseWithPostUpdate(
C);
815 for (
auto *E :
C->privates()) {
817 Profiler->VisitStmt(E);
819 for (
auto *E :
C->inits()) {
821 Profiler->VisitStmt(E);
823 for (
auto *E :
C->updates()) {
825 Profiler->VisitStmt(E);
827 for (
auto *E :
C->finals()) {
829 Profiler->VisitStmt(E);
832 Profiler->VisitStmt(
C->getStep());
833 if (
C->getCalcStep())
834 Profiler->VisitStmt(
C->getCalcStep());
836void OMPClauseProfiler::VisitOMPAlignedClause(
const OMPAlignedClause *
C) {
837 VisitOMPClauseList(
C);
838 if (
C->getAlignment())
839 Profiler->VisitStmt(
C->getAlignment());
841void OMPClauseProfiler::VisitOMPCopyinClause(
const OMPCopyinClause *
C) {
842 VisitOMPClauseList(
C);
843 for (
auto *E :
C->source_exprs()) {
845 Profiler->VisitStmt(E);
847 for (
auto *E :
C->destination_exprs()) {
849 Profiler->VisitStmt(E);
851 for (
auto *E :
C->assignment_ops()) {
853 Profiler->VisitStmt(E);
857OMPClauseProfiler::VisitOMPCopyprivateClause(
const OMPCopyprivateClause *
C) {
858 VisitOMPClauseList(
C);
859 for (
auto *E :
C->source_exprs()) {
861 Profiler->VisitStmt(E);
863 for (
auto *E :
C->destination_exprs()) {
865 Profiler->VisitStmt(E);
867 for (
auto *E :
C->assignment_ops()) {
869 Profiler->VisitStmt(E);
872void OMPClauseProfiler::VisitOMPFlushClause(
const OMPFlushClause *
C) {
873 VisitOMPClauseList(
C);
875void OMPClauseProfiler::VisitOMPDepobjClause(
const OMPDepobjClause *
C) {
876 if (
const Expr *Depobj =
C->getDepobj())
877 Profiler->VisitStmt(Depobj);
879void OMPClauseProfiler::VisitOMPDependClause(
const OMPDependClause *
C) {
880 VisitOMPClauseList(
C);
882void OMPClauseProfiler::VisitOMPDeviceClause(
const OMPDeviceClause *
C) {
884 Profiler->VisitStmt(
C->getDevice());
886void OMPClauseProfiler::VisitOMPMapClause(
const OMPMapClause *
C) {
887 VisitOMPClauseList(
C);
889void OMPClauseProfiler::VisitOMPAllocateClause(
const OMPAllocateClause *
C) {
890 if (Expr *Allocator =
C->getAllocator())
891 Profiler->VisitStmt(Allocator);
892 VisitOMPClauseList(
C);
894void OMPClauseProfiler::VisitOMPNumTeamsClause(
const OMPNumTeamsClause *
C) {
895 VisitOMPClauseList(
C);
896 VisitOMPClauseWithPreInit(
C);
898void OMPClauseProfiler::VisitOMPThreadLimitClause(
899 const OMPThreadLimitClause *
C) {
900 VisitOMPClauseList(
C);
901 VisitOMPClauseWithPreInit(
C);
903void OMPClauseProfiler::VisitOMPPriorityClause(
const OMPPriorityClause *
C) {
904 VisitOMPClauseWithPreInit(
C);
905 if (
C->getPriority())
906 Profiler->VisitStmt(
C->getPriority());
908void OMPClauseProfiler::VisitOMPGrainsizeClause(
const OMPGrainsizeClause *
C) {
909 VisitOMPClauseWithPreInit(
C);
910 if (
C->getGrainsize())
911 Profiler->VisitStmt(
C->getGrainsize());
913void OMPClauseProfiler::VisitOMPNumTasksClause(
const OMPNumTasksClause *
C) {
914 VisitOMPClauseWithPreInit(
C);
915 if (
C->getNumTasks())
916 Profiler->VisitStmt(
C->getNumTasks());
918void OMPClauseProfiler::VisitOMPHintClause(
const OMPHintClause *
C) {
920 Profiler->VisitStmt(
C->getHint());
922void OMPClauseProfiler::VisitOMPToClause(
const OMPToClause *
C) {
923 VisitOMPClauseList(
C);
925void OMPClauseProfiler::VisitOMPFromClause(
const OMPFromClause *
C) {
926 VisitOMPClauseList(
C);
928void OMPClauseProfiler::VisitOMPUseDevicePtrClause(
929 const OMPUseDevicePtrClause *
C) {
930 VisitOMPClauseList(
C);
932void OMPClauseProfiler::VisitOMPUseDeviceAddrClause(
933 const OMPUseDeviceAddrClause *
C) {
934 VisitOMPClauseList(
C);
936void OMPClauseProfiler::VisitOMPIsDevicePtrClause(
937 const OMPIsDevicePtrClause *
C) {
938 VisitOMPClauseList(
C);
940void OMPClauseProfiler::VisitOMPHasDeviceAddrClause(
941 const OMPHasDeviceAddrClause *
C) {
942 VisitOMPClauseList(
C);
944void OMPClauseProfiler::VisitOMPNontemporalClause(
945 const OMPNontemporalClause *
C) {
946 VisitOMPClauseList(
C);
947 for (
auto *E :
C->private_refs())
948 Profiler->VisitStmt(E);
950void OMPClauseProfiler::VisitOMPInclusiveClause(
const OMPInclusiveClause *
C) {
951 VisitOMPClauseList(
C);
953void OMPClauseProfiler::VisitOMPExclusiveClause(
const OMPExclusiveClause *
C) {
954 VisitOMPClauseList(
C);
956void OMPClauseProfiler::VisitOMPUsesAllocatorsClause(
957 const OMPUsesAllocatorsClause *
C) {
958 for (
unsigned I = 0, E =
C->getNumberOfAllocators(); I < E; ++I) {
959 OMPUsesAllocatorsClause::Data D =
C->getAllocatorData(I);
965void OMPClauseProfiler::VisitOMPAffinityClause(
const OMPAffinityClause *
C) {
966 if (
const Expr *Modifier =
C->getModifier())
967 Profiler->VisitStmt(Modifier);
968 for (
const Expr *E :
C->varlist())
969 Profiler->VisitStmt(E);
971void OMPClauseProfiler::VisitOMPOrderClause(
const OMPOrderClause *
C) {}
972void OMPClauseProfiler::VisitOMPBindClause(
const OMPBindClause *
C) {}
973void OMPClauseProfiler::VisitOMPXDynCGroupMemClause(
974 const OMPXDynCGroupMemClause *
C) {
975 VisitOMPClauseWithPreInit(
C);
976 if (Expr *Size =
C->getSize())
977 Profiler->VisitStmt(Size);
979void OMPClauseProfiler::VisitOMPDynGroupprivateClause(
980 const OMPDynGroupprivateClause *
C) {
981 VisitOMPClauseWithPreInit(
C);
982 if (
auto *Size =
C->getSize())
983 Profiler->VisitStmt(Size);
985void OMPClauseProfiler::VisitOMPDoacrossClause(
const OMPDoacrossClause *
C) {
986 VisitOMPClauseList(
C);
988void OMPClauseProfiler::VisitOMPXAttributeClause(
const OMPXAttributeClause *
C) {
990void OMPClauseProfiler::VisitOMPXBareClause(
const OMPXBareClause *
C) {}
994StmtProfiler::VisitOMPExecutableDirective(
const OMPExecutableDirective *S) {
996 OMPClauseProfiler P(
this);
997 ArrayRef<OMPClause *> Clauses = S->clauses();
998 for (ArrayRef<OMPClause *>::iterator I = Clauses.begin(), E = Clauses.end();
1004void StmtProfiler::VisitOMPCanonicalLoop(
const OMPCanonicalLoop *L) {
1008void StmtProfiler::VisitOMPLoopBasedDirective(
const OMPLoopBasedDirective *S) {
1009 VisitOMPExecutableDirective(S);
1012void StmtProfiler::VisitOMPLoopDirective(
const OMPLoopDirective *S) {
1013 VisitOMPLoopBasedDirective(S);
1016void StmtProfiler::VisitOMPMetaDirective(
const OMPMetaDirective *S) {
1017 VisitOMPExecutableDirective(S);
1020void StmtProfiler::VisitOMPParallelDirective(
const OMPParallelDirective *S) {
1021 VisitOMPExecutableDirective(S);
1024void StmtProfiler::VisitOMPSimdDirective(
const OMPSimdDirective *S) {
1025 VisitOMPLoopDirective(S);
1028void StmtProfiler::VisitOMPCanonicalLoopNestTransformationDirective(
1029 const OMPCanonicalLoopNestTransformationDirective *S) {
1030 VisitOMPLoopBasedDirective(S);
1033void StmtProfiler::VisitOMPTileDirective(
const OMPTileDirective *S) {
1034 VisitOMPCanonicalLoopNestTransformationDirective(S);
1037void StmtProfiler::VisitOMPStripeDirective(
const OMPStripeDirective *S) {
1038 VisitOMPCanonicalLoopNestTransformationDirective(S);
1041void StmtProfiler::VisitOMPUnrollDirective(
const OMPUnrollDirective *S) {
1042 VisitOMPCanonicalLoopNestTransformationDirective(S);
1045void StmtProfiler::VisitOMPReverseDirective(
const OMPReverseDirective *S) {
1046 VisitOMPCanonicalLoopNestTransformationDirective(S);
1049void StmtProfiler::VisitOMPInterchangeDirective(
1050 const OMPInterchangeDirective *S) {
1051 VisitOMPCanonicalLoopNestTransformationDirective(S);
1054void StmtProfiler::VisitOMPCanonicalLoopSequenceTransformationDirective(
1055 const OMPCanonicalLoopSequenceTransformationDirective *S) {
1056 VisitOMPExecutableDirective(S);
1059void StmtProfiler::VisitOMPFuseDirective(
const OMPFuseDirective *S) {
1060 VisitOMPCanonicalLoopSequenceTransformationDirective(S);
1063void StmtProfiler::VisitOMPForDirective(
const OMPForDirective *S) {
1064 VisitOMPLoopDirective(S);
1067void StmtProfiler::VisitOMPForSimdDirective(
const OMPForSimdDirective *S) {
1068 VisitOMPLoopDirective(S);
1071void StmtProfiler::VisitOMPSectionsDirective(
const OMPSectionsDirective *S) {
1072 VisitOMPExecutableDirective(S);
1075void StmtProfiler::VisitOMPSectionDirective(
const OMPSectionDirective *S) {
1076 VisitOMPExecutableDirective(S);
1079void StmtProfiler::VisitOMPScopeDirective(
const OMPScopeDirective *S) {
1080 VisitOMPExecutableDirective(S);
1083void StmtProfiler::VisitOMPSingleDirective(
const OMPSingleDirective *S) {
1084 VisitOMPExecutableDirective(S);
1087void StmtProfiler::VisitOMPMasterDirective(
const OMPMasterDirective *S) {
1088 VisitOMPExecutableDirective(S);
1091void StmtProfiler::VisitOMPCriticalDirective(
const OMPCriticalDirective *S) {
1092 VisitOMPExecutableDirective(S);
1093 VisitName(S->getDirectiveName().getName());
1097StmtProfiler::VisitOMPParallelForDirective(
const OMPParallelForDirective *S) {
1098 VisitOMPLoopDirective(S);
1101void StmtProfiler::VisitOMPParallelForSimdDirective(
1102 const OMPParallelForSimdDirective *S) {
1103 VisitOMPLoopDirective(S);
1106void StmtProfiler::VisitOMPParallelMasterDirective(
1107 const OMPParallelMasterDirective *S) {
1108 VisitOMPExecutableDirective(S);
1111void StmtProfiler::VisitOMPParallelMaskedDirective(
1112 const OMPParallelMaskedDirective *S) {
1113 VisitOMPExecutableDirective(S);
1116void StmtProfiler::VisitOMPParallelSectionsDirective(
1117 const OMPParallelSectionsDirective *S) {
1118 VisitOMPExecutableDirective(S);
1121void StmtProfiler::VisitOMPTaskDirective(
const OMPTaskDirective *S) {
1122 VisitOMPExecutableDirective(S);
1125void StmtProfiler::VisitOMPTaskyieldDirective(
const OMPTaskyieldDirective *S) {
1126 VisitOMPExecutableDirective(S);
1129void StmtProfiler::VisitOMPBarrierDirective(
const OMPBarrierDirective *S) {
1130 VisitOMPExecutableDirective(S);
1133void StmtProfiler::VisitOMPTaskwaitDirective(
const OMPTaskwaitDirective *S) {
1134 VisitOMPExecutableDirective(S);
1137void StmtProfiler::VisitOMPAssumeDirective(
const OMPAssumeDirective *S) {
1138 VisitOMPExecutableDirective(S);
1141void StmtProfiler::VisitOMPErrorDirective(
const OMPErrorDirective *S) {
1142 VisitOMPExecutableDirective(S);
1144void StmtProfiler::VisitOMPTaskgroupDirective(
const OMPTaskgroupDirective *S) {
1145 VisitOMPExecutableDirective(S);
1146 if (
const Expr *E = S->getReductionRef())
1150void StmtProfiler::VisitOMPFlushDirective(
const OMPFlushDirective *S) {
1151 VisitOMPExecutableDirective(S);
1154void StmtProfiler::VisitOMPDepobjDirective(
const OMPDepobjDirective *S) {
1155 VisitOMPExecutableDirective(S);
1158void StmtProfiler::VisitOMPScanDirective(
const OMPScanDirective *S) {
1159 VisitOMPExecutableDirective(S);
1162void StmtProfiler::VisitOMPOrderedDirective(
const OMPOrderedDirective *S) {
1163 VisitOMPExecutableDirective(S);
1166void StmtProfiler::VisitOMPAtomicDirective(
const OMPAtomicDirective *S) {
1167 VisitOMPExecutableDirective(S);
1170void StmtProfiler::VisitOMPTargetDirective(
const OMPTargetDirective *S) {
1171 VisitOMPExecutableDirective(S);
1174void StmtProfiler::VisitOMPTargetDataDirective(
const OMPTargetDataDirective *S) {
1175 VisitOMPExecutableDirective(S);
1178void StmtProfiler::VisitOMPTargetEnterDataDirective(
1179 const OMPTargetEnterDataDirective *S) {
1180 VisitOMPExecutableDirective(S);
1183void StmtProfiler::VisitOMPTargetExitDataDirective(
1184 const OMPTargetExitDataDirective *S) {
1185 VisitOMPExecutableDirective(S);
1188void StmtProfiler::VisitOMPTargetParallelDirective(
1189 const OMPTargetParallelDirective *S) {
1190 VisitOMPExecutableDirective(S);
1193void StmtProfiler::VisitOMPTargetParallelForDirective(
1194 const OMPTargetParallelForDirective *S) {
1195 VisitOMPExecutableDirective(S);
1198void StmtProfiler::VisitOMPTeamsDirective(
const OMPTeamsDirective *S) {
1199 VisitOMPExecutableDirective(S);
1202void StmtProfiler::VisitOMPCancellationPointDirective(
1203 const OMPCancellationPointDirective *S) {
1204 VisitOMPExecutableDirective(S);
1207void StmtProfiler::VisitOMPCancelDirective(
const OMPCancelDirective *S) {
1208 VisitOMPExecutableDirective(S);
1211void StmtProfiler::VisitOMPTaskLoopDirective(
const OMPTaskLoopDirective *S) {
1212 VisitOMPLoopDirective(S);
1215void StmtProfiler::VisitOMPTaskLoopSimdDirective(
1216 const OMPTaskLoopSimdDirective *S) {
1217 VisitOMPLoopDirective(S);
1220void StmtProfiler::VisitOMPMasterTaskLoopDirective(
1221 const OMPMasterTaskLoopDirective *S) {
1222 VisitOMPLoopDirective(S);
1225void StmtProfiler::VisitOMPMaskedTaskLoopDirective(
1226 const OMPMaskedTaskLoopDirective *S) {
1227 VisitOMPLoopDirective(S);
1230void StmtProfiler::VisitOMPMasterTaskLoopSimdDirective(
1231 const OMPMasterTaskLoopSimdDirective *S) {
1232 VisitOMPLoopDirective(S);
1235void StmtProfiler::VisitOMPMaskedTaskLoopSimdDirective(
1236 const OMPMaskedTaskLoopSimdDirective *S) {
1237 VisitOMPLoopDirective(S);
1240void StmtProfiler::VisitOMPParallelMasterTaskLoopDirective(
1241 const OMPParallelMasterTaskLoopDirective *S) {
1242 VisitOMPLoopDirective(S);
1245void StmtProfiler::VisitOMPParallelMaskedTaskLoopDirective(
1246 const OMPParallelMaskedTaskLoopDirective *S) {
1247 VisitOMPLoopDirective(S);
1250void StmtProfiler::VisitOMPParallelMasterTaskLoopSimdDirective(
1251 const OMPParallelMasterTaskLoopSimdDirective *S) {
1252 VisitOMPLoopDirective(S);
1255void StmtProfiler::VisitOMPParallelMaskedTaskLoopSimdDirective(
1256 const OMPParallelMaskedTaskLoopSimdDirective *S) {
1257 VisitOMPLoopDirective(S);
1260void StmtProfiler::VisitOMPDistributeDirective(
1261 const OMPDistributeDirective *S) {
1262 VisitOMPLoopDirective(S);
1265void OMPClauseProfiler::VisitOMPDistScheduleClause(
1266 const OMPDistScheduleClause *
C) {
1267 VisitOMPClauseWithPreInit(
C);
1268 if (
auto *S =
C->getChunkSize())
1269 Profiler->VisitStmt(S);
1272void OMPClauseProfiler::VisitOMPDefaultmapClause(
const OMPDefaultmapClause *) {}
1274void StmtProfiler::VisitOMPTargetUpdateDirective(
1275 const OMPTargetUpdateDirective *S) {
1276 VisitOMPExecutableDirective(S);
1279void StmtProfiler::VisitOMPDistributeParallelForDirective(
1280 const OMPDistributeParallelForDirective *S) {
1281 VisitOMPLoopDirective(S);
1284void StmtProfiler::VisitOMPDistributeParallelForSimdDirective(
1285 const OMPDistributeParallelForSimdDirective *S) {
1286 VisitOMPLoopDirective(S);
1289void StmtProfiler::VisitOMPDistributeSimdDirective(
1290 const OMPDistributeSimdDirective *S) {
1291 VisitOMPLoopDirective(S);
1294void StmtProfiler::VisitOMPTargetParallelForSimdDirective(
1295 const OMPTargetParallelForSimdDirective *S) {
1296 VisitOMPLoopDirective(S);
1299void StmtProfiler::VisitOMPTargetSimdDirective(
1300 const OMPTargetSimdDirective *S) {
1301 VisitOMPLoopDirective(S);
1304void StmtProfiler::VisitOMPTeamsDistributeDirective(
1305 const OMPTeamsDistributeDirective *S) {
1306 VisitOMPLoopDirective(S);
1309void StmtProfiler::VisitOMPTeamsDistributeSimdDirective(
1310 const OMPTeamsDistributeSimdDirective *S) {
1311 VisitOMPLoopDirective(S);
1314void StmtProfiler::VisitOMPTeamsDistributeParallelForSimdDirective(
1315 const OMPTeamsDistributeParallelForSimdDirective *S) {
1316 VisitOMPLoopDirective(S);
1319void StmtProfiler::VisitOMPTeamsDistributeParallelForDirective(
1320 const OMPTeamsDistributeParallelForDirective *S) {
1321 VisitOMPLoopDirective(S);
1324void StmtProfiler::VisitOMPTargetTeamsDirective(
1325 const OMPTargetTeamsDirective *S) {
1326 VisitOMPExecutableDirective(S);
1329void StmtProfiler::VisitOMPTargetTeamsDistributeDirective(
1330 const OMPTargetTeamsDistributeDirective *S) {
1331 VisitOMPLoopDirective(S);
1334void StmtProfiler::VisitOMPTargetTeamsDistributeParallelForDirective(
1335 const OMPTargetTeamsDistributeParallelForDirective *S) {
1336 VisitOMPLoopDirective(S);
1339void StmtProfiler::VisitOMPTargetTeamsDistributeParallelForSimdDirective(
1340 const OMPTargetTeamsDistributeParallelForSimdDirective *S) {
1341 VisitOMPLoopDirective(S);
1344void StmtProfiler::VisitOMPTargetTeamsDistributeSimdDirective(
1345 const OMPTargetTeamsDistributeSimdDirective *S) {
1346 VisitOMPLoopDirective(S);
1349void StmtProfiler::VisitOMPInteropDirective(
const OMPInteropDirective *S) {
1350 VisitOMPExecutableDirective(S);
1353void StmtProfiler::VisitOMPDispatchDirective(
const OMPDispatchDirective *S) {
1354 VisitOMPExecutableDirective(S);
1357void StmtProfiler::VisitOMPMaskedDirective(
const OMPMaskedDirective *S) {
1358 VisitOMPExecutableDirective(S);
1361void StmtProfiler::VisitOMPGenericLoopDirective(
1362 const OMPGenericLoopDirective *S) {
1363 VisitOMPLoopDirective(S);
1366void StmtProfiler::VisitOMPTeamsGenericLoopDirective(
1367 const OMPTeamsGenericLoopDirective *S) {
1368 VisitOMPLoopDirective(S);
1371void StmtProfiler::VisitOMPTargetTeamsGenericLoopDirective(
1372 const OMPTargetTeamsGenericLoopDirective *S) {
1373 VisitOMPLoopDirective(S);
1376void StmtProfiler::VisitOMPParallelGenericLoopDirective(
1377 const OMPParallelGenericLoopDirective *S) {
1378 VisitOMPLoopDirective(S);
1381void StmtProfiler::VisitOMPTargetParallelGenericLoopDirective(
1382 const OMPTargetParallelGenericLoopDirective *S) {
1383 VisitOMPLoopDirective(S);
1386void StmtProfiler::VisitExpr(
const Expr *S) {
1390void StmtProfiler::VisitConstantExpr(
const ConstantExpr *S) {
1395void StmtProfiler::VisitDeclRefExpr(
const DeclRefExpr *S) {
1407void StmtProfiler::VisitSYCLUniqueStableNameExpr(
1408 const SYCLUniqueStableNameExpr *S) {
1413void StmtProfiler::VisitUnresolvedSYCLKernelCallStmt(
1414 const UnresolvedSYCLKernelCallStmt *S) {
1418void StmtProfiler::VisitPredefinedExpr(
const PredefinedExpr *S) {
1423void StmtProfiler::VisitOpenACCAsteriskSizeExpr(
1424 const OpenACCAsteriskSizeExpr *S) {
1428void StmtProfiler::VisitIntegerLiteral(
const IntegerLiteral *S) {
1436 if (
auto BitIntT = T->
getAs<BitIntType>())
1437 BitIntT->Profile(ID);
1439 ID.AddInteger(T->
castAs<BuiltinType>()->getKind());
1442void StmtProfiler::VisitFixedPointLiteral(
const FixedPointLiteral *S) {
1445 ID.AddInteger(S->
getType()->
castAs<BuiltinType>()->getKind());
1448void StmtProfiler::VisitCharacterLiteral(
const CharacterLiteral *S) {
1450 ID.AddInteger(llvm::to_underlying(S->
getKind()));
1454void StmtProfiler::VisitFloatingLiteral(
const FloatingLiteral *S) {
1458 ID.AddInteger(S->
getType()->
castAs<BuiltinType>()->getKind());
1461void StmtProfiler::VisitImaginaryLiteral(
const ImaginaryLiteral *S) {
1465void StmtProfiler::VisitStringLiteral(
const StringLiteral *S) {
1468 ID.AddInteger(llvm::to_underlying(S->
getKind()));
1471void StmtProfiler::VisitParenExpr(
const ParenExpr *S) {
1475void StmtProfiler::VisitParenListExpr(
const ParenListExpr *S) {
1479void StmtProfiler::VisitUnaryOperator(
const UnaryOperator *S) {
1484void StmtProfiler::VisitOffsetOfExpr(
const OffsetOfExpr *S) {
1487 for (
unsigned i = 0; i < n; ++i) {
1513StmtProfiler::VisitUnaryExprOrTypeTraitExpr(
const UnaryExprOrTypeTraitExpr *S) {
1520void StmtProfiler::VisitArraySubscriptExpr(
const ArraySubscriptExpr *S) {
1524void StmtProfiler::VisitMatrixSingleSubscriptExpr(
1525 const MatrixSingleSubscriptExpr *S) {
1529void StmtProfiler::VisitMatrixSubscriptExpr(
const MatrixSubscriptExpr *S) {
1533void StmtProfiler::VisitArraySectionExpr(
const ArraySectionExpr *S) {
1537void StmtProfiler::VisitOMPArrayShapingExpr(
const OMPArrayShapingExpr *S) {
1541void StmtProfiler::VisitOMPIteratorExpr(
const OMPIteratorExpr *S) {
1547void StmtProfiler::VisitCallExpr(
const CallExpr *S) {
1551void StmtProfiler::VisitMemberExpr(
const MemberExpr *S) {
1559void StmtProfiler::VisitCompoundLiteralExpr(
const CompoundLiteralExpr *S) {
1564void StmtProfiler::VisitCastExpr(
const CastExpr *S) {
1568void StmtProfiler::VisitImplicitCastExpr(
const ImplicitCastExpr *S) {
1573void StmtProfiler::VisitExplicitCastExpr(
const ExplicitCastExpr *S) {
1578void StmtProfiler::VisitCStyleCastExpr(
const CStyleCastExpr *S) {
1579 VisitExplicitCastExpr(S);
1582void StmtProfiler::VisitBinaryOperator(
const BinaryOperator *S) {
1588StmtProfiler::VisitCompoundAssignOperator(
const CompoundAssignOperator *S) {
1589 VisitBinaryOperator(S);
1592void StmtProfiler::VisitConditionalOperator(
const ConditionalOperator *S) {
1596void StmtProfiler::VisitBinaryConditionalOperator(
1597 const BinaryConditionalOperator *S) {
1601void StmtProfiler::VisitAddrLabelExpr(
const AddrLabelExpr *S) {
1606void StmtProfiler::VisitStmtExpr(
const StmtExpr *S) {
1610void StmtProfiler::VisitShuffleVectorExpr(
const ShuffleVectorExpr *S) {
1614void StmtProfiler::VisitConvertVectorExpr(
const ConvertVectorExpr *S) {
1618void StmtProfiler::VisitChooseExpr(
const ChooseExpr *S) {
1622void StmtProfiler::VisitGNUNullExpr(
const GNUNullExpr *S) {
1626void StmtProfiler::VisitVAArgExpr(
const VAArgExpr *S) {
1630void StmtProfiler::VisitInitListExpr(
const InitListExpr *S) {
1639void StmtProfiler::VisitDesignatedInitExpr(
const DesignatedInitExpr *S) {
1642 for (
const DesignatedInitExpr::Designator &D : S->
designators()) {
1643 if (D.isFieldDesignator()) {
1645 VisitName(D.getFieldName());
1649 if (D.isArrayDesignator()) {
1652 assert(D.isArrayRangeDesignator());
1655 ID.AddInteger(D.getArrayIndex());
1661void StmtProfiler::VisitDesignatedInitUpdateExpr(
1662 const DesignatedInitUpdateExpr *S) {
1663 llvm_unreachable(
"Unexpected DesignatedInitUpdateExpr in syntactic form of "
1667void StmtProfiler::VisitArrayInitLoopExpr(
const ArrayInitLoopExpr *S) {
1671void StmtProfiler::VisitArrayInitIndexExpr(
const ArrayInitIndexExpr *S) {
1675void StmtProfiler::VisitNoInitExpr(
const NoInitExpr *S) {
1676 llvm_unreachable(
"Unexpected NoInitExpr in syntactic form of initializer");
1679void StmtProfiler::VisitImplicitValueInitExpr(
const ImplicitValueInitExpr *S) {
1683void StmtProfiler::VisitExtVectorElementExpr(
const ExtVectorElementExpr *S) {
1688void StmtProfiler::VisitMatrixElementExpr(
const MatrixElementExpr *S) {
1693void StmtProfiler::VisitBlockExpr(
const BlockExpr *S) {
1698void StmtProfiler::VisitGenericSelectionExpr(
const GenericSelectionExpr *S) {
1702 QualType T = Assoc.getType();
1704 ID.AddPointer(
nullptr);
1707 VisitExpr(Assoc.getAssociationExpr());
1711void StmtProfiler::VisitPseudoObjectExpr(
const PseudoObjectExpr *S) {
1716 if (
const OpaqueValueExpr *OVE = dyn_cast<OpaqueValueExpr>(*i))
1717 Visit(OVE->getSourceExpr());
1720void StmtProfiler::VisitAtomicExpr(
const AtomicExpr *S) {
1722 ID.AddInteger(S->
getOp());
1725void StmtProfiler::VisitConceptSpecializationExpr(
1726 const ConceptSpecializationExpr *S) {
1730 VisitTemplateArgument(Arg);
1733void StmtProfiler::VisitRequiresExpr(
const RequiresExpr *S) {
1737 VisitDecl(LocalParam);
1740 if (
auto *TypeReq = dyn_cast<concepts::TypeRequirement>(Req)) {
1742 ID.AddBoolean(TypeReq->isSubstitutionFailure());
1743 if (!TypeReq->isSubstitutionFailure())
1744 VisitType(TypeReq->getType()->getType());
1745 }
else if (
auto *ExprReq = dyn_cast<concepts::ExprRequirement>(Req)) {
1747 ID.AddBoolean(ExprReq->isExprSubstitutionFailure());
1748 if (!ExprReq->isExprSubstitutionFailure())
1749 Visit(ExprReq->getExpr());
1754 ID.AddBoolean(ExprReq->getNoexceptLoc().isValid());
1755 const concepts::ExprRequirement::ReturnTypeRequirement &RetReq =
1756 ExprReq->getReturnTypeRequirement();
1769 ID.AddBoolean(NestedReq->hasInvalidConstraint());
1770 if (!NestedReq->hasInvalidConstraint())
1771 Visit(NestedReq->getConstraintExpr());
1779 unsigned &NumArgs) {
1785 case OO_Array_Delete:
1787 case OO_Conditional:
1789 llvm_unreachable(
"Invalid operator call kind");
1794 return Stmt::UnaryOperatorClass;
1798 return Stmt::BinaryOperatorClass;
1803 return Stmt::UnaryOperatorClass;
1807 return Stmt::BinaryOperatorClass;
1812 return Stmt::UnaryOperatorClass;
1816 return Stmt::BinaryOperatorClass;
1820 return Stmt::BinaryOperatorClass;
1824 return Stmt::BinaryOperatorClass;
1828 return Stmt::BinaryOperatorClass;
1832 UnaryOp = UO_AddrOf;
1833 return Stmt::UnaryOperatorClass;
1837 return Stmt::BinaryOperatorClass;
1841 return Stmt::BinaryOperatorClass;
1845 return Stmt::UnaryOperatorClass;
1849 return Stmt::UnaryOperatorClass;
1852 BinaryOp = BO_Assign;
1853 return Stmt::BinaryOperatorClass;
1857 return Stmt::BinaryOperatorClass;
1861 return Stmt::BinaryOperatorClass;
1864 BinaryOp = BO_AddAssign;
1865 return Stmt::CompoundAssignOperatorClass;
1868 BinaryOp = BO_SubAssign;
1869 return Stmt::CompoundAssignOperatorClass;
1872 BinaryOp = BO_MulAssign;
1873 return Stmt::CompoundAssignOperatorClass;
1876 BinaryOp = BO_DivAssign;
1877 return Stmt::CompoundAssignOperatorClass;
1879 case OO_PercentEqual:
1880 BinaryOp = BO_RemAssign;
1881 return Stmt::CompoundAssignOperatorClass;
1884 BinaryOp = BO_XorAssign;
1885 return Stmt::CompoundAssignOperatorClass;
1888 BinaryOp = BO_AndAssign;
1889 return Stmt::CompoundAssignOperatorClass;
1892 BinaryOp = BO_OrAssign;
1893 return Stmt::CompoundAssignOperatorClass;
1897 return Stmt::BinaryOperatorClass;
1899 case OO_GreaterGreater:
1901 return Stmt::BinaryOperatorClass;
1903 case OO_LessLessEqual:
1904 BinaryOp = BO_ShlAssign;
1905 return Stmt::CompoundAssignOperatorClass;
1907 case OO_GreaterGreaterEqual:
1908 BinaryOp = BO_ShrAssign;
1909 return Stmt::CompoundAssignOperatorClass;
1913 return Stmt::BinaryOperatorClass;
1915 case OO_ExclaimEqual:
1917 return Stmt::BinaryOperatorClass;
1921 return Stmt::BinaryOperatorClass;
1923 case OO_GreaterEqual:
1925 return Stmt::BinaryOperatorClass;
1929 return Stmt::BinaryOperatorClass;
1933 return Stmt::BinaryOperatorClass;
1937 return Stmt::BinaryOperatorClass;
1940 UnaryOp = NumArgs == 1 ? UO_PreInc : UO_PostInc;
1942 return Stmt::UnaryOperatorClass;
1945 UnaryOp = NumArgs == 1 ? UO_PreDec : UO_PostDec;
1947 return Stmt::UnaryOperatorClass;
1950 BinaryOp = BO_Comma;
1951 return Stmt::BinaryOperatorClass;
1954 BinaryOp = BO_PtrMemI;
1955 return Stmt::BinaryOperatorClass;
1958 return Stmt::ArraySubscriptExprClass;
1961 return Stmt::CallExprClass;
1964 UnaryOp = UO_Coawait;
1965 return Stmt::UnaryOperatorClass;
1968 llvm_unreachable(
"Invalid overloaded operator expression");
1971#if defined(_MSC_VER) && !defined(__clang__)
1976#pragma optimize("", off)
1980void StmtProfiler::VisitCXXOperatorCallExpr(
const CXXOperatorCallExpr *S) {
1988 return Visit(S->
getArg(0));
1996 for (
unsigned I = 0; I != NumArgs; ++I)
1998 if (SC == Stmt::UnaryOperatorClass)
1999 ID.AddInteger(UnaryOp);
2000 else if (SC == Stmt::BinaryOperatorClass ||
2001 SC == Stmt::CompoundAssignOperatorClass)
2002 ID.AddInteger(BinaryOp);
2004 assert(SC == Stmt::ArraySubscriptExprClass || SC == Stmt::CallExprClass);
2013void StmtProfiler::VisitCXXRewrittenBinaryOperator(
2014 const CXXRewrittenBinaryOperator *S) {
2018 "resolved rewritten operator should never be type-dependent");
2023#if defined(_MSC_VER) && !defined(__clang__)
2025#pragma optimize("", on)
2029void StmtProfiler::VisitCXXMemberCallExpr(
const CXXMemberCallExpr *S) {
2033void StmtProfiler::VisitCUDAKernelCallExpr(
const CUDAKernelCallExpr *S) {
2037void StmtProfiler::VisitAsTypeExpr(
const AsTypeExpr *S) {
2041void StmtProfiler::VisitCXXNamedCastExpr(
const CXXNamedCastExpr *S) {
2042 VisitExplicitCastExpr(S);
2045void StmtProfiler::VisitCXXStaticCastExpr(
const CXXStaticCastExpr *S) {
2046 VisitCXXNamedCastExpr(S);
2049void StmtProfiler::VisitCXXDynamicCastExpr(
const CXXDynamicCastExpr *S) {
2050 VisitCXXNamedCastExpr(S);
2054StmtProfiler::VisitCXXReinterpretCastExpr(
const CXXReinterpretCastExpr *S) {
2055 VisitCXXNamedCastExpr(S);
2058void StmtProfiler::VisitCXXConstCastExpr(
const CXXConstCastExpr *S) {
2059 VisitCXXNamedCastExpr(S);
2062void StmtProfiler::VisitBuiltinBitCastExpr(
const BuiltinBitCastExpr *S) {
2067void StmtProfiler::VisitCXXAddrspaceCastExpr(
const CXXAddrspaceCastExpr *S) {
2068 VisitCXXNamedCastExpr(S);
2071void StmtProfiler::VisitUserDefinedLiteral(
const UserDefinedLiteral *S) {
2075void StmtProfiler::VisitCXXBoolLiteralExpr(
const CXXBoolLiteralExpr *S) {
2080void StmtProfiler::VisitCXXNullPtrLiteralExpr(
const CXXNullPtrLiteralExpr *S) {
2084void StmtProfiler::VisitCXXStdInitializerListExpr(
2085 const CXXStdInitializerListExpr *S) {
2089void StmtProfiler::VisitCXXTypeidExpr(
const CXXTypeidExpr *S) {
2095void StmtProfiler::VisitCXXUuidofExpr(
const CXXUuidofExpr *S) {
2101void StmtProfiler::VisitMSPropertyRefExpr(
const MSPropertyRefExpr *S) {
2106void StmtProfiler::VisitMSPropertySubscriptExpr(
2107 const MSPropertySubscriptExpr *S) {
2111void StmtProfiler::VisitCXXThisExpr(
const CXXThisExpr *S) {
2117void StmtProfiler::VisitCXXThrowExpr(
const CXXThrowExpr *S) {
2121void StmtProfiler::VisitCXXDefaultArgExpr(
const CXXDefaultArgExpr *S) {
2126void StmtProfiler::VisitCXXDefaultInitExpr(
const CXXDefaultInitExpr *S) {
2131void StmtProfiler::VisitCXXBindTemporaryExpr(
const CXXBindTemporaryExpr *S) {
2137void StmtProfiler::VisitCXXConstructExpr(
const CXXConstructExpr *S) {
2143void StmtProfiler::VisitCXXInheritedCtorInitExpr(
2144 const CXXInheritedCtorInitExpr *S) {
2149void StmtProfiler::VisitCXXFunctionalCastExpr(
const CXXFunctionalCastExpr *S) {
2150 VisitExplicitCastExpr(S);
2154StmtProfiler::VisitCXXTemporaryObjectExpr(
const CXXTemporaryObjectExpr *S) {
2155 VisitCXXConstructExpr(S);
2159StmtProfiler::VisitLambdaExpr(
const LambdaExpr *S) {
2160 if (!ProfileLambdaExpr) {
2164 VisitStmtNoChildren(S);
2175 ID.AddInteger(
Capture.getCaptureKind());
2176 if (
Capture.capturesVariable())
2177 VisitDecl(
Capture.getCapturedVar());
2186 for (
auto *SubDecl : Lambda->
decls()) {
2187 FunctionDecl *
Call =
nullptr;
2188 if (
auto *FTD = dyn_cast<FunctionTemplateDecl>(SubDecl))
2189 Call = FTD->getTemplatedDecl();
2190 else if (
auto *FD = dyn_cast<FunctionDecl>(SubDecl))
2201void StmtProfiler::VisitCXXReflectExpr(
const CXXReflectExpr *E) {
2203 assert(
false &&
"not implemented yet");
2207StmtProfiler::VisitCXXScalarValueInitExpr(
const CXXScalarValueInitExpr *S) {
2211void StmtProfiler::VisitCXXDeleteExpr(
const CXXDeleteExpr *S) {
2218void StmtProfiler::VisitCXXNewExpr(
const CXXNewExpr *S) {
2231StmtProfiler::VisitCXXPseudoDestructorExpr(
const CXXPseudoDestructorExpr *S) {
2245void StmtProfiler::VisitOverloadExpr(
const OverloadExpr *S) {
2247 bool DescribingDependentVarTemplate =
2249 if (DescribingDependentVarTemplate) {
2253 VisitName(S->
getName(),
true);
2261StmtProfiler::VisitUnresolvedLookupExpr(
const UnresolvedLookupExpr *S) {
2262 VisitOverloadExpr(S);
2265void StmtProfiler::VisitTypeTraitExpr(
const TypeTraitExpr *S) {
2269 for (
unsigned I = 0, N = S->
getNumArgs(); I != N; ++I)
2273void StmtProfiler::VisitArrayTypeTraitExpr(
const ArrayTypeTraitExpr *S) {
2279void StmtProfiler::VisitExpressionTraitExpr(
const ExpressionTraitExpr *S) {
2285void StmtProfiler::VisitDependentScopeDeclRefExpr(
2286 const DependentScopeDeclRefExpr *S) {
2295void StmtProfiler::VisitExprWithCleanups(
const ExprWithCleanups *S) {
2299void StmtProfiler::VisitCXXUnresolvedConstructExpr(
2300 const CXXUnresolvedConstructExpr *S) {
2306void StmtProfiler::VisitCXXDependentScopeMemberExpr(
2307 const CXXDependentScopeMemberExpr *S) {
2320void StmtProfiler::VisitUnresolvedMemberExpr(
const UnresolvedMemberExpr *S) {
2333void StmtProfiler::VisitCXXNoexceptExpr(
const CXXNoexceptExpr *S) {
2337void StmtProfiler::VisitPackExpansionExpr(
const PackExpansionExpr *S) {
2341void StmtProfiler::VisitSizeOfPackExpr(
const SizeOfPackExpr *S) {
2345 ID.AddInteger(Args.size());
2346 for (
const auto &TA : Args)
2347 VisitTemplateArgument(TA);
2354void StmtProfiler::VisitPackIndexingExpr(
const PackIndexingExpr *E) {
2366void StmtProfiler::VisitSubstNonTypeTemplateParmPackExpr(
2367 const SubstNonTypeTemplateParmPackExpr *S) {
2373void StmtProfiler::VisitSubstNonTypeTemplateParmExpr(
2374 const SubstNonTypeTemplateParmExpr *E) {
2379void StmtProfiler::VisitFunctionParmPackExpr(
const FunctionParmPackExpr *S) {
2387void StmtProfiler::VisitMaterializeTemporaryExpr(
2388 const MaterializeTemporaryExpr *S) {
2392void StmtProfiler::VisitCXXFoldExpr(
const CXXFoldExpr *S) {
2397void StmtProfiler::VisitCXXParenListInitExpr(
const CXXParenListInitExpr *S) {
2401void StmtProfiler::VisitCoroutineBodyStmt(
const CoroutineBodyStmt *S) {
2405void StmtProfiler::VisitCoreturnStmt(
const CoreturnStmt *S) {
2409void StmtProfiler::VisitCoawaitExpr(
const CoawaitExpr *S) {
2413void StmtProfiler::VisitDependentCoawaitExpr(
const DependentCoawaitExpr *S) {
2417void StmtProfiler::VisitCoyieldExpr(
const CoyieldExpr *S) {
2421void StmtProfiler::VisitOpaqueValueExpr(
const OpaqueValueExpr *E) {
2425void StmtProfiler::VisitSourceLocExpr(
const SourceLocExpr *E) {
2429void StmtProfiler::VisitEmbedExpr(
const EmbedExpr *E) { VisitExpr(E); }
2431void StmtProfiler::VisitRecoveryExpr(
const RecoveryExpr *E) { VisitExpr(E); }
2433void StmtProfiler::VisitObjCStringLiteral(
const ObjCStringLiteral *S) {
2437void StmtProfiler::VisitObjCBoxedExpr(
const ObjCBoxedExpr *E) {
2441void StmtProfiler::VisitObjCArrayLiteral(
const ObjCArrayLiteral *E) {
2445void StmtProfiler::VisitObjCDictionaryLiteral(
const ObjCDictionaryLiteral *E) {
2449void StmtProfiler::VisitObjCEncodeExpr(
const ObjCEncodeExpr *S) {
2454void StmtProfiler::VisitObjCSelectorExpr(
const ObjCSelectorExpr *S) {
2459void StmtProfiler::VisitObjCProtocolExpr(
const ObjCProtocolExpr *S) {
2464void StmtProfiler::VisitObjCIvarRefExpr(
const ObjCIvarRefExpr *S) {
2471void StmtProfiler::VisitObjCPropertyRefExpr(
const ObjCPropertyRefExpr *S) {
2485void StmtProfiler::VisitObjCSubscriptRefExpr(
const ObjCSubscriptRefExpr *S) {
2491void StmtProfiler::VisitObjCMessageExpr(
const ObjCMessageExpr *S) {
2497void StmtProfiler::VisitObjCIsaExpr(
const ObjCIsaExpr *S) {
2502void StmtProfiler::VisitObjCBoolLiteralExpr(
const ObjCBoolLiteralExpr *S) {
2507void StmtProfiler::VisitObjCIndirectCopyRestoreExpr(
2508 const ObjCIndirectCopyRestoreExpr *S) {
2513void StmtProfiler::VisitObjCBridgedCastExpr(
const ObjCBridgedCastExpr *S) {
2514 VisitExplicitCastExpr(S);
2518void StmtProfiler::VisitObjCAvailabilityCheckExpr(
2519 const ObjCAvailabilityCheckExpr *S) {
2523void StmtProfiler::VisitTemplateArguments(
const TemplateArgumentLoc *Args,
2525 ID.AddInteger(NumArgs);
2526 for (
unsigned I = 0; I != NumArgs; ++I)
2530void StmtProfiler::VisitTemplateArgument(
const TemplateArgument &Arg) {
2573 VisitTemplateArgument(P);
2579class OpenACCClauseProfiler
2580 :
public OpenACCClauseVisitor<OpenACCClauseProfiler> {
2581 StmtProfiler &Profiler;
2584 OpenACCClauseProfiler(StmtProfiler &P) : Profiler(P) {}
2586 void VisitOpenACCClauseList(ArrayRef<const OpenACCClause *> Clauses) {
2587 for (
const OpenACCClause *Clause : Clauses) {
2594 void VisitClauseWithVarList(
const OpenACCClauseWithVarList &Clause) {
2596 Profiler.VisitStmt(E);
2599#define VISIT_CLAUSE(CLAUSE_NAME) \
2600 void Visit##CLAUSE_NAME##Clause(const OpenACC##CLAUSE_NAME##Clause &Clause);
2602#include "clang/Basic/OpenACCClauses.def"
2606void OpenACCClauseProfiler::VisitDefaultClause(
2607 const OpenACCDefaultClause &Clause) {}
2609void OpenACCClauseProfiler::VisitIfClause(
const OpenACCIfClause &Clause) {
2611 "if clause requires a valid condition expr");
2615void OpenACCClauseProfiler::VisitCopyClause(
const OpenACCCopyClause &Clause) {
2616 VisitClauseWithVarList(Clause);
2619void OpenACCClauseProfiler::VisitLinkClause(
const OpenACCLinkClause &Clause) {
2620 VisitClauseWithVarList(Clause);
2623void OpenACCClauseProfiler::VisitDeviceResidentClause(
2624 const OpenACCDeviceResidentClause &Clause) {
2625 VisitClauseWithVarList(Clause);
2628void OpenACCClauseProfiler::VisitCopyInClause(
2629 const OpenACCCopyInClause &Clause) {
2630 VisitClauseWithVarList(Clause);
2633void OpenACCClauseProfiler::VisitCopyOutClause(
2634 const OpenACCCopyOutClause &Clause) {
2635 VisitClauseWithVarList(Clause);
2638void OpenACCClauseProfiler::VisitCreateClause(
2639 const OpenACCCreateClause &Clause) {
2640 VisitClauseWithVarList(Clause);
2643void OpenACCClauseProfiler::VisitHostClause(
const OpenACCHostClause &Clause) {
2644 VisitClauseWithVarList(Clause);
2647void OpenACCClauseProfiler::VisitDeviceClause(
2648 const OpenACCDeviceClause &Clause) {
2649 VisitClauseWithVarList(Clause);
2652void OpenACCClauseProfiler::VisitSelfClause(
const OpenACCSelfClause &Clause) {
2658 Profiler.VisitStmt(E);
2662void OpenACCClauseProfiler::VisitFinalizeClause(
2663 const OpenACCFinalizeClause &Clause) {}
2665void OpenACCClauseProfiler::VisitIfPresentClause(
2666 const OpenACCIfPresentClause &Clause) {}
2668void OpenACCClauseProfiler::VisitNumGangsClause(
2669 const OpenACCNumGangsClause &Clause) {
2671 Profiler.VisitStmt(E);
2674void OpenACCClauseProfiler::VisitTileClause(
const OpenACCTileClause &Clause) {
2676 Profiler.VisitStmt(E);
2679void OpenACCClauseProfiler::VisitNumWorkersClause(
2680 const OpenACCNumWorkersClause &Clause) {
2681 assert(Clause.
hasIntExpr() &&
"num_workers clause requires a valid int expr");
2685void OpenACCClauseProfiler::VisitCollapseClause(
2686 const OpenACCCollapseClause &Clause) {
2687 assert(Clause.
getLoopCount() &&
"collapse clause requires a valid int expr");
2691void OpenACCClauseProfiler::VisitPrivateClause(
2692 const OpenACCPrivateClause &Clause) {
2693 VisitClauseWithVarList(Clause);
2696 Profiler.VisitDecl(Recipe.AllocaDecl);
2700void OpenACCClauseProfiler::VisitFirstPrivateClause(
2701 const OpenACCFirstPrivateClause &Clause) {
2702 VisitClauseWithVarList(Clause);
2705 Profiler.VisitDecl(Recipe.AllocaDecl);
2706 Profiler.VisitDecl(Recipe.InitFromTemporary);
2710void OpenACCClauseProfiler::VisitAttachClause(
2711 const OpenACCAttachClause &Clause) {
2712 VisitClauseWithVarList(Clause);
2715void OpenACCClauseProfiler::VisitDetachClause(
2716 const OpenACCDetachClause &Clause) {
2717 VisitClauseWithVarList(Clause);
2720void OpenACCClauseProfiler::VisitDeleteClause(
2721 const OpenACCDeleteClause &Clause) {
2722 VisitClauseWithVarList(Clause);
2725void OpenACCClauseProfiler::VisitDevicePtrClause(
2726 const OpenACCDevicePtrClause &Clause) {
2727 VisitClauseWithVarList(Clause);
2730void OpenACCClauseProfiler::VisitNoCreateClause(
2731 const OpenACCNoCreateClause &Clause) {
2732 VisitClauseWithVarList(Clause);
2735void OpenACCClauseProfiler::VisitPresentClause(
2736 const OpenACCPresentClause &Clause) {
2737 VisitClauseWithVarList(Clause);
2740void OpenACCClauseProfiler::VisitUseDeviceClause(
2741 const OpenACCUseDeviceClause &Clause) {
2742 VisitClauseWithVarList(Clause);
2745void OpenACCClauseProfiler::VisitVectorLengthClause(
2746 const OpenACCVectorLengthClause &Clause) {
2748 "vector_length clause requires a valid int expr");
2752void OpenACCClauseProfiler::VisitAsyncClause(
const OpenACCAsyncClause &Clause) {
2757void OpenACCClauseProfiler::VisitDeviceNumClause(
2758 const OpenACCDeviceNumClause &Clause) {
2762void OpenACCClauseProfiler::VisitDefaultAsyncClause(
2763 const OpenACCDefaultAsyncClause &Clause) {
2767void OpenACCClauseProfiler::VisitWorkerClause(
2768 const OpenACCWorkerClause &Clause) {
2773void OpenACCClauseProfiler::VisitVectorClause(
2774 const OpenACCVectorClause &Clause) {
2779void OpenACCClauseProfiler::VisitWaitClause(
const OpenACCWaitClause &Clause) {
2783 Profiler.VisitStmt(E);
2787void OpenACCClauseProfiler::VisitDeviceTypeClause(
2788 const OpenACCDeviceTypeClause &Clause) {}
2790void OpenACCClauseProfiler::VisitAutoClause(
const OpenACCAutoClause &Clause) {}
2792void OpenACCClauseProfiler::VisitIndependentClause(
2793 const OpenACCIndependentClause &Clause) {}
2795void OpenACCClauseProfiler::VisitSeqClause(
const OpenACCSeqClause &Clause) {}
2796void OpenACCClauseProfiler::VisitNoHostClause(
2797 const OpenACCNoHostClause &Clause) {}
2799void OpenACCClauseProfiler::VisitGangClause(
const OpenACCGangClause &Clause) {
2800 for (
unsigned I = 0; I < Clause.
getNumExprs(); ++I) {
2801 Profiler.VisitStmt(Clause.
getExpr(I).second);
2805void OpenACCClauseProfiler::VisitReductionClause(
2806 const OpenACCReductionClause &Clause) {
2807 VisitClauseWithVarList(Clause);
2810 Profiler.VisitDecl(Recipe.AllocaDecl);
2815 static_assert(
sizeof(OpenACCReductionRecipe::CombinerRecipe) ==
2817 for (
auto &CombinerRecipe : Recipe.CombinerRecipes) {
2818 if (CombinerRecipe.Op) {
2819 Profiler.VisitDecl(CombinerRecipe.LHS);
2820 Profiler.VisitDecl(CombinerRecipe.RHS);
2821 Profiler.VisitStmt(CombinerRecipe.Op);
2827void OpenACCClauseProfiler::VisitBindClause(
const OpenACCBindClause &Clause) {
2828 assert(
false &&
"not implemented... what can we do about our expr?");
2832void StmtProfiler::VisitOpenACCComputeConstruct(
2837 OpenACCClauseProfiler P{*
this};
2838 P.VisitOpenACCClauseList(S->clauses());
2841void StmtProfiler::VisitOpenACCLoopConstruct(
const OpenACCLoopConstruct *S) {
2845 OpenACCClauseProfiler P{*
this};
2846 P.VisitOpenACCClauseList(S->clauses());
2849void StmtProfiler::VisitOpenACCCombinedConstruct(
2850 const OpenACCCombinedConstruct *S) {
2854 OpenACCClauseProfiler P{*
this};
2855 P.VisitOpenACCClauseList(S->clauses());
2858void StmtProfiler::VisitOpenACCDataConstruct(
const OpenACCDataConstruct *S) {
2861 OpenACCClauseProfiler P{*
this};
2862 P.VisitOpenACCClauseList(S->clauses());
2865void StmtProfiler::VisitOpenACCEnterDataConstruct(
2866 const OpenACCEnterDataConstruct *S) {
2869 OpenACCClauseProfiler P{*
this};
2870 P.VisitOpenACCClauseList(S->clauses());
2873void StmtProfiler::VisitOpenACCExitDataConstruct(
2874 const OpenACCExitDataConstruct *S) {
2877 OpenACCClauseProfiler P{*
this};
2878 P.VisitOpenACCClauseList(S->clauses());
2881void StmtProfiler::VisitOpenACCHostDataConstruct(
2882 const OpenACCHostDataConstruct *S) {
2885 OpenACCClauseProfiler P{*
this};
2886 P.VisitOpenACCClauseList(S->clauses());
2889void StmtProfiler::VisitOpenACCWaitConstruct(
const OpenACCWaitConstruct *S) {
2893 OpenACCClauseProfiler P{*
this};
2894 P.VisitOpenACCClauseList(S->clauses());
2897void StmtProfiler::VisitOpenACCCacheConstruct(
const OpenACCCacheConstruct *S) {
2902void StmtProfiler::VisitOpenACCInitConstruct(
const OpenACCInitConstruct *S) {
2904 OpenACCClauseProfiler P{*
this};
2905 P.VisitOpenACCClauseList(S->clauses());
2908void StmtProfiler::VisitOpenACCShutdownConstruct(
2909 const OpenACCShutdownConstruct *S) {
2911 OpenACCClauseProfiler P{*
this};
2912 P.VisitOpenACCClauseList(S->clauses());
2915void StmtProfiler::VisitOpenACCSetConstruct(
const OpenACCSetConstruct *S) {
2917 OpenACCClauseProfiler P{*
this};
2918 P.VisitOpenACCClauseList(S->clauses());
2921void StmtProfiler::VisitOpenACCUpdateConstruct(
2922 const OpenACCUpdateConstruct *S) {
2924 OpenACCClauseProfiler P{*
this};
2925 P.VisitOpenACCClauseList(S->clauses());
2928void StmtProfiler::VisitOpenACCAtomicConstruct(
2929 const OpenACCAtomicConstruct *S) {
2931 OpenACCClauseProfiler P{*
this};
2932 P.VisitOpenACCClauseList(S->clauses());
2935void StmtProfiler::VisitHLSLOutArgExpr(
const HLSLOutArgExpr *S) {
2940 bool Canonical,
bool ProfileLambdaExpr)
const {
2941 StmtProfilerWithPointers Profiler(ID, Context, Canonical, ProfileLambdaExpr);
2942 Profiler.Visit(
this);
2947 StmtProfilerWithoutPointers Profiler(ID, Hash);
2948 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.