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::VisitOMPAllocatorClause(
const OMPAllocatorClause *
C) {
514 if (
C->getAllocator())
515 Profiler->VisitStmt(
C->getAllocator());
518void OMPClauseProfiler::VisitOMPCollapseClause(
const OMPCollapseClause *
C) {
519 if (
C->getNumForLoops())
520 Profiler->VisitStmt(
C->getNumForLoops());
523void OMPClauseProfiler::VisitOMPDetachClause(
const OMPDetachClause *
C) {
524 if (Expr *Evt =
C->getEventHandler())
525 Profiler->VisitStmt(Evt);
528void OMPClauseProfiler::VisitOMPNovariantsClause(
const OMPNovariantsClause *
C) {
529 VisitOMPClauseWithPreInit(
C);
530 if (
C->getCondition())
531 Profiler->VisitStmt(
C->getCondition());
534void OMPClauseProfiler::VisitOMPNocontextClause(
const OMPNocontextClause *
C) {
535 VisitOMPClauseWithPreInit(
C);
536 if (
C->getCondition())
537 Profiler->VisitStmt(
C->getCondition());
540void OMPClauseProfiler::VisitOMPDefaultClause(
const OMPDefaultClause *
C) { }
542void OMPClauseProfiler::VisitOMPProcBindClause(
const OMPProcBindClause *
C) { }
544void OMPClauseProfiler::VisitOMPUnifiedAddressClause(
545 const OMPUnifiedAddressClause *
C) {}
547void OMPClauseProfiler::VisitOMPUnifiedSharedMemoryClause(
548 const OMPUnifiedSharedMemoryClause *
C) {}
550void OMPClauseProfiler::VisitOMPReverseOffloadClause(
551 const OMPReverseOffloadClause *
C) {}
553void OMPClauseProfiler::VisitOMPDynamicAllocatorsClause(
554 const OMPDynamicAllocatorsClause *
C) {}
556void OMPClauseProfiler::VisitOMPAtomicDefaultMemOrderClause(
557 const OMPAtomicDefaultMemOrderClause *
C) {}
559void OMPClauseProfiler::VisitOMPSelfMapsClause(
const OMPSelfMapsClause *
C) {}
561void OMPClauseProfiler::VisitOMPAtClause(
const OMPAtClause *
C) {}
563void OMPClauseProfiler::VisitOMPSeverityClause(
const OMPSeverityClause *
C) {}
565void OMPClauseProfiler::VisitOMPMessageClause(
const OMPMessageClause *
C) {
566 if (
C->getMessageString())
567 Profiler->VisitStmt(
C->getMessageString());
570void OMPClauseProfiler::VisitOMPScheduleClause(
const OMPScheduleClause *
C) {
571 VisitOMPClauseWithPreInit(
C);
572 if (
auto *S =
C->getChunkSize())
573 Profiler->VisitStmt(S);
576void OMPClauseProfiler::VisitOMPOrderedClause(
const OMPOrderedClause *
C) {
577 if (
auto *
Num =
C->getNumForLoops())
578 Profiler->VisitStmt(
Num);
581void OMPClauseProfiler::VisitOMPNowaitClause(
const OMPNowaitClause *) {}
583void OMPClauseProfiler::VisitOMPUntiedClause(
const OMPUntiedClause *) {}
585void OMPClauseProfiler::VisitOMPMergeableClause(
const OMPMergeableClause *) {}
587void OMPClauseProfiler::VisitOMPReadClause(
const OMPReadClause *) {}
589void OMPClauseProfiler::VisitOMPWriteClause(
const OMPWriteClause *) {}
591void OMPClauseProfiler::VisitOMPUpdateClause(
const OMPUpdateClause *) {}
593void OMPClauseProfiler::VisitOMPCaptureClause(
const OMPCaptureClause *) {}
595void OMPClauseProfiler::VisitOMPCompareClause(
const OMPCompareClause *) {}
597void OMPClauseProfiler::VisitOMPFailClause(
const OMPFailClause *) {}
599void OMPClauseProfiler::VisitOMPAbsentClause(
const OMPAbsentClause *) {}
601void OMPClauseProfiler::VisitOMPHoldsClause(
const OMPHoldsClause *) {}
603void OMPClauseProfiler::VisitOMPContainsClause(
const OMPContainsClause *) {}
605void OMPClauseProfiler::VisitOMPNoOpenMPClause(
const OMPNoOpenMPClause *) {}
607void OMPClauseProfiler::VisitOMPNoOpenMPRoutinesClause(
608 const OMPNoOpenMPRoutinesClause *) {}
610void OMPClauseProfiler::VisitOMPNoOpenMPConstructsClause(
611 const OMPNoOpenMPConstructsClause *) {}
613void OMPClauseProfiler::VisitOMPNoParallelismClause(
614 const OMPNoParallelismClause *) {}
616void OMPClauseProfiler::VisitOMPSeqCstClause(
const OMPSeqCstClause *) {}
618void OMPClauseProfiler::VisitOMPAcqRelClause(
const OMPAcqRelClause *) {}
620void OMPClauseProfiler::VisitOMPAcquireClause(
const OMPAcquireClause *) {}
622void OMPClauseProfiler::VisitOMPReleaseClause(
const OMPReleaseClause *) {}
624void OMPClauseProfiler::VisitOMPRelaxedClause(
const OMPRelaxedClause *) {}
626void OMPClauseProfiler::VisitOMPWeakClause(
const OMPWeakClause *) {}
628void OMPClauseProfiler::VisitOMPThreadsClause(
const OMPThreadsClause *) {}
630void OMPClauseProfiler::VisitOMPSIMDClause(
const OMPSIMDClause *) {}
632void OMPClauseProfiler::VisitOMPNogroupClause(
const OMPNogroupClause *) {}
634void OMPClauseProfiler::VisitOMPInitClause(
const OMPInitClause *
C) {
635 VisitOMPClauseList(
C);
638void OMPClauseProfiler::VisitOMPUseClause(
const OMPUseClause *
C) {
639 if (
C->getInteropVar())
640 Profiler->VisitStmt(
C->getInteropVar());
643void OMPClauseProfiler::VisitOMPDestroyClause(
const OMPDestroyClause *
C) {
644 if (
C->getInteropVar())
645 Profiler->VisitStmt(
C->getInteropVar());
648void OMPClauseProfiler::VisitOMPFilterClause(
const OMPFilterClause *
C) {
649 VisitOMPClauseWithPreInit(
C);
650 if (
C->getThreadID())
651 Profiler->VisitStmt(
C->getThreadID());
655void OMPClauseProfiler::VisitOMPClauseList(
T *Node) {
656 for (
auto *E : Node->varlist()) {
658 Profiler->VisitStmt(E);
662void OMPClauseProfiler::VisitOMPPrivateClause(
const OMPPrivateClause *
C) {
663 VisitOMPClauseList(
C);
664 for (
auto *E :
C->private_copies()) {
666 Profiler->VisitStmt(E);
670OMPClauseProfiler::VisitOMPFirstprivateClause(
const OMPFirstprivateClause *
C) {
671 VisitOMPClauseList(
C);
672 VisitOMPClauseWithPreInit(
C);
673 for (
auto *E :
C->private_copies()) {
675 Profiler->VisitStmt(E);
677 for (
auto *E :
C->inits()) {
679 Profiler->VisitStmt(E);
683OMPClauseProfiler::VisitOMPLastprivateClause(
const OMPLastprivateClause *
C) {
684 VisitOMPClauseList(
C);
685 VisitOMPClauseWithPostUpdate(
C);
686 for (
auto *E :
C->source_exprs()) {
688 Profiler->VisitStmt(E);
690 for (
auto *E :
C->destination_exprs()) {
692 Profiler->VisitStmt(E);
694 for (
auto *E :
C->assignment_ops()) {
696 Profiler->VisitStmt(E);
699void OMPClauseProfiler::VisitOMPSharedClause(
const OMPSharedClause *
C) {
700 VisitOMPClauseList(
C);
702void OMPClauseProfiler::VisitOMPReductionClause(
703 const OMPReductionClause *
C) {
704 Profiler->VisitNestedNameSpecifier(
705 C->getQualifierLoc().getNestedNameSpecifier());
706 Profiler->VisitName(
C->getNameInfo().getName());
707 VisitOMPClauseList(
C);
708 VisitOMPClauseWithPostUpdate(
C);
709 for (
auto *E :
C->privates()) {
711 Profiler->VisitStmt(E);
713 for (
auto *E :
C->lhs_exprs()) {
715 Profiler->VisitStmt(E);
717 for (
auto *E :
C->rhs_exprs()) {
719 Profiler->VisitStmt(E);
721 for (
auto *E :
C->reduction_ops()) {
723 Profiler->VisitStmt(E);
725 if (
C->getModifier() == clang::OMPC_REDUCTION_inscan) {
726 for (
auto *E :
C->copy_ops()) {
728 Profiler->VisitStmt(E);
730 for (
auto *E :
C->copy_array_temps()) {
732 Profiler->VisitStmt(E);
734 for (
auto *E :
C->copy_array_elems()) {
736 Profiler->VisitStmt(E);
740void OMPClauseProfiler::VisitOMPTaskReductionClause(
741 const OMPTaskReductionClause *
C) {
742 Profiler->VisitNestedNameSpecifier(
743 C->getQualifierLoc().getNestedNameSpecifier());
744 Profiler->VisitName(
C->getNameInfo().getName());
745 VisitOMPClauseList(
C);
746 VisitOMPClauseWithPostUpdate(
C);
747 for (
auto *E :
C->privates()) {
749 Profiler->VisitStmt(E);
751 for (
auto *E :
C->lhs_exprs()) {
753 Profiler->VisitStmt(E);
755 for (
auto *E :
C->rhs_exprs()) {
757 Profiler->VisitStmt(E);
759 for (
auto *E :
C->reduction_ops()) {
761 Profiler->VisitStmt(E);
764void OMPClauseProfiler::VisitOMPInReductionClause(
765 const OMPInReductionClause *
C) {
766 Profiler->VisitNestedNameSpecifier(
767 C->getQualifierLoc().getNestedNameSpecifier());
768 Profiler->VisitName(
C->getNameInfo().getName());
769 VisitOMPClauseList(
C);
770 VisitOMPClauseWithPostUpdate(
C);
771 for (
auto *E :
C->privates()) {
773 Profiler->VisitStmt(E);
775 for (
auto *E :
C->lhs_exprs()) {
777 Profiler->VisitStmt(E);
779 for (
auto *E :
C->rhs_exprs()) {
781 Profiler->VisitStmt(E);
783 for (
auto *E :
C->reduction_ops()) {
785 Profiler->VisitStmt(E);
787 for (
auto *E :
C->taskgroup_descriptors()) {
789 Profiler->VisitStmt(E);
792void OMPClauseProfiler::VisitOMPLinearClause(
const OMPLinearClause *
C) {
793 VisitOMPClauseList(
C);
794 VisitOMPClauseWithPostUpdate(
C);
795 for (
auto *E :
C->privates()) {
797 Profiler->VisitStmt(E);
799 for (
auto *E :
C->inits()) {
801 Profiler->VisitStmt(E);
803 for (
auto *E :
C->updates()) {
805 Profiler->VisitStmt(E);
807 for (
auto *E :
C->finals()) {
809 Profiler->VisitStmt(E);
812 Profiler->VisitStmt(
C->getStep());
813 if (
C->getCalcStep())
814 Profiler->VisitStmt(
C->getCalcStep());
816void OMPClauseProfiler::VisitOMPAlignedClause(
const OMPAlignedClause *
C) {
817 VisitOMPClauseList(
C);
818 if (
C->getAlignment())
819 Profiler->VisitStmt(
C->getAlignment());
821void OMPClauseProfiler::VisitOMPCopyinClause(
const OMPCopyinClause *
C) {
822 VisitOMPClauseList(
C);
823 for (
auto *E :
C->source_exprs()) {
825 Profiler->VisitStmt(E);
827 for (
auto *E :
C->destination_exprs()) {
829 Profiler->VisitStmt(E);
831 for (
auto *E :
C->assignment_ops()) {
833 Profiler->VisitStmt(E);
837OMPClauseProfiler::VisitOMPCopyprivateClause(
const OMPCopyprivateClause *
C) {
838 VisitOMPClauseList(
C);
839 for (
auto *E :
C->source_exprs()) {
841 Profiler->VisitStmt(E);
843 for (
auto *E :
C->destination_exprs()) {
845 Profiler->VisitStmt(E);
847 for (
auto *E :
C->assignment_ops()) {
849 Profiler->VisitStmt(E);
852void OMPClauseProfiler::VisitOMPFlushClause(
const OMPFlushClause *
C) {
853 VisitOMPClauseList(
C);
855void OMPClauseProfiler::VisitOMPDepobjClause(
const OMPDepobjClause *
C) {
856 if (
const Expr *Depobj =
C->getDepobj())
857 Profiler->VisitStmt(Depobj);
859void OMPClauseProfiler::VisitOMPDependClause(
const OMPDependClause *
C) {
860 VisitOMPClauseList(
C);
862void OMPClauseProfiler::VisitOMPDeviceClause(
const OMPDeviceClause *
C) {
864 Profiler->VisitStmt(
C->getDevice());
866void OMPClauseProfiler::VisitOMPMapClause(
const OMPMapClause *
C) {
867 VisitOMPClauseList(
C);
869void OMPClauseProfiler::VisitOMPAllocateClause(
const OMPAllocateClause *
C) {
870 if (Expr *Allocator =
C->getAllocator())
871 Profiler->VisitStmt(Allocator);
872 VisitOMPClauseList(
C);
874void OMPClauseProfiler::VisitOMPNumTeamsClause(
const OMPNumTeamsClause *
C) {
875 VisitOMPClauseList(
C);
876 VisitOMPClauseWithPreInit(
C);
878void OMPClauseProfiler::VisitOMPThreadLimitClause(
879 const OMPThreadLimitClause *
C) {
880 VisitOMPClauseList(
C);
881 VisitOMPClauseWithPreInit(
C);
883void OMPClauseProfiler::VisitOMPPriorityClause(
const OMPPriorityClause *
C) {
884 VisitOMPClauseWithPreInit(
C);
885 if (
C->getPriority())
886 Profiler->VisitStmt(
C->getPriority());
888void OMPClauseProfiler::VisitOMPGrainsizeClause(
const OMPGrainsizeClause *
C) {
889 VisitOMPClauseWithPreInit(
C);
890 if (
C->getGrainsize())
891 Profiler->VisitStmt(
C->getGrainsize());
893void OMPClauseProfiler::VisitOMPNumTasksClause(
const OMPNumTasksClause *
C) {
894 VisitOMPClauseWithPreInit(
C);
895 if (
C->getNumTasks())
896 Profiler->VisitStmt(
C->getNumTasks());
898void OMPClauseProfiler::VisitOMPHintClause(
const OMPHintClause *
C) {
900 Profiler->VisitStmt(
C->getHint());
902void OMPClauseProfiler::VisitOMPToClause(
const OMPToClause *
C) {
903 VisitOMPClauseList(
C);
905void OMPClauseProfiler::VisitOMPFromClause(
const OMPFromClause *
C) {
906 VisitOMPClauseList(
C);
908void OMPClauseProfiler::VisitOMPUseDevicePtrClause(
909 const OMPUseDevicePtrClause *
C) {
910 VisitOMPClauseList(
C);
912void OMPClauseProfiler::VisitOMPUseDeviceAddrClause(
913 const OMPUseDeviceAddrClause *
C) {
914 VisitOMPClauseList(
C);
916void OMPClauseProfiler::VisitOMPIsDevicePtrClause(
917 const OMPIsDevicePtrClause *
C) {
918 VisitOMPClauseList(
C);
920void OMPClauseProfiler::VisitOMPHasDeviceAddrClause(
921 const OMPHasDeviceAddrClause *
C) {
922 VisitOMPClauseList(
C);
924void OMPClauseProfiler::VisitOMPNontemporalClause(
925 const OMPNontemporalClause *
C) {
926 VisitOMPClauseList(
C);
927 for (
auto *E :
C->private_refs())
928 Profiler->VisitStmt(E);
930void OMPClauseProfiler::VisitOMPInclusiveClause(
const OMPInclusiveClause *
C) {
931 VisitOMPClauseList(
C);
933void OMPClauseProfiler::VisitOMPExclusiveClause(
const OMPExclusiveClause *
C) {
934 VisitOMPClauseList(
C);
936void OMPClauseProfiler::VisitOMPUsesAllocatorsClause(
937 const OMPUsesAllocatorsClause *
C) {
938 for (
unsigned I = 0, E =
C->getNumberOfAllocators(); I < E; ++I) {
939 OMPUsesAllocatorsClause::Data D =
C->getAllocatorData(I);
945void OMPClauseProfiler::VisitOMPAffinityClause(
const OMPAffinityClause *
C) {
946 if (
const Expr *Modifier =
C->getModifier())
947 Profiler->VisitStmt(Modifier);
948 for (
const Expr *E :
C->varlist())
949 Profiler->VisitStmt(E);
951void OMPClauseProfiler::VisitOMPOrderClause(
const OMPOrderClause *
C) {}
952void OMPClauseProfiler::VisitOMPBindClause(
const OMPBindClause *
C) {}
953void OMPClauseProfiler::VisitOMPXDynCGroupMemClause(
954 const OMPXDynCGroupMemClause *
C) {
955 VisitOMPClauseWithPreInit(
C);
956 if (Expr *Size =
C->getSize())
957 Profiler->VisitStmt(Size);
959void OMPClauseProfiler::VisitOMPDoacrossClause(
const OMPDoacrossClause *
C) {
960 VisitOMPClauseList(
C);
962void OMPClauseProfiler::VisitOMPXAttributeClause(
const OMPXAttributeClause *
C) {
964void OMPClauseProfiler::VisitOMPXBareClause(
const OMPXBareClause *
C) {}
968StmtProfiler::VisitOMPExecutableDirective(
const OMPExecutableDirective *S) {
970 OMPClauseProfiler P(
this);
971 ArrayRef<OMPClause *> Clauses = S->clauses();
972 for (ArrayRef<OMPClause *>::iterator I = Clauses.begin(), E = Clauses.end();
978void StmtProfiler::VisitOMPCanonicalLoop(
const OMPCanonicalLoop *L) {
982void StmtProfiler::VisitOMPLoopBasedDirective(
const OMPLoopBasedDirective *S) {
983 VisitOMPExecutableDirective(S);
986void StmtProfiler::VisitOMPLoopDirective(
const OMPLoopDirective *S) {
987 VisitOMPLoopBasedDirective(S);
990void StmtProfiler::VisitOMPMetaDirective(
const OMPMetaDirective *S) {
991 VisitOMPExecutableDirective(S);
994void StmtProfiler::VisitOMPParallelDirective(
const OMPParallelDirective *S) {
995 VisitOMPExecutableDirective(S);
998void StmtProfiler::VisitOMPSimdDirective(
const OMPSimdDirective *S) {
999 VisitOMPLoopDirective(S);
1002void StmtProfiler::VisitOMPCanonicalLoopNestTransformationDirective(
1003 const OMPCanonicalLoopNestTransformationDirective *S) {
1004 VisitOMPLoopBasedDirective(S);
1007void StmtProfiler::VisitOMPTileDirective(
const OMPTileDirective *S) {
1008 VisitOMPCanonicalLoopNestTransformationDirective(S);
1011void StmtProfiler::VisitOMPStripeDirective(
const OMPStripeDirective *S) {
1012 VisitOMPCanonicalLoopNestTransformationDirective(S);
1015void StmtProfiler::VisitOMPUnrollDirective(
const OMPUnrollDirective *S) {
1016 VisitOMPCanonicalLoopNestTransformationDirective(S);
1019void StmtProfiler::VisitOMPReverseDirective(
const OMPReverseDirective *S) {
1020 VisitOMPCanonicalLoopNestTransformationDirective(S);
1023void StmtProfiler::VisitOMPInterchangeDirective(
1024 const OMPInterchangeDirective *S) {
1025 VisitOMPCanonicalLoopNestTransformationDirective(S);
1028void StmtProfiler::VisitOMPForDirective(
const OMPForDirective *S) {
1029 VisitOMPLoopDirective(S);
1032void StmtProfiler::VisitOMPForSimdDirective(
const OMPForSimdDirective *S) {
1033 VisitOMPLoopDirective(S);
1036void StmtProfiler::VisitOMPSectionsDirective(
const OMPSectionsDirective *S) {
1037 VisitOMPExecutableDirective(S);
1040void StmtProfiler::VisitOMPSectionDirective(
const OMPSectionDirective *S) {
1041 VisitOMPExecutableDirective(S);
1044void StmtProfiler::VisitOMPScopeDirective(
const OMPScopeDirective *S) {
1045 VisitOMPExecutableDirective(S);
1048void StmtProfiler::VisitOMPSingleDirective(
const OMPSingleDirective *S) {
1049 VisitOMPExecutableDirective(S);
1052void StmtProfiler::VisitOMPMasterDirective(
const OMPMasterDirective *S) {
1053 VisitOMPExecutableDirective(S);
1056void StmtProfiler::VisitOMPCriticalDirective(
const OMPCriticalDirective *S) {
1057 VisitOMPExecutableDirective(S);
1058 VisitName(S->getDirectiveName().getName());
1062StmtProfiler::VisitOMPParallelForDirective(
const OMPParallelForDirective *S) {
1063 VisitOMPLoopDirective(S);
1066void StmtProfiler::VisitOMPParallelForSimdDirective(
1067 const OMPParallelForSimdDirective *S) {
1068 VisitOMPLoopDirective(S);
1071void StmtProfiler::VisitOMPParallelMasterDirective(
1072 const OMPParallelMasterDirective *S) {
1073 VisitOMPExecutableDirective(S);
1076void StmtProfiler::VisitOMPParallelMaskedDirective(
1077 const OMPParallelMaskedDirective *S) {
1078 VisitOMPExecutableDirective(S);
1081void StmtProfiler::VisitOMPParallelSectionsDirective(
1082 const OMPParallelSectionsDirective *S) {
1083 VisitOMPExecutableDirective(S);
1086void StmtProfiler::VisitOMPTaskDirective(
const OMPTaskDirective *S) {
1087 VisitOMPExecutableDirective(S);
1090void StmtProfiler::VisitOMPTaskyieldDirective(
const OMPTaskyieldDirective *S) {
1091 VisitOMPExecutableDirective(S);
1094void StmtProfiler::VisitOMPBarrierDirective(
const OMPBarrierDirective *S) {
1095 VisitOMPExecutableDirective(S);
1098void StmtProfiler::VisitOMPTaskwaitDirective(
const OMPTaskwaitDirective *S) {
1099 VisitOMPExecutableDirective(S);
1102void StmtProfiler::VisitOMPAssumeDirective(
const OMPAssumeDirective *S) {
1103 VisitOMPExecutableDirective(S);
1106void StmtProfiler::VisitOMPErrorDirective(
const OMPErrorDirective *S) {
1107 VisitOMPExecutableDirective(S);
1109void StmtProfiler::VisitOMPTaskgroupDirective(
const OMPTaskgroupDirective *S) {
1110 VisitOMPExecutableDirective(S);
1111 if (
const Expr *E = S->getReductionRef())
1115void StmtProfiler::VisitOMPFlushDirective(
const OMPFlushDirective *S) {
1116 VisitOMPExecutableDirective(S);
1119void StmtProfiler::VisitOMPDepobjDirective(
const OMPDepobjDirective *S) {
1120 VisitOMPExecutableDirective(S);
1123void StmtProfiler::VisitOMPScanDirective(
const OMPScanDirective *S) {
1124 VisitOMPExecutableDirective(S);
1127void StmtProfiler::VisitOMPOrderedDirective(
const OMPOrderedDirective *S) {
1128 VisitOMPExecutableDirective(S);
1131void StmtProfiler::VisitOMPAtomicDirective(
const OMPAtomicDirective *S) {
1132 VisitOMPExecutableDirective(S);
1135void StmtProfiler::VisitOMPTargetDirective(
const OMPTargetDirective *S) {
1136 VisitOMPExecutableDirective(S);
1139void StmtProfiler::VisitOMPTargetDataDirective(
const OMPTargetDataDirective *S) {
1140 VisitOMPExecutableDirective(S);
1143void StmtProfiler::VisitOMPTargetEnterDataDirective(
1144 const OMPTargetEnterDataDirective *S) {
1145 VisitOMPExecutableDirective(S);
1148void StmtProfiler::VisitOMPTargetExitDataDirective(
1149 const OMPTargetExitDataDirective *S) {
1150 VisitOMPExecutableDirective(S);
1153void StmtProfiler::VisitOMPTargetParallelDirective(
1154 const OMPTargetParallelDirective *S) {
1155 VisitOMPExecutableDirective(S);
1158void StmtProfiler::VisitOMPTargetParallelForDirective(
1159 const OMPTargetParallelForDirective *S) {
1160 VisitOMPExecutableDirective(S);
1163void StmtProfiler::VisitOMPTeamsDirective(
const OMPTeamsDirective *S) {
1164 VisitOMPExecutableDirective(S);
1167void StmtProfiler::VisitOMPCancellationPointDirective(
1168 const OMPCancellationPointDirective *S) {
1169 VisitOMPExecutableDirective(S);
1172void StmtProfiler::VisitOMPCancelDirective(
const OMPCancelDirective *S) {
1173 VisitOMPExecutableDirective(S);
1176void StmtProfiler::VisitOMPTaskLoopDirective(
const OMPTaskLoopDirective *S) {
1177 VisitOMPLoopDirective(S);
1180void StmtProfiler::VisitOMPTaskLoopSimdDirective(
1181 const OMPTaskLoopSimdDirective *S) {
1182 VisitOMPLoopDirective(S);
1185void StmtProfiler::VisitOMPMasterTaskLoopDirective(
1186 const OMPMasterTaskLoopDirective *S) {
1187 VisitOMPLoopDirective(S);
1190void StmtProfiler::VisitOMPMaskedTaskLoopDirective(
1191 const OMPMaskedTaskLoopDirective *S) {
1192 VisitOMPLoopDirective(S);
1195void StmtProfiler::VisitOMPMasterTaskLoopSimdDirective(
1196 const OMPMasterTaskLoopSimdDirective *S) {
1197 VisitOMPLoopDirective(S);
1200void StmtProfiler::VisitOMPMaskedTaskLoopSimdDirective(
1201 const OMPMaskedTaskLoopSimdDirective *S) {
1202 VisitOMPLoopDirective(S);
1205void StmtProfiler::VisitOMPParallelMasterTaskLoopDirective(
1206 const OMPParallelMasterTaskLoopDirective *S) {
1207 VisitOMPLoopDirective(S);
1210void StmtProfiler::VisitOMPParallelMaskedTaskLoopDirective(
1211 const OMPParallelMaskedTaskLoopDirective *S) {
1212 VisitOMPLoopDirective(S);
1215void StmtProfiler::VisitOMPParallelMasterTaskLoopSimdDirective(
1216 const OMPParallelMasterTaskLoopSimdDirective *S) {
1217 VisitOMPLoopDirective(S);
1220void StmtProfiler::VisitOMPParallelMaskedTaskLoopSimdDirective(
1221 const OMPParallelMaskedTaskLoopSimdDirective *S) {
1222 VisitOMPLoopDirective(S);
1225void StmtProfiler::VisitOMPDistributeDirective(
1226 const OMPDistributeDirective *S) {
1227 VisitOMPLoopDirective(S);
1230void OMPClauseProfiler::VisitOMPDistScheduleClause(
1231 const OMPDistScheduleClause *
C) {
1232 VisitOMPClauseWithPreInit(
C);
1233 if (
auto *S =
C->getChunkSize())
1234 Profiler->VisitStmt(S);
1237void OMPClauseProfiler::VisitOMPDefaultmapClause(
const OMPDefaultmapClause *) {}
1239void StmtProfiler::VisitOMPTargetUpdateDirective(
1240 const OMPTargetUpdateDirective *S) {
1241 VisitOMPExecutableDirective(S);
1244void StmtProfiler::VisitOMPDistributeParallelForDirective(
1245 const OMPDistributeParallelForDirective *S) {
1246 VisitOMPLoopDirective(S);
1249void StmtProfiler::VisitOMPDistributeParallelForSimdDirective(
1250 const OMPDistributeParallelForSimdDirective *S) {
1251 VisitOMPLoopDirective(S);
1254void StmtProfiler::VisitOMPDistributeSimdDirective(
1255 const OMPDistributeSimdDirective *S) {
1256 VisitOMPLoopDirective(S);
1259void StmtProfiler::VisitOMPTargetParallelForSimdDirective(
1260 const OMPTargetParallelForSimdDirective *S) {
1261 VisitOMPLoopDirective(S);
1264void StmtProfiler::VisitOMPTargetSimdDirective(
1265 const OMPTargetSimdDirective *S) {
1266 VisitOMPLoopDirective(S);
1269void StmtProfiler::VisitOMPTeamsDistributeDirective(
1270 const OMPTeamsDistributeDirective *S) {
1271 VisitOMPLoopDirective(S);
1274void StmtProfiler::VisitOMPTeamsDistributeSimdDirective(
1275 const OMPTeamsDistributeSimdDirective *S) {
1276 VisitOMPLoopDirective(S);
1279void StmtProfiler::VisitOMPTeamsDistributeParallelForSimdDirective(
1280 const OMPTeamsDistributeParallelForSimdDirective *S) {
1281 VisitOMPLoopDirective(S);
1284void StmtProfiler::VisitOMPTeamsDistributeParallelForDirective(
1285 const OMPTeamsDistributeParallelForDirective *S) {
1286 VisitOMPLoopDirective(S);
1289void StmtProfiler::VisitOMPTargetTeamsDirective(
1290 const OMPTargetTeamsDirective *S) {
1291 VisitOMPExecutableDirective(S);
1294void StmtProfiler::VisitOMPTargetTeamsDistributeDirective(
1295 const OMPTargetTeamsDistributeDirective *S) {
1296 VisitOMPLoopDirective(S);
1299void StmtProfiler::VisitOMPTargetTeamsDistributeParallelForDirective(
1300 const OMPTargetTeamsDistributeParallelForDirective *S) {
1301 VisitOMPLoopDirective(S);
1304void StmtProfiler::VisitOMPTargetTeamsDistributeParallelForSimdDirective(
1305 const OMPTargetTeamsDistributeParallelForSimdDirective *S) {
1306 VisitOMPLoopDirective(S);
1309void StmtProfiler::VisitOMPTargetTeamsDistributeSimdDirective(
1310 const OMPTargetTeamsDistributeSimdDirective *S) {
1311 VisitOMPLoopDirective(S);
1314void StmtProfiler::VisitOMPInteropDirective(
const OMPInteropDirective *S) {
1315 VisitOMPExecutableDirective(S);
1318void StmtProfiler::VisitOMPDispatchDirective(
const OMPDispatchDirective *S) {
1319 VisitOMPExecutableDirective(S);
1322void StmtProfiler::VisitOMPMaskedDirective(
const OMPMaskedDirective *S) {
1323 VisitOMPExecutableDirective(S);
1326void StmtProfiler::VisitOMPGenericLoopDirective(
1327 const OMPGenericLoopDirective *S) {
1328 VisitOMPLoopDirective(S);
1331void StmtProfiler::VisitOMPTeamsGenericLoopDirective(
1332 const OMPTeamsGenericLoopDirective *S) {
1333 VisitOMPLoopDirective(S);
1336void StmtProfiler::VisitOMPTargetTeamsGenericLoopDirective(
1337 const OMPTargetTeamsGenericLoopDirective *S) {
1338 VisitOMPLoopDirective(S);
1341void StmtProfiler::VisitOMPParallelGenericLoopDirective(
1342 const OMPParallelGenericLoopDirective *S) {
1343 VisitOMPLoopDirective(S);
1346void StmtProfiler::VisitOMPTargetParallelGenericLoopDirective(
1347 const OMPTargetParallelGenericLoopDirective *S) {
1348 VisitOMPLoopDirective(S);
1351void StmtProfiler::VisitExpr(
const Expr *S) {
1355void StmtProfiler::VisitConstantExpr(
const ConstantExpr *S) {
1360void StmtProfiler::VisitDeclRefExpr(
const DeclRefExpr *S) {
1372void StmtProfiler::VisitSYCLUniqueStableNameExpr(
1373 const SYCLUniqueStableNameExpr *S) {
1378void StmtProfiler::VisitPredefinedExpr(
const PredefinedExpr *S) {
1383void StmtProfiler::VisitOpenACCAsteriskSizeExpr(
1384 const OpenACCAsteriskSizeExpr *S) {
1388void StmtProfiler::VisitIntegerLiteral(
const IntegerLiteral *S) {
1394 T =
T.getCanonicalType();
1396 if (
auto BitIntT =
T->
getAs<BitIntType>())
1397 BitIntT->Profile(ID);
1399 ID.AddInteger(
T->
castAs<BuiltinType>()->getKind());
1402void StmtProfiler::VisitFixedPointLiteral(
const FixedPointLiteral *S) {
1405 ID.AddInteger(S->
getType()->
castAs<BuiltinType>()->getKind());
1408void StmtProfiler::VisitCharacterLiteral(
const CharacterLiteral *S) {
1410 ID.AddInteger(llvm::to_underlying(S->
getKind()));
1414void StmtProfiler::VisitFloatingLiteral(
const FloatingLiteral *S) {
1418 ID.AddInteger(S->
getType()->
castAs<BuiltinType>()->getKind());
1421void StmtProfiler::VisitImaginaryLiteral(
const ImaginaryLiteral *S) {
1425void StmtProfiler::VisitStringLiteral(
const StringLiteral *S) {
1428 ID.AddInteger(llvm::to_underlying(S->
getKind()));
1431void StmtProfiler::VisitParenExpr(
const ParenExpr *S) {
1435void StmtProfiler::VisitParenListExpr(
const ParenListExpr *S) {
1439void StmtProfiler::VisitUnaryOperator(
const UnaryOperator *S) {
1444void StmtProfiler::VisitOffsetOfExpr(
const OffsetOfExpr *S) {
1447 for (
unsigned i = 0; i < n; ++i) {
1473StmtProfiler::VisitUnaryExprOrTypeTraitExpr(
const UnaryExprOrTypeTraitExpr *S) {
1480void StmtProfiler::VisitArraySubscriptExpr(
const ArraySubscriptExpr *S) {
1484void StmtProfiler::VisitMatrixSubscriptExpr(
const MatrixSubscriptExpr *S) {
1488void StmtProfiler::VisitArraySectionExpr(
const ArraySectionExpr *S) {
1492void StmtProfiler::VisitOMPArrayShapingExpr(
const OMPArrayShapingExpr *S) {
1496void StmtProfiler::VisitOMPIteratorExpr(
const OMPIteratorExpr *S) {
1502void StmtProfiler::VisitCallExpr(
const CallExpr *S) {
1506void StmtProfiler::VisitMemberExpr(
const MemberExpr *S) {
1514void StmtProfiler::VisitCompoundLiteralExpr(
const CompoundLiteralExpr *S) {
1519void StmtProfiler::VisitCastExpr(
const CastExpr *S) {
1523void StmtProfiler::VisitImplicitCastExpr(
const ImplicitCastExpr *S) {
1528void StmtProfiler::VisitExplicitCastExpr(
const ExplicitCastExpr *S) {
1533void StmtProfiler::VisitCStyleCastExpr(
const CStyleCastExpr *S) {
1534 VisitExplicitCastExpr(S);
1537void StmtProfiler::VisitBinaryOperator(
const BinaryOperator *S) {
1543StmtProfiler::VisitCompoundAssignOperator(
const CompoundAssignOperator *S) {
1544 VisitBinaryOperator(S);
1547void StmtProfiler::VisitConditionalOperator(
const ConditionalOperator *S) {
1551void StmtProfiler::VisitBinaryConditionalOperator(
1552 const BinaryConditionalOperator *S) {
1556void StmtProfiler::VisitAddrLabelExpr(
const AddrLabelExpr *S) {
1561void StmtProfiler::VisitStmtExpr(
const StmtExpr *S) {
1565void StmtProfiler::VisitShuffleVectorExpr(
const ShuffleVectorExpr *S) {
1569void StmtProfiler::VisitConvertVectorExpr(
const ConvertVectorExpr *S) {
1573void StmtProfiler::VisitChooseExpr(
const ChooseExpr *S) {
1577void StmtProfiler::VisitGNUNullExpr(
const GNUNullExpr *S) {
1581void StmtProfiler::VisitVAArgExpr(
const VAArgExpr *S) {
1585void StmtProfiler::VisitInitListExpr(
const InitListExpr *S) {
1594void StmtProfiler::VisitDesignatedInitExpr(
const DesignatedInitExpr *S) {
1597 for (
const DesignatedInitExpr::Designator &D : S->
designators()) {
1598 if (D.isFieldDesignator()) {
1600 VisitName(D.getFieldName());
1604 if (D.isArrayDesignator()) {
1607 assert(D.isArrayRangeDesignator());
1610 ID.AddInteger(D.getArrayIndex());
1616void StmtProfiler::VisitDesignatedInitUpdateExpr(
1617 const DesignatedInitUpdateExpr *S) {
1618 llvm_unreachable(
"Unexpected DesignatedInitUpdateExpr in syntactic form of "
1622void StmtProfiler::VisitArrayInitLoopExpr(
const ArrayInitLoopExpr *S) {
1626void StmtProfiler::VisitArrayInitIndexExpr(
const ArrayInitIndexExpr *S) {
1630void StmtProfiler::VisitNoInitExpr(
const NoInitExpr *S) {
1631 llvm_unreachable(
"Unexpected NoInitExpr in syntactic form of initializer");
1634void StmtProfiler::VisitImplicitValueInitExpr(
const ImplicitValueInitExpr *S) {
1638void StmtProfiler::VisitExtVectorElementExpr(
const ExtVectorElementExpr *S) {
1643void StmtProfiler::VisitBlockExpr(
const BlockExpr *S) {
1648void StmtProfiler::VisitGenericSelectionExpr(
const GenericSelectionExpr *S) {
1652 QualType
T = Assoc.getType();
1654 ID.AddPointer(
nullptr);
1657 VisitExpr(Assoc.getAssociationExpr());
1661void StmtProfiler::VisitPseudoObjectExpr(
const PseudoObjectExpr *S) {
1666 if (
const OpaqueValueExpr *OVE = dyn_cast<OpaqueValueExpr>(*i))
1667 Visit(OVE->getSourceExpr());
1670void StmtProfiler::VisitAtomicExpr(
const AtomicExpr *S) {
1672 ID.AddInteger(S->
getOp());
1675void StmtProfiler::VisitConceptSpecializationExpr(
1676 const ConceptSpecializationExpr *S) {
1680 VisitTemplateArgument(Arg);
1683void StmtProfiler::VisitRequiresExpr(
const RequiresExpr *S) {
1687 VisitDecl(LocalParam);
1690 if (
auto *TypeReq = dyn_cast<concepts::TypeRequirement>(Req)) {
1692 ID.AddBoolean(TypeReq->isSubstitutionFailure());
1693 if (!TypeReq->isSubstitutionFailure())
1694 VisitType(TypeReq->getType()->getType());
1695 }
else if (
auto *ExprReq = dyn_cast<concepts::ExprRequirement>(Req)) {
1697 ID.AddBoolean(ExprReq->isExprSubstitutionFailure());
1698 if (!ExprReq->isExprSubstitutionFailure())
1699 Visit(ExprReq->getExpr());
1704 ID.AddBoolean(ExprReq->getNoexceptLoc().isValid());
1705 const concepts::ExprRequirement::ReturnTypeRequirement &RetReq =
1706 ExprReq->getReturnTypeRequirement();
1719 ID.AddBoolean(NestedReq->hasInvalidConstraint());
1720 if (!NestedReq->hasInvalidConstraint())
1721 Visit(NestedReq->getConstraintExpr());
1729 unsigned &NumArgs) {
1735 case OO_Array_Delete:
1737 case OO_Conditional:
1739 llvm_unreachable(
"Invalid operator call kind");
1744 return Stmt::UnaryOperatorClass;
1748 return Stmt::BinaryOperatorClass;
1753 return Stmt::UnaryOperatorClass;
1757 return Stmt::BinaryOperatorClass;
1762 return Stmt::UnaryOperatorClass;
1766 return Stmt::BinaryOperatorClass;
1770 return Stmt::BinaryOperatorClass;
1774 return Stmt::BinaryOperatorClass;
1778 return Stmt::BinaryOperatorClass;
1782 UnaryOp = UO_AddrOf;
1783 return Stmt::UnaryOperatorClass;
1787 return Stmt::BinaryOperatorClass;
1791 return Stmt::BinaryOperatorClass;
1795 return Stmt::UnaryOperatorClass;
1799 return Stmt::UnaryOperatorClass;
1802 BinaryOp = BO_Assign;
1803 return Stmt::BinaryOperatorClass;
1807 return Stmt::BinaryOperatorClass;
1811 return Stmt::BinaryOperatorClass;
1814 BinaryOp = BO_AddAssign;
1815 return Stmt::CompoundAssignOperatorClass;
1818 BinaryOp = BO_SubAssign;
1819 return Stmt::CompoundAssignOperatorClass;
1822 BinaryOp = BO_MulAssign;
1823 return Stmt::CompoundAssignOperatorClass;
1826 BinaryOp = BO_DivAssign;
1827 return Stmt::CompoundAssignOperatorClass;
1829 case OO_PercentEqual:
1830 BinaryOp = BO_RemAssign;
1831 return Stmt::CompoundAssignOperatorClass;
1834 BinaryOp = BO_XorAssign;
1835 return Stmt::CompoundAssignOperatorClass;
1838 BinaryOp = BO_AndAssign;
1839 return Stmt::CompoundAssignOperatorClass;
1842 BinaryOp = BO_OrAssign;
1843 return Stmt::CompoundAssignOperatorClass;
1847 return Stmt::BinaryOperatorClass;
1849 case OO_GreaterGreater:
1851 return Stmt::BinaryOperatorClass;
1853 case OO_LessLessEqual:
1854 BinaryOp = BO_ShlAssign;
1855 return Stmt::CompoundAssignOperatorClass;
1857 case OO_GreaterGreaterEqual:
1858 BinaryOp = BO_ShrAssign;
1859 return Stmt::CompoundAssignOperatorClass;
1863 return Stmt::BinaryOperatorClass;
1865 case OO_ExclaimEqual:
1867 return Stmt::BinaryOperatorClass;
1871 return Stmt::BinaryOperatorClass;
1873 case OO_GreaterEqual:
1875 return Stmt::BinaryOperatorClass;
1879 return Stmt::BinaryOperatorClass;
1883 return Stmt::BinaryOperatorClass;
1887 return Stmt::BinaryOperatorClass;
1890 UnaryOp = NumArgs == 1 ? UO_PreInc : UO_PostInc;
1892 return Stmt::UnaryOperatorClass;
1895 UnaryOp = NumArgs == 1 ? UO_PreDec : UO_PostDec;
1897 return Stmt::UnaryOperatorClass;
1900 BinaryOp = BO_Comma;
1901 return Stmt::BinaryOperatorClass;
1904 BinaryOp = BO_PtrMemI;
1905 return Stmt::BinaryOperatorClass;
1908 return Stmt::ArraySubscriptExprClass;
1911 return Stmt::CallExprClass;
1914 UnaryOp = UO_Coawait;
1915 return Stmt::UnaryOperatorClass;
1918 llvm_unreachable(
"Invalid overloaded operator expression");
1921#if defined(_MSC_VER) && !defined(__clang__)
1926#pragma optimize("", off)
1930void StmtProfiler::VisitCXXOperatorCallExpr(
const CXXOperatorCallExpr *S) {
1938 return Visit(S->
getArg(0));
1946 for (
unsigned I = 0; I != NumArgs; ++I)
1948 if (SC == Stmt::UnaryOperatorClass)
1949 ID.AddInteger(UnaryOp);
1950 else if (SC == Stmt::BinaryOperatorClass ||
1951 SC == Stmt::CompoundAssignOperatorClass)
1952 ID.AddInteger(BinaryOp);
1954 assert(SC == Stmt::ArraySubscriptExprClass || SC == Stmt::CallExprClass);
1963void StmtProfiler::VisitCXXRewrittenBinaryOperator(
1964 const CXXRewrittenBinaryOperator *S) {
1968 "resolved rewritten operator should never be type-dependent");
1973#if defined(_MSC_VER) && !defined(__clang__)
1975#pragma optimize("", on)
1979void StmtProfiler::VisitCXXMemberCallExpr(
const CXXMemberCallExpr *S) {
1983void StmtProfiler::VisitCUDAKernelCallExpr(
const CUDAKernelCallExpr *S) {
1987void StmtProfiler::VisitAsTypeExpr(
const AsTypeExpr *S) {
1991void StmtProfiler::VisitCXXNamedCastExpr(
const CXXNamedCastExpr *S) {
1992 VisitExplicitCastExpr(S);
1995void StmtProfiler::VisitCXXStaticCastExpr(
const CXXStaticCastExpr *S) {
1996 VisitCXXNamedCastExpr(S);
1999void StmtProfiler::VisitCXXDynamicCastExpr(
const CXXDynamicCastExpr *S) {
2000 VisitCXXNamedCastExpr(S);
2004StmtProfiler::VisitCXXReinterpretCastExpr(
const CXXReinterpretCastExpr *S) {
2005 VisitCXXNamedCastExpr(S);
2008void StmtProfiler::VisitCXXConstCastExpr(
const CXXConstCastExpr *S) {
2009 VisitCXXNamedCastExpr(S);
2012void StmtProfiler::VisitBuiltinBitCastExpr(
const BuiltinBitCastExpr *S) {
2017void StmtProfiler::VisitCXXAddrspaceCastExpr(
const CXXAddrspaceCastExpr *S) {
2018 VisitCXXNamedCastExpr(S);
2021void StmtProfiler::VisitUserDefinedLiteral(
const UserDefinedLiteral *S) {
2025void StmtProfiler::VisitCXXBoolLiteralExpr(
const CXXBoolLiteralExpr *S) {
2030void StmtProfiler::VisitCXXNullPtrLiteralExpr(
const CXXNullPtrLiteralExpr *S) {
2034void StmtProfiler::VisitCXXStdInitializerListExpr(
2035 const CXXStdInitializerListExpr *S) {
2039void StmtProfiler::VisitCXXTypeidExpr(
const CXXTypeidExpr *S) {
2045void StmtProfiler::VisitCXXUuidofExpr(
const CXXUuidofExpr *S) {
2051void StmtProfiler::VisitMSPropertyRefExpr(
const MSPropertyRefExpr *S) {
2056void StmtProfiler::VisitMSPropertySubscriptExpr(
2057 const MSPropertySubscriptExpr *S) {
2061void StmtProfiler::VisitCXXThisExpr(
const CXXThisExpr *S) {
2067void StmtProfiler::VisitCXXThrowExpr(
const CXXThrowExpr *S) {
2071void StmtProfiler::VisitCXXDefaultArgExpr(
const CXXDefaultArgExpr *S) {
2076void StmtProfiler::VisitCXXDefaultInitExpr(
const CXXDefaultInitExpr *S) {
2081void StmtProfiler::VisitCXXBindTemporaryExpr(
const CXXBindTemporaryExpr *S) {
2087void StmtProfiler::VisitCXXConstructExpr(
const CXXConstructExpr *S) {
2093void StmtProfiler::VisitCXXInheritedCtorInitExpr(
2094 const CXXInheritedCtorInitExpr *S) {
2099void StmtProfiler::VisitCXXFunctionalCastExpr(
const CXXFunctionalCastExpr *S) {
2100 VisitExplicitCastExpr(S);
2104StmtProfiler::VisitCXXTemporaryObjectExpr(
const CXXTemporaryObjectExpr *S) {
2105 VisitCXXConstructExpr(S);
2109StmtProfiler::VisitLambdaExpr(
const LambdaExpr *S) {
2110 if (!ProfileLambdaExpr) {
2114 VisitStmtNoChildren(S);
2125 ID.AddInteger(
Capture.getCaptureKind());
2126 if (
Capture.capturesVariable())
2127 VisitDecl(
Capture.getCapturedVar());
2136 for (
auto *SubDecl : Lambda->
decls()) {
2137 FunctionDecl *
Call =
nullptr;
2138 if (
auto *FTD = dyn_cast<FunctionTemplateDecl>(SubDecl))
2139 Call = FTD->getTemplatedDecl();
2140 else if (
auto *FD = dyn_cast<FunctionDecl>(SubDecl))
2152StmtProfiler::VisitCXXScalarValueInitExpr(
const CXXScalarValueInitExpr *S) {
2156void StmtProfiler::VisitCXXDeleteExpr(
const CXXDeleteExpr *S) {
2163void StmtProfiler::VisitCXXNewExpr(
const CXXNewExpr *S) {
2176StmtProfiler::VisitCXXPseudoDestructorExpr(
const CXXPseudoDestructorExpr *S) {
2190void StmtProfiler::VisitOverloadExpr(
const OverloadExpr *S) {
2192 bool DescribingDependentVarTemplate =
2194 if (DescribingDependentVarTemplate) {
2198 VisitName(S->
getName(),
true);
2206StmtProfiler::VisitUnresolvedLookupExpr(
const UnresolvedLookupExpr *S) {
2207 VisitOverloadExpr(S);
2210void StmtProfiler::VisitTypeTraitExpr(
const TypeTraitExpr *S) {
2214 for (
unsigned I = 0, N = S->
getNumArgs(); I != N; ++I)
2218void StmtProfiler::VisitArrayTypeTraitExpr(
const ArrayTypeTraitExpr *S) {
2224void StmtProfiler::VisitExpressionTraitExpr(
const ExpressionTraitExpr *S) {
2230void StmtProfiler::VisitDependentScopeDeclRefExpr(
2231 const DependentScopeDeclRefExpr *S) {
2240void StmtProfiler::VisitExprWithCleanups(
const ExprWithCleanups *S) {
2244void StmtProfiler::VisitCXXUnresolvedConstructExpr(
2245 const CXXUnresolvedConstructExpr *S) {
2251void StmtProfiler::VisitCXXDependentScopeMemberExpr(
2252 const CXXDependentScopeMemberExpr *S) {
2265void StmtProfiler::VisitUnresolvedMemberExpr(
const UnresolvedMemberExpr *S) {
2278void StmtProfiler::VisitCXXNoexceptExpr(
const CXXNoexceptExpr *S) {
2282void StmtProfiler::VisitPackExpansionExpr(
const PackExpansionExpr *S) {
2286void StmtProfiler::VisitSizeOfPackExpr(
const SizeOfPackExpr *S) {
2290 ID.AddInteger(Args.size());
2291 for (
const auto &TA : Args)
2292 VisitTemplateArgument(TA);
2299void StmtProfiler::VisitPackIndexingExpr(
const PackIndexingExpr *E) {
2311void StmtProfiler::VisitSubstNonTypeTemplateParmPackExpr(
2312 const SubstNonTypeTemplateParmPackExpr *S) {
2318void StmtProfiler::VisitSubstNonTypeTemplateParmExpr(
2319 const SubstNonTypeTemplateParmExpr *E) {
2324void StmtProfiler::VisitFunctionParmPackExpr(
const FunctionParmPackExpr *S) {
2332void StmtProfiler::VisitMaterializeTemporaryExpr(
2333 const MaterializeTemporaryExpr *S) {
2337void StmtProfiler::VisitCXXFoldExpr(
const CXXFoldExpr *S) {
2342void StmtProfiler::VisitCXXParenListInitExpr(
const CXXParenListInitExpr *S) {
2346void StmtProfiler::VisitCoroutineBodyStmt(
const CoroutineBodyStmt *S) {
2350void StmtProfiler::VisitCoreturnStmt(
const CoreturnStmt *S) {
2354void StmtProfiler::VisitCoawaitExpr(
const CoawaitExpr *S) {
2358void StmtProfiler::VisitDependentCoawaitExpr(
const DependentCoawaitExpr *S) {
2362void StmtProfiler::VisitCoyieldExpr(
const CoyieldExpr *S) {
2366void StmtProfiler::VisitOpaqueValueExpr(
const OpaqueValueExpr *E) {
2370void StmtProfiler::VisitSourceLocExpr(
const SourceLocExpr *E) {
2374void StmtProfiler::VisitEmbedExpr(
const EmbedExpr *E) { VisitExpr(E); }
2376void StmtProfiler::VisitRecoveryExpr(
const RecoveryExpr *E) { VisitExpr(E); }
2378void StmtProfiler::VisitObjCStringLiteral(
const ObjCStringLiteral *S) {
2382void StmtProfiler::VisitObjCBoxedExpr(
const ObjCBoxedExpr *E) {
2386void StmtProfiler::VisitObjCArrayLiteral(
const ObjCArrayLiteral *E) {
2390void StmtProfiler::VisitObjCDictionaryLiteral(
const ObjCDictionaryLiteral *E) {
2394void StmtProfiler::VisitObjCEncodeExpr(
const ObjCEncodeExpr *S) {
2399void StmtProfiler::VisitObjCSelectorExpr(
const ObjCSelectorExpr *S) {
2404void StmtProfiler::VisitObjCProtocolExpr(
const ObjCProtocolExpr *S) {
2409void StmtProfiler::VisitObjCIvarRefExpr(
const ObjCIvarRefExpr *S) {
2416void StmtProfiler::VisitObjCPropertyRefExpr(
const ObjCPropertyRefExpr *S) {
2430void StmtProfiler::VisitObjCSubscriptRefExpr(
const ObjCSubscriptRefExpr *S) {
2436void StmtProfiler::VisitObjCMessageExpr(
const ObjCMessageExpr *S) {
2442void StmtProfiler::VisitObjCIsaExpr(
const ObjCIsaExpr *S) {
2447void StmtProfiler::VisitObjCBoolLiteralExpr(
const ObjCBoolLiteralExpr *S) {
2452void StmtProfiler::VisitObjCIndirectCopyRestoreExpr(
2453 const ObjCIndirectCopyRestoreExpr *S) {
2458void StmtProfiler::VisitObjCBridgedCastExpr(
const ObjCBridgedCastExpr *S) {
2459 VisitExplicitCastExpr(S);
2463void StmtProfiler::VisitObjCAvailabilityCheckExpr(
2464 const ObjCAvailabilityCheckExpr *S) {
2468void StmtProfiler::VisitTemplateArguments(
const TemplateArgumentLoc *Args,
2470 ID.AddInteger(NumArgs);
2471 for (
unsigned I = 0; I != NumArgs; ++I)
2475void StmtProfiler::VisitTemplateArgument(
const TemplateArgument &Arg) {
2518 VisitTemplateArgument(P);
2524class OpenACCClauseProfiler
2525 :
public OpenACCClauseVisitor<OpenACCClauseProfiler> {
2526 StmtProfiler &Profiler;
2529 OpenACCClauseProfiler(StmtProfiler &P) : Profiler(P) {}
2531 void VisitOpenACCClauseList(ArrayRef<const OpenACCClause *> Clauses) {
2532 for (
const OpenACCClause *Clause : Clauses) {
2539 void VisitClauseWithVarList(
const OpenACCClauseWithVarList &Clause) {
2541 Profiler.VisitStmt(E);
2544#define VISIT_CLAUSE(CLAUSE_NAME) \
2545 void Visit##CLAUSE_NAME##Clause(const OpenACC##CLAUSE_NAME##Clause &Clause);
2547#include "clang/Basic/OpenACCClauses.def"
2551void OpenACCClauseProfiler::VisitDefaultClause(
2552 const OpenACCDefaultClause &Clause) {}
2554void OpenACCClauseProfiler::VisitIfClause(
const OpenACCIfClause &Clause) {
2556 "if clause requires a valid condition expr");
2560void OpenACCClauseProfiler::VisitCopyClause(
const OpenACCCopyClause &Clause) {
2561 VisitClauseWithVarList(Clause);
2564void OpenACCClauseProfiler::VisitLinkClause(
const OpenACCLinkClause &Clause) {
2565 VisitClauseWithVarList(Clause);
2568void OpenACCClauseProfiler::VisitDeviceResidentClause(
2569 const OpenACCDeviceResidentClause &Clause) {
2570 VisitClauseWithVarList(Clause);
2573void OpenACCClauseProfiler::VisitCopyInClause(
2574 const OpenACCCopyInClause &Clause) {
2575 VisitClauseWithVarList(Clause);
2578void OpenACCClauseProfiler::VisitCopyOutClause(
2579 const OpenACCCopyOutClause &Clause) {
2580 VisitClauseWithVarList(Clause);
2583void OpenACCClauseProfiler::VisitCreateClause(
2584 const OpenACCCreateClause &Clause) {
2585 VisitClauseWithVarList(Clause);
2588void OpenACCClauseProfiler::VisitHostClause(
const OpenACCHostClause &Clause) {
2589 VisitClauseWithVarList(Clause);
2592void OpenACCClauseProfiler::VisitDeviceClause(
2593 const OpenACCDeviceClause &Clause) {
2594 VisitClauseWithVarList(Clause);
2597void OpenACCClauseProfiler::VisitSelfClause(
const OpenACCSelfClause &Clause) {
2603 Profiler.VisitStmt(E);
2607void OpenACCClauseProfiler::VisitFinalizeClause(
2608 const OpenACCFinalizeClause &Clause) {}
2610void OpenACCClauseProfiler::VisitIfPresentClause(
2611 const OpenACCIfPresentClause &Clause) {}
2613void OpenACCClauseProfiler::VisitNumGangsClause(
2614 const OpenACCNumGangsClause &Clause) {
2616 Profiler.VisitStmt(E);
2619void OpenACCClauseProfiler::VisitTileClause(
const OpenACCTileClause &Clause) {
2621 Profiler.VisitStmt(E);
2624void OpenACCClauseProfiler::VisitNumWorkersClause(
2625 const OpenACCNumWorkersClause &Clause) {
2626 assert(Clause.
hasIntExpr() &&
"num_workers clause requires a valid int expr");
2630void OpenACCClauseProfiler::VisitCollapseClause(
2631 const OpenACCCollapseClause &Clause) {
2632 assert(Clause.
getLoopCount() &&
"collapse clause requires a valid int expr");
2636void OpenACCClauseProfiler::VisitPrivateClause(
2637 const OpenACCPrivateClause &Clause) {
2638 VisitClauseWithVarList(Clause);
2641 Profiler.VisitDecl(Recipe.AllocaDecl);
2642 if (Recipe.InitExpr)
2643 Profiler.VisitExpr(Recipe.InitExpr);
2647void OpenACCClauseProfiler::VisitFirstPrivateClause(
2648 const OpenACCFirstPrivateClause &Clause) {
2649 VisitClauseWithVarList(Clause);
2652 Profiler.VisitDecl(Recipe.AllocaDecl);
2653 if (Recipe.InitExpr)
2654 Profiler.VisitExpr(Recipe.InitExpr);
2655 Profiler.VisitDecl(Recipe.InitFromTemporary);
2659void OpenACCClauseProfiler::VisitAttachClause(
2660 const OpenACCAttachClause &Clause) {
2661 VisitClauseWithVarList(Clause);
2664void OpenACCClauseProfiler::VisitDetachClause(
2665 const OpenACCDetachClause &Clause) {
2666 VisitClauseWithVarList(Clause);
2669void OpenACCClauseProfiler::VisitDeleteClause(
2670 const OpenACCDeleteClause &Clause) {
2671 VisitClauseWithVarList(Clause);
2674void OpenACCClauseProfiler::VisitDevicePtrClause(
2675 const OpenACCDevicePtrClause &Clause) {
2676 VisitClauseWithVarList(Clause);
2679void OpenACCClauseProfiler::VisitNoCreateClause(
2680 const OpenACCNoCreateClause &Clause) {
2681 VisitClauseWithVarList(Clause);
2684void OpenACCClauseProfiler::VisitPresentClause(
2685 const OpenACCPresentClause &Clause) {
2686 VisitClauseWithVarList(Clause);
2689void OpenACCClauseProfiler::VisitUseDeviceClause(
2690 const OpenACCUseDeviceClause &Clause) {
2691 VisitClauseWithVarList(Clause);
2694void OpenACCClauseProfiler::VisitVectorLengthClause(
2695 const OpenACCVectorLengthClause &Clause) {
2697 "vector_length clause requires a valid int expr");
2701void OpenACCClauseProfiler::VisitAsyncClause(
const OpenACCAsyncClause &Clause) {
2706void OpenACCClauseProfiler::VisitDeviceNumClause(
2707 const OpenACCDeviceNumClause &Clause) {
2711void OpenACCClauseProfiler::VisitDefaultAsyncClause(
2712 const OpenACCDefaultAsyncClause &Clause) {
2716void OpenACCClauseProfiler::VisitWorkerClause(
2717 const OpenACCWorkerClause &Clause) {
2722void OpenACCClauseProfiler::VisitVectorClause(
2723 const OpenACCVectorClause &Clause) {
2728void OpenACCClauseProfiler::VisitWaitClause(
const OpenACCWaitClause &Clause) {
2732 Profiler.VisitStmt(E);
2736void OpenACCClauseProfiler::VisitDeviceTypeClause(
2737 const OpenACCDeviceTypeClause &Clause) {}
2739void OpenACCClauseProfiler::VisitAutoClause(
const OpenACCAutoClause &Clause) {}
2741void OpenACCClauseProfiler::VisitIndependentClause(
2742 const OpenACCIndependentClause &Clause) {}
2744void OpenACCClauseProfiler::VisitSeqClause(
const OpenACCSeqClause &Clause) {}
2745void OpenACCClauseProfiler::VisitNoHostClause(
2746 const OpenACCNoHostClause &Clause) {}
2748void OpenACCClauseProfiler::VisitGangClause(
const OpenACCGangClause &Clause) {
2749 for (
unsigned I = 0; I < Clause.
getNumExprs(); ++I) {
2750 Profiler.VisitStmt(Clause.
getExpr(I).second);
2754void OpenACCClauseProfiler::VisitReductionClause(
2755 const OpenACCReductionClause &Clause) {
2756 VisitClauseWithVarList(Clause);
2759 Profiler.VisitDecl(Recipe.AllocaDecl);
2760 if (Recipe.InitExpr)
2761 Profiler.VisitExpr(Recipe.InitExpr);
2765 static_assert(
sizeof(OpenACCReductionRecipe) == 2 *
sizeof(
int *));
2769void OpenACCClauseProfiler::VisitBindClause(
const OpenACCBindClause &Clause) {
2770 assert(
false &&
"not implemented... what can we do about our expr?");
2774void StmtProfiler::VisitOpenACCComputeConstruct(
2779 OpenACCClauseProfiler P{*
this};
2780 P.VisitOpenACCClauseList(S->clauses());
2783void StmtProfiler::VisitOpenACCLoopConstruct(
const OpenACCLoopConstruct *S) {
2787 OpenACCClauseProfiler P{*
this};
2788 P.VisitOpenACCClauseList(S->clauses());
2791void StmtProfiler::VisitOpenACCCombinedConstruct(
2792 const OpenACCCombinedConstruct *S) {
2796 OpenACCClauseProfiler P{*
this};
2797 P.VisitOpenACCClauseList(S->clauses());
2800void StmtProfiler::VisitOpenACCDataConstruct(
const OpenACCDataConstruct *S) {
2803 OpenACCClauseProfiler P{*
this};
2804 P.VisitOpenACCClauseList(S->clauses());
2807void StmtProfiler::VisitOpenACCEnterDataConstruct(
2808 const OpenACCEnterDataConstruct *S) {
2811 OpenACCClauseProfiler P{*
this};
2812 P.VisitOpenACCClauseList(S->clauses());
2815void StmtProfiler::VisitOpenACCExitDataConstruct(
2816 const OpenACCExitDataConstruct *S) {
2819 OpenACCClauseProfiler P{*
this};
2820 P.VisitOpenACCClauseList(S->clauses());
2823void StmtProfiler::VisitOpenACCHostDataConstruct(
2824 const OpenACCHostDataConstruct *S) {
2827 OpenACCClauseProfiler P{*
this};
2828 P.VisitOpenACCClauseList(S->clauses());
2831void StmtProfiler::VisitOpenACCWaitConstruct(
const OpenACCWaitConstruct *S) {
2835 OpenACCClauseProfiler P{*
this};
2836 P.VisitOpenACCClauseList(S->clauses());
2839void StmtProfiler::VisitOpenACCCacheConstruct(
const OpenACCCacheConstruct *S) {
2844void StmtProfiler::VisitOpenACCInitConstruct(
const OpenACCInitConstruct *S) {
2846 OpenACCClauseProfiler P{*
this};
2847 P.VisitOpenACCClauseList(S->clauses());
2850void StmtProfiler::VisitOpenACCShutdownConstruct(
2851 const OpenACCShutdownConstruct *S) {
2853 OpenACCClauseProfiler P{*
this};
2854 P.VisitOpenACCClauseList(S->clauses());
2857void StmtProfiler::VisitOpenACCSetConstruct(
const OpenACCSetConstruct *S) {
2859 OpenACCClauseProfiler P{*
this};
2860 P.VisitOpenACCClauseList(S->clauses());
2863void StmtProfiler::VisitOpenACCUpdateConstruct(
2864 const OpenACCUpdateConstruct *S) {
2866 OpenACCClauseProfiler P{*
this};
2867 P.VisitOpenACCClauseList(S->clauses());
2870void StmtProfiler::VisitOpenACCAtomicConstruct(
2871 const OpenACCAtomicConstruct *S) {
2873 OpenACCClauseProfiler P{*
this};
2874 P.VisitOpenACCClauseList(S->clauses());
2877void StmtProfiler::VisitHLSLOutArgExpr(
const HLSLOutArgExpr *S) {
2882 bool Canonical,
bool ProfileLambdaExpr)
const {
2883 StmtProfilerWithPointers Profiler(ID, Context, Canonical, ProfileLambdaExpr);
2884 Profiler.Visit(
this);
2889 StmtProfilerWithoutPointers Profiler(ID, Hash);
2890 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.