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::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::VisitOMPProcBindClause(
const OMPProcBindClause *
C) { }
555void OMPClauseProfiler::VisitOMPUnifiedAddressClause(
556 const OMPUnifiedAddressClause *
C) {}
558void OMPClauseProfiler::VisitOMPUnifiedSharedMemoryClause(
559 const OMPUnifiedSharedMemoryClause *
C) {}
561void OMPClauseProfiler::VisitOMPReverseOffloadClause(
562 const OMPReverseOffloadClause *
C) {}
564void OMPClauseProfiler::VisitOMPDynamicAllocatorsClause(
565 const OMPDynamicAllocatorsClause *
C) {}
567void OMPClauseProfiler::VisitOMPAtomicDefaultMemOrderClause(
568 const OMPAtomicDefaultMemOrderClause *
C) {}
570void OMPClauseProfiler::VisitOMPSelfMapsClause(
const OMPSelfMapsClause *
C) {}
572void OMPClauseProfiler::VisitOMPAtClause(
const OMPAtClause *
C) {}
574void OMPClauseProfiler::VisitOMPSeverityClause(
const OMPSeverityClause *
C) {}
576void OMPClauseProfiler::VisitOMPMessageClause(
const OMPMessageClause *
C) {
577 if (
C->getMessageString())
578 Profiler->VisitStmt(
C->getMessageString());
581void OMPClauseProfiler::VisitOMPScheduleClause(
const OMPScheduleClause *
C) {
582 VisitOMPClauseWithPreInit(
C);
583 if (
auto *S =
C->getChunkSize())
584 Profiler->VisitStmt(S);
587void OMPClauseProfiler::VisitOMPOrderedClause(
const OMPOrderedClause *
C) {
588 if (
auto *
Num =
C->getNumForLoops())
589 Profiler->VisitStmt(
Num);
592void OMPClauseProfiler::VisitOMPNowaitClause(
const OMPNowaitClause *
C) {
593 if (
C->getCondition())
594 Profiler->VisitStmt(
C->getCondition());
597void OMPClauseProfiler::VisitOMPUntiedClause(
const OMPUntiedClause *) {}
599void OMPClauseProfiler::VisitOMPMergeableClause(
const OMPMergeableClause *) {}
601void OMPClauseProfiler::VisitOMPReadClause(
const OMPReadClause *) {}
603void OMPClauseProfiler::VisitOMPWriteClause(
const OMPWriteClause *) {}
605void OMPClauseProfiler::VisitOMPUpdateClause(
const OMPUpdateClause *) {}
607void OMPClauseProfiler::VisitOMPCaptureClause(
const OMPCaptureClause *) {}
609void OMPClauseProfiler::VisitOMPCompareClause(
const OMPCompareClause *) {}
611void OMPClauseProfiler::VisitOMPFailClause(
const OMPFailClause *) {}
613void OMPClauseProfiler::VisitOMPAbsentClause(
const OMPAbsentClause *) {}
615void OMPClauseProfiler::VisitOMPHoldsClause(
const OMPHoldsClause *) {}
617void OMPClauseProfiler::VisitOMPContainsClause(
const OMPContainsClause *) {}
619void OMPClauseProfiler::VisitOMPNoOpenMPClause(
const OMPNoOpenMPClause *) {}
621void OMPClauseProfiler::VisitOMPNoOpenMPRoutinesClause(
622 const OMPNoOpenMPRoutinesClause *) {}
624void OMPClauseProfiler::VisitOMPNoOpenMPConstructsClause(
625 const OMPNoOpenMPConstructsClause *) {}
627void OMPClauseProfiler::VisitOMPNoParallelismClause(
628 const OMPNoParallelismClause *) {}
630void OMPClauseProfiler::VisitOMPSeqCstClause(
const OMPSeqCstClause *) {}
632void OMPClauseProfiler::VisitOMPAcqRelClause(
const OMPAcqRelClause *) {}
634void OMPClauseProfiler::VisitOMPAcquireClause(
const OMPAcquireClause *) {}
636void OMPClauseProfiler::VisitOMPReleaseClause(
const OMPReleaseClause *) {}
638void OMPClauseProfiler::VisitOMPRelaxedClause(
const OMPRelaxedClause *) {}
640void OMPClauseProfiler::VisitOMPWeakClause(
const OMPWeakClause *) {}
642void OMPClauseProfiler::VisitOMPThreadsClause(
const OMPThreadsClause *) {}
644void OMPClauseProfiler::VisitOMPSIMDClause(
const OMPSIMDClause *) {}
646void OMPClauseProfiler::VisitOMPNogroupClause(
const OMPNogroupClause *) {}
648void OMPClauseProfiler::VisitOMPInitClause(
const OMPInitClause *
C) {
649 VisitOMPClauseList(
C);
652void OMPClauseProfiler::VisitOMPUseClause(
const OMPUseClause *
C) {
653 if (
C->getInteropVar())
654 Profiler->VisitStmt(
C->getInteropVar());
657void OMPClauseProfiler::VisitOMPDestroyClause(
const OMPDestroyClause *
C) {
658 if (
C->getInteropVar())
659 Profiler->VisitStmt(
C->getInteropVar());
662void OMPClauseProfiler::VisitOMPFilterClause(
const OMPFilterClause *
C) {
663 VisitOMPClauseWithPreInit(
C);
664 if (
C->getThreadID())
665 Profiler->VisitStmt(
C->getThreadID());
669void OMPClauseProfiler::VisitOMPClauseList(
T *Node) {
670 for (
auto *E : Node->varlist()) {
672 Profiler->VisitStmt(E);
676void OMPClauseProfiler::VisitOMPPrivateClause(
const OMPPrivateClause *
C) {
677 VisitOMPClauseList(
C);
678 for (
auto *E :
C->private_copies()) {
680 Profiler->VisitStmt(E);
684OMPClauseProfiler::VisitOMPFirstprivateClause(
const OMPFirstprivateClause *
C) {
685 VisitOMPClauseList(
C);
686 VisitOMPClauseWithPreInit(
C);
687 for (
auto *E :
C->private_copies()) {
689 Profiler->VisitStmt(E);
691 for (
auto *E :
C->inits()) {
693 Profiler->VisitStmt(E);
697OMPClauseProfiler::VisitOMPLastprivateClause(
const OMPLastprivateClause *
C) {
698 VisitOMPClauseList(
C);
699 VisitOMPClauseWithPostUpdate(
C);
700 for (
auto *E :
C->source_exprs()) {
702 Profiler->VisitStmt(E);
704 for (
auto *E :
C->destination_exprs()) {
706 Profiler->VisitStmt(E);
708 for (
auto *E :
C->assignment_ops()) {
710 Profiler->VisitStmt(E);
713void OMPClauseProfiler::VisitOMPSharedClause(
const OMPSharedClause *
C) {
714 VisitOMPClauseList(
C);
716void OMPClauseProfiler::VisitOMPReductionClause(
717 const OMPReductionClause *
C) {
718 Profiler->VisitNestedNameSpecifier(
719 C->getQualifierLoc().getNestedNameSpecifier());
720 Profiler->VisitName(
C->getNameInfo().getName());
721 VisitOMPClauseList(
C);
722 VisitOMPClauseWithPostUpdate(
C);
723 for (
auto *E :
C->privates()) {
725 Profiler->VisitStmt(E);
727 for (
auto *E :
C->lhs_exprs()) {
729 Profiler->VisitStmt(E);
731 for (
auto *E :
C->rhs_exprs()) {
733 Profiler->VisitStmt(E);
735 for (
auto *E :
C->reduction_ops()) {
737 Profiler->VisitStmt(E);
739 if (
C->getModifier() == clang::OMPC_REDUCTION_inscan) {
740 for (
auto *E :
C->copy_ops()) {
742 Profiler->VisitStmt(E);
744 for (
auto *E :
C->copy_array_temps()) {
746 Profiler->VisitStmt(E);
748 for (
auto *E :
C->copy_array_elems()) {
750 Profiler->VisitStmt(E);
754void OMPClauseProfiler::VisitOMPTaskReductionClause(
755 const OMPTaskReductionClause *
C) {
756 Profiler->VisitNestedNameSpecifier(
757 C->getQualifierLoc().getNestedNameSpecifier());
758 Profiler->VisitName(
C->getNameInfo().getName());
759 VisitOMPClauseList(
C);
760 VisitOMPClauseWithPostUpdate(
C);
761 for (
auto *E :
C->privates()) {
763 Profiler->VisitStmt(E);
765 for (
auto *E :
C->lhs_exprs()) {
767 Profiler->VisitStmt(E);
769 for (
auto *E :
C->rhs_exprs()) {
771 Profiler->VisitStmt(E);
773 for (
auto *E :
C->reduction_ops()) {
775 Profiler->VisitStmt(E);
778void OMPClauseProfiler::VisitOMPInReductionClause(
779 const OMPInReductionClause *
C) {
780 Profiler->VisitNestedNameSpecifier(
781 C->getQualifierLoc().getNestedNameSpecifier());
782 Profiler->VisitName(
C->getNameInfo().getName());
783 VisitOMPClauseList(
C);
784 VisitOMPClauseWithPostUpdate(
C);
785 for (
auto *E :
C->privates()) {
787 Profiler->VisitStmt(E);
789 for (
auto *E :
C->lhs_exprs()) {
791 Profiler->VisitStmt(E);
793 for (
auto *E :
C->rhs_exprs()) {
795 Profiler->VisitStmt(E);
797 for (
auto *E :
C->reduction_ops()) {
799 Profiler->VisitStmt(E);
801 for (
auto *E :
C->taskgroup_descriptors()) {
803 Profiler->VisitStmt(E);
806void OMPClauseProfiler::VisitOMPLinearClause(
const OMPLinearClause *
C) {
807 VisitOMPClauseList(
C);
808 VisitOMPClauseWithPostUpdate(
C);
809 for (
auto *E :
C->privates()) {
811 Profiler->VisitStmt(E);
813 for (
auto *E :
C->inits()) {
815 Profiler->VisitStmt(E);
817 for (
auto *E :
C->updates()) {
819 Profiler->VisitStmt(E);
821 for (
auto *E :
C->finals()) {
823 Profiler->VisitStmt(E);
826 Profiler->VisitStmt(
C->getStep());
827 if (
C->getCalcStep())
828 Profiler->VisitStmt(
C->getCalcStep());
830void OMPClauseProfiler::VisitOMPAlignedClause(
const OMPAlignedClause *
C) {
831 VisitOMPClauseList(
C);
832 if (
C->getAlignment())
833 Profiler->VisitStmt(
C->getAlignment());
835void OMPClauseProfiler::VisitOMPCopyinClause(
const OMPCopyinClause *
C) {
836 VisitOMPClauseList(
C);
837 for (
auto *E :
C->source_exprs()) {
839 Profiler->VisitStmt(E);
841 for (
auto *E :
C->destination_exprs()) {
843 Profiler->VisitStmt(E);
845 for (
auto *E :
C->assignment_ops()) {
847 Profiler->VisitStmt(E);
851OMPClauseProfiler::VisitOMPCopyprivateClause(
const OMPCopyprivateClause *
C) {
852 VisitOMPClauseList(
C);
853 for (
auto *E :
C->source_exprs()) {
855 Profiler->VisitStmt(E);
857 for (
auto *E :
C->destination_exprs()) {
859 Profiler->VisitStmt(E);
861 for (
auto *E :
C->assignment_ops()) {
863 Profiler->VisitStmt(E);
866void OMPClauseProfiler::VisitOMPFlushClause(
const OMPFlushClause *
C) {
867 VisitOMPClauseList(
C);
869void OMPClauseProfiler::VisitOMPDepobjClause(
const OMPDepobjClause *
C) {
870 if (
const Expr *Depobj =
C->getDepobj())
871 Profiler->VisitStmt(Depobj);
873void OMPClauseProfiler::VisitOMPDependClause(
const OMPDependClause *
C) {
874 VisitOMPClauseList(
C);
876void OMPClauseProfiler::VisitOMPDeviceClause(
const OMPDeviceClause *
C) {
878 Profiler->VisitStmt(
C->getDevice());
880void OMPClauseProfiler::VisitOMPMapClause(
const OMPMapClause *
C) {
881 VisitOMPClauseList(
C);
883void OMPClauseProfiler::VisitOMPAllocateClause(
const OMPAllocateClause *
C) {
884 if (Expr *Allocator =
C->getAllocator())
885 Profiler->VisitStmt(Allocator);
886 VisitOMPClauseList(
C);
888void OMPClauseProfiler::VisitOMPNumTeamsClause(
const OMPNumTeamsClause *
C) {
889 VisitOMPClauseList(
C);
890 VisitOMPClauseWithPreInit(
C);
892void OMPClauseProfiler::VisitOMPThreadLimitClause(
893 const OMPThreadLimitClause *
C) {
894 VisitOMPClauseList(
C);
895 VisitOMPClauseWithPreInit(
C);
897void OMPClauseProfiler::VisitOMPPriorityClause(
const OMPPriorityClause *
C) {
898 VisitOMPClauseWithPreInit(
C);
899 if (
C->getPriority())
900 Profiler->VisitStmt(
C->getPriority());
902void OMPClauseProfiler::VisitOMPGrainsizeClause(
const OMPGrainsizeClause *
C) {
903 VisitOMPClauseWithPreInit(
C);
904 if (
C->getGrainsize())
905 Profiler->VisitStmt(
C->getGrainsize());
907void OMPClauseProfiler::VisitOMPNumTasksClause(
const OMPNumTasksClause *
C) {
908 VisitOMPClauseWithPreInit(
C);
909 if (
C->getNumTasks())
910 Profiler->VisitStmt(
C->getNumTasks());
912void OMPClauseProfiler::VisitOMPHintClause(
const OMPHintClause *
C) {
914 Profiler->VisitStmt(
C->getHint());
916void OMPClauseProfiler::VisitOMPToClause(
const OMPToClause *
C) {
917 VisitOMPClauseList(
C);
919void OMPClauseProfiler::VisitOMPFromClause(
const OMPFromClause *
C) {
920 VisitOMPClauseList(
C);
922void OMPClauseProfiler::VisitOMPUseDevicePtrClause(
923 const OMPUseDevicePtrClause *
C) {
924 VisitOMPClauseList(
C);
926void OMPClauseProfiler::VisitOMPUseDeviceAddrClause(
927 const OMPUseDeviceAddrClause *
C) {
928 VisitOMPClauseList(
C);
930void OMPClauseProfiler::VisitOMPIsDevicePtrClause(
931 const OMPIsDevicePtrClause *
C) {
932 VisitOMPClauseList(
C);
934void OMPClauseProfiler::VisitOMPHasDeviceAddrClause(
935 const OMPHasDeviceAddrClause *
C) {
936 VisitOMPClauseList(
C);
938void OMPClauseProfiler::VisitOMPNontemporalClause(
939 const OMPNontemporalClause *
C) {
940 VisitOMPClauseList(
C);
941 for (
auto *E :
C->private_refs())
942 Profiler->VisitStmt(E);
944void OMPClauseProfiler::VisitOMPInclusiveClause(
const OMPInclusiveClause *
C) {
945 VisitOMPClauseList(
C);
947void OMPClauseProfiler::VisitOMPExclusiveClause(
const OMPExclusiveClause *
C) {
948 VisitOMPClauseList(
C);
950void OMPClauseProfiler::VisitOMPUsesAllocatorsClause(
951 const OMPUsesAllocatorsClause *
C) {
952 for (
unsigned I = 0, E =
C->getNumberOfAllocators(); I < E; ++I) {
953 OMPUsesAllocatorsClause::Data D =
C->getAllocatorData(I);
959void OMPClauseProfiler::VisitOMPAffinityClause(
const OMPAffinityClause *
C) {
960 if (
const Expr *Modifier =
C->getModifier())
961 Profiler->VisitStmt(Modifier);
962 for (
const Expr *E :
C->varlist())
963 Profiler->VisitStmt(E);
965void OMPClauseProfiler::VisitOMPOrderClause(
const OMPOrderClause *
C) {}
966void OMPClauseProfiler::VisitOMPBindClause(
const OMPBindClause *
C) {}
967void OMPClauseProfiler::VisitOMPXDynCGroupMemClause(
968 const OMPXDynCGroupMemClause *
C) {
969 VisitOMPClauseWithPreInit(
C);
970 if (Expr *Size =
C->getSize())
971 Profiler->VisitStmt(Size);
973void OMPClauseProfiler::VisitOMPDynGroupprivateClause(
974 const OMPDynGroupprivateClause *
C) {
975 VisitOMPClauseWithPreInit(
C);
976 if (
auto *Size =
C->getSize())
977 Profiler->VisitStmt(Size);
979void OMPClauseProfiler::VisitOMPDoacrossClause(
const OMPDoacrossClause *
C) {
980 VisitOMPClauseList(
C);
982void OMPClauseProfiler::VisitOMPXAttributeClause(
const OMPXAttributeClause *
C) {
984void OMPClauseProfiler::VisitOMPXBareClause(
const OMPXBareClause *
C) {}
988StmtProfiler::VisitOMPExecutableDirective(
const OMPExecutableDirective *S) {
990 OMPClauseProfiler P(
this);
991 ArrayRef<OMPClause *> Clauses = S->clauses();
992 for (ArrayRef<OMPClause *>::iterator I = Clauses.begin(), E = Clauses.end();
998void StmtProfiler::VisitOMPCanonicalLoop(
const OMPCanonicalLoop *L) {
1002void StmtProfiler::VisitOMPLoopBasedDirective(
const OMPLoopBasedDirective *S) {
1003 VisitOMPExecutableDirective(S);
1006void StmtProfiler::VisitOMPLoopDirective(
const OMPLoopDirective *S) {
1007 VisitOMPLoopBasedDirective(S);
1010void StmtProfiler::VisitOMPMetaDirective(
const OMPMetaDirective *S) {
1011 VisitOMPExecutableDirective(S);
1014void StmtProfiler::VisitOMPParallelDirective(
const OMPParallelDirective *S) {
1015 VisitOMPExecutableDirective(S);
1018void StmtProfiler::VisitOMPSimdDirective(
const OMPSimdDirective *S) {
1019 VisitOMPLoopDirective(S);
1022void StmtProfiler::VisitOMPCanonicalLoopNestTransformationDirective(
1023 const OMPCanonicalLoopNestTransformationDirective *S) {
1024 VisitOMPLoopBasedDirective(S);
1027void StmtProfiler::VisitOMPTileDirective(
const OMPTileDirective *S) {
1028 VisitOMPCanonicalLoopNestTransformationDirective(S);
1031void StmtProfiler::VisitOMPStripeDirective(
const OMPStripeDirective *S) {
1032 VisitOMPCanonicalLoopNestTransformationDirective(S);
1035void StmtProfiler::VisitOMPUnrollDirective(
const OMPUnrollDirective *S) {
1036 VisitOMPCanonicalLoopNestTransformationDirective(S);
1039void StmtProfiler::VisitOMPReverseDirective(
const OMPReverseDirective *S) {
1040 VisitOMPCanonicalLoopNestTransformationDirective(S);
1043void StmtProfiler::VisitOMPInterchangeDirective(
1044 const OMPInterchangeDirective *S) {
1045 VisitOMPCanonicalLoopNestTransformationDirective(S);
1048void StmtProfiler::VisitOMPCanonicalLoopSequenceTransformationDirective(
1049 const OMPCanonicalLoopSequenceTransformationDirective *S) {
1050 VisitOMPExecutableDirective(S);
1053void StmtProfiler::VisitOMPFuseDirective(
const OMPFuseDirective *S) {
1054 VisitOMPCanonicalLoopSequenceTransformationDirective(S);
1057void StmtProfiler::VisitOMPForDirective(
const OMPForDirective *S) {
1058 VisitOMPLoopDirective(S);
1061void StmtProfiler::VisitOMPForSimdDirective(
const OMPForSimdDirective *S) {
1062 VisitOMPLoopDirective(S);
1065void StmtProfiler::VisitOMPSectionsDirective(
const OMPSectionsDirective *S) {
1066 VisitOMPExecutableDirective(S);
1069void StmtProfiler::VisitOMPSectionDirective(
const OMPSectionDirective *S) {
1070 VisitOMPExecutableDirective(S);
1073void StmtProfiler::VisitOMPScopeDirective(
const OMPScopeDirective *S) {
1074 VisitOMPExecutableDirective(S);
1077void StmtProfiler::VisitOMPSingleDirective(
const OMPSingleDirective *S) {
1078 VisitOMPExecutableDirective(S);
1081void StmtProfiler::VisitOMPMasterDirective(
const OMPMasterDirective *S) {
1082 VisitOMPExecutableDirective(S);
1085void StmtProfiler::VisitOMPCriticalDirective(
const OMPCriticalDirective *S) {
1086 VisitOMPExecutableDirective(S);
1087 VisitName(S->getDirectiveName().getName());
1091StmtProfiler::VisitOMPParallelForDirective(
const OMPParallelForDirective *S) {
1092 VisitOMPLoopDirective(S);
1095void StmtProfiler::VisitOMPParallelForSimdDirective(
1096 const OMPParallelForSimdDirective *S) {
1097 VisitOMPLoopDirective(S);
1100void StmtProfiler::VisitOMPParallelMasterDirective(
1101 const OMPParallelMasterDirective *S) {
1102 VisitOMPExecutableDirective(S);
1105void StmtProfiler::VisitOMPParallelMaskedDirective(
1106 const OMPParallelMaskedDirective *S) {
1107 VisitOMPExecutableDirective(S);
1110void StmtProfiler::VisitOMPParallelSectionsDirective(
1111 const OMPParallelSectionsDirective *S) {
1112 VisitOMPExecutableDirective(S);
1115void StmtProfiler::VisitOMPTaskDirective(
const OMPTaskDirective *S) {
1116 VisitOMPExecutableDirective(S);
1119void StmtProfiler::VisitOMPTaskyieldDirective(
const OMPTaskyieldDirective *S) {
1120 VisitOMPExecutableDirective(S);
1123void StmtProfiler::VisitOMPBarrierDirective(
const OMPBarrierDirective *S) {
1124 VisitOMPExecutableDirective(S);
1127void StmtProfiler::VisitOMPTaskwaitDirective(
const OMPTaskwaitDirective *S) {
1128 VisitOMPExecutableDirective(S);
1131void StmtProfiler::VisitOMPAssumeDirective(
const OMPAssumeDirective *S) {
1132 VisitOMPExecutableDirective(S);
1135void StmtProfiler::VisitOMPErrorDirective(
const OMPErrorDirective *S) {
1136 VisitOMPExecutableDirective(S);
1138void StmtProfiler::VisitOMPTaskgroupDirective(
const OMPTaskgroupDirective *S) {
1139 VisitOMPExecutableDirective(S);
1140 if (
const Expr *E = S->getReductionRef())
1144void StmtProfiler::VisitOMPFlushDirective(
const OMPFlushDirective *S) {
1145 VisitOMPExecutableDirective(S);
1148void StmtProfiler::VisitOMPDepobjDirective(
const OMPDepobjDirective *S) {
1149 VisitOMPExecutableDirective(S);
1152void StmtProfiler::VisitOMPScanDirective(
const OMPScanDirective *S) {
1153 VisitOMPExecutableDirective(S);
1156void StmtProfiler::VisitOMPOrderedDirective(
const OMPOrderedDirective *S) {
1157 VisitOMPExecutableDirective(S);
1160void StmtProfiler::VisitOMPAtomicDirective(
const OMPAtomicDirective *S) {
1161 VisitOMPExecutableDirective(S);
1164void StmtProfiler::VisitOMPTargetDirective(
const OMPTargetDirective *S) {
1165 VisitOMPExecutableDirective(S);
1168void StmtProfiler::VisitOMPTargetDataDirective(
const OMPTargetDataDirective *S) {
1169 VisitOMPExecutableDirective(S);
1172void StmtProfiler::VisitOMPTargetEnterDataDirective(
1173 const OMPTargetEnterDataDirective *S) {
1174 VisitOMPExecutableDirective(S);
1177void StmtProfiler::VisitOMPTargetExitDataDirective(
1178 const OMPTargetExitDataDirective *S) {
1179 VisitOMPExecutableDirective(S);
1182void StmtProfiler::VisitOMPTargetParallelDirective(
1183 const OMPTargetParallelDirective *S) {
1184 VisitOMPExecutableDirective(S);
1187void StmtProfiler::VisitOMPTargetParallelForDirective(
1188 const OMPTargetParallelForDirective *S) {
1189 VisitOMPExecutableDirective(S);
1192void StmtProfiler::VisitOMPTeamsDirective(
const OMPTeamsDirective *S) {
1193 VisitOMPExecutableDirective(S);
1196void StmtProfiler::VisitOMPCancellationPointDirective(
1197 const OMPCancellationPointDirective *S) {
1198 VisitOMPExecutableDirective(S);
1201void StmtProfiler::VisitOMPCancelDirective(
const OMPCancelDirective *S) {
1202 VisitOMPExecutableDirective(S);
1205void StmtProfiler::VisitOMPTaskLoopDirective(
const OMPTaskLoopDirective *S) {
1206 VisitOMPLoopDirective(S);
1209void StmtProfiler::VisitOMPTaskLoopSimdDirective(
1210 const OMPTaskLoopSimdDirective *S) {
1211 VisitOMPLoopDirective(S);
1214void StmtProfiler::VisitOMPMasterTaskLoopDirective(
1215 const OMPMasterTaskLoopDirective *S) {
1216 VisitOMPLoopDirective(S);
1219void StmtProfiler::VisitOMPMaskedTaskLoopDirective(
1220 const OMPMaskedTaskLoopDirective *S) {
1221 VisitOMPLoopDirective(S);
1224void StmtProfiler::VisitOMPMasterTaskLoopSimdDirective(
1225 const OMPMasterTaskLoopSimdDirective *S) {
1226 VisitOMPLoopDirective(S);
1229void StmtProfiler::VisitOMPMaskedTaskLoopSimdDirective(
1230 const OMPMaskedTaskLoopSimdDirective *S) {
1231 VisitOMPLoopDirective(S);
1234void StmtProfiler::VisitOMPParallelMasterTaskLoopDirective(
1235 const OMPParallelMasterTaskLoopDirective *S) {
1236 VisitOMPLoopDirective(S);
1239void StmtProfiler::VisitOMPParallelMaskedTaskLoopDirective(
1240 const OMPParallelMaskedTaskLoopDirective *S) {
1241 VisitOMPLoopDirective(S);
1244void StmtProfiler::VisitOMPParallelMasterTaskLoopSimdDirective(
1245 const OMPParallelMasterTaskLoopSimdDirective *S) {
1246 VisitOMPLoopDirective(S);
1249void StmtProfiler::VisitOMPParallelMaskedTaskLoopSimdDirective(
1250 const OMPParallelMaskedTaskLoopSimdDirective *S) {
1251 VisitOMPLoopDirective(S);
1254void StmtProfiler::VisitOMPDistributeDirective(
1255 const OMPDistributeDirective *S) {
1256 VisitOMPLoopDirective(S);
1259void OMPClauseProfiler::VisitOMPDistScheduleClause(
1260 const OMPDistScheduleClause *
C) {
1261 VisitOMPClauseWithPreInit(
C);
1262 if (
auto *S =
C->getChunkSize())
1263 Profiler->VisitStmt(S);
1266void OMPClauseProfiler::VisitOMPDefaultmapClause(
const OMPDefaultmapClause *) {}
1268void StmtProfiler::VisitOMPTargetUpdateDirective(
1269 const OMPTargetUpdateDirective *S) {
1270 VisitOMPExecutableDirective(S);
1273void StmtProfiler::VisitOMPDistributeParallelForDirective(
1274 const OMPDistributeParallelForDirective *S) {
1275 VisitOMPLoopDirective(S);
1278void StmtProfiler::VisitOMPDistributeParallelForSimdDirective(
1279 const OMPDistributeParallelForSimdDirective *S) {
1280 VisitOMPLoopDirective(S);
1283void StmtProfiler::VisitOMPDistributeSimdDirective(
1284 const OMPDistributeSimdDirective *S) {
1285 VisitOMPLoopDirective(S);
1288void StmtProfiler::VisitOMPTargetParallelForSimdDirective(
1289 const OMPTargetParallelForSimdDirective *S) {
1290 VisitOMPLoopDirective(S);
1293void StmtProfiler::VisitOMPTargetSimdDirective(
1294 const OMPTargetSimdDirective *S) {
1295 VisitOMPLoopDirective(S);
1298void StmtProfiler::VisitOMPTeamsDistributeDirective(
1299 const OMPTeamsDistributeDirective *S) {
1300 VisitOMPLoopDirective(S);
1303void StmtProfiler::VisitOMPTeamsDistributeSimdDirective(
1304 const OMPTeamsDistributeSimdDirective *S) {
1305 VisitOMPLoopDirective(S);
1308void StmtProfiler::VisitOMPTeamsDistributeParallelForSimdDirective(
1309 const OMPTeamsDistributeParallelForSimdDirective *S) {
1310 VisitOMPLoopDirective(S);
1313void StmtProfiler::VisitOMPTeamsDistributeParallelForDirective(
1314 const OMPTeamsDistributeParallelForDirective *S) {
1315 VisitOMPLoopDirective(S);
1318void StmtProfiler::VisitOMPTargetTeamsDirective(
1319 const OMPTargetTeamsDirective *S) {
1320 VisitOMPExecutableDirective(S);
1323void StmtProfiler::VisitOMPTargetTeamsDistributeDirective(
1324 const OMPTargetTeamsDistributeDirective *S) {
1325 VisitOMPLoopDirective(S);
1328void StmtProfiler::VisitOMPTargetTeamsDistributeParallelForDirective(
1329 const OMPTargetTeamsDistributeParallelForDirective *S) {
1330 VisitOMPLoopDirective(S);
1333void StmtProfiler::VisitOMPTargetTeamsDistributeParallelForSimdDirective(
1334 const OMPTargetTeamsDistributeParallelForSimdDirective *S) {
1335 VisitOMPLoopDirective(S);
1338void StmtProfiler::VisitOMPTargetTeamsDistributeSimdDirective(
1339 const OMPTargetTeamsDistributeSimdDirective *S) {
1340 VisitOMPLoopDirective(S);
1343void StmtProfiler::VisitOMPInteropDirective(
const OMPInteropDirective *S) {
1344 VisitOMPExecutableDirective(S);
1347void StmtProfiler::VisitOMPDispatchDirective(
const OMPDispatchDirective *S) {
1348 VisitOMPExecutableDirective(S);
1351void StmtProfiler::VisitOMPMaskedDirective(
const OMPMaskedDirective *S) {
1352 VisitOMPExecutableDirective(S);
1355void StmtProfiler::VisitOMPGenericLoopDirective(
1356 const OMPGenericLoopDirective *S) {
1357 VisitOMPLoopDirective(S);
1360void StmtProfiler::VisitOMPTeamsGenericLoopDirective(
1361 const OMPTeamsGenericLoopDirective *S) {
1362 VisitOMPLoopDirective(S);
1365void StmtProfiler::VisitOMPTargetTeamsGenericLoopDirective(
1366 const OMPTargetTeamsGenericLoopDirective *S) {
1367 VisitOMPLoopDirective(S);
1370void StmtProfiler::VisitOMPParallelGenericLoopDirective(
1371 const OMPParallelGenericLoopDirective *S) {
1372 VisitOMPLoopDirective(S);
1375void StmtProfiler::VisitOMPTargetParallelGenericLoopDirective(
1376 const OMPTargetParallelGenericLoopDirective *S) {
1377 VisitOMPLoopDirective(S);
1380void StmtProfiler::VisitExpr(
const Expr *S) {
1384void StmtProfiler::VisitConstantExpr(
const ConstantExpr *S) {
1389void StmtProfiler::VisitDeclRefExpr(
const DeclRefExpr *S) {
1401void StmtProfiler::VisitSYCLUniqueStableNameExpr(
1402 const SYCLUniqueStableNameExpr *S) {
1407void StmtProfiler::VisitPredefinedExpr(
const PredefinedExpr *S) {
1412void StmtProfiler::VisitOpenACCAsteriskSizeExpr(
1413 const OpenACCAsteriskSizeExpr *S) {
1417void StmtProfiler::VisitIntegerLiteral(
const IntegerLiteral *S) {
1423 T =
T.getCanonicalType();
1425 if (
auto BitIntT =
T->
getAs<BitIntType>())
1426 BitIntT->Profile(ID);
1428 ID.AddInteger(
T->
castAs<BuiltinType>()->getKind());
1431void StmtProfiler::VisitFixedPointLiteral(
const FixedPointLiteral *S) {
1434 ID.AddInteger(S->
getType()->
castAs<BuiltinType>()->getKind());
1437void StmtProfiler::VisitCharacterLiteral(
const CharacterLiteral *S) {
1439 ID.AddInteger(llvm::to_underlying(S->
getKind()));
1443void StmtProfiler::VisitFloatingLiteral(
const FloatingLiteral *S) {
1447 ID.AddInteger(S->
getType()->
castAs<BuiltinType>()->getKind());
1450void StmtProfiler::VisitImaginaryLiteral(
const ImaginaryLiteral *S) {
1454void StmtProfiler::VisitStringLiteral(
const StringLiteral *S) {
1457 ID.AddInteger(llvm::to_underlying(S->
getKind()));
1460void StmtProfiler::VisitParenExpr(
const ParenExpr *S) {
1464void StmtProfiler::VisitParenListExpr(
const ParenListExpr *S) {
1468void StmtProfiler::VisitUnaryOperator(
const UnaryOperator *S) {
1473void StmtProfiler::VisitOffsetOfExpr(
const OffsetOfExpr *S) {
1476 for (
unsigned i = 0; i < n; ++i) {
1502StmtProfiler::VisitUnaryExprOrTypeTraitExpr(
const UnaryExprOrTypeTraitExpr *S) {
1509void StmtProfiler::VisitArraySubscriptExpr(
const ArraySubscriptExpr *S) {
1513void StmtProfiler::VisitMatrixSubscriptExpr(
const MatrixSubscriptExpr *S) {
1517void StmtProfiler::VisitArraySectionExpr(
const ArraySectionExpr *S) {
1521void StmtProfiler::VisitOMPArrayShapingExpr(
const OMPArrayShapingExpr *S) {
1525void StmtProfiler::VisitOMPIteratorExpr(
const OMPIteratorExpr *S) {
1531void StmtProfiler::VisitCallExpr(
const CallExpr *S) {
1535void StmtProfiler::VisitMemberExpr(
const MemberExpr *S) {
1543void StmtProfiler::VisitCompoundLiteralExpr(
const CompoundLiteralExpr *S) {
1548void StmtProfiler::VisitCastExpr(
const CastExpr *S) {
1552void StmtProfiler::VisitImplicitCastExpr(
const ImplicitCastExpr *S) {
1557void StmtProfiler::VisitExplicitCastExpr(
const ExplicitCastExpr *S) {
1562void StmtProfiler::VisitCStyleCastExpr(
const CStyleCastExpr *S) {
1563 VisitExplicitCastExpr(S);
1566void StmtProfiler::VisitBinaryOperator(
const BinaryOperator *S) {
1572StmtProfiler::VisitCompoundAssignOperator(
const CompoundAssignOperator *S) {
1573 VisitBinaryOperator(S);
1576void StmtProfiler::VisitConditionalOperator(
const ConditionalOperator *S) {
1580void StmtProfiler::VisitBinaryConditionalOperator(
1581 const BinaryConditionalOperator *S) {
1585void StmtProfiler::VisitAddrLabelExpr(
const AddrLabelExpr *S) {
1590void StmtProfiler::VisitStmtExpr(
const StmtExpr *S) {
1594void StmtProfiler::VisitShuffleVectorExpr(
const ShuffleVectorExpr *S) {
1598void StmtProfiler::VisitConvertVectorExpr(
const ConvertVectorExpr *S) {
1602void StmtProfiler::VisitChooseExpr(
const ChooseExpr *S) {
1606void StmtProfiler::VisitGNUNullExpr(
const GNUNullExpr *S) {
1610void StmtProfiler::VisitVAArgExpr(
const VAArgExpr *S) {
1614void StmtProfiler::VisitInitListExpr(
const InitListExpr *S) {
1623void StmtProfiler::VisitDesignatedInitExpr(
const DesignatedInitExpr *S) {
1626 for (
const DesignatedInitExpr::Designator &D : S->
designators()) {
1627 if (D.isFieldDesignator()) {
1629 VisitName(D.getFieldName());
1633 if (D.isArrayDesignator()) {
1636 assert(D.isArrayRangeDesignator());
1639 ID.AddInteger(D.getArrayIndex());
1645void StmtProfiler::VisitDesignatedInitUpdateExpr(
1646 const DesignatedInitUpdateExpr *S) {
1647 llvm_unreachable(
"Unexpected DesignatedInitUpdateExpr in syntactic form of "
1651void StmtProfiler::VisitArrayInitLoopExpr(
const ArrayInitLoopExpr *S) {
1655void StmtProfiler::VisitArrayInitIndexExpr(
const ArrayInitIndexExpr *S) {
1659void StmtProfiler::VisitNoInitExpr(
const NoInitExpr *S) {
1660 llvm_unreachable(
"Unexpected NoInitExpr in syntactic form of initializer");
1663void StmtProfiler::VisitImplicitValueInitExpr(
const ImplicitValueInitExpr *S) {
1667void StmtProfiler::VisitExtVectorElementExpr(
const ExtVectorElementExpr *S) {
1672void StmtProfiler::VisitBlockExpr(
const BlockExpr *S) {
1677void StmtProfiler::VisitGenericSelectionExpr(
const GenericSelectionExpr *S) {
1681 QualType
T = Assoc.getType();
1683 ID.AddPointer(
nullptr);
1686 VisitExpr(Assoc.getAssociationExpr());
1690void StmtProfiler::VisitPseudoObjectExpr(
const PseudoObjectExpr *S) {
1695 if (
const OpaqueValueExpr *OVE = dyn_cast<OpaqueValueExpr>(*i))
1696 Visit(OVE->getSourceExpr());
1699void StmtProfiler::VisitAtomicExpr(
const AtomicExpr *S) {
1701 ID.AddInteger(S->
getOp());
1704void StmtProfiler::VisitConceptSpecializationExpr(
1705 const ConceptSpecializationExpr *S) {
1709 VisitTemplateArgument(Arg);
1712void StmtProfiler::VisitRequiresExpr(
const RequiresExpr *S) {
1716 VisitDecl(LocalParam);
1719 if (
auto *TypeReq = dyn_cast<concepts::TypeRequirement>(Req)) {
1721 ID.AddBoolean(TypeReq->isSubstitutionFailure());
1722 if (!TypeReq->isSubstitutionFailure())
1723 VisitType(TypeReq->getType()->getType());
1724 }
else if (
auto *ExprReq = dyn_cast<concepts::ExprRequirement>(Req)) {
1726 ID.AddBoolean(ExprReq->isExprSubstitutionFailure());
1727 if (!ExprReq->isExprSubstitutionFailure())
1728 Visit(ExprReq->getExpr());
1733 ID.AddBoolean(ExprReq->getNoexceptLoc().isValid());
1734 const concepts::ExprRequirement::ReturnTypeRequirement &RetReq =
1735 ExprReq->getReturnTypeRequirement();
1748 ID.AddBoolean(NestedReq->hasInvalidConstraint());
1749 if (!NestedReq->hasInvalidConstraint())
1750 Visit(NestedReq->getConstraintExpr());
1758 unsigned &NumArgs) {
1764 case OO_Array_Delete:
1766 case OO_Conditional:
1768 llvm_unreachable(
"Invalid operator call kind");
1773 return Stmt::UnaryOperatorClass;
1777 return Stmt::BinaryOperatorClass;
1782 return Stmt::UnaryOperatorClass;
1786 return Stmt::BinaryOperatorClass;
1791 return Stmt::UnaryOperatorClass;
1795 return Stmt::BinaryOperatorClass;
1799 return Stmt::BinaryOperatorClass;
1803 return Stmt::BinaryOperatorClass;
1807 return Stmt::BinaryOperatorClass;
1811 UnaryOp = UO_AddrOf;
1812 return Stmt::UnaryOperatorClass;
1816 return Stmt::BinaryOperatorClass;
1820 return Stmt::BinaryOperatorClass;
1824 return Stmt::UnaryOperatorClass;
1828 return Stmt::UnaryOperatorClass;
1831 BinaryOp = BO_Assign;
1832 return Stmt::BinaryOperatorClass;
1836 return Stmt::BinaryOperatorClass;
1840 return Stmt::BinaryOperatorClass;
1843 BinaryOp = BO_AddAssign;
1844 return Stmt::CompoundAssignOperatorClass;
1847 BinaryOp = BO_SubAssign;
1848 return Stmt::CompoundAssignOperatorClass;
1851 BinaryOp = BO_MulAssign;
1852 return Stmt::CompoundAssignOperatorClass;
1855 BinaryOp = BO_DivAssign;
1856 return Stmt::CompoundAssignOperatorClass;
1858 case OO_PercentEqual:
1859 BinaryOp = BO_RemAssign;
1860 return Stmt::CompoundAssignOperatorClass;
1863 BinaryOp = BO_XorAssign;
1864 return Stmt::CompoundAssignOperatorClass;
1867 BinaryOp = BO_AndAssign;
1868 return Stmt::CompoundAssignOperatorClass;
1871 BinaryOp = BO_OrAssign;
1872 return Stmt::CompoundAssignOperatorClass;
1876 return Stmt::BinaryOperatorClass;
1878 case OO_GreaterGreater:
1880 return Stmt::BinaryOperatorClass;
1882 case OO_LessLessEqual:
1883 BinaryOp = BO_ShlAssign;
1884 return Stmt::CompoundAssignOperatorClass;
1886 case OO_GreaterGreaterEqual:
1887 BinaryOp = BO_ShrAssign;
1888 return Stmt::CompoundAssignOperatorClass;
1892 return Stmt::BinaryOperatorClass;
1894 case OO_ExclaimEqual:
1896 return Stmt::BinaryOperatorClass;
1900 return Stmt::BinaryOperatorClass;
1902 case OO_GreaterEqual:
1904 return Stmt::BinaryOperatorClass;
1908 return Stmt::BinaryOperatorClass;
1912 return Stmt::BinaryOperatorClass;
1916 return Stmt::BinaryOperatorClass;
1919 UnaryOp = NumArgs == 1 ? UO_PreInc : UO_PostInc;
1921 return Stmt::UnaryOperatorClass;
1924 UnaryOp = NumArgs == 1 ? UO_PreDec : UO_PostDec;
1926 return Stmt::UnaryOperatorClass;
1929 BinaryOp = BO_Comma;
1930 return Stmt::BinaryOperatorClass;
1933 BinaryOp = BO_PtrMemI;
1934 return Stmt::BinaryOperatorClass;
1937 return Stmt::ArraySubscriptExprClass;
1940 return Stmt::CallExprClass;
1943 UnaryOp = UO_Coawait;
1944 return Stmt::UnaryOperatorClass;
1947 llvm_unreachable(
"Invalid overloaded operator expression");
1950#if defined(_MSC_VER) && !defined(__clang__)
1955#pragma optimize("", off)
1959void StmtProfiler::VisitCXXOperatorCallExpr(
const CXXOperatorCallExpr *S) {
1967 return Visit(S->
getArg(0));
1975 for (
unsigned I = 0; I != NumArgs; ++I)
1977 if (SC == Stmt::UnaryOperatorClass)
1978 ID.AddInteger(UnaryOp);
1979 else if (SC == Stmt::BinaryOperatorClass ||
1980 SC == Stmt::CompoundAssignOperatorClass)
1981 ID.AddInteger(BinaryOp);
1983 assert(SC == Stmt::ArraySubscriptExprClass || SC == Stmt::CallExprClass);
1992void StmtProfiler::VisitCXXRewrittenBinaryOperator(
1993 const CXXRewrittenBinaryOperator *S) {
1997 "resolved rewritten operator should never be type-dependent");
2002#if defined(_MSC_VER) && !defined(__clang__)
2004#pragma optimize("", on)
2008void StmtProfiler::VisitCXXMemberCallExpr(
const CXXMemberCallExpr *S) {
2012void StmtProfiler::VisitCUDAKernelCallExpr(
const CUDAKernelCallExpr *S) {
2016void StmtProfiler::VisitAsTypeExpr(
const AsTypeExpr *S) {
2020void StmtProfiler::VisitCXXNamedCastExpr(
const CXXNamedCastExpr *S) {
2021 VisitExplicitCastExpr(S);
2024void StmtProfiler::VisitCXXStaticCastExpr(
const CXXStaticCastExpr *S) {
2025 VisitCXXNamedCastExpr(S);
2028void StmtProfiler::VisitCXXDynamicCastExpr(
const CXXDynamicCastExpr *S) {
2029 VisitCXXNamedCastExpr(S);
2033StmtProfiler::VisitCXXReinterpretCastExpr(
const CXXReinterpretCastExpr *S) {
2034 VisitCXXNamedCastExpr(S);
2037void StmtProfiler::VisitCXXConstCastExpr(
const CXXConstCastExpr *S) {
2038 VisitCXXNamedCastExpr(S);
2041void StmtProfiler::VisitBuiltinBitCastExpr(
const BuiltinBitCastExpr *S) {
2046void StmtProfiler::VisitCXXAddrspaceCastExpr(
const CXXAddrspaceCastExpr *S) {
2047 VisitCXXNamedCastExpr(S);
2050void StmtProfiler::VisitUserDefinedLiteral(
const UserDefinedLiteral *S) {
2054void StmtProfiler::VisitCXXBoolLiteralExpr(
const CXXBoolLiteralExpr *S) {
2059void StmtProfiler::VisitCXXNullPtrLiteralExpr(
const CXXNullPtrLiteralExpr *S) {
2063void StmtProfiler::VisitCXXStdInitializerListExpr(
2064 const CXXStdInitializerListExpr *S) {
2068void StmtProfiler::VisitCXXTypeidExpr(
const CXXTypeidExpr *S) {
2074void StmtProfiler::VisitCXXUuidofExpr(
const CXXUuidofExpr *S) {
2080void StmtProfiler::VisitMSPropertyRefExpr(
const MSPropertyRefExpr *S) {
2085void StmtProfiler::VisitMSPropertySubscriptExpr(
2086 const MSPropertySubscriptExpr *S) {
2090void StmtProfiler::VisitCXXThisExpr(
const CXXThisExpr *S) {
2096void StmtProfiler::VisitCXXThrowExpr(
const CXXThrowExpr *S) {
2100void StmtProfiler::VisitCXXDefaultArgExpr(
const CXXDefaultArgExpr *S) {
2105void StmtProfiler::VisitCXXDefaultInitExpr(
const CXXDefaultInitExpr *S) {
2110void StmtProfiler::VisitCXXBindTemporaryExpr(
const CXXBindTemporaryExpr *S) {
2116void StmtProfiler::VisitCXXConstructExpr(
const CXXConstructExpr *S) {
2122void StmtProfiler::VisitCXXInheritedCtorInitExpr(
2123 const CXXInheritedCtorInitExpr *S) {
2128void StmtProfiler::VisitCXXFunctionalCastExpr(
const CXXFunctionalCastExpr *S) {
2129 VisitExplicitCastExpr(S);
2133StmtProfiler::VisitCXXTemporaryObjectExpr(
const CXXTemporaryObjectExpr *S) {
2134 VisitCXXConstructExpr(S);
2138StmtProfiler::VisitLambdaExpr(
const LambdaExpr *S) {
2139 if (!ProfileLambdaExpr) {
2143 VisitStmtNoChildren(S);
2154 ID.AddInteger(
Capture.getCaptureKind());
2155 if (
Capture.capturesVariable())
2156 VisitDecl(
Capture.getCapturedVar());
2165 for (
auto *SubDecl : Lambda->
decls()) {
2166 FunctionDecl *
Call =
nullptr;
2167 if (
auto *FTD = dyn_cast<FunctionTemplateDecl>(SubDecl))
2168 Call = FTD->getTemplatedDecl();
2169 else if (
auto *FD = dyn_cast<FunctionDecl>(SubDecl))
2181StmtProfiler::VisitCXXScalarValueInitExpr(
const CXXScalarValueInitExpr *S) {
2185void StmtProfiler::VisitCXXDeleteExpr(
const CXXDeleteExpr *S) {
2192void StmtProfiler::VisitCXXNewExpr(
const CXXNewExpr *S) {
2205StmtProfiler::VisitCXXPseudoDestructorExpr(
const CXXPseudoDestructorExpr *S) {
2219void StmtProfiler::VisitOverloadExpr(
const OverloadExpr *S) {
2221 bool DescribingDependentVarTemplate =
2223 if (DescribingDependentVarTemplate) {
2227 VisitName(S->
getName(),
true);
2235StmtProfiler::VisitUnresolvedLookupExpr(
const UnresolvedLookupExpr *S) {
2236 VisitOverloadExpr(S);
2239void StmtProfiler::VisitTypeTraitExpr(
const TypeTraitExpr *S) {
2243 for (
unsigned I = 0, N = S->
getNumArgs(); I != N; ++I)
2247void StmtProfiler::VisitArrayTypeTraitExpr(
const ArrayTypeTraitExpr *S) {
2253void StmtProfiler::VisitExpressionTraitExpr(
const ExpressionTraitExpr *S) {
2259void StmtProfiler::VisitDependentScopeDeclRefExpr(
2260 const DependentScopeDeclRefExpr *S) {
2269void StmtProfiler::VisitExprWithCleanups(
const ExprWithCleanups *S) {
2273void StmtProfiler::VisitCXXUnresolvedConstructExpr(
2274 const CXXUnresolvedConstructExpr *S) {
2280void StmtProfiler::VisitCXXDependentScopeMemberExpr(
2281 const CXXDependentScopeMemberExpr *S) {
2294void StmtProfiler::VisitUnresolvedMemberExpr(
const UnresolvedMemberExpr *S) {
2307void StmtProfiler::VisitCXXNoexceptExpr(
const CXXNoexceptExpr *S) {
2311void StmtProfiler::VisitPackExpansionExpr(
const PackExpansionExpr *S) {
2315void StmtProfiler::VisitSizeOfPackExpr(
const SizeOfPackExpr *S) {
2319 ID.AddInteger(Args.size());
2320 for (
const auto &TA : Args)
2321 VisitTemplateArgument(TA);
2328void StmtProfiler::VisitPackIndexingExpr(
const PackIndexingExpr *E) {
2340void StmtProfiler::VisitSubstNonTypeTemplateParmPackExpr(
2341 const SubstNonTypeTemplateParmPackExpr *S) {
2347void StmtProfiler::VisitSubstNonTypeTemplateParmExpr(
2348 const SubstNonTypeTemplateParmExpr *E) {
2353void StmtProfiler::VisitFunctionParmPackExpr(
const FunctionParmPackExpr *S) {
2361void StmtProfiler::VisitMaterializeTemporaryExpr(
2362 const MaterializeTemporaryExpr *S) {
2366void StmtProfiler::VisitCXXFoldExpr(
const CXXFoldExpr *S) {
2371void StmtProfiler::VisitCXXParenListInitExpr(
const CXXParenListInitExpr *S) {
2375void StmtProfiler::VisitCoroutineBodyStmt(
const CoroutineBodyStmt *S) {
2379void StmtProfiler::VisitCoreturnStmt(
const CoreturnStmt *S) {
2383void StmtProfiler::VisitCoawaitExpr(
const CoawaitExpr *S) {
2387void StmtProfiler::VisitDependentCoawaitExpr(
const DependentCoawaitExpr *S) {
2391void StmtProfiler::VisitCoyieldExpr(
const CoyieldExpr *S) {
2395void StmtProfiler::VisitOpaqueValueExpr(
const OpaqueValueExpr *E) {
2399void StmtProfiler::VisitSourceLocExpr(
const SourceLocExpr *E) {
2403void StmtProfiler::VisitEmbedExpr(
const EmbedExpr *E) { VisitExpr(E); }
2405void StmtProfiler::VisitRecoveryExpr(
const RecoveryExpr *E) { VisitExpr(E); }
2407void StmtProfiler::VisitObjCStringLiteral(
const ObjCStringLiteral *S) {
2411void StmtProfiler::VisitObjCBoxedExpr(
const ObjCBoxedExpr *E) {
2415void StmtProfiler::VisitObjCArrayLiteral(
const ObjCArrayLiteral *E) {
2419void StmtProfiler::VisitObjCDictionaryLiteral(
const ObjCDictionaryLiteral *E) {
2423void StmtProfiler::VisitObjCEncodeExpr(
const ObjCEncodeExpr *S) {
2428void StmtProfiler::VisitObjCSelectorExpr(
const ObjCSelectorExpr *S) {
2433void StmtProfiler::VisitObjCProtocolExpr(
const ObjCProtocolExpr *S) {
2438void StmtProfiler::VisitObjCIvarRefExpr(
const ObjCIvarRefExpr *S) {
2445void StmtProfiler::VisitObjCPropertyRefExpr(
const ObjCPropertyRefExpr *S) {
2459void StmtProfiler::VisitObjCSubscriptRefExpr(
const ObjCSubscriptRefExpr *S) {
2465void StmtProfiler::VisitObjCMessageExpr(
const ObjCMessageExpr *S) {
2471void StmtProfiler::VisitObjCIsaExpr(
const ObjCIsaExpr *S) {
2476void StmtProfiler::VisitObjCBoolLiteralExpr(
const ObjCBoolLiteralExpr *S) {
2481void StmtProfiler::VisitObjCIndirectCopyRestoreExpr(
2482 const ObjCIndirectCopyRestoreExpr *S) {
2487void StmtProfiler::VisitObjCBridgedCastExpr(
const ObjCBridgedCastExpr *S) {
2488 VisitExplicitCastExpr(S);
2492void StmtProfiler::VisitObjCAvailabilityCheckExpr(
2493 const ObjCAvailabilityCheckExpr *S) {
2497void StmtProfiler::VisitTemplateArguments(
const TemplateArgumentLoc *Args,
2499 ID.AddInteger(NumArgs);
2500 for (
unsigned I = 0; I != NumArgs; ++I)
2504void StmtProfiler::VisitTemplateArgument(
const TemplateArgument &Arg) {
2547 VisitTemplateArgument(P);
2553class OpenACCClauseProfiler
2554 :
public OpenACCClauseVisitor<OpenACCClauseProfiler> {
2555 StmtProfiler &Profiler;
2558 OpenACCClauseProfiler(StmtProfiler &P) : Profiler(P) {}
2560 void VisitOpenACCClauseList(ArrayRef<const OpenACCClause *> Clauses) {
2561 for (
const OpenACCClause *Clause : Clauses) {
2568 void VisitClauseWithVarList(
const OpenACCClauseWithVarList &Clause) {
2570 Profiler.VisitStmt(E);
2573#define VISIT_CLAUSE(CLAUSE_NAME) \
2574 void Visit##CLAUSE_NAME##Clause(const OpenACC##CLAUSE_NAME##Clause &Clause);
2576#include "clang/Basic/OpenACCClauses.def"
2580void OpenACCClauseProfiler::VisitDefaultClause(
2581 const OpenACCDefaultClause &Clause) {}
2583void OpenACCClauseProfiler::VisitIfClause(
const OpenACCIfClause &Clause) {
2585 "if clause requires a valid condition expr");
2589void OpenACCClauseProfiler::VisitCopyClause(
const OpenACCCopyClause &Clause) {
2590 VisitClauseWithVarList(Clause);
2593void OpenACCClauseProfiler::VisitLinkClause(
const OpenACCLinkClause &Clause) {
2594 VisitClauseWithVarList(Clause);
2597void OpenACCClauseProfiler::VisitDeviceResidentClause(
2598 const OpenACCDeviceResidentClause &Clause) {
2599 VisitClauseWithVarList(Clause);
2602void OpenACCClauseProfiler::VisitCopyInClause(
2603 const OpenACCCopyInClause &Clause) {
2604 VisitClauseWithVarList(Clause);
2607void OpenACCClauseProfiler::VisitCopyOutClause(
2608 const OpenACCCopyOutClause &Clause) {
2609 VisitClauseWithVarList(Clause);
2612void OpenACCClauseProfiler::VisitCreateClause(
2613 const OpenACCCreateClause &Clause) {
2614 VisitClauseWithVarList(Clause);
2617void OpenACCClauseProfiler::VisitHostClause(
const OpenACCHostClause &Clause) {
2618 VisitClauseWithVarList(Clause);
2621void OpenACCClauseProfiler::VisitDeviceClause(
2622 const OpenACCDeviceClause &Clause) {
2623 VisitClauseWithVarList(Clause);
2626void OpenACCClauseProfiler::VisitSelfClause(
const OpenACCSelfClause &Clause) {
2632 Profiler.VisitStmt(E);
2636void OpenACCClauseProfiler::VisitFinalizeClause(
2637 const OpenACCFinalizeClause &Clause) {}
2639void OpenACCClauseProfiler::VisitIfPresentClause(
2640 const OpenACCIfPresentClause &Clause) {}
2642void OpenACCClauseProfiler::VisitNumGangsClause(
2643 const OpenACCNumGangsClause &Clause) {
2645 Profiler.VisitStmt(E);
2648void OpenACCClauseProfiler::VisitTileClause(
const OpenACCTileClause &Clause) {
2650 Profiler.VisitStmt(E);
2653void OpenACCClauseProfiler::VisitNumWorkersClause(
2654 const OpenACCNumWorkersClause &Clause) {
2655 assert(Clause.
hasIntExpr() &&
"num_workers clause requires a valid int expr");
2659void OpenACCClauseProfiler::VisitCollapseClause(
2660 const OpenACCCollapseClause &Clause) {
2661 assert(Clause.
getLoopCount() &&
"collapse clause requires a valid int expr");
2665void OpenACCClauseProfiler::VisitPrivateClause(
2666 const OpenACCPrivateClause &Clause) {
2667 VisitClauseWithVarList(Clause);
2670 Profiler.VisitDecl(Recipe.AllocaDecl);
2674void OpenACCClauseProfiler::VisitFirstPrivateClause(
2675 const OpenACCFirstPrivateClause &Clause) {
2676 VisitClauseWithVarList(Clause);
2679 Profiler.VisitDecl(Recipe.AllocaDecl);
2680 Profiler.VisitDecl(Recipe.InitFromTemporary);
2684void OpenACCClauseProfiler::VisitAttachClause(
2685 const OpenACCAttachClause &Clause) {
2686 VisitClauseWithVarList(Clause);
2689void OpenACCClauseProfiler::VisitDetachClause(
2690 const OpenACCDetachClause &Clause) {
2691 VisitClauseWithVarList(Clause);
2694void OpenACCClauseProfiler::VisitDeleteClause(
2695 const OpenACCDeleteClause &Clause) {
2696 VisitClauseWithVarList(Clause);
2699void OpenACCClauseProfiler::VisitDevicePtrClause(
2700 const OpenACCDevicePtrClause &Clause) {
2701 VisitClauseWithVarList(Clause);
2704void OpenACCClauseProfiler::VisitNoCreateClause(
2705 const OpenACCNoCreateClause &Clause) {
2706 VisitClauseWithVarList(Clause);
2709void OpenACCClauseProfiler::VisitPresentClause(
2710 const OpenACCPresentClause &Clause) {
2711 VisitClauseWithVarList(Clause);
2714void OpenACCClauseProfiler::VisitUseDeviceClause(
2715 const OpenACCUseDeviceClause &Clause) {
2716 VisitClauseWithVarList(Clause);
2719void OpenACCClauseProfiler::VisitVectorLengthClause(
2720 const OpenACCVectorLengthClause &Clause) {
2722 "vector_length clause requires a valid int expr");
2726void OpenACCClauseProfiler::VisitAsyncClause(
const OpenACCAsyncClause &Clause) {
2731void OpenACCClauseProfiler::VisitDeviceNumClause(
2732 const OpenACCDeviceNumClause &Clause) {
2736void OpenACCClauseProfiler::VisitDefaultAsyncClause(
2737 const OpenACCDefaultAsyncClause &Clause) {
2741void OpenACCClauseProfiler::VisitWorkerClause(
2742 const OpenACCWorkerClause &Clause) {
2747void OpenACCClauseProfiler::VisitVectorClause(
2748 const OpenACCVectorClause &Clause) {
2753void OpenACCClauseProfiler::VisitWaitClause(
const OpenACCWaitClause &Clause) {
2757 Profiler.VisitStmt(E);
2761void OpenACCClauseProfiler::VisitDeviceTypeClause(
2762 const OpenACCDeviceTypeClause &Clause) {}
2764void OpenACCClauseProfiler::VisitAutoClause(
const OpenACCAutoClause &Clause) {}
2766void OpenACCClauseProfiler::VisitIndependentClause(
2767 const OpenACCIndependentClause &Clause) {}
2769void OpenACCClauseProfiler::VisitSeqClause(
const OpenACCSeqClause &Clause) {}
2770void OpenACCClauseProfiler::VisitNoHostClause(
2771 const OpenACCNoHostClause &Clause) {}
2773void OpenACCClauseProfiler::VisitGangClause(
const OpenACCGangClause &Clause) {
2774 for (
unsigned I = 0; I < Clause.
getNumExprs(); ++I) {
2775 Profiler.VisitStmt(Clause.
getExpr(I).second);
2779void OpenACCClauseProfiler::VisitReductionClause(
2780 const OpenACCReductionClause &Clause) {
2781 VisitClauseWithVarList(Clause);
2784 Profiler.VisitDecl(Recipe.AllocaDecl);
2789 static_assert(
sizeof(OpenACCReductionRecipe::CombinerRecipe) ==
2791 for (
auto &CombinerRecipe : Recipe.CombinerRecipes) {
2792 if (CombinerRecipe.Op) {
2793 Profiler.VisitDecl(CombinerRecipe.LHS);
2794 Profiler.VisitDecl(CombinerRecipe.RHS);
2795 Profiler.VisitStmt(CombinerRecipe.Op);
2801void OpenACCClauseProfiler::VisitBindClause(
const OpenACCBindClause &Clause) {
2802 assert(
false &&
"not implemented... what can we do about our expr?");
2806void StmtProfiler::VisitOpenACCComputeConstruct(
2811 OpenACCClauseProfiler P{*
this};
2812 P.VisitOpenACCClauseList(S->clauses());
2815void StmtProfiler::VisitOpenACCLoopConstruct(
const OpenACCLoopConstruct *S) {
2819 OpenACCClauseProfiler P{*
this};
2820 P.VisitOpenACCClauseList(S->clauses());
2823void StmtProfiler::VisitOpenACCCombinedConstruct(
2824 const OpenACCCombinedConstruct *S) {
2828 OpenACCClauseProfiler P{*
this};
2829 P.VisitOpenACCClauseList(S->clauses());
2832void StmtProfiler::VisitOpenACCDataConstruct(
const OpenACCDataConstruct *S) {
2835 OpenACCClauseProfiler P{*
this};
2836 P.VisitOpenACCClauseList(S->clauses());
2839void StmtProfiler::VisitOpenACCEnterDataConstruct(
2840 const OpenACCEnterDataConstruct *S) {
2843 OpenACCClauseProfiler P{*
this};
2844 P.VisitOpenACCClauseList(S->clauses());
2847void StmtProfiler::VisitOpenACCExitDataConstruct(
2848 const OpenACCExitDataConstruct *S) {
2851 OpenACCClauseProfiler P{*
this};
2852 P.VisitOpenACCClauseList(S->clauses());
2855void StmtProfiler::VisitOpenACCHostDataConstruct(
2856 const OpenACCHostDataConstruct *S) {
2859 OpenACCClauseProfiler P{*
this};
2860 P.VisitOpenACCClauseList(S->clauses());
2863void StmtProfiler::VisitOpenACCWaitConstruct(
const OpenACCWaitConstruct *S) {
2867 OpenACCClauseProfiler P{*
this};
2868 P.VisitOpenACCClauseList(S->clauses());
2871void StmtProfiler::VisitOpenACCCacheConstruct(
const OpenACCCacheConstruct *S) {
2876void StmtProfiler::VisitOpenACCInitConstruct(
const OpenACCInitConstruct *S) {
2878 OpenACCClauseProfiler P{*
this};
2879 P.VisitOpenACCClauseList(S->clauses());
2882void StmtProfiler::VisitOpenACCShutdownConstruct(
2883 const OpenACCShutdownConstruct *S) {
2885 OpenACCClauseProfiler P{*
this};
2886 P.VisitOpenACCClauseList(S->clauses());
2889void StmtProfiler::VisitOpenACCSetConstruct(
const OpenACCSetConstruct *S) {
2891 OpenACCClauseProfiler P{*
this};
2892 P.VisitOpenACCClauseList(S->clauses());
2895void StmtProfiler::VisitOpenACCUpdateConstruct(
2896 const OpenACCUpdateConstruct *S) {
2898 OpenACCClauseProfiler P{*
this};
2899 P.VisitOpenACCClauseList(S->clauses());
2902void StmtProfiler::VisitOpenACCAtomicConstruct(
2903 const OpenACCAtomicConstruct *S) {
2905 OpenACCClauseProfiler P{*
this};
2906 P.VisitOpenACCClauseList(S->clauses());
2909void StmtProfiler::VisitHLSLOutArgExpr(
const HLSLOutArgExpr *S) {
2914 bool Canonical,
bool ProfileLambdaExpr)
const {
2915 StmtProfilerWithPointers Profiler(ID, Context, Canonical, ProfileLambdaExpr);
2916 Profiler.Visit(
this);
2921 StmtProfilerWithoutPointers Profiler(ID, Hash);
2922 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.