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;
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())
157 T = Context.getCanonicalType(
T);
159 ID.AddPointer(
T.getAsOpaquePtr());
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::VisitGCCAsmStmt(
const GCCAsmStmt *S) {
337 for (
unsigned I = 0, N = S->
getNumInputs(); I != N; ++I) {
345 for (
auto *L : S->
labels())
346 VisitDecl(L->getLabel());
349void StmtProfiler::VisitMSAsmStmt(
const MSAsmStmt *S) {
354void StmtProfiler::VisitCXXCatchStmt(
const CXXCatchStmt *S) {
359void StmtProfiler::VisitCXXTryStmt(
const CXXTryStmt *S) {
363void StmtProfiler::VisitCXXForRangeStmt(
const CXXForRangeStmt *S) {
367void StmtProfiler::VisitMSDependentExistsStmt(
const MSDependentExistsStmt *S) {
374void StmtProfiler::VisitSEHTryStmt(
const SEHTryStmt *S) {
378void StmtProfiler::VisitSEHFinallyStmt(
const SEHFinallyStmt *S) {
382void StmtProfiler::VisitSEHExceptStmt(
const SEHExceptStmt *S) {
386void StmtProfiler::VisitSEHLeaveStmt(
const SEHLeaveStmt *S) {
390void StmtProfiler::VisitCapturedStmt(
const CapturedStmt *S) {
394void StmtProfiler::VisitSYCLKernelCallStmt(
const SYCLKernelCallStmt *S) {
398void StmtProfiler::VisitObjCForCollectionStmt(
const ObjCForCollectionStmt *S) {
402void StmtProfiler::VisitObjCAtCatchStmt(
const ObjCAtCatchStmt *S) {
409void StmtProfiler::VisitObjCAtFinallyStmt(
const ObjCAtFinallyStmt *S) {
413void StmtProfiler::VisitObjCAtTryStmt(
const ObjCAtTryStmt *S) {
418StmtProfiler::VisitObjCAtSynchronizedStmt(
const ObjCAtSynchronizedStmt *S) {
422void StmtProfiler::VisitObjCAtThrowStmt(
const ObjCAtThrowStmt *S) {
427StmtProfiler::VisitObjCAutoreleasePoolStmt(
const ObjCAutoreleasePoolStmt *S) {
432class OMPClauseProfiler :
public ConstOMPClauseVisitor<OMPClauseProfiler> {
433 StmtProfiler *Profiler;
435 template <
typename T>
436 void VisitOMPClauseList(
T *Node);
439 OMPClauseProfiler(StmtProfiler *P) : Profiler(P) { }
440#define GEN_CLANG_CLAUSE_CLASS
441#define CLAUSE_CLASS(Enum, Str, Class) void Visit##Class(const Class *C);
442#include "llvm/Frontend/OpenMP/OMP.inc"
447void OMPClauseProfiler::VisitOMPClauseWithPreInit(
448 const OMPClauseWithPreInit *
C) {
449 if (
auto *S =
C->getPreInitStmt())
450 Profiler->VisitStmt(S);
453void OMPClauseProfiler::VisitOMPClauseWithPostUpdate(
454 const OMPClauseWithPostUpdate *
C) {
455 VisitOMPClauseWithPreInit(
C);
456 if (
auto *E =
C->getPostUpdateExpr())
457 Profiler->VisitStmt(E);
460void OMPClauseProfiler::VisitOMPIfClause(
const OMPIfClause *
C) {
461 VisitOMPClauseWithPreInit(
C);
462 if (
C->getCondition())
463 Profiler->VisitStmt(
C->getCondition());
466void OMPClauseProfiler::VisitOMPFinalClause(
const OMPFinalClause *
C) {
467 VisitOMPClauseWithPreInit(
C);
468 if (
C->getCondition())
469 Profiler->VisitStmt(
C->getCondition());
472void OMPClauseProfiler::VisitOMPNumThreadsClause(
const OMPNumThreadsClause *
C) {
473 VisitOMPClauseWithPreInit(
C);
474 if (
C->getNumThreads())
475 Profiler->VisitStmt(
C->getNumThreads());
478void OMPClauseProfiler::VisitOMPAlignClause(
const OMPAlignClause *
C) {
479 if (
C->getAlignment())
480 Profiler->VisitStmt(
C->getAlignment());
483void OMPClauseProfiler::VisitOMPSafelenClause(
const OMPSafelenClause *
C) {
485 Profiler->VisitStmt(
C->getSafelen());
488void OMPClauseProfiler::VisitOMPSimdlenClause(
const OMPSimdlenClause *
C) {
490 Profiler->VisitStmt(
C->getSimdlen());
493void OMPClauseProfiler::VisitOMPSizesClause(
const OMPSizesClause *
C) {
494 for (
auto *E :
C->getSizesRefs())
496 Profiler->VisitExpr(E);
499void OMPClauseProfiler::VisitOMPPermutationClause(
500 const OMPPermutationClause *
C) {
501 for (Expr *E :
C->getArgsRefs())
503 Profiler->VisitExpr(E);
506void OMPClauseProfiler::VisitOMPFullClause(
const OMPFullClause *
C) {}
508void OMPClauseProfiler::VisitOMPPartialClause(
const OMPPartialClause *
C) {
509 if (
const Expr *Factor =
C->getFactor())
510 Profiler->VisitExpr(Factor);
513void OMPClauseProfiler::VisitOMPLoopRangeClause(
const OMPLoopRangeClause *
C) {
514 if (
const Expr *
First =
C->getFirst())
515 Profiler->VisitExpr(
First);
516 if (
const Expr *Count =
C->getCount())
517 Profiler->VisitExpr(Count);
520void OMPClauseProfiler::VisitOMPAllocatorClause(
const OMPAllocatorClause *
C) {
521 if (
C->getAllocator())
522 Profiler->VisitStmt(
C->getAllocator());
525void OMPClauseProfiler::VisitOMPCollapseClause(
const OMPCollapseClause *
C) {
526 if (
C->getNumForLoops())
527 Profiler->VisitStmt(
C->getNumForLoops());
530void OMPClauseProfiler::VisitOMPDetachClause(
const OMPDetachClause *
C) {
531 if (Expr *Evt =
C->getEventHandler())
532 Profiler->VisitStmt(Evt);
535void OMPClauseProfiler::VisitOMPNovariantsClause(
const OMPNovariantsClause *
C) {
536 VisitOMPClauseWithPreInit(
C);
537 if (
C->getCondition())
538 Profiler->VisitStmt(
C->getCondition());
541void OMPClauseProfiler::VisitOMPNocontextClause(
const OMPNocontextClause *
C) {
542 VisitOMPClauseWithPreInit(
C);
543 if (
C->getCondition())
544 Profiler->VisitStmt(
C->getCondition());
547void OMPClauseProfiler::VisitOMPDefaultClause(
const OMPDefaultClause *
C) { }
549void OMPClauseProfiler::VisitOMPThreadsetClause(
const OMPThreadsetClause *
C) {}
551void OMPClauseProfiler::VisitOMPProcBindClause(
const OMPProcBindClause *
C) { }
553void OMPClauseProfiler::VisitOMPUnifiedAddressClause(
554 const OMPUnifiedAddressClause *
C) {}
556void OMPClauseProfiler::VisitOMPUnifiedSharedMemoryClause(
557 const OMPUnifiedSharedMemoryClause *
C) {}
559void OMPClauseProfiler::VisitOMPReverseOffloadClause(
560 const OMPReverseOffloadClause *
C) {}
562void OMPClauseProfiler::VisitOMPDynamicAllocatorsClause(
563 const OMPDynamicAllocatorsClause *
C) {}
565void OMPClauseProfiler::VisitOMPAtomicDefaultMemOrderClause(
566 const OMPAtomicDefaultMemOrderClause *
C) {}
568void OMPClauseProfiler::VisitOMPSelfMapsClause(
const OMPSelfMapsClause *
C) {}
570void OMPClauseProfiler::VisitOMPAtClause(
const OMPAtClause *
C) {}
572void OMPClauseProfiler::VisitOMPSeverityClause(
const OMPSeverityClause *
C) {}
574void OMPClauseProfiler::VisitOMPMessageClause(
const OMPMessageClause *
C) {
575 if (
C->getMessageString())
576 Profiler->VisitStmt(
C->getMessageString());
579void OMPClauseProfiler::VisitOMPScheduleClause(
const OMPScheduleClause *
C) {
580 VisitOMPClauseWithPreInit(
C);
581 if (
auto *S =
C->getChunkSize())
582 Profiler->VisitStmt(S);
585void OMPClauseProfiler::VisitOMPOrderedClause(
const OMPOrderedClause *
C) {
586 if (
auto *
Num =
C->getNumForLoops())
587 Profiler->VisitStmt(
Num);
590void OMPClauseProfiler::VisitOMPNowaitClause(
const OMPNowaitClause *
C) {
591 if (
C->getCondition())
592 Profiler->VisitStmt(
C->getCondition());
595void OMPClauseProfiler::VisitOMPUntiedClause(
const OMPUntiedClause *) {}
597void OMPClauseProfiler::VisitOMPMergeableClause(
const OMPMergeableClause *) {}
599void OMPClauseProfiler::VisitOMPReadClause(
const OMPReadClause *) {}
601void OMPClauseProfiler::VisitOMPWriteClause(
const OMPWriteClause *) {}
603void OMPClauseProfiler::VisitOMPUpdateClause(
const OMPUpdateClause *) {}
605void OMPClauseProfiler::VisitOMPCaptureClause(
const OMPCaptureClause *) {}
607void OMPClauseProfiler::VisitOMPCompareClause(
const OMPCompareClause *) {}
609void OMPClauseProfiler::VisitOMPFailClause(
const OMPFailClause *) {}
611void OMPClauseProfiler::VisitOMPAbsentClause(
const OMPAbsentClause *) {}
613void OMPClauseProfiler::VisitOMPHoldsClause(
const OMPHoldsClause *) {}
615void OMPClauseProfiler::VisitOMPContainsClause(
const OMPContainsClause *) {}
617void OMPClauseProfiler::VisitOMPNoOpenMPClause(
const OMPNoOpenMPClause *) {}
619void OMPClauseProfiler::VisitOMPNoOpenMPRoutinesClause(
620 const OMPNoOpenMPRoutinesClause *) {}
622void OMPClauseProfiler::VisitOMPNoOpenMPConstructsClause(
623 const OMPNoOpenMPConstructsClause *) {}
625void OMPClauseProfiler::VisitOMPNoParallelismClause(
626 const OMPNoParallelismClause *) {}
628void OMPClauseProfiler::VisitOMPSeqCstClause(
const OMPSeqCstClause *) {}
630void OMPClauseProfiler::VisitOMPAcqRelClause(
const OMPAcqRelClause *) {}
632void OMPClauseProfiler::VisitOMPAcquireClause(
const OMPAcquireClause *) {}
634void OMPClauseProfiler::VisitOMPReleaseClause(
const OMPReleaseClause *) {}
636void OMPClauseProfiler::VisitOMPRelaxedClause(
const OMPRelaxedClause *) {}
638void OMPClauseProfiler::VisitOMPWeakClause(
const OMPWeakClause *) {}
640void OMPClauseProfiler::VisitOMPThreadsClause(
const OMPThreadsClause *) {}
642void OMPClauseProfiler::VisitOMPSIMDClause(
const OMPSIMDClause *) {}
644void OMPClauseProfiler::VisitOMPNogroupClause(
const OMPNogroupClause *) {}
646void OMPClauseProfiler::VisitOMPInitClause(
const OMPInitClause *
C) {
647 VisitOMPClauseList(
C);
650void OMPClauseProfiler::VisitOMPUseClause(
const OMPUseClause *
C) {
651 if (
C->getInteropVar())
652 Profiler->VisitStmt(
C->getInteropVar());
655void OMPClauseProfiler::VisitOMPDestroyClause(
const OMPDestroyClause *
C) {
656 if (
C->getInteropVar())
657 Profiler->VisitStmt(
C->getInteropVar());
660void OMPClauseProfiler::VisitOMPFilterClause(
const OMPFilterClause *
C) {
661 VisitOMPClauseWithPreInit(
C);
662 if (
C->getThreadID())
663 Profiler->VisitStmt(
C->getThreadID());
667void OMPClauseProfiler::VisitOMPClauseList(
T *Node) {
668 for (
auto *E : Node->varlist()) {
670 Profiler->VisitStmt(E);
674void OMPClauseProfiler::VisitOMPPrivateClause(
const OMPPrivateClause *
C) {
675 VisitOMPClauseList(
C);
676 for (
auto *E :
C->private_copies()) {
678 Profiler->VisitStmt(E);
682OMPClauseProfiler::VisitOMPFirstprivateClause(
const OMPFirstprivateClause *
C) {
683 VisitOMPClauseList(
C);
684 VisitOMPClauseWithPreInit(
C);
685 for (
auto *E :
C->private_copies()) {
687 Profiler->VisitStmt(E);
689 for (
auto *E :
C->inits()) {
691 Profiler->VisitStmt(E);
695OMPClauseProfiler::VisitOMPLastprivateClause(
const OMPLastprivateClause *
C) {
696 VisitOMPClauseList(
C);
697 VisitOMPClauseWithPostUpdate(
C);
698 for (
auto *E :
C->source_exprs()) {
700 Profiler->VisitStmt(E);
702 for (
auto *E :
C->destination_exprs()) {
704 Profiler->VisitStmt(E);
706 for (
auto *E :
C->assignment_ops()) {
708 Profiler->VisitStmt(E);
711void OMPClauseProfiler::VisitOMPSharedClause(
const OMPSharedClause *
C) {
712 VisitOMPClauseList(
C);
714void OMPClauseProfiler::VisitOMPReductionClause(
715 const OMPReductionClause *
C) {
716 Profiler->VisitNestedNameSpecifier(
717 C->getQualifierLoc().getNestedNameSpecifier());
718 Profiler->VisitName(
C->getNameInfo().getName());
719 VisitOMPClauseList(
C);
720 VisitOMPClauseWithPostUpdate(
C);
721 for (
auto *E :
C->privates()) {
723 Profiler->VisitStmt(E);
725 for (
auto *E :
C->lhs_exprs()) {
727 Profiler->VisitStmt(E);
729 for (
auto *E :
C->rhs_exprs()) {
731 Profiler->VisitStmt(E);
733 for (
auto *E :
C->reduction_ops()) {
735 Profiler->VisitStmt(E);
737 if (
C->getModifier() == clang::OMPC_REDUCTION_inscan) {
738 for (
auto *E :
C->copy_ops()) {
740 Profiler->VisitStmt(E);
742 for (
auto *E :
C->copy_array_temps()) {
744 Profiler->VisitStmt(E);
746 for (
auto *E :
C->copy_array_elems()) {
748 Profiler->VisitStmt(E);
752void OMPClauseProfiler::VisitOMPTaskReductionClause(
753 const OMPTaskReductionClause *
C) {
754 Profiler->VisitNestedNameSpecifier(
755 C->getQualifierLoc().getNestedNameSpecifier());
756 Profiler->VisitName(
C->getNameInfo().getName());
757 VisitOMPClauseList(
C);
758 VisitOMPClauseWithPostUpdate(
C);
759 for (
auto *E :
C->privates()) {
761 Profiler->VisitStmt(E);
763 for (
auto *E :
C->lhs_exprs()) {
765 Profiler->VisitStmt(E);
767 for (
auto *E :
C->rhs_exprs()) {
769 Profiler->VisitStmt(E);
771 for (
auto *E :
C->reduction_ops()) {
773 Profiler->VisitStmt(E);
776void OMPClauseProfiler::VisitOMPInReductionClause(
777 const OMPInReductionClause *
C) {
778 Profiler->VisitNestedNameSpecifier(
779 C->getQualifierLoc().getNestedNameSpecifier());
780 Profiler->VisitName(
C->getNameInfo().getName());
781 VisitOMPClauseList(
C);
782 VisitOMPClauseWithPostUpdate(
C);
783 for (
auto *E :
C->privates()) {
785 Profiler->VisitStmt(E);
787 for (
auto *E :
C->lhs_exprs()) {
789 Profiler->VisitStmt(E);
791 for (
auto *E :
C->rhs_exprs()) {
793 Profiler->VisitStmt(E);
795 for (
auto *E :
C->reduction_ops()) {
797 Profiler->VisitStmt(E);
799 for (
auto *E :
C->taskgroup_descriptors()) {
801 Profiler->VisitStmt(E);
804void OMPClauseProfiler::VisitOMPLinearClause(
const OMPLinearClause *
C) {
805 VisitOMPClauseList(
C);
806 VisitOMPClauseWithPostUpdate(
C);
807 for (
auto *E :
C->privates()) {
809 Profiler->VisitStmt(E);
811 for (
auto *E :
C->inits()) {
813 Profiler->VisitStmt(E);
815 for (
auto *E :
C->updates()) {
817 Profiler->VisitStmt(E);
819 for (
auto *E :
C->finals()) {
821 Profiler->VisitStmt(E);
824 Profiler->VisitStmt(
C->getStep());
825 if (
C->getCalcStep())
826 Profiler->VisitStmt(
C->getCalcStep());
828void OMPClauseProfiler::VisitOMPAlignedClause(
const OMPAlignedClause *
C) {
829 VisitOMPClauseList(
C);
830 if (
C->getAlignment())
831 Profiler->VisitStmt(
C->getAlignment());
833void OMPClauseProfiler::VisitOMPCopyinClause(
const OMPCopyinClause *
C) {
834 VisitOMPClauseList(
C);
835 for (
auto *E :
C->source_exprs()) {
837 Profiler->VisitStmt(E);
839 for (
auto *E :
C->destination_exprs()) {
841 Profiler->VisitStmt(E);
843 for (
auto *E :
C->assignment_ops()) {
845 Profiler->VisitStmt(E);
849OMPClauseProfiler::VisitOMPCopyprivateClause(
const OMPCopyprivateClause *
C) {
850 VisitOMPClauseList(
C);
851 for (
auto *E :
C->source_exprs()) {
853 Profiler->VisitStmt(E);
855 for (
auto *E :
C->destination_exprs()) {
857 Profiler->VisitStmt(E);
859 for (
auto *E :
C->assignment_ops()) {
861 Profiler->VisitStmt(E);
864void OMPClauseProfiler::VisitOMPFlushClause(
const OMPFlushClause *
C) {
865 VisitOMPClauseList(
C);
867void OMPClauseProfiler::VisitOMPDepobjClause(
const OMPDepobjClause *
C) {
868 if (
const Expr *Depobj =
C->getDepobj())
869 Profiler->VisitStmt(Depobj);
871void OMPClauseProfiler::VisitOMPDependClause(
const OMPDependClause *
C) {
872 VisitOMPClauseList(
C);
874void OMPClauseProfiler::VisitOMPDeviceClause(
const OMPDeviceClause *
C) {
876 Profiler->VisitStmt(
C->getDevice());
878void OMPClauseProfiler::VisitOMPMapClause(
const OMPMapClause *
C) {
879 VisitOMPClauseList(
C);
881void OMPClauseProfiler::VisitOMPAllocateClause(
const OMPAllocateClause *
C) {
882 if (Expr *Allocator =
C->getAllocator())
883 Profiler->VisitStmt(Allocator);
884 VisitOMPClauseList(
C);
886void OMPClauseProfiler::VisitOMPNumTeamsClause(
const OMPNumTeamsClause *
C) {
887 VisitOMPClauseList(
C);
888 VisitOMPClauseWithPreInit(
C);
890void OMPClauseProfiler::VisitOMPThreadLimitClause(
891 const OMPThreadLimitClause *
C) {
892 VisitOMPClauseList(
C);
893 VisitOMPClauseWithPreInit(
C);
895void OMPClauseProfiler::VisitOMPPriorityClause(
const OMPPriorityClause *
C) {
896 VisitOMPClauseWithPreInit(
C);
897 if (
C->getPriority())
898 Profiler->VisitStmt(
C->getPriority());
900void OMPClauseProfiler::VisitOMPGrainsizeClause(
const OMPGrainsizeClause *
C) {
901 VisitOMPClauseWithPreInit(
C);
902 if (
C->getGrainsize())
903 Profiler->VisitStmt(
C->getGrainsize());
905void OMPClauseProfiler::VisitOMPNumTasksClause(
const OMPNumTasksClause *
C) {
906 VisitOMPClauseWithPreInit(
C);
907 if (
C->getNumTasks())
908 Profiler->VisitStmt(
C->getNumTasks());
910void OMPClauseProfiler::VisitOMPHintClause(
const OMPHintClause *
C) {
912 Profiler->VisitStmt(
C->getHint());
914void OMPClauseProfiler::VisitOMPToClause(
const OMPToClause *
C) {
915 VisitOMPClauseList(
C);
917void OMPClauseProfiler::VisitOMPFromClause(
const OMPFromClause *
C) {
918 VisitOMPClauseList(
C);
920void OMPClauseProfiler::VisitOMPUseDevicePtrClause(
921 const OMPUseDevicePtrClause *
C) {
922 VisitOMPClauseList(
C);
924void OMPClauseProfiler::VisitOMPUseDeviceAddrClause(
925 const OMPUseDeviceAddrClause *
C) {
926 VisitOMPClauseList(
C);
928void OMPClauseProfiler::VisitOMPIsDevicePtrClause(
929 const OMPIsDevicePtrClause *
C) {
930 VisitOMPClauseList(
C);
932void OMPClauseProfiler::VisitOMPHasDeviceAddrClause(
933 const OMPHasDeviceAddrClause *
C) {
934 VisitOMPClauseList(
C);
936void OMPClauseProfiler::VisitOMPNontemporalClause(
937 const OMPNontemporalClause *
C) {
938 VisitOMPClauseList(
C);
939 for (
auto *E :
C->private_refs())
940 Profiler->VisitStmt(E);
942void OMPClauseProfiler::VisitOMPInclusiveClause(
const OMPInclusiveClause *
C) {
943 VisitOMPClauseList(
C);
945void OMPClauseProfiler::VisitOMPExclusiveClause(
const OMPExclusiveClause *
C) {
946 VisitOMPClauseList(
C);
948void OMPClauseProfiler::VisitOMPUsesAllocatorsClause(
949 const OMPUsesAllocatorsClause *
C) {
950 for (
unsigned I = 0, E =
C->getNumberOfAllocators(); I < E; ++I) {
951 OMPUsesAllocatorsClause::Data D =
C->getAllocatorData(I);
957void OMPClauseProfiler::VisitOMPAffinityClause(
const OMPAffinityClause *
C) {
958 if (
const Expr *Modifier =
C->getModifier())
959 Profiler->VisitStmt(Modifier);
960 for (
const Expr *E :
C->varlist())
961 Profiler->VisitStmt(E);
963void OMPClauseProfiler::VisitOMPOrderClause(
const OMPOrderClause *
C) {}
964void OMPClauseProfiler::VisitOMPBindClause(
const OMPBindClause *
C) {}
965void OMPClauseProfiler::VisitOMPXDynCGroupMemClause(
966 const OMPXDynCGroupMemClause *
C) {
967 VisitOMPClauseWithPreInit(
C);
968 if (Expr *Size =
C->getSize())
969 Profiler->VisitStmt(Size);
971void OMPClauseProfiler::VisitOMPDoacrossClause(
const OMPDoacrossClause *
C) {
972 VisitOMPClauseList(
C);
974void OMPClauseProfiler::VisitOMPXAttributeClause(
const OMPXAttributeClause *
C) {
976void OMPClauseProfiler::VisitOMPXBareClause(
const OMPXBareClause *
C) {}
980StmtProfiler::VisitOMPExecutableDirective(
const OMPExecutableDirective *S) {
982 OMPClauseProfiler P(
this);
983 ArrayRef<OMPClause *> Clauses = S->clauses();
984 for (ArrayRef<OMPClause *>::iterator I = Clauses.begin(), E = Clauses.end();
990void StmtProfiler::VisitOMPCanonicalLoop(
const OMPCanonicalLoop *L) {
994void StmtProfiler::VisitOMPLoopBasedDirective(
const OMPLoopBasedDirective *S) {
995 VisitOMPExecutableDirective(S);
998void StmtProfiler::VisitOMPLoopDirective(
const OMPLoopDirective *S) {
999 VisitOMPLoopBasedDirective(S);
1002void StmtProfiler::VisitOMPMetaDirective(
const OMPMetaDirective *S) {
1003 VisitOMPExecutableDirective(S);
1006void StmtProfiler::VisitOMPParallelDirective(
const OMPParallelDirective *S) {
1007 VisitOMPExecutableDirective(S);
1010void StmtProfiler::VisitOMPSimdDirective(
const OMPSimdDirective *S) {
1011 VisitOMPLoopDirective(S);
1014void StmtProfiler::VisitOMPCanonicalLoopNestTransformationDirective(
1015 const OMPCanonicalLoopNestTransformationDirective *S) {
1016 VisitOMPLoopBasedDirective(S);
1019void StmtProfiler::VisitOMPTileDirective(
const OMPTileDirective *S) {
1020 VisitOMPCanonicalLoopNestTransformationDirective(S);
1023void StmtProfiler::VisitOMPStripeDirective(
const OMPStripeDirective *S) {
1024 VisitOMPCanonicalLoopNestTransformationDirective(S);
1027void StmtProfiler::VisitOMPUnrollDirective(
const OMPUnrollDirective *S) {
1028 VisitOMPCanonicalLoopNestTransformationDirective(S);
1031void StmtProfiler::VisitOMPReverseDirective(
const OMPReverseDirective *S) {
1032 VisitOMPCanonicalLoopNestTransformationDirective(S);
1035void StmtProfiler::VisitOMPInterchangeDirective(
1036 const OMPInterchangeDirective *S) {
1037 VisitOMPCanonicalLoopNestTransformationDirective(S);
1040void StmtProfiler::VisitOMPCanonicalLoopSequenceTransformationDirective(
1041 const OMPCanonicalLoopSequenceTransformationDirective *S) {
1042 VisitOMPExecutableDirective(S);
1045void StmtProfiler::VisitOMPFuseDirective(
const OMPFuseDirective *S) {
1046 VisitOMPCanonicalLoopSequenceTransformationDirective(S);
1049void StmtProfiler::VisitOMPForDirective(
const OMPForDirective *S) {
1050 VisitOMPLoopDirective(S);
1053void StmtProfiler::VisitOMPForSimdDirective(
const OMPForSimdDirective *S) {
1054 VisitOMPLoopDirective(S);
1057void StmtProfiler::VisitOMPSectionsDirective(
const OMPSectionsDirective *S) {
1058 VisitOMPExecutableDirective(S);
1061void StmtProfiler::VisitOMPSectionDirective(
const OMPSectionDirective *S) {
1062 VisitOMPExecutableDirective(S);
1065void StmtProfiler::VisitOMPScopeDirective(
const OMPScopeDirective *S) {
1066 VisitOMPExecutableDirective(S);
1069void StmtProfiler::VisitOMPSingleDirective(
const OMPSingleDirective *S) {
1070 VisitOMPExecutableDirective(S);
1073void StmtProfiler::VisitOMPMasterDirective(
const OMPMasterDirective *S) {
1074 VisitOMPExecutableDirective(S);
1077void StmtProfiler::VisitOMPCriticalDirective(
const OMPCriticalDirective *S) {
1078 VisitOMPExecutableDirective(S);
1079 VisitName(S->getDirectiveName().getName());
1083StmtProfiler::VisitOMPParallelForDirective(
const OMPParallelForDirective *S) {
1084 VisitOMPLoopDirective(S);
1087void StmtProfiler::VisitOMPParallelForSimdDirective(
1088 const OMPParallelForSimdDirective *S) {
1089 VisitOMPLoopDirective(S);
1092void StmtProfiler::VisitOMPParallelMasterDirective(
1093 const OMPParallelMasterDirective *S) {
1094 VisitOMPExecutableDirective(S);
1097void StmtProfiler::VisitOMPParallelMaskedDirective(
1098 const OMPParallelMaskedDirective *S) {
1099 VisitOMPExecutableDirective(S);
1102void StmtProfiler::VisitOMPParallelSectionsDirective(
1103 const OMPParallelSectionsDirective *S) {
1104 VisitOMPExecutableDirective(S);
1107void StmtProfiler::VisitOMPTaskDirective(
const OMPTaskDirective *S) {
1108 VisitOMPExecutableDirective(S);
1111void StmtProfiler::VisitOMPTaskyieldDirective(
const OMPTaskyieldDirective *S) {
1112 VisitOMPExecutableDirective(S);
1115void StmtProfiler::VisitOMPBarrierDirective(
const OMPBarrierDirective *S) {
1116 VisitOMPExecutableDirective(S);
1119void StmtProfiler::VisitOMPTaskwaitDirective(
const OMPTaskwaitDirective *S) {
1120 VisitOMPExecutableDirective(S);
1123void StmtProfiler::VisitOMPAssumeDirective(
const OMPAssumeDirective *S) {
1124 VisitOMPExecutableDirective(S);
1127void StmtProfiler::VisitOMPErrorDirective(
const OMPErrorDirective *S) {
1128 VisitOMPExecutableDirective(S);
1130void StmtProfiler::VisitOMPTaskgroupDirective(
const OMPTaskgroupDirective *S) {
1131 VisitOMPExecutableDirective(S);
1132 if (
const Expr *E = S->getReductionRef())
1136void StmtProfiler::VisitOMPFlushDirective(
const OMPFlushDirective *S) {
1137 VisitOMPExecutableDirective(S);
1140void StmtProfiler::VisitOMPDepobjDirective(
const OMPDepobjDirective *S) {
1141 VisitOMPExecutableDirective(S);
1144void StmtProfiler::VisitOMPScanDirective(
const OMPScanDirective *S) {
1145 VisitOMPExecutableDirective(S);
1148void StmtProfiler::VisitOMPOrderedDirective(
const OMPOrderedDirective *S) {
1149 VisitOMPExecutableDirective(S);
1152void StmtProfiler::VisitOMPAtomicDirective(
const OMPAtomicDirective *S) {
1153 VisitOMPExecutableDirective(S);
1156void StmtProfiler::VisitOMPTargetDirective(
const OMPTargetDirective *S) {
1157 VisitOMPExecutableDirective(S);
1160void StmtProfiler::VisitOMPTargetDataDirective(
const OMPTargetDataDirective *S) {
1161 VisitOMPExecutableDirective(S);
1164void StmtProfiler::VisitOMPTargetEnterDataDirective(
1165 const OMPTargetEnterDataDirective *S) {
1166 VisitOMPExecutableDirective(S);
1169void StmtProfiler::VisitOMPTargetExitDataDirective(
1170 const OMPTargetExitDataDirective *S) {
1171 VisitOMPExecutableDirective(S);
1174void StmtProfiler::VisitOMPTargetParallelDirective(
1175 const OMPTargetParallelDirective *S) {
1176 VisitOMPExecutableDirective(S);
1179void StmtProfiler::VisitOMPTargetParallelForDirective(
1180 const OMPTargetParallelForDirective *S) {
1181 VisitOMPExecutableDirective(S);
1184void StmtProfiler::VisitOMPTeamsDirective(
const OMPTeamsDirective *S) {
1185 VisitOMPExecutableDirective(S);
1188void StmtProfiler::VisitOMPCancellationPointDirective(
1189 const OMPCancellationPointDirective *S) {
1190 VisitOMPExecutableDirective(S);
1193void StmtProfiler::VisitOMPCancelDirective(
const OMPCancelDirective *S) {
1194 VisitOMPExecutableDirective(S);
1197void StmtProfiler::VisitOMPTaskLoopDirective(
const OMPTaskLoopDirective *S) {
1198 VisitOMPLoopDirective(S);
1201void StmtProfiler::VisitOMPTaskLoopSimdDirective(
1202 const OMPTaskLoopSimdDirective *S) {
1203 VisitOMPLoopDirective(S);
1206void StmtProfiler::VisitOMPMasterTaskLoopDirective(
1207 const OMPMasterTaskLoopDirective *S) {
1208 VisitOMPLoopDirective(S);
1211void StmtProfiler::VisitOMPMaskedTaskLoopDirective(
1212 const OMPMaskedTaskLoopDirective *S) {
1213 VisitOMPLoopDirective(S);
1216void StmtProfiler::VisitOMPMasterTaskLoopSimdDirective(
1217 const OMPMasterTaskLoopSimdDirective *S) {
1218 VisitOMPLoopDirective(S);
1221void StmtProfiler::VisitOMPMaskedTaskLoopSimdDirective(
1222 const OMPMaskedTaskLoopSimdDirective *S) {
1223 VisitOMPLoopDirective(S);
1226void StmtProfiler::VisitOMPParallelMasterTaskLoopDirective(
1227 const OMPParallelMasterTaskLoopDirective *S) {
1228 VisitOMPLoopDirective(S);
1231void StmtProfiler::VisitOMPParallelMaskedTaskLoopDirective(
1232 const OMPParallelMaskedTaskLoopDirective *S) {
1233 VisitOMPLoopDirective(S);
1236void StmtProfiler::VisitOMPParallelMasterTaskLoopSimdDirective(
1237 const OMPParallelMasterTaskLoopSimdDirective *S) {
1238 VisitOMPLoopDirective(S);
1241void StmtProfiler::VisitOMPParallelMaskedTaskLoopSimdDirective(
1242 const OMPParallelMaskedTaskLoopSimdDirective *S) {
1243 VisitOMPLoopDirective(S);
1246void StmtProfiler::VisitOMPDistributeDirective(
1247 const OMPDistributeDirective *S) {
1248 VisitOMPLoopDirective(S);
1251void OMPClauseProfiler::VisitOMPDistScheduleClause(
1252 const OMPDistScheduleClause *
C) {
1253 VisitOMPClauseWithPreInit(
C);
1254 if (
auto *S =
C->getChunkSize())
1255 Profiler->VisitStmt(S);
1258void OMPClauseProfiler::VisitOMPDefaultmapClause(
const OMPDefaultmapClause *) {}
1260void StmtProfiler::VisitOMPTargetUpdateDirective(
1261 const OMPTargetUpdateDirective *S) {
1262 VisitOMPExecutableDirective(S);
1265void StmtProfiler::VisitOMPDistributeParallelForDirective(
1266 const OMPDistributeParallelForDirective *S) {
1267 VisitOMPLoopDirective(S);
1270void StmtProfiler::VisitOMPDistributeParallelForSimdDirective(
1271 const OMPDistributeParallelForSimdDirective *S) {
1272 VisitOMPLoopDirective(S);
1275void StmtProfiler::VisitOMPDistributeSimdDirective(
1276 const OMPDistributeSimdDirective *S) {
1277 VisitOMPLoopDirective(S);
1280void StmtProfiler::VisitOMPTargetParallelForSimdDirective(
1281 const OMPTargetParallelForSimdDirective *S) {
1282 VisitOMPLoopDirective(S);
1285void StmtProfiler::VisitOMPTargetSimdDirective(
1286 const OMPTargetSimdDirective *S) {
1287 VisitOMPLoopDirective(S);
1290void StmtProfiler::VisitOMPTeamsDistributeDirective(
1291 const OMPTeamsDistributeDirective *S) {
1292 VisitOMPLoopDirective(S);
1295void StmtProfiler::VisitOMPTeamsDistributeSimdDirective(
1296 const OMPTeamsDistributeSimdDirective *S) {
1297 VisitOMPLoopDirective(S);
1300void StmtProfiler::VisitOMPTeamsDistributeParallelForSimdDirective(
1301 const OMPTeamsDistributeParallelForSimdDirective *S) {
1302 VisitOMPLoopDirective(S);
1305void StmtProfiler::VisitOMPTeamsDistributeParallelForDirective(
1306 const OMPTeamsDistributeParallelForDirective *S) {
1307 VisitOMPLoopDirective(S);
1310void StmtProfiler::VisitOMPTargetTeamsDirective(
1311 const OMPTargetTeamsDirective *S) {
1312 VisitOMPExecutableDirective(S);
1315void StmtProfiler::VisitOMPTargetTeamsDistributeDirective(
1316 const OMPTargetTeamsDistributeDirective *S) {
1317 VisitOMPLoopDirective(S);
1320void StmtProfiler::VisitOMPTargetTeamsDistributeParallelForDirective(
1321 const OMPTargetTeamsDistributeParallelForDirective *S) {
1322 VisitOMPLoopDirective(S);
1325void StmtProfiler::VisitOMPTargetTeamsDistributeParallelForSimdDirective(
1326 const OMPTargetTeamsDistributeParallelForSimdDirective *S) {
1327 VisitOMPLoopDirective(S);
1330void StmtProfiler::VisitOMPTargetTeamsDistributeSimdDirective(
1331 const OMPTargetTeamsDistributeSimdDirective *S) {
1332 VisitOMPLoopDirective(S);
1335void StmtProfiler::VisitOMPInteropDirective(
const OMPInteropDirective *S) {
1336 VisitOMPExecutableDirective(S);
1339void StmtProfiler::VisitOMPDispatchDirective(
const OMPDispatchDirective *S) {
1340 VisitOMPExecutableDirective(S);
1343void StmtProfiler::VisitOMPMaskedDirective(
const OMPMaskedDirective *S) {
1344 VisitOMPExecutableDirective(S);
1347void StmtProfiler::VisitOMPGenericLoopDirective(
1348 const OMPGenericLoopDirective *S) {
1349 VisitOMPLoopDirective(S);
1352void StmtProfiler::VisitOMPTeamsGenericLoopDirective(
1353 const OMPTeamsGenericLoopDirective *S) {
1354 VisitOMPLoopDirective(S);
1357void StmtProfiler::VisitOMPTargetTeamsGenericLoopDirective(
1358 const OMPTargetTeamsGenericLoopDirective *S) {
1359 VisitOMPLoopDirective(S);
1362void StmtProfiler::VisitOMPParallelGenericLoopDirective(
1363 const OMPParallelGenericLoopDirective *S) {
1364 VisitOMPLoopDirective(S);
1367void StmtProfiler::VisitOMPTargetParallelGenericLoopDirective(
1368 const OMPTargetParallelGenericLoopDirective *S) {
1369 VisitOMPLoopDirective(S);
1372void StmtProfiler::VisitExpr(
const Expr *S) {
1376void StmtProfiler::VisitConstantExpr(
const ConstantExpr *S) {
1381void StmtProfiler::VisitDeclRefExpr(
const DeclRefExpr *S) {
1393void StmtProfiler::VisitSYCLUniqueStableNameExpr(
1394 const SYCLUniqueStableNameExpr *S) {
1399void StmtProfiler::VisitPredefinedExpr(
const PredefinedExpr *S) {
1404void StmtProfiler::VisitOpenACCAsteriskSizeExpr(
1405 const OpenACCAsteriskSizeExpr *S) {
1409void StmtProfiler::VisitIntegerLiteral(
const IntegerLiteral *S) {
1415 T =
T.getCanonicalType();
1417 if (
auto BitIntT =
T->
getAs<BitIntType>())
1418 BitIntT->Profile(ID);
1420 ID.AddInteger(
T->
castAs<BuiltinType>()->getKind());
1423void StmtProfiler::VisitFixedPointLiteral(
const FixedPointLiteral *S) {
1426 ID.AddInteger(S->
getType()->
castAs<BuiltinType>()->getKind());
1429void StmtProfiler::VisitCharacterLiteral(
const CharacterLiteral *S) {
1431 ID.AddInteger(llvm::to_underlying(S->
getKind()));
1435void StmtProfiler::VisitFloatingLiteral(
const FloatingLiteral *S) {
1439 ID.AddInteger(S->
getType()->
castAs<BuiltinType>()->getKind());
1442void StmtProfiler::VisitImaginaryLiteral(
const ImaginaryLiteral *S) {
1446void StmtProfiler::VisitStringLiteral(
const StringLiteral *S) {
1449 ID.AddInteger(llvm::to_underlying(S->
getKind()));
1452void StmtProfiler::VisitParenExpr(
const ParenExpr *S) {
1456void StmtProfiler::VisitParenListExpr(
const ParenListExpr *S) {
1460void StmtProfiler::VisitUnaryOperator(
const UnaryOperator *S) {
1465void StmtProfiler::VisitOffsetOfExpr(
const OffsetOfExpr *S) {
1468 for (
unsigned i = 0; i < n; ++i) {
1494StmtProfiler::VisitUnaryExprOrTypeTraitExpr(
const UnaryExprOrTypeTraitExpr *S) {
1501void StmtProfiler::VisitArraySubscriptExpr(
const ArraySubscriptExpr *S) {
1505void StmtProfiler::VisitMatrixSubscriptExpr(
const MatrixSubscriptExpr *S) {
1509void StmtProfiler::VisitArraySectionExpr(
const ArraySectionExpr *S) {
1513void StmtProfiler::VisitOMPArrayShapingExpr(
const OMPArrayShapingExpr *S) {
1517void StmtProfiler::VisitOMPIteratorExpr(
const OMPIteratorExpr *S) {
1523void StmtProfiler::VisitCallExpr(
const CallExpr *S) {
1527void StmtProfiler::VisitMemberExpr(
const MemberExpr *S) {
1535void StmtProfiler::VisitCompoundLiteralExpr(
const CompoundLiteralExpr *S) {
1540void StmtProfiler::VisitCastExpr(
const CastExpr *S) {
1544void StmtProfiler::VisitImplicitCastExpr(
const ImplicitCastExpr *S) {
1549void StmtProfiler::VisitExplicitCastExpr(
const ExplicitCastExpr *S) {
1554void StmtProfiler::VisitCStyleCastExpr(
const CStyleCastExpr *S) {
1555 VisitExplicitCastExpr(S);
1558void StmtProfiler::VisitBinaryOperator(
const BinaryOperator *S) {
1564StmtProfiler::VisitCompoundAssignOperator(
const CompoundAssignOperator *S) {
1565 VisitBinaryOperator(S);
1568void StmtProfiler::VisitConditionalOperator(
const ConditionalOperator *S) {
1572void StmtProfiler::VisitBinaryConditionalOperator(
1573 const BinaryConditionalOperator *S) {
1577void StmtProfiler::VisitAddrLabelExpr(
const AddrLabelExpr *S) {
1582void StmtProfiler::VisitStmtExpr(
const StmtExpr *S) {
1586void StmtProfiler::VisitShuffleVectorExpr(
const ShuffleVectorExpr *S) {
1590void StmtProfiler::VisitConvertVectorExpr(
const ConvertVectorExpr *S) {
1594void StmtProfiler::VisitChooseExpr(
const ChooseExpr *S) {
1598void StmtProfiler::VisitGNUNullExpr(
const GNUNullExpr *S) {
1602void StmtProfiler::VisitVAArgExpr(
const VAArgExpr *S) {
1606void StmtProfiler::VisitInitListExpr(
const InitListExpr *S) {
1615void StmtProfiler::VisitDesignatedInitExpr(
const DesignatedInitExpr *S) {
1618 for (
const DesignatedInitExpr::Designator &D : S->
designators()) {
1619 if (D.isFieldDesignator()) {
1621 VisitName(D.getFieldName());
1625 if (D.isArrayDesignator()) {
1628 assert(D.isArrayRangeDesignator());
1631 ID.AddInteger(D.getArrayIndex());
1637void StmtProfiler::VisitDesignatedInitUpdateExpr(
1638 const DesignatedInitUpdateExpr *S) {
1639 llvm_unreachable(
"Unexpected DesignatedInitUpdateExpr in syntactic form of "
1643void StmtProfiler::VisitArrayInitLoopExpr(
const ArrayInitLoopExpr *S) {
1647void StmtProfiler::VisitArrayInitIndexExpr(
const ArrayInitIndexExpr *S) {
1651void StmtProfiler::VisitNoInitExpr(
const NoInitExpr *S) {
1652 llvm_unreachable(
"Unexpected NoInitExpr in syntactic form of initializer");
1655void StmtProfiler::VisitImplicitValueInitExpr(
const ImplicitValueInitExpr *S) {
1659void StmtProfiler::VisitExtVectorElementExpr(
const ExtVectorElementExpr *S) {
1664void StmtProfiler::VisitBlockExpr(
const BlockExpr *S) {
1669void StmtProfiler::VisitGenericSelectionExpr(
const GenericSelectionExpr *S) {
1673 QualType
T = Assoc.getType();
1675 ID.AddPointer(
nullptr);
1678 VisitExpr(Assoc.getAssociationExpr());
1682void StmtProfiler::VisitPseudoObjectExpr(
const PseudoObjectExpr *S) {
1687 if (
const OpaqueValueExpr *OVE = dyn_cast<OpaqueValueExpr>(*i))
1688 Visit(OVE->getSourceExpr());
1691void StmtProfiler::VisitAtomicExpr(
const AtomicExpr *S) {
1693 ID.AddInteger(S->
getOp());
1696void StmtProfiler::VisitConceptSpecializationExpr(
1697 const ConceptSpecializationExpr *S) {
1701 VisitTemplateArgument(Arg);
1704void StmtProfiler::VisitRequiresExpr(
const RequiresExpr *S) {
1708 VisitDecl(LocalParam);
1711 if (
auto *TypeReq = dyn_cast<concepts::TypeRequirement>(Req)) {
1713 ID.AddBoolean(TypeReq->isSubstitutionFailure());
1714 if (!TypeReq->isSubstitutionFailure())
1715 VisitType(TypeReq->getType()->getType());
1716 }
else if (
auto *ExprReq = dyn_cast<concepts::ExprRequirement>(Req)) {
1718 ID.AddBoolean(ExprReq->isExprSubstitutionFailure());
1719 if (!ExprReq->isExprSubstitutionFailure())
1720 Visit(ExprReq->getExpr());
1725 ID.AddBoolean(ExprReq->getNoexceptLoc().isValid());
1726 const concepts::ExprRequirement::ReturnTypeRequirement &RetReq =
1727 ExprReq->getReturnTypeRequirement();
1740 ID.AddBoolean(NestedReq->hasInvalidConstraint());
1741 if (!NestedReq->hasInvalidConstraint())
1742 Visit(NestedReq->getConstraintExpr());
1750 unsigned &NumArgs) {
1756 case OO_Array_Delete:
1758 case OO_Conditional:
1760 llvm_unreachable(
"Invalid operator call kind");
1765 return Stmt::UnaryOperatorClass;
1769 return Stmt::BinaryOperatorClass;
1774 return Stmt::UnaryOperatorClass;
1778 return Stmt::BinaryOperatorClass;
1783 return Stmt::UnaryOperatorClass;
1787 return Stmt::BinaryOperatorClass;
1791 return Stmt::BinaryOperatorClass;
1795 return Stmt::BinaryOperatorClass;
1799 return Stmt::BinaryOperatorClass;
1803 UnaryOp = UO_AddrOf;
1804 return Stmt::UnaryOperatorClass;
1808 return Stmt::BinaryOperatorClass;
1812 return Stmt::BinaryOperatorClass;
1816 return Stmt::UnaryOperatorClass;
1820 return Stmt::UnaryOperatorClass;
1823 BinaryOp = BO_Assign;
1824 return Stmt::BinaryOperatorClass;
1828 return Stmt::BinaryOperatorClass;
1832 return Stmt::BinaryOperatorClass;
1835 BinaryOp = BO_AddAssign;
1836 return Stmt::CompoundAssignOperatorClass;
1839 BinaryOp = BO_SubAssign;
1840 return Stmt::CompoundAssignOperatorClass;
1843 BinaryOp = BO_MulAssign;
1844 return Stmt::CompoundAssignOperatorClass;
1847 BinaryOp = BO_DivAssign;
1848 return Stmt::CompoundAssignOperatorClass;
1850 case OO_PercentEqual:
1851 BinaryOp = BO_RemAssign;
1852 return Stmt::CompoundAssignOperatorClass;
1855 BinaryOp = BO_XorAssign;
1856 return Stmt::CompoundAssignOperatorClass;
1859 BinaryOp = BO_AndAssign;
1860 return Stmt::CompoundAssignOperatorClass;
1863 BinaryOp = BO_OrAssign;
1864 return Stmt::CompoundAssignOperatorClass;
1868 return Stmt::BinaryOperatorClass;
1870 case OO_GreaterGreater:
1872 return Stmt::BinaryOperatorClass;
1874 case OO_LessLessEqual:
1875 BinaryOp = BO_ShlAssign;
1876 return Stmt::CompoundAssignOperatorClass;
1878 case OO_GreaterGreaterEqual:
1879 BinaryOp = BO_ShrAssign;
1880 return Stmt::CompoundAssignOperatorClass;
1884 return Stmt::BinaryOperatorClass;
1886 case OO_ExclaimEqual:
1888 return Stmt::BinaryOperatorClass;
1892 return Stmt::BinaryOperatorClass;
1894 case OO_GreaterEqual:
1896 return Stmt::BinaryOperatorClass;
1900 return Stmt::BinaryOperatorClass;
1904 return Stmt::BinaryOperatorClass;
1908 return Stmt::BinaryOperatorClass;
1911 UnaryOp = NumArgs == 1 ? UO_PreInc : UO_PostInc;
1913 return Stmt::UnaryOperatorClass;
1916 UnaryOp = NumArgs == 1 ? UO_PreDec : UO_PostDec;
1918 return Stmt::UnaryOperatorClass;
1921 BinaryOp = BO_Comma;
1922 return Stmt::BinaryOperatorClass;
1925 BinaryOp = BO_PtrMemI;
1926 return Stmt::BinaryOperatorClass;
1929 return Stmt::ArraySubscriptExprClass;
1932 return Stmt::CallExprClass;
1935 UnaryOp = UO_Coawait;
1936 return Stmt::UnaryOperatorClass;
1939 llvm_unreachable(
"Invalid overloaded operator expression");
1942#if defined(_MSC_VER) && !defined(__clang__)
1947#pragma optimize("", off)
1951void StmtProfiler::VisitCXXOperatorCallExpr(
const CXXOperatorCallExpr *S) {
1959 return Visit(S->
getArg(0));
1967 for (
unsigned I = 0; I != NumArgs; ++I)
1969 if (SC == Stmt::UnaryOperatorClass)
1970 ID.AddInteger(UnaryOp);
1971 else if (SC == Stmt::BinaryOperatorClass ||
1972 SC == Stmt::CompoundAssignOperatorClass)
1973 ID.AddInteger(BinaryOp);
1975 assert(SC == Stmt::ArraySubscriptExprClass || SC == Stmt::CallExprClass);
1984void StmtProfiler::VisitCXXRewrittenBinaryOperator(
1985 const CXXRewrittenBinaryOperator *S) {
1989 "resolved rewritten operator should never be type-dependent");
1994#if defined(_MSC_VER) && !defined(__clang__)
1996#pragma optimize("", on)
2000void StmtProfiler::VisitCXXMemberCallExpr(
const CXXMemberCallExpr *S) {
2004void StmtProfiler::VisitCUDAKernelCallExpr(
const CUDAKernelCallExpr *S) {
2008void StmtProfiler::VisitAsTypeExpr(
const AsTypeExpr *S) {
2012void StmtProfiler::VisitCXXNamedCastExpr(
const CXXNamedCastExpr *S) {
2013 VisitExplicitCastExpr(S);
2016void StmtProfiler::VisitCXXStaticCastExpr(
const CXXStaticCastExpr *S) {
2017 VisitCXXNamedCastExpr(S);
2020void StmtProfiler::VisitCXXDynamicCastExpr(
const CXXDynamicCastExpr *S) {
2021 VisitCXXNamedCastExpr(S);
2025StmtProfiler::VisitCXXReinterpretCastExpr(
const CXXReinterpretCastExpr *S) {
2026 VisitCXXNamedCastExpr(S);
2029void StmtProfiler::VisitCXXConstCastExpr(
const CXXConstCastExpr *S) {
2030 VisitCXXNamedCastExpr(S);
2033void StmtProfiler::VisitBuiltinBitCastExpr(
const BuiltinBitCastExpr *S) {
2038void StmtProfiler::VisitCXXAddrspaceCastExpr(
const CXXAddrspaceCastExpr *S) {
2039 VisitCXXNamedCastExpr(S);
2042void StmtProfiler::VisitUserDefinedLiteral(
const UserDefinedLiteral *S) {
2046void StmtProfiler::VisitCXXBoolLiteralExpr(
const CXXBoolLiteralExpr *S) {
2051void StmtProfiler::VisitCXXNullPtrLiteralExpr(
const CXXNullPtrLiteralExpr *S) {
2055void StmtProfiler::VisitCXXStdInitializerListExpr(
2056 const CXXStdInitializerListExpr *S) {
2060void StmtProfiler::VisitCXXTypeidExpr(
const CXXTypeidExpr *S) {
2066void StmtProfiler::VisitCXXUuidofExpr(
const CXXUuidofExpr *S) {
2072void StmtProfiler::VisitMSPropertyRefExpr(
const MSPropertyRefExpr *S) {
2077void StmtProfiler::VisitMSPropertySubscriptExpr(
2078 const MSPropertySubscriptExpr *S) {
2082void StmtProfiler::VisitCXXThisExpr(
const CXXThisExpr *S) {
2088void StmtProfiler::VisitCXXThrowExpr(
const CXXThrowExpr *S) {
2092void StmtProfiler::VisitCXXDefaultArgExpr(
const CXXDefaultArgExpr *S) {
2097void StmtProfiler::VisitCXXDefaultInitExpr(
const CXXDefaultInitExpr *S) {
2102void StmtProfiler::VisitCXXBindTemporaryExpr(
const CXXBindTemporaryExpr *S) {
2108void StmtProfiler::VisitCXXConstructExpr(
const CXXConstructExpr *S) {
2114void StmtProfiler::VisitCXXInheritedCtorInitExpr(
2115 const CXXInheritedCtorInitExpr *S) {
2120void StmtProfiler::VisitCXXFunctionalCastExpr(
const CXXFunctionalCastExpr *S) {
2121 VisitExplicitCastExpr(S);
2125StmtProfiler::VisitCXXTemporaryObjectExpr(
const CXXTemporaryObjectExpr *S) {
2126 VisitCXXConstructExpr(S);
2130StmtProfiler::VisitLambdaExpr(
const LambdaExpr *S) {
2131 if (!ProfileLambdaExpr) {
2135 VisitStmtNoChildren(S);
2146 ID.AddInteger(
Capture.getCaptureKind());
2147 if (
Capture.capturesVariable())
2148 VisitDecl(
Capture.getCapturedVar());
2157 for (
auto *SubDecl : Lambda->
decls()) {
2158 FunctionDecl *
Call =
nullptr;
2159 if (
auto *FTD = dyn_cast<FunctionTemplateDecl>(SubDecl))
2160 Call = FTD->getTemplatedDecl();
2161 else if (
auto *FD = dyn_cast<FunctionDecl>(SubDecl))
2173StmtProfiler::VisitCXXScalarValueInitExpr(
const CXXScalarValueInitExpr *S) {
2177void StmtProfiler::VisitCXXDeleteExpr(
const CXXDeleteExpr *S) {
2184void StmtProfiler::VisitCXXNewExpr(
const CXXNewExpr *S) {
2197StmtProfiler::VisitCXXPseudoDestructorExpr(
const CXXPseudoDestructorExpr *S) {
2211void StmtProfiler::VisitOverloadExpr(
const OverloadExpr *S) {
2213 bool DescribingDependentVarTemplate =
2215 if (DescribingDependentVarTemplate) {
2219 VisitName(S->
getName(),
true);
2227StmtProfiler::VisitUnresolvedLookupExpr(
const UnresolvedLookupExpr *S) {
2228 VisitOverloadExpr(S);
2231void StmtProfiler::VisitTypeTraitExpr(
const TypeTraitExpr *S) {
2235 for (
unsigned I = 0, N = S->
getNumArgs(); I != N; ++I)
2239void StmtProfiler::VisitArrayTypeTraitExpr(
const ArrayTypeTraitExpr *S) {
2245void StmtProfiler::VisitExpressionTraitExpr(
const ExpressionTraitExpr *S) {
2251void StmtProfiler::VisitDependentScopeDeclRefExpr(
2252 const DependentScopeDeclRefExpr *S) {
2261void StmtProfiler::VisitExprWithCleanups(
const ExprWithCleanups *S) {
2265void StmtProfiler::VisitCXXUnresolvedConstructExpr(
2266 const CXXUnresolvedConstructExpr *S) {
2272void StmtProfiler::VisitCXXDependentScopeMemberExpr(
2273 const CXXDependentScopeMemberExpr *S) {
2286void StmtProfiler::VisitUnresolvedMemberExpr(
const UnresolvedMemberExpr *S) {
2299void StmtProfiler::VisitCXXNoexceptExpr(
const CXXNoexceptExpr *S) {
2303void StmtProfiler::VisitPackExpansionExpr(
const PackExpansionExpr *S) {
2307void StmtProfiler::VisitSizeOfPackExpr(
const SizeOfPackExpr *S) {
2311 ID.AddInteger(Args.size());
2312 for (
const auto &TA : Args)
2313 VisitTemplateArgument(TA);
2320void StmtProfiler::VisitPackIndexingExpr(
const PackIndexingExpr *E) {
2332void StmtProfiler::VisitSubstNonTypeTemplateParmPackExpr(
2333 const SubstNonTypeTemplateParmPackExpr *S) {
2339void StmtProfiler::VisitSubstNonTypeTemplateParmExpr(
2340 const SubstNonTypeTemplateParmExpr *E) {
2345void StmtProfiler::VisitFunctionParmPackExpr(
const FunctionParmPackExpr *S) {
2353void StmtProfiler::VisitMaterializeTemporaryExpr(
2354 const MaterializeTemporaryExpr *S) {
2358void StmtProfiler::VisitCXXFoldExpr(
const CXXFoldExpr *S) {
2363void StmtProfiler::VisitCXXParenListInitExpr(
const CXXParenListInitExpr *S) {
2367void StmtProfiler::VisitCoroutineBodyStmt(
const CoroutineBodyStmt *S) {
2371void StmtProfiler::VisitCoreturnStmt(
const CoreturnStmt *S) {
2375void StmtProfiler::VisitCoawaitExpr(
const CoawaitExpr *S) {
2379void StmtProfiler::VisitDependentCoawaitExpr(
const DependentCoawaitExpr *S) {
2383void StmtProfiler::VisitCoyieldExpr(
const CoyieldExpr *S) {
2387void StmtProfiler::VisitOpaqueValueExpr(
const OpaqueValueExpr *E) {
2391void StmtProfiler::VisitSourceLocExpr(
const SourceLocExpr *E) {
2395void StmtProfiler::VisitEmbedExpr(
const EmbedExpr *E) { VisitExpr(E); }
2397void StmtProfiler::VisitRecoveryExpr(
const RecoveryExpr *E) { VisitExpr(E); }
2399void StmtProfiler::VisitObjCStringLiteral(
const ObjCStringLiteral *S) {
2403void StmtProfiler::VisitObjCBoxedExpr(
const ObjCBoxedExpr *E) {
2407void StmtProfiler::VisitObjCArrayLiteral(
const ObjCArrayLiteral *E) {
2411void StmtProfiler::VisitObjCDictionaryLiteral(
const ObjCDictionaryLiteral *E) {
2415void StmtProfiler::VisitObjCEncodeExpr(
const ObjCEncodeExpr *S) {
2420void StmtProfiler::VisitObjCSelectorExpr(
const ObjCSelectorExpr *S) {
2425void StmtProfiler::VisitObjCProtocolExpr(
const ObjCProtocolExpr *S) {
2430void StmtProfiler::VisitObjCIvarRefExpr(
const ObjCIvarRefExpr *S) {
2437void StmtProfiler::VisitObjCPropertyRefExpr(
const ObjCPropertyRefExpr *S) {
2451void StmtProfiler::VisitObjCSubscriptRefExpr(
const ObjCSubscriptRefExpr *S) {
2457void StmtProfiler::VisitObjCMessageExpr(
const ObjCMessageExpr *S) {
2463void StmtProfiler::VisitObjCIsaExpr(
const ObjCIsaExpr *S) {
2468void StmtProfiler::VisitObjCBoolLiteralExpr(
const ObjCBoolLiteralExpr *S) {
2473void StmtProfiler::VisitObjCIndirectCopyRestoreExpr(
2474 const ObjCIndirectCopyRestoreExpr *S) {
2479void StmtProfiler::VisitObjCBridgedCastExpr(
const ObjCBridgedCastExpr *S) {
2480 VisitExplicitCastExpr(S);
2484void StmtProfiler::VisitObjCAvailabilityCheckExpr(
2485 const ObjCAvailabilityCheckExpr *S) {
2489void StmtProfiler::VisitTemplateArguments(
const TemplateArgumentLoc *Args,
2491 ID.AddInteger(NumArgs);
2492 for (
unsigned I = 0; I != NumArgs; ++I)
2496void StmtProfiler::VisitTemplateArgument(
const TemplateArgument &Arg) {
2539 VisitTemplateArgument(P);
2545class OpenACCClauseProfiler
2546 :
public OpenACCClauseVisitor<OpenACCClauseProfiler> {
2547 StmtProfiler &Profiler;
2550 OpenACCClauseProfiler(StmtProfiler &P) : Profiler(P) {}
2552 void VisitOpenACCClauseList(ArrayRef<const OpenACCClause *> Clauses) {
2553 for (
const OpenACCClause *Clause : Clauses) {
2560 void VisitClauseWithVarList(
const OpenACCClauseWithVarList &Clause) {
2562 Profiler.VisitStmt(E);
2565#define VISIT_CLAUSE(CLAUSE_NAME) \
2566 void Visit##CLAUSE_NAME##Clause(const OpenACC##CLAUSE_NAME##Clause &Clause);
2568#include "clang/Basic/OpenACCClauses.def"
2572void OpenACCClauseProfiler::VisitDefaultClause(
2573 const OpenACCDefaultClause &Clause) {}
2575void OpenACCClauseProfiler::VisitIfClause(
const OpenACCIfClause &Clause) {
2577 "if clause requires a valid condition expr");
2581void OpenACCClauseProfiler::VisitCopyClause(
const OpenACCCopyClause &Clause) {
2582 VisitClauseWithVarList(Clause);
2585void OpenACCClauseProfiler::VisitLinkClause(
const OpenACCLinkClause &Clause) {
2586 VisitClauseWithVarList(Clause);
2589void OpenACCClauseProfiler::VisitDeviceResidentClause(
2590 const OpenACCDeviceResidentClause &Clause) {
2591 VisitClauseWithVarList(Clause);
2594void OpenACCClauseProfiler::VisitCopyInClause(
2595 const OpenACCCopyInClause &Clause) {
2596 VisitClauseWithVarList(Clause);
2599void OpenACCClauseProfiler::VisitCopyOutClause(
2600 const OpenACCCopyOutClause &Clause) {
2601 VisitClauseWithVarList(Clause);
2604void OpenACCClauseProfiler::VisitCreateClause(
2605 const OpenACCCreateClause &Clause) {
2606 VisitClauseWithVarList(Clause);
2609void OpenACCClauseProfiler::VisitHostClause(
const OpenACCHostClause &Clause) {
2610 VisitClauseWithVarList(Clause);
2613void OpenACCClauseProfiler::VisitDeviceClause(
2614 const OpenACCDeviceClause &Clause) {
2615 VisitClauseWithVarList(Clause);
2618void OpenACCClauseProfiler::VisitSelfClause(
const OpenACCSelfClause &Clause) {
2624 Profiler.VisitStmt(E);
2628void OpenACCClauseProfiler::VisitFinalizeClause(
2629 const OpenACCFinalizeClause &Clause) {}
2631void OpenACCClauseProfiler::VisitIfPresentClause(
2632 const OpenACCIfPresentClause &Clause) {}
2634void OpenACCClauseProfiler::VisitNumGangsClause(
2635 const OpenACCNumGangsClause &Clause) {
2637 Profiler.VisitStmt(E);
2640void OpenACCClauseProfiler::VisitTileClause(
const OpenACCTileClause &Clause) {
2642 Profiler.VisitStmt(E);
2645void OpenACCClauseProfiler::VisitNumWorkersClause(
2646 const OpenACCNumWorkersClause &Clause) {
2647 assert(Clause.
hasIntExpr() &&
"num_workers clause requires a valid int expr");
2651void OpenACCClauseProfiler::VisitCollapseClause(
2652 const OpenACCCollapseClause &Clause) {
2653 assert(Clause.
getLoopCount() &&
"collapse clause requires a valid int expr");
2657void OpenACCClauseProfiler::VisitPrivateClause(
2658 const OpenACCPrivateClause &Clause) {
2659 VisitClauseWithVarList(Clause);
2662 Profiler.VisitDecl(Recipe.AllocaDecl);
2666void OpenACCClauseProfiler::VisitFirstPrivateClause(
2667 const OpenACCFirstPrivateClause &Clause) {
2668 VisitClauseWithVarList(Clause);
2671 Profiler.VisitDecl(Recipe.AllocaDecl);
2672 Profiler.VisitDecl(Recipe.InitFromTemporary);
2676void OpenACCClauseProfiler::VisitAttachClause(
2677 const OpenACCAttachClause &Clause) {
2678 VisitClauseWithVarList(Clause);
2681void OpenACCClauseProfiler::VisitDetachClause(
2682 const OpenACCDetachClause &Clause) {
2683 VisitClauseWithVarList(Clause);
2686void OpenACCClauseProfiler::VisitDeleteClause(
2687 const OpenACCDeleteClause &Clause) {
2688 VisitClauseWithVarList(Clause);
2691void OpenACCClauseProfiler::VisitDevicePtrClause(
2692 const OpenACCDevicePtrClause &Clause) {
2693 VisitClauseWithVarList(Clause);
2696void OpenACCClauseProfiler::VisitNoCreateClause(
2697 const OpenACCNoCreateClause &Clause) {
2698 VisitClauseWithVarList(Clause);
2701void OpenACCClauseProfiler::VisitPresentClause(
2702 const OpenACCPresentClause &Clause) {
2703 VisitClauseWithVarList(Clause);
2706void OpenACCClauseProfiler::VisitUseDeviceClause(
2707 const OpenACCUseDeviceClause &Clause) {
2708 VisitClauseWithVarList(Clause);
2711void OpenACCClauseProfiler::VisitVectorLengthClause(
2712 const OpenACCVectorLengthClause &Clause) {
2714 "vector_length clause requires a valid int expr");
2718void OpenACCClauseProfiler::VisitAsyncClause(
const OpenACCAsyncClause &Clause) {
2723void OpenACCClauseProfiler::VisitDeviceNumClause(
2724 const OpenACCDeviceNumClause &Clause) {
2728void OpenACCClauseProfiler::VisitDefaultAsyncClause(
2729 const OpenACCDefaultAsyncClause &Clause) {
2733void OpenACCClauseProfiler::VisitWorkerClause(
2734 const OpenACCWorkerClause &Clause) {
2739void OpenACCClauseProfiler::VisitVectorClause(
2740 const OpenACCVectorClause &Clause) {
2745void OpenACCClauseProfiler::VisitWaitClause(
const OpenACCWaitClause &Clause) {
2749 Profiler.VisitStmt(E);
2753void OpenACCClauseProfiler::VisitDeviceTypeClause(
2754 const OpenACCDeviceTypeClause &Clause) {}
2756void OpenACCClauseProfiler::VisitAutoClause(
const OpenACCAutoClause &Clause) {}
2758void OpenACCClauseProfiler::VisitIndependentClause(
2759 const OpenACCIndependentClause &Clause) {}
2761void OpenACCClauseProfiler::VisitSeqClause(
const OpenACCSeqClause &Clause) {}
2762void OpenACCClauseProfiler::VisitNoHostClause(
2763 const OpenACCNoHostClause &Clause) {}
2765void OpenACCClauseProfiler::VisitGangClause(
const OpenACCGangClause &Clause) {
2766 for (
unsigned I = 0; I < Clause.
getNumExprs(); ++I) {
2767 Profiler.VisitStmt(Clause.
getExpr(I).second);
2771void OpenACCClauseProfiler::VisitReductionClause(
2772 const OpenACCReductionClause &Clause) {
2773 VisitClauseWithVarList(Clause);
2776 Profiler.VisitDecl(Recipe.AllocaDecl);
2781 static_assert(
sizeof(OpenACCReductionRecipe::CombinerRecipe) ==
2783 for (
auto &CombinerRecipe : Recipe.CombinerRecipes) {
2784 if (CombinerRecipe.Op) {
2785 Profiler.VisitDecl(CombinerRecipe.LHS);
2786 Profiler.VisitDecl(CombinerRecipe.RHS);
2787 Profiler.VisitStmt(CombinerRecipe.Op);
2793void OpenACCClauseProfiler::VisitBindClause(
const OpenACCBindClause &Clause) {
2794 assert(
false &&
"not implemented... what can we do about our expr?");
2798void StmtProfiler::VisitOpenACCComputeConstruct(
2803 OpenACCClauseProfiler P{*
this};
2804 P.VisitOpenACCClauseList(S->clauses());
2807void StmtProfiler::VisitOpenACCLoopConstruct(
const OpenACCLoopConstruct *S) {
2811 OpenACCClauseProfiler P{*
this};
2812 P.VisitOpenACCClauseList(S->clauses());
2815void StmtProfiler::VisitOpenACCCombinedConstruct(
2816 const OpenACCCombinedConstruct *S) {
2820 OpenACCClauseProfiler P{*
this};
2821 P.VisitOpenACCClauseList(S->clauses());
2824void StmtProfiler::VisitOpenACCDataConstruct(
const OpenACCDataConstruct *S) {
2827 OpenACCClauseProfiler P{*
this};
2828 P.VisitOpenACCClauseList(S->clauses());
2831void StmtProfiler::VisitOpenACCEnterDataConstruct(
2832 const OpenACCEnterDataConstruct *S) {
2835 OpenACCClauseProfiler P{*
this};
2836 P.VisitOpenACCClauseList(S->clauses());
2839void StmtProfiler::VisitOpenACCExitDataConstruct(
2840 const OpenACCExitDataConstruct *S) {
2843 OpenACCClauseProfiler P{*
this};
2844 P.VisitOpenACCClauseList(S->clauses());
2847void StmtProfiler::VisitOpenACCHostDataConstruct(
2848 const OpenACCHostDataConstruct *S) {
2851 OpenACCClauseProfiler P{*
this};
2852 P.VisitOpenACCClauseList(S->clauses());
2855void StmtProfiler::VisitOpenACCWaitConstruct(
const OpenACCWaitConstruct *S) {
2859 OpenACCClauseProfiler P{*
this};
2860 P.VisitOpenACCClauseList(S->clauses());
2863void StmtProfiler::VisitOpenACCCacheConstruct(
const OpenACCCacheConstruct *S) {
2868void StmtProfiler::VisitOpenACCInitConstruct(
const OpenACCInitConstruct *S) {
2870 OpenACCClauseProfiler P{*
this};
2871 P.VisitOpenACCClauseList(S->clauses());
2874void StmtProfiler::VisitOpenACCShutdownConstruct(
2875 const OpenACCShutdownConstruct *S) {
2877 OpenACCClauseProfiler P{*
this};
2878 P.VisitOpenACCClauseList(S->clauses());
2881void StmtProfiler::VisitOpenACCSetConstruct(
const OpenACCSetConstruct *S) {
2883 OpenACCClauseProfiler P{*
this};
2884 P.VisitOpenACCClauseList(S->clauses());
2887void StmtProfiler::VisitOpenACCUpdateConstruct(
2888 const OpenACCUpdateConstruct *S) {
2890 OpenACCClauseProfiler P{*
this};
2891 P.VisitOpenACCClauseList(S->clauses());
2894void StmtProfiler::VisitOpenACCAtomicConstruct(
2895 const OpenACCAtomicConstruct *S) {
2897 OpenACCClauseProfiler P{*
this};
2898 P.VisitOpenACCClauseList(S->clauses());
2901void StmtProfiler::VisitHLSLOutArgExpr(
const HLSLOutArgExpr *S) {
2906 bool Canonical,
bool ProfileLambdaExpr)
const {
2907 StmtProfilerWithPointers Profiler(ID, Context, Canonical, ProfileLambdaExpr);
2908 Profiler.Visit(
this);
2913 StmtProfilerWithoutPointers Profiler(ID, Hash);
2914 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()
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
IdentifierInfo & getAccessor() 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.
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)
const FunctionProtoType * T
U cast(CodeGen::Address addr)
DeclarationName getName() const
getName - Returns the embedded declaration name.
Expr * AllocatorTraits
Allocator traits.
Expr * Allocator
Allocator.