24#include "llvm/ADT/FoldingSet.h"
30 llvm::FoldingSetNodeID &ID;
32 bool ProfileLambdaExpr;
35 StmtProfiler(llvm::FoldingSetNodeID &ID,
bool Canonical,
36 bool ProfileLambdaExpr)
37 : ID(ID), Canonical(Canonical), ProfileLambdaExpr(ProfileLambdaExpr) {}
39 virtual ~StmtProfiler() {}
41 void VisitStmt(
const Stmt *S);
43 void VisitStmtNoChildren(
const Stmt *S) {
49#define STMT(Node, Base) void Visit##Node(const Node *S);
50#include "clang/AST/StmtNodes.inc"
54 virtual void VisitDecl(
const Decl *D) = 0;
61 virtual void VisitName(
DeclarationName Name,
bool TreatAsDecl =
false) = 0;
83 class StmtProfilerWithPointers :
public StmtProfiler {
84 const ASTContext &Context;
87 StmtProfilerWithPointers(llvm::FoldingSetNodeID &ID,
88 const ASTContext &Context,
bool Canonical,
89 bool ProfileLambdaExpr)
90 : StmtProfiler(
ID, Canonical, ProfileLambdaExpr), Context(Context) {}
97 void VisitDecl(
const Decl *D)
override {
100 if (Canonical && D) {
101 if (
const NonTypeTemplateParmDecl *NTTP =
102 dyn_cast<NonTypeTemplateParmDecl>(D)) {
103 ID.AddInteger(NTTP->getDepth());
104 ID.AddInteger(NTTP->getIndex());
105 ID.AddBoolean(NTTP->isParameterPack());
114 VisitType(Context.getUnconstrainedType(NTTP->getType()));
118 if (
const ParmVarDecl *Parm = dyn_cast<ParmVarDecl>(D)) {
129 VisitType(Parm->getType());
130 ID.AddInteger(Parm->getFunctionScopeDepth());
131 ID.AddInteger(Parm->getFunctionScopeIndex());
135 if (
const TemplateTypeParmDecl *TTP =
136 dyn_cast<TemplateTypeParmDecl>(D)) {
137 ID.AddInteger(TTP->getDepth());
138 ID.AddInteger(TTP->getIndex());
139 ID.AddBoolean(TTP->isParameterPack());
143 if (
const TemplateTemplateParmDecl *TTP =
144 dyn_cast<TemplateTemplateParmDecl>(D)) {
145 ID.AddInteger(TTP->getDepth());
146 ID.AddInteger(TTP->getIndex());
147 ID.AddBoolean(TTP->isParameterPack());
155 void VisitType(QualType
T)
override {
156 if (Canonical && !
T.isNull())
157 T = Context.getCanonicalType(
T);
159 ID.AddPointer(
T.getAsOpaquePtr());
162 void VisitName(DeclarationName Name,
bool )
override {
166 void VisitIdentifierInfo(
const IdentifierInfo *II)
override {
170 void VisitNestedNameSpecifier(NestedNameSpecifier NNS)
override {
178 Name = Context.getCanonicalTemplateName(Name);
184 class StmtProfilerWithoutPointers :
public StmtProfiler {
187 StmtProfilerWithoutPointers(llvm::FoldingSetNodeID &ID, ODRHash &Hash)
193 if (SC == Stmt::UnresolvedLookupExprClass) {
196 ID.AddInteger(Stmt::DeclRefExprClass);
202 void VisitType(QualType
T)
override {
206 void VisitName(DeclarationName Name,
bool TreatAsDecl)
override {
212 Hash.AddDeclarationName(Name, TreatAsDecl);
214 void VisitIdentifierInfo(
const IdentifierInfo *II)
override {
217 Hash.AddIdentifierInfo(II);
220 void VisitDecl(
const Decl *D)
override {
227 Hash.AddTemplateName(Name);
229 void VisitNestedNameSpecifier(NestedNameSpecifier NNS)
override {
230 ID.AddBoolean(
bool(NNS));
232 Hash.AddNestedNameSpecifier(NNS);
237void StmtProfiler::VisitStmt(
const Stmt *S) {
238 assert(S &&
"Requires non-null Stmt pointer");
240 VisitStmtNoChildren(S);
242 for (
const Stmt *SubStmt : S->
children()) {
250void StmtProfiler::VisitDeclStmt(
const DeclStmt *S) {
252 for (
const auto *D : S->
decls())
256void StmtProfiler::VisitNullStmt(
const NullStmt *S) {
260void StmtProfiler::VisitCompoundStmt(
const CompoundStmt *S) {
264void StmtProfiler::VisitCaseStmt(
const CaseStmt *S) {
268void StmtProfiler::VisitDefaultStmt(
const DefaultStmt *S) {
272void StmtProfiler::VisitLabelStmt(
const LabelStmt *S) {
277void StmtProfiler::VisitAttributedStmt(
const AttributedStmt *S) {
282void StmtProfiler::VisitIfStmt(
const IfStmt *S) {
287void StmtProfiler::VisitSwitchStmt(
const SwitchStmt *S) {
292void StmtProfiler::VisitWhileStmt(
const WhileStmt *S) {
297void StmtProfiler::VisitDoStmt(
const DoStmt *S) {
301void StmtProfiler::VisitForStmt(
const ForStmt *S) {
305void StmtProfiler::VisitGotoStmt(
const GotoStmt *S) {
310void StmtProfiler::VisitIndirectGotoStmt(
const IndirectGotoStmt *S) {
314void StmtProfiler::VisitContinueStmt(
const ContinueStmt *S) {
318void StmtProfiler::VisitBreakStmt(
const BreakStmt *S) {
322void StmtProfiler::VisitReturnStmt(
const ReturnStmt *S) {
326void StmtProfiler::VisitGCCAsmStmt(
const GCCAsmStmt *S) {
337 for (
unsigned I = 0, N = S->
getNumInputs(); I != N; ++I) {
345 for (
auto *L : S->
labels())
346 VisitDecl(L->getLabel());
349void StmtProfiler::VisitMSAsmStmt(
const MSAsmStmt *S) {
354void StmtProfiler::VisitCXXCatchStmt(
const CXXCatchStmt *S) {
359void StmtProfiler::VisitCXXTryStmt(
const CXXTryStmt *S) {
363void StmtProfiler::VisitCXXForRangeStmt(
const CXXForRangeStmt *S) {
367void StmtProfiler::VisitMSDependentExistsStmt(
const MSDependentExistsStmt *S) {
374void StmtProfiler::VisitSEHTryStmt(
const SEHTryStmt *S) {
378void StmtProfiler::VisitSEHFinallyStmt(
const SEHFinallyStmt *S) {
382void StmtProfiler::VisitSEHExceptStmt(
const SEHExceptStmt *S) {
386void StmtProfiler::VisitSEHLeaveStmt(
const SEHLeaveStmt *S) {
390void StmtProfiler::VisitCapturedStmt(
const CapturedStmt *S) {
394void StmtProfiler::VisitSYCLKernelCallStmt(
const SYCLKernelCallStmt *S) {
398void StmtProfiler::VisitObjCForCollectionStmt(
const ObjCForCollectionStmt *S) {
402void StmtProfiler::VisitObjCAtCatchStmt(
const ObjCAtCatchStmt *S) {
409void StmtProfiler::VisitObjCAtFinallyStmt(
const ObjCAtFinallyStmt *S) {
413void StmtProfiler::VisitObjCAtTryStmt(
const ObjCAtTryStmt *S) {
418StmtProfiler::VisitObjCAtSynchronizedStmt(
const ObjCAtSynchronizedStmt *S) {
422void StmtProfiler::VisitObjCAtThrowStmt(
const ObjCAtThrowStmt *S) {
427StmtProfiler::VisitObjCAutoreleasePoolStmt(
const ObjCAutoreleasePoolStmt *S) {
432class OMPClauseProfiler :
public ConstOMPClauseVisitor<OMPClauseProfiler> {
433 StmtProfiler *Profiler;
435 template <
typename T>
436 void VisitOMPClauseList(
T *Node);
439 OMPClauseProfiler(StmtProfiler *P) : Profiler(P) { }
440#define GEN_CLANG_CLAUSE_CLASS
441#define CLAUSE_CLASS(Enum, Str, Class) void Visit##Class(const Class *C);
442#include "llvm/Frontend/OpenMP/OMP.inc"
447void OMPClauseProfiler::VisitOMPClauseWithPreInit(
448 const OMPClauseWithPreInit *
C) {
449 if (
auto *S =
C->getPreInitStmt())
450 Profiler->VisitStmt(S);
453void OMPClauseProfiler::VisitOMPClauseWithPostUpdate(
454 const OMPClauseWithPostUpdate *
C) {
455 VisitOMPClauseWithPreInit(
C);
456 if (
auto *E =
C->getPostUpdateExpr())
457 Profiler->VisitStmt(E);
460void OMPClauseProfiler::VisitOMPIfClause(
const OMPIfClause *
C) {
461 VisitOMPClauseWithPreInit(
C);
462 if (
C->getCondition())
463 Profiler->VisitStmt(
C->getCondition());
466void OMPClauseProfiler::VisitOMPFinalClause(
const OMPFinalClause *
C) {
467 VisitOMPClauseWithPreInit(
C);
468 if (
C->getCondition())
469 Profiler->VisitStmt(
C->getCondition());
472void OMPClauseProfiler::VisitOMPNumThreadsClause(
const OMPNumThreadsClause *
C) {
473 VisitOMPClauseWithPreInit(
C);
474 if (
C->getNumThreads())
475 Profiler->VisitStmt(
C->getNumThreads());
478void OMPClauseProfiler::VisitOMPAlignClause(
const OMPAlignClause *
C) {
479 if (
C->getAlignment())
480 Profiler->VisitStmt(
C->getAlignment());
483void OMPClauseProfiler::VisitOMPSafelenClause(
const OMPSafelenClause *
C) {
485 Profiler->VisitStmt(
C->getSafelen());
488void OMPClauseProfiler::VisitOMPSimdlenClause(
const OMPSimdlenClause *
C) {
490 Profiler->VisitStmt(
C->getSimdlen());
493void OMPClauseProfiler::VisitOMPSizesClause(
const OMPSizesClause *
C) {
494 for (
auto *E :
C->getSizesRefs())
496 Profiler->VisitExpr(E);
499void OMPClauseProfiler::VisitOMPPermutationClause(
500 const OMPPermutationClause *
C) {
501 for (Expr *E :
C->getArgsRefs())
503 Profiler->VisitExpr(E);
506void OMPClauseProfiler::VisitOMPFullClause(
const OMPFullClause *
C) {}
508void OMPClauseProfiler::VisitOMPPartialClause(
const OMPPartialClause *
C) {
509 if (
const Expr *Factor =
C->getFactor())
510 Profiler->VisitExpr(Factor);
513void OMPClauseProfiler::VisitOMPLoopRangeClause(
const OMPLoopRangeClause *
C) {
514 if (
const Expr *
First =
C->getFirst())
515 Profiler->VisitExpr(
First);
516 if (
const Expr *Count =
C->getCount())
517 Profiler->VisitExpr(Count);
520void OMPClauseProfiler::VisitOMPAllocatorClause(
const OMPAllocatorClause *
C) {
521 if (
C->getAllocator())
522 Profiler->VisitStmt(
C->getAllocator());
525void OMPClauseProfiler::VisitOMPCollapseClause(
const OMPCollapseClause *
C) {
526 if (
C->getNumForLoops())
527 Profiler->VisitStmt(
C->getNumForLoops());
530void OMPClauseProfiler::VisitOMPDetachClause(
const OMPDetachClause *
C) {
531 if (Expr *Evt =
C->getEventHandler())
532 Profiler->VisitStmt(Evt);
535void OMPClauseProfiler::VisitOMPNovariantsClause(
const OMPNovariantsClause *
C) {
536 VisitOMPClauseWithPreInit(
C);
537 if (
C->getCondition())
538 Profiler->VisitStmt(
C->getCondition());
541void OMPClauseProfiler::VisitOMPNocontextClause(
const OMPNocontextClause *
C) {
542 VisitOMPClauseWithPreInit(
C);
543 if (
C->getCondition())
544 Profiler->VisitStmt(
C->getCondition());
547void OMPClauseProfiler::VisitOMPDefaultClause(
const OMPDefaultClause *
C) { }
549void OMPClauseProfiler::VisitOMPProcBindClause(
const OMPProcBindClause *
C) { }
551void OMPClauseProfiler::VisitOMPUnifiedAddressClause(
552 const OMPUnifiedAddressClause *
C) {}
554void OMPClauseProfiler::VisitOMPUnifiedSharedMemoryClause(
555 const OMPUnifiedSharedMemoryClause *
C) {}
557void OMPClauseProfiler::VisitOMPReverseOffloadClause(
558 const OMPReverseOffloadClause *
C) {}
560void OMPClauseProfiler::VisitOMPDynamicAllocatorsClause(
561 const OMPDynamicAllocatorsClause *
C) {}
563void OMPClauseProfiler::VisitOMPAtomicDefaultMemOrderClause(
564 const OMPAtomicDefaultMemOrderClause *
C) {}
566void OMPClauseProfiler::VisitOMPSelfMapsClause(
const OMPSelfMapsClause *
C) {}
568void OMPClauseProfiler::VisitOMPAtClause(
const OMPAtClause *
C) {}
570void OMPClauseProfiler::VisitOMPSeverityClause(
const OMPSeverityClause *
C) {}
572void OMPClauseProfiler::VisitOMPMessageClause(
const OMPMessageClause *
C) {
573 if (
C->getMessageString())
574 Profiler->VisitStmt(
C->getMessageString());
577void OMPClauseProfiler::VisitOMPScheduleClause(
const OMPScheduleClause *
C) {
578 VisitOMPClauseWithPreInit(
C);
579 if (
auto *S =
C->getChunkSize())
580 Profiler->VisitStmt(S);
583void OMPClauseProfiler::VisitOMPOrderedClause(
const OMPOrderedClause *
C) {
584 if (
auto *
Num =
C->getNumForLoops())
585 Profiler->VisitStmt(
Num);
588void OMPClauseProfiler::VisitOMPNowaitClause(
const OMPNowaitClause *) {}
590void OMPClauseProfiler::VisitOMPUntiedClause(
const OMPUntiedClause *) {}
592void OMPClauseProfiler::VisitOMPMergeableClause(
const OMPMergeableClause *) {}
594void OMPClauseProfiler::VisitOMPReadClause(
const OMPReadClause *) {}
596void OMPClauseProfiler::VisitOMPWriteClause(
const OMPWriteClause *) {}
598void OMPClauseProfiler::VisitOMPUpdateClause(
const OMPUpdateClause *) {}
600void OMPClauseProfiler::VisitOMPCaptureClause(
const OMPCaptureClause *) {}
602void OMPClauseProfiler::VisitOMPCompareClause(
const OMPCompareClause *) {}
604void OMPClauseProfiler::VisitOMPFailClause(
const OMPFailClause *) {}
606void OMPClauseProfiler::VisitOMPAbsentClause(
const OMPAbsentClause *) {}
608void OMPClauseProfiler::VisitOMPHoldsClause(
const OMPHoldsClause *) {}
610void OMPClauseProfiler::VisitOMPContainsClause(
const OMPContainsClause *) {}
612void OMPClauseProfiler::VisitOMPNoOpenMPClause(
const OMPNoOpenMPClause *) {}
614void OMPClauseProfiler::VisitOMPNoOpenMPRoutinesClause(
615 const OMPNoOpenMPRoutinesClause *) {}
617void OMPClauseProfiler::VisitOMPNoOpenMPConstructsClause(
618 const OMPNoOpenMPConstructsClause *) {}
620void OMPClauseProfiler::VisitOMPNoParallelismClause(
621 const OMPNoParallelismClause *) {}
623void OMPClauseProfiler::VisitOMPSeqCstClause(
const OMPSeqCstClause *) {}
625void OMPClauseProfiler::VisitOMPAcqRelClause(
const OMPAcqRelClause *) {}
627void OMPClauseProfiler::VisitOMPAcquireClause(
const OMPAcquireClause *) {}
629void OMPClauseProfiler::VisitOMPReleaseClause(
const OMPReleaseClause *) {}
631void OMPClauseProfiler::VisitOMPRelaxedClause(
const OMPRelaxedClause *) {}
633void OMPClauseProfiler::VisitOMPWeakClause(
const OMPWeakClause *) {}
635void OMPClauseProfiler::VisitOMPThreadsClause(
const OMPThreadsClause *) {}
637void OMPClauseProfiler::VisitOMPSIMDClause(
const OMPSIMDClause *) {}
639void OMPClauseProfiler::VisitOMPNogroupClause(
const OMPNogroupClause *) {}
641void OMPClauseProfiler::VisitOMPInitClause(
const OMPInitClause *
C) {
642 VisitOMPClauseList(
C);
645void OMPClauseProfiler::VisitOMPUseClause(
const OMPUseClause *
C) {
646 if (
C->getInteropVar())
647 Profiler->VisitStmt(
C->getInteropVar());
650void OMPClauseProfiler::VisitOMPDestroyClause(
const OMPDestroyClause *
C) {
651 if (
C->getInteropVar())
652 Profiler->VisitStmt(
C->getInteropVar());
655void OMPClauseProfiler::VisitOMPFilterClause(
const OMPFilterClause *
C) {
656 VisitOMPClauseWithPreInit(
C);
657 if (
C->getThreadID())
658 Profiler->VisitStmt(
C->getThreadID());
662void OMPClauseProfiler::VisitOMPClauseList(
T *Node) {
663 for (
auto *E : Node->varlist()) {
665 Profiler->VisitStmt(E);
669void OMPClauseProfiler::VisitOMPPrivateClause(
const OMPPrivateClause *
C) {
670 VisitOMPClauseList(
C);
671 for (
auto *E :
C->private_copies()) {
673 Profiler->VisitStmt(E);
677OMPClauseProfiler::VisitOMPFirstprivateClause(
const OMPFirstprivateClause *
C) {
678 VisitOMPClauseList(
C);
679 VisitOMPClauseWithPreInit(
C);
680 for (
auto *E :
C->private_copies()) {
682 Profiler->VisitStmt(E);
684 for (
auto *E :
C->inits()) {
686 Profiler->VisitStmt(E);
690OMPClauseProfiler::VisitOMPLastprivateClause(
const OMPLastprivateClause *
C) {
691 VisitOMPClauseList(
C);
692 VisitOMPClauseWithPostUpdate(
C);
693 for (
auto *E :
C->source_exprs()) {
695 Profiler->VisitStmt(E);
697 for (
auto *E :
C->destination_exprs()) {
699 Profiler->VisitStmt(E);
701 for (
auto *E :
C->assignment_ops()) {
703 Profiler->VisitStmt(E);
706void OMPClauseProfiler::VisitOMPSharedClause(
const OMPSharedClause *
C) {
707 VisitOMPClauseList(
C);
709void OMPClauseProfiler::VisitOMPReductionClause(
710 const OMPReductionClause *
C) {
711 Profiler->VisitNestedNameSpecifier(
712 C->getQualifierLoc().getNestedNameSpecifier());
713 Profiler->VisitName(
C->getNameInfo().getName());
714 VisitOMPClauseList(
C);
715 VisitOMPClauseWithPostUpdate(
C);
716 for (
auto *E :
C->privates()) {
718 Profiler->VisitStmt(E);
720 for (
auto *E :
C->lhs_exprs()) {
722 Profiler->VisitStmt(E);
724 for (
auto *E :
C->rhs_exprs()) {
726 Profiler->VisitStmt(E);
728 for (
auto *E :
C->reduction_ops()) {
730 Profiler->VisitStmt(E);
732 if (
C->getModifier() == clang::OMPC_REDUCTION_inscan) {
733 for (
auto *E :
C->copy_ops()) {
735 Profiler->VisitStmt(E);
737 for (
auto *E :
C->copy_array_temps()) {
739 Profiler->VisitStmt(E);
741 for (
auto *E :
C->copy_array_elems()) {
743 Profiler->VisitStmt(E);
747void OMPClauseProfiler::VisitOMPTaskReductionClause(
748 const OMPTaskReductionClause *
C) {
749 Profiler->VisitNestedNameSpecifier(
750 C->getQualifierLoc().getNestedNameSpecifier());
751 Profiler->VisitName(
C->getNameInfo().getName());
752 VisitOMPClauseList(
C);
753 VisitOMPClauseWithPostUpdate(
C);
754 for (
auto *E :
C->privates()) {
756 Profiler->VisitStmt(E);
758 for (
auto *E :
C->lhs_exprs()) {
760 Profiler->VisitStmt(E);
762 for (
auto *E :
C->rhs_exprs()) {
764 Profiler->VisitStmt(E);
766 for (
auto *E :
C->reduction_ops()) {
768 Profiler->VisitStmt(E);
771void OMPClauseProfiler::VisitOMPInReductionClause(
772 const OMPInReductionClause *
C) {
773 Profiler->VisitNestedNameSpecifier(
774 C->getQualifierLoc().getNestedNameSpecifier());
775 Profiler->VisitName(
C->getNameInfo().getName());
776 VisitOMPClauseList(
C);
777 VisitOMPClauseWithPostUpdate(
C);
778 for (
auto *E :
C->privates()) {
780 Profiler->VisitStmt(E);
782 for (
auto *E :
C->lhs_exprs()) {
784 Profiler->VisitStmt(E);
786 for (
auto *E :
C->rhs_exprs()) {
788 Profiler->VisitStmt(E);
790 for (
auto *E :
C->reduction_ops()) {
792 Profiler->VisitStmt(E);
794 for (
auto *E :
C->taskgroup_descriptors()) {
796 Profiler->VisitStmt(E);
799void OMPClauseProfiler::VisitOMPLinearClause(
const OMPLinearClause *
C) {
800 VisitOMPClauseList(
C);
801 VisitOMPClauseWithPostUpdate(
C);
802 for (
auto *E :
C->privates()) {
804 Profiler->VisitStmt(E);
806 for (
auto *E :
C->inits()) {
808 Profiler->VisitStmt(E);
810 for (
auto *E :
C->updates()) {
812 Profiler->VisitStmt(E);
814 for (
auto *E :
C->finals()) {
816 Profiler->VisitStmt(E);
819 Profiler->VisitStmt(
C->getStep());
820 if (
C->getCalcStep())
821 Profiler->VisitStmt(
C->getCalcStep());
823void OMPClauseProfiler::VisitOMPAlignedClause(
const OMPAlignedClause *
C) {
824 VisitOMPClauseList(
C);
825 if (
C->getAlignment())
826 Profiler->VisitStmt(
C->getAlignment());
828void OMPClauseProfiler::VisitOMPCopyinClause(
const OMPCopyinClause *
C) {
829 VisitOMPClauseList(
C);
830 for (
auto *E :
C->source_exprs()) {
832 Profiler->VisitStmt(E);
834 for (
auto *E :
C->destination_exprs()) {
836 Profiler->VisitStmt(E);
838 for (
auto *E :
C->assignment_ops()) {
840 Profiler->VisitStmt(E);
844OMPClauseProfiler::VisitOMPCopyprivateClause(
const OMPCopyprivateClause *
C) {
845 VisitOMPClauseList(
C);
846 for (
auto *E :
C->source_exprs()) {
848 Profiler->VisitStmt(E);
850 for (
auto *E :
C->destination_exprs()) {
852 Profiler->VisitStmt(E);
854 for (
auto *E :
C->assignment_ops()) {
856 Profiler->VisitStmt(E);
859void OMPClauseProfiler::VisitOMPFlushClause(
const OMPFlushClause *
C) {
860 VisitOMPClauseList(
C);
862void OMPClauseProfiler::VisitOMPDepobjClause(
const OMPDepobjClause *
C) {
863 if (
const Expr *Depobj =
C->getDepobj())
864 Profiler->VisitStmt(Depobj);
866void OMPClauseProfiler::VisitOMPDependClause(
const OMPDependClause *
C) {
867 VisitOMPClauseList(
C);
869void OMPClauseProfiler::VisitOMPDeviceClause(
const OMPDeviceClause *
C) {
871 Profiler->VisitStmt(
C->getDevice());
873void OMPClauseProfiler::VisitOMPMapClause(
const OMPMapClause *
C) {
874 VisitOMPClauseList(
C);
876void OMPClauseProfiler::VisitOMPAllocateClause(
const OMPAllocateClause *
C) {
877 if (Expr *Allocator =
C->getAllocator())
878 Profiler->VisitStmt(Allocator);
879 VisitOMPClauseList(
C);
881void OMPClauseProfiler::VisitOMPNumTeamsClause(
const OMPNumTeamsClause *
C) {
882 VisitOMPClauseList(
C);
883 VisitOMPClauseWithPreInit(
C);
885void OMPClauseProfiler::VisitOMPThreadLimitClause(
886 const OMPThreadLimitClause *
C) {
887 VisitOMPClauseList(
C);
888 VisitOMPClauseWithPreInit(
C);
890void OMPClauseProfiler::VisitOMPPriorityClause(
const OMPPriorityClause *
C) {
891 VisitOMPClauseWithPreInit(
C);
892 if (
C->getPriority())
893 Profiler->VisitStmt(
C->getPriority());
895void OMPClauseProfiler::VisitOMPGrainsizeClause(
const OMPGrainsizeClause *
C) {
896 VisitOMPClauseWithPreInit(
C);
897 if (
C->getGrainsize())
898 Profiler->VisitStmt(
C->getGrainsize());
900void OMPClauseProfiler::VisitOMPNumTasksClause(
const OMPNumTasksClause *
C) {
901 VisitOMPClauseWithPreInit(
C);
902 if (
C->getNumTasks())
903 Profiler->VisitStmt(
C->getNumTasks());
905void OMPClauseProfiler::VisitOMPHintClause(
const OMPHintClause *
C) {
907 Profiler->VisitStmt(
C->getHint());
909void OMPClauseProfiler::VisitOMPToClause(
const OMPToClause *
C) {
910 VisitOMPClauseList(
C);
912void OMPClauseProfiler::VisitOMPFromClause(
const OMPFromClause *
C) {
913 VisitOMPClauseList(
C);
915void OMPClauseProfiler::VisitOMPUseDevicePtrClause(
916 const OMPUseDevicePtrClause *
C) {
917 VisitOMPClauseList(
C);
919void OMPClauseProfiler::VisitOMPUseDeviceAddrClause(
920 const OMPUseDeviceAddrClause *
C) {
921 VisitOMPClauseList(
C);
923void OMPClauseProfiler::VisitOMPIsDevicePtrClause(
924 const OMPIsDevicePtrClause *
C) {
925 VisitOMPClauseList(
C);
927void OMPClauseProfiler::VisitOMPHasDeviceAddrClause(
928 const OMPHasDeviceAddrClause *
C) {
929 VisitOMPClauseList(
C);
931void OMPClauseProfiler::VisitOMPNontemporalClause(
932 const OMPNontemporalClause *
C) {
933 VisitOMPClauseList(
C);
934 for (
auto *E :
C->private_refs())
935 Profiler->VisitStmt(E);
937void OMPClauseProfiler::VisitOMPInclusiveClause(
const OMPInclusiveClause *
C) {
938 VisitOMPClauseList(
C);
940void OMPClauseProfiler::VisitOMPExclusiveClause(
const OMPExclusiveClause *
C) {
941 VisitOMPClauseList(
C);
943void OMPClauseProfiler::VisitOMPUsesAllocatorsClause(
944 const OMPUsesAllocatorsClause *
C) {
945 for (
unsigned I = 0, E =
C->getNumberOfAllocators(); I < E; ++I) {
946 OMPUsesAllocatorsClause::Data D =
C->getAllocatorData(I);
952void OMPClauseProfiler::VisitOMPAffinityClause(
const OMPAffinityClause *
C) {
953 if (
const Expr *Modifier =
C->getModifier())
954 Profiler->VisitStmt(Modifier);
955 for (
const Expr *E :
C->varlist())
956 Profiler->VisitStmt(E);
958void OMPClauseProfiler::VisitOMPOrderClause(
const OMPOrderClause *
C) {}
959void OMPClauseProfiler::VisitOMPBindClause(
const OMPBindClause *
C) {}
960void OMPClauseProfiler::VisitOMPXDynCGroupMemClause(
961 const OMPXDynCGroupMemClause *
C) {
962 VisitOMPClauseWithPreInit(
C);
963 if (Expr *Size =
C->getSize())
964 Profiler->VisitStmt(Size);
966void OMPClauseProfiler::VisitOMPDoacrossClause(
const OMPDoacrossClause *
C) {
967 VisitOMPClauseList(
C);
969void OMPClauseProfiler::VisitOMPXAttributeClause(
const OMPXAttributeClause *
C) {
971void OMPClauseProfiler::VisitOMPXBareClause(
const OMPXBareClause *
C) {}
975StmtProfiler::VisitOMPExecutableDirective(
const OMPExecutableDirective *S) {
977 OMPClauseProfiler P(
this);
978 ArrayRef<OMPClause *> Clauses = S->clauses();
979 for (ArrayRef<OMPClause *>::iterator I = Clauses.begin(), E = Clauses.end();
985void StmtProfiler::VisitOMPCanonicalLoop(
const OMPCanonicalLoop *L) {
989void StmtProfiler::VisitOMPLoopBasedDirective(
const OMPLoopBasedDirective *S) {
990 VisitOMPExecutableDirective(S);
993void StmtProfiler::VisitOMPLoopDirective(
const OMPLoopDirective *S) {
994 VisitOMPLoopBasedDirective(S);
997void StmtProfiler::VisitOMPMetaDirective(
const OMPMetaDirective *S) {
998 VisitOMPExecutableDirective(S);
1001void StmtProfiler::VisitOMPParallelDirective(
const OMPParallelDirective *S) {
1002 VisitOMPExecutableDirective(S);
1005void StmtProfiler::VisitOMPSimdDirective(
const OMPSimdDirective *S) {
1006 VisitOMPLoopDirective(S);
1009void StmtProfiler::VisitOMPCanonicalLoopNestTransformationDirective(
1010 const OMPCanonicalLoopNestTransformationDirective *S) {
1011 VisitOMPLoopBasedDirective(S);
1014void StmtProfiler::VisitOMPTileDirective(
const OMPTileDirective *S) {
1015 VisitOMPCanonicalLoopNestTransformationDirective(S);
1018void StmtProfiler::VisitOMPStripeDirective(
const OMPStripeDirective *S) {
1019 VisitOMPCanonicalLoopNestTransformationDirective(S);
1022void StmtProfiler::VisitOMPUnrollDirective(
const OMPUnrollDirective *S) {
1023 VisitOMPCanonicalLoopNestTransformationDirective(S);
1026void StmtProfiler::VisitOMPReverseDirective(
const OMPReverseDirective *S) {
1027 VisitOMPCanonicalLoopNestTransformationDirective(S);
1030void StmtProfiler::VisitOMPInterchangeDirective(
1031 const OMPInterchangeDirective *S) {
1032 VisitOMPCanonicalLoopNestTransformationDirective(S);
1035void StmtProfiler::VisitOMPCanonicalLoopSequenceTransformationDirective(
1036 const OMPCanonicalLoopSequenceTransformationDirective *S) {
1037 VisitOMPExecutableDirective(S);
1040void StmtProfiler::VisitOMPFuseDirective(
const OMPFuseDirective *S) {
1041 VisitOMPCanonicalLoopSequenceTransformationDirective(S);
1044void StmtProfiler::VisitOMPForDirective(
const OMPForDirective *S) {
1045 VisitOMPLoopDirective(S);
1048void StmtProfiler::VisitOMPForSimdDirective(
const OMPForSimdDirective *S) {
1049 VisitOMPLoopDirective(S);
1052void StmtProfiler::VisitOMPSectionsDirective(
const OMPSectionsDirective *S) {
1053 VisitOMPExecutableDirective(S);
1056void StmtProfiler::VisitOMPSectionDirective(
const OMPSectionDirective *S) {
1057 VisitOMPExecutableDirective(S);
1060void StmtProfiler::VisitOMPScopeDirective(
const OMPScopeDirective *S) {
1061 VisitOMPExecutableDirective(S);
1064void StmtProfiler::VisitOMPSingleDirective(
const OMPSingleDirective *S) {
1065 VisitOMPExecutableDirective(S);
1068void StmtProfiler::VisitOMPMasterDirective(
const OMPMasterDirective *S) {
1069 VisitOMPExecutableDirective(S);
1072void StmtProfiler::VisitOMPCriticalDirective(
const OMPCriticalDirective *S) {
1073 VisitOMPExecutableDirective(S);
1074 VisitName(S->getDirectiveName().getName());
1078StmtProfiler::VisitOMPParallelForDirective(
const OMPParallelForDirective *S) {
1079 VisitOMPLoopDirective(S);
1082void StmtProfiler::VisitOMPParallelForSimdDirective(
1083 const OMPParallelForSimdDirective *S) {
1084 VisitOMPLoopDirective(S);
1087void StmtProfiler::VisitOMPParallelMasterDirective(
1088 const OMPParallelMasterDirective *S) {
1089 VisitOMPExecutableDirective(S);
1092void StmtProfiler::VisitOMPParallelMaskedDirective(
1093 const OMPParallelMaskedDirective *S) {
1094 VisitOMPExecutableDirective(S);
1097void StmtProfiler::VisitOMPParallelSectionsDirective(
1098 const OMPParallelSectionsDirective *S) {
1099 VisitOMPExecutableDirective(S);
1102void StmtProfiler::VisitOMPTaskDirective(
const OMPTaskDirective *S) {
1103 VisitOMPExecutableDirective(S);
1106void StmtProfiler::VisitOMPTaskyieldDirective(
const OMPTaskyieldDirective *S) {
1107 VisitOMPExecutableDirective(S);
1110void StmtProfiler::VisitOMPBarrierDirective(
const OMPBarrierDirective *S) {
1111 VisitOMPExecutableDirective(S);
1114void StmtProfiler::VisitOMPTaskwaitDirective(
const OMPTaskwaitDirective *S) {
1115 VisitOMPExecutableDirective(S);
1118void StmtProfiler::VisitOMPAssumeDirective(
const OMPAssumeDirective *S) {
1119 VisitOMPExecutableDirective(S);
1122void StmtProfiler::VisitOMPErrorDirective(
const OMPErrorDirective *S) {
1123 VisitOMPExecutableDirective(S);
1125void StmtProfiler::VisitOMPTaskgroupDirective(
const OMPTaskgroupDirective *S) {
1126 VisitOMPExecutableDirective(S);
1127 if (
const Expr *E = S->getReductionRef())
1131void StmtProfiler::VisitOMPFlushDirective(
const OMPFlushDirective *S) {
1132 VisitOMPExecutableDirective(S);
1135void StmtProfiler::VisitOMPDepobjDirective(
const OMPDepobjDirective *S) {
1136 VisitOMPExecutableDirective(S);
1139void StmtProfiler::VisitOMPScanDirective(
const OMPScanDirective *S) {
1140 VisitOMPExecutableDirective(S);
1143void StmtProfiler::VisitOMPOrderedDirective(
const OMPOrderedDirective *S) {
1144 VisitOMPExecutableDirective(S);
1147void StmtProfiler::VisitOMPAtomicDirective(
const OMPAtomicDirective *S) {
1148 VisitOMPExecutableDirective(S);
1151void StmtProfiler::VisitOMPTargetDirective(
const OMPTargetDirective *S) {
1152 VisitOMPExecutableDirective(S);
1155void StmtProfiler::VisitOMPTargetDataDirective(
const OMPTargetDataDirective *S) {
1156 VisitOMPExecutableDirective(S);
1159void StmtProfiler::VisitOMPTargetEnterDataDirective(
1160 const OMPTargetEnterDataDirective *S) {
1161 VisitOMPExecutableDirective(S);
1164void StmtProfiler::VisitOMPTargetExitDataDirective(
1165 const OMPTargetExitDataDirective *S) {
1166 VisitOMPExecutableDirective(S);
1169void StmtProfiler::VisitOMPTargetParallelDirective(
1170 const OMPTargetParallelDirective *S) {
1171 VisitOMPExecutableDirective(S);
1174void StmtProfiler::VisitOMPTargetParallelForDirective(
1175 const OMPTargetParallelForDirective *S) {
1176 VisitOMPExecutableDirective(S);
1179void StmtProfiler::VisitOMPTeamsDirective(
const OMPTeamsDirective *S) {
1180 VisitOMPExecutableDirective(S);
1183void StmtProfiler::VisitOMPCancellationPointDirective(
1184 const OMPCancellationPointDirective *S) {
1185 VisitOMPExecutableDirective(S);
1188void StmtProfiler::VisitOMPCancelDirective(
const OMPCancelDirective *S) {
1189 VisitOMPExecutableDirective(S);
1192void StmtProfiler::VisitOMPTaskLoopDirective(
const OMPTaskLoopDirective *S) {
1193 VisitOMPLoopDirective(S);
1196void StmtProfiler::VisitOMPTaskLoopSimdDirective(
1197 const OMPTaskLoopSimdDirective *S) {
1198 VisitOMPLoopDirective(S);
1201void StmtProfiler::VisitOMPMasterTaskLoopDirective(
1202 const OMPMasterTaskLoopDirective *S) {
1203 VisitOMPLoopDirective(S);
1206void StmtProfiler::VisitOMPMaskedTaskLoopDirective(
1207 const OMPMaskedTaskLoopDirective *S) {
1208 VisitOMPLoopDirective(S);
1211void StmtProfiler::VisitOMPMasterTaskLoopSimdDirective(
1212 const OMPMasterTaskLoopSimdDirective *S) {
1213 VisitOMPLoopDirective(S);
1216void StmtProfiler::VisitOMPMaskedTaskLoopSimdDirective(
1217 const OMPMaskedTaskLoopSimdDirective *S) {
1218 VisitOMPLoopDirective(S);
1221void StmtProfiler::VisitOMPParallelMasterTaskLoopDirective(
1222 const OMPParallelMasterTaskLoopDirective *S) {
1223 VisitOMPLoopDirective(S);
1226void StmtProfiler::VisitOMPParallelMaskedTaskLoopDirective(
1227 const OMPParallelMaskedTaskLoopDirective *S) {
1228 VisitOMPLoopDirective(S);
1231void StmtProfiler::VisitOMPParallelMasterTaskLoopSimdDirective(
1232 const OMPParallelMasterTaskLoopSimdDirective *S) {
1233 VisitOMPLoopDirective(S);
1236void StmtProfiler::VisitOMPParallelMaskedTaskLoopSimdDirective(
1237 const OMPParallelMaskedTaskLoopSimdDirective *S) {
1238 VisitOMPLoopDirective(S);
1241void StmtProfiler::VisitOMPDistributeDirective(
1242 const OMPDistributeDirective *S) {
1243 VisitOMPLoopDirective(S);
1246void OMPClauseProfiler::VisitOMPDistScheduleClause(
1247 const OMPDistScheduleClause *
C) {
1248 VisitOMPClauseWithPreInit(
C);
1249 if (
auto *S =
C->getChunkSize())
1250 Profiler->VisitStmt(S);
1253void OMPClauseProfiler::VisitOMPDefaultmapClause(
const OMPDefaultmapClause *) {}
1255void StmtProfiler::VisitOMPTargetUpdateDirective(
1256 const OMPTargetUpdateDirective *S) {
1257 VisitOMPExecutableDirective(S);
1260void StmtProfiler::VisitOMPDistributeParallelForDirective(
1261 const OMPDistributeParallelForDirective *S) {
1262 VisitOMPLoopDirective(S);
1265void StmtProfiler::VisitOMPDistributeParallelForSimdDirective(
1266 const OMPDistributeParallelForSimdDirective *S) {
1267 VisitOMPLoopDirective(S);
1270void StmtProfiler::VisitOMPDistributeSimdDirective(
1271 const OMPDistributeSimdDirective *S) {
1272 VisitOMPLoopDirective(S);
1275void StmtProfiler::VisitOMPTargetParallelForSimdDirective(
1276 const OMPTargetParallelForSimdDirective *S) {
1277 VisitOMPLoopDirective(S);
1280void StmtProfiler::VisitOMPTargetSimdDirective(
1281 const OMPTargetSimdDirective *S) {
1282 VisitOMPLoopDirective(S);
1285void StmtProfiler::VisitOMPTeamsDistributeDirective(
1286 const OMPTeamsDistributeDirective *S) {
1287 VisitOMPLoopDirective(S);
1290void StmtProfiler::VisitOMPTeamsDistributeSimdDirective(
1291 const OMPTeamsDistributeSimdDirective *S) {
1292 VisitOMPLoopDirective(S);
1295void StmtProfiler::VisitOMPTeamsDistributeParallelForSimdDirective(
1296 const OMPTeamsDistributeParallelForSimdDirective *S) {
1297 VisitOMPLoopDirective(S);
1300void StmtProfiler::VisitOMPTeamsDistributeParallelForDirective(
1301 const OMPTeamsDistributeParallelForDirective *S) {
1302 VisitOMPLoopDirective(S);
1305void StmtProfiler::VisitOMPTargetTeamsDirective(
1306 const OMPTargetTeamsDirective *S) {
1307 VisitOMPExecutableDirective(S);
1310void StmtProfiler::VisitOMPTargetTeamsDistributeDirective(
1311 const OMPTargetTeamsDistributeDirective *S) {
1312 VisitOMPLoopDirective(S);
1315void StmtProfiler::VisitOMPTargetTeamsDistributeParallelForDirective(
1316 const OMPTargetTeamsDistributeParallelForDirective *S) {
1317 VisitOMPLoopDirective(S);
1320void StmtProfiler::VisitOMPTargetTeamsDistributeParallelForSimdDirective(
1321 const OMPTargetTeamsDistributeParallelForSimdDirective *S) {
1322 VisitOMPLoopDirective(S);
1325void StmtProfiler::VisitOMPTargetTeamsDistributeSimdDirective(
1326 const OMPTargetTeamsDistributeSimdDirective *S) {
1327 VisitOMPLoopDirective(S);
1330void StmtProfiler::VisitOMPInteropDirective(
const OMPInteropDirective *S) {
1331 VisitOMPExecutableDirective(S);
1334void StmtProfiler::VisitOMPDispatchDirective(
const OMPDispatchDirective *S) {
1335 VisitOMPExecutableDirective(S);
1338void StmtProfiler::VisitOMPMaskedDirective(
const OMPMaskedDirective *S) {
1339 VisitOMPExecutableDirective(S);
1342void StmtProfiler::VisitOMPGenericLoopDirective(
1343 const OMPGenericLoopDirective *S) {
1344 VisitOMPLoopDirective(S);
1347void StmtProfiler::VisitOMPTeamsGenericLoopDirective(
1348 const OMPTeamsGenericLoopDirective *S) {
1349 VisitOMPLoopDirective(S);
1352void StmtProfiler::VisitOMPTargetTeamsGenericLoopDirective(
1353 const OMPTargetTeamsGenericLoopDirective *S) {
1354 VisitOMPLoopDirective(S);
1357void StmtProfiler::VisitOMPParallelGenericLoopDirective(
1358 const OMPParallelGenericLoopDirective *S) {
1359 VisitOMPLoopDirective(S);
1362void StmtProfiler::VisitOMPTargetParallelGenericLoopDirective(
1363 const OMPTargetParallelGenericLoopDirective *S) {
1364 VisitOMPLoopDirective(S);
1367void StmtProfiler::VisitExpr(
const Expr *S) {
1371void StmtProfiler::VisitConstantExpr(
const ConstantExpr *S) {
1376void StmtProfiler::VisitDeclRefExpr(
const DeclRefExpr *S) {
1388void StmtProfiler::VisitSYCLUniqueStableNameExpr(
1389 const SYCLUniqueStableNameExpr *S) {
1394void StmtProfiler::VisitPredefinedExpr(
const PredefinedExpr *S) {
1399void StmtProfiler::VisitOpenACCAsteriskSizeExpr(
1400 const OpenACCAsteriskSizeExpr *S) {
1404void StmtProfiler::VisitIntegerLiteral(
const IntegerLiteral *S) {
1410 T =
T.getCanonicalType();
1412 if (
auto BitIntT =
T->
getAs<BitIntType>())
1413 BitIntT->Profile(ID);
1415 ID.AddInteger(
T->
castAs<BuiltinType>()->getKind());
1418void StmtProfiler::VisitFixedPointLiteral(
const FixedPointLiteral *S) {
1421 ID.AddInteger(S->
getType()->
castAs<BuiltinType>()->getKind());
1424void StmtProfiler::VisitCharacterLiteral(
const CharacterLiteral *S) {
1426 ID.AddInteger(llvm::to_underlying(S->
getKind()));
1430void StmtProfiler::VisitFloatingLiteral(
const FloatingLiteral *S) {
1434 ID.AddInteger(S->
getType()->
castAs<BuiltinType>()->getKind());
1437void StmtProfiler::VisitImaginaryLiteral(
const ImaginaryLiteral *S) {
1441void StmtProfiler::VisitStringLiteral(
const StringLiteral *S) {
1444 ID.AddInteger(llvm::to_underlying(S->
getKind()));
1447void StmtProfiler::VisitParenExpr(
const ParenExpr *S) {
1451void StmtProfiler::VisitParenListExpr(
const ParenListExpr *S) {
1455void StmtProfiler::VisitUnaryOperator(
const UnaryOperator *S) {
1460void StmtProfiler::VisitOffsetOfExpr(
const OffsetOfExpr *S) {
1463 for (
unsigned i = 0; i < n; ++i) {
1489StmtProfiler::VisitUnaryExprOrTypeTraitExpr(
const UnaryExprOrTypeTraitExpr *S) {
1496void StmtProfiler::VisitArraySubscriptExpr(
const ArraySubscriptExpr *S) {
1500void StmtProfiler::VisitMatrixSubscriptExpr(
const MatrixSubscriptExpr *S) {
1504void StmtProfiler::VisitArraySectionExpr(
const ArraySectionExpr *S) {
1508void StmtProfiler::VisitOMPArrayShapingExpr(
const OMPArrayShapingExpr *S) {
1512void StmtProfiler::VisitOMPIteratorExpr(
const OMPIteratorExpr *S) {
1518void StmtProfiler::VisitCallExpr(
const CallExpr *S) {
1522void StmtProfiler::VisitMemberExpr(
const MemberExpr *S) {
1530void StmtProfiler::VisitCompoundLiteralExpr(
const CompoundLiteralExpr *S) {
1535void StmtProfiler::VisitCastExpr(
const CastExpr *S) {
1539void StmtProfiler::VisitImplicitCastExpr(
const ImplicitCastExpr *S) {
1544void StmtProfiler::VisitExplicitCastExpr(
const ExplicitCastExpr *S) {
1549void StmtProfiler::VisitCStyleCastExpr(
const CStyleCastExpr *S) {
1550 VisitExplicitCastExpr(S);
1553void StmtProfiler::VisitBinaryOperator(
const BinaryOperator *S) {
1559StmtProfiler::VisitCompoundAssignOperator(
const CompoundAssignOperator *S) {
1560 VisitBinaryOperator(S);
1563void StmtProfiler::VisitConditionalOperator(
const ConditionalOperator *S) {
1567void StmtProfiler::VisitBinaryConditionalOperator(
1568 const BinaryConditionalOperator *S) {
1572void StmtProfiler::VisitAddrLabelExpr(
const AddrLabelExpr *S) {
1577void StmtProfiler::VisitStmtExpr(
const StmtExpr *S) {
1581void StmtProfiler::VisitShuffleVectorExpr(
const ShuffleVectorExpr *S) {
1585void StmtProfiler::VisitConvertVectorExpr(
const ConvertVectorExpr *S) {
1589void StmtProfiler::VisitChooseExpr(
const ChooseExpr *S) {
1593void StmtProfiler::VisitGNUNullExpr(
const GNUNullExpr *S) {
1597void StmtProfiler::VisitVAArgExpr(
const VAArgExpr *S) {
1601void StmtProfiler::VisitInitListExpr(
const InitListExpr *S) {
1610void StmtProfiler::VisitDesignatedInitExpr(
const DesignatedInitExpr *S) {
1613 for (
const DesignatedInitExpr::Designator &D : S->
designators()) {
1614 if (D.isFieldDesignator()) {
1616 VisitName(D.getFieldName());
1620 if (D.isArrayDesignator()) {
1623 assert(D.isArrayRangeDesignator());
1626 ID.AddInteger(D.getArrayIndex());
1632void StmtProfiler::VisitDesignatedInitUpdateExpr(
1633 const DesignatedInitUpdateExpr *S) {
1634 llvm_unreachable(
"Unexpected DesignatedInitUpdateExpr in syntactic form of "
1638void StmtProfiler::VisitArrayInitLoopExpr(
const ArrayInitLoopExpr *S) {
1642void StmtProfiler::VisitArrayInitIndexExpr(
const ArrayInitIndexExpr *S) {
1646void StmtProfiler::VisitNoInitExpr(
const NoInitExpr *S) {
1647 llvm_unreachable(
"Unexpected NoInitExpr in syntactic form of initializer");
1650void StmtProfiler::VisitImplicitValueInitExpr(
const ImplicitValueInitExpr *S) {
1654void StmtProfiler::VisitExtVectorElementExpr(
const ExtVectorElementExpr *S) {
1659void StmtProfiler::VisitBlockExpr(
const BlockExpr *S) {
1664void StmtProfiler::VisitGenericSelectionExpr(
const GenericSelectionExpr *S) {
1668 QualType
T = Assoc.getType();
1670 ID.AddPointer(
nullptr);
1673 VisitExpr(Assoc.getAssociationExpr());
1677void StmtProfiler::VisitPseudoObjectExpr(
const PseudoObjectExpr *S) {
1682 if (
const OpaqueValueExpr *OVE = dyn_cast<OpaqueValueExpr>(*i))
1683 Visit(OVE->getSourceExpr());
1686void StmtProfiler::VisitAtomicExpr(
const AtomicExpr *S) {
1688 ID.AddInteger(S->
getOp());
1691void StmtProfiler::VisitConceptSpecializationExpr(
1692 const ConceptSpecializationExpr *S) {
1696 VisitTemplateArgument(Arg);
1699void StmtProfiler::VisitRequiresExpr(
const RequiresExpr *S) {
1703 VisitDecl(LocalParam);
1706 if (
auto *TypeReq = dyn_cast<concepts::TypeRequirement>(Req)) {
1708 ID.AddBoolean(TypeReq->isSubstitutionFailure());
1709 if (!TypeReq->isSubstitutionFailure())
1710 VisitType(TypeReq->getType()->getType());
1711 }
else if (
auto *ExprReq = dyn_cast<concepts::ExprRequirement>(Req)) {
1713 ID.AddBoolean(ExprReq->isExprSubstitutionFailure());
1714 if (!ExprReq->isExprSubstitutionFailure())
1715 Visit(ExprReq->getExpr());
1720 ID.AddBoolean(ExprReq->getNoexceptLoc().isValid());
1721 const concepts::ExprRequirement::ReturnTypeRequirement &RetReq =
1722 ExprReq->getReturnTypeRequirement();
1735 ID.AddBoolean(NestedReq->hasInvalidConstraint());
1736 if (!NestedReq->hasInvalidConstraint())
1737 Visit(NestedReq->getConstraintExpr());
1745 unsigned &NumArgs) {
1751 case OO_Array_Delete:
1753 case OO_Conditional:
1755 llvm_unreachable(
"Invalid operator call kind");
1760 return Stmt::UnaryOperatorClass;
1764 return Stmt::BinaryOperatorClass;
1769 return Stmt::UnaryOperatorClass;
1773 return Stmt::BinaryOperatorClass;
1778 return Stmt::UnaryOperatorClass;
1782 return Stmt::BinaryOperatorClass;
1786 return Stmt::BinaryOperatorClass;
1790 return Stmt::BinaryOperatorClass;
1794 return Stmt::BinaryOperatorClass;
1798 UnaryOp = UO_AddrOf;
1799 return Stmt::UnaryOperatorClass;
1803 return Stmt::BinaryOperatorClass;
1807 return Stmt::BinaryOperatorClass;
1811 return Stmt::UnaryOperatorClass;
1815 return Stmt::UnaryOperatorClass;
1818 BinaryOp = BO_Assign;
1819 return Stmt::BinaryOperatorClass;
1823 return Stmt::BinaryOperatorClass;
1827 return Stmt::BinaryOperatorClass;
1830 BinaryOp = BO_AddAssign;
1831 return Stmt::CompoundAssignOperatorClass;
1834 BinaryOp = BO_SubAssign;
1835 return Stmt::CompoundAssignOperatorClass;
1838 BinaryOp = BO_MulAssign;
1839 return Stmt::CompoundAssignOperatorClass;
1842 BinaryOp = BO_DivAssign;
1843 return Stmt::CompoundAssignOperatorClass;
1845 case OO_PercentEqual:
1846 BinaryOp = BO_RemAssign;
1847 return Stmt::CompoundAssignOperatorClass;
1850 BinaryOp = BO_XorAssign;
1851 return Stmt::CompoundAssignOperatorClass;
1854 BinaryOp = BO_AndAssign;
1855 return Stmt::CompoundAssignOperatorClass;
1858 BinaryOp = BO_OrAssign;
1859 return Stmt::CompoundAssignOperatorClass;
1863 return Stmt::BinaryOperatorClass;
1865 case OO_GreaterGreater:
1867 return Stmt::BinaryOperatorClass;
1869 case OO_LessLessEqual:
1870 BinaryOp = BO_ShlAssign;
1871 return Stmt::CompoundAssignOperatorClass;
1873 case OO_GreaterGreaterEqual:
1874 BinaryOp = BO_ShrAssign;
1875 return Stmt::CompoundAssignOperatorClass;
1879 return Stmt::BinaryOperatorClass;
1881 case OO_ExclaimEqual:
1883 return Stmt::BinaryOperatorClass;
1887 return Stmt::BinaryOperatorClass;
1889 case OO_GreaterEqual:
1891 return Stmt::BinaryOperatorClass;
1895 return Stmt::BinaryOperatorClass;
1899 return Stmt::BinaryOperatorClass;
1903 return Stmt::BinaryOperatorClass;
1906 UnaryOp = NumArgs == 1 ? UO_PreInc : UO_PostInc;
1908 return Stmt::UnaryOperatorClass;
1911 UnaryOp = NumArgs == 1 ? UO_PreDec : UO_PostDec;
1913 return Stmt::UnaryOperatorClass;
1916 BinaryOp = BO_Comma;
1917 return Stmt::BinaryOperatorClass;
1920 BinaryOp = BO_PtrMemI;
1921 return Stmt::BinaryOperatorClass;
1924 return Stmt::ArraySubscriptExprClass;
1927 return Stmt::CallExprClass;
1930 UnaryOp = UO_Coawait;
1931 return Stmt::UnaryOperatorClass;
1934 llvm_unreachable(
"Invalid overloaded operator expression");
1937#if defined(_MSC_VER) && !defined(__clang__)
1942#pragma optimize("", off)
1946void StmtProfiler::VisitCXXOperatorCallExpr(
const CXXOperatorCallExpr *S) {
1954 return Visit(S->
getArg(0));
1962 for (
unsigned I = 0; I != NumArgs; ++I)
1964 if (SC == Stmt::UnaryOperatorClass)
1965 ID.AddInteger(UnaryOp);
1966 else if (SC == Stmt::BinaryOperatorClass ||
1967 SC == Stmt::CompoundAssignOperatorClass)
1968 ID.AddInteger(BinaryOp);
1970 assert(SC == Stmt::ArraySubscriptExprClass || SC == Stmt::CallExprClass);
1979void StmtProfiler::VisitCXXRewrittenBinaryOperator(
1980 const CXXRewrittenBinaryOperator *S) {
1984 "resolved rewritten operator should never be type-dependent");
1989#if defined(_MSC_VER) && !defined(__clang__)
1991#pragma optimize("", on)
1995void StmtProfiler::VisitCXXMemberCallExpr(
const CXXMemberCallExpr *S) {
1999void StmtProfiler::VisitCUDAKernelCallExpr(
const CUDAKernelCallExpr *S) {
2003void StmtProfiler::VisitAsTypeExpr(
const AsTypeExpr *S) {
2007void StmtProfiler::VisitCXXNamedCastExpr(
const CXXNamedCastExpr *S) {
2008 VisitExplicitCastExpr(S);
2011void StmtProfiler::VisitCXXStaticCastExpr(
const CXXStaticCastExpr *S) {
2012 VisitCXXNamedCastExpr(S);
2015void StmtProfiler::VisitCXXDynamicCastExpr(
const CXXDynamicCastExpr *S) {
2016 VisitCXXNamedCastExpr(S);
2020StmtProfiler::VisitCXXReinterpretCastExpr(
const CXXReinterpretCastExpr *S) {
2021 VisitCXXNamedCastExpr(S);
2024void StmtProfiler::VisitCXXConstCastExpr(
const CXXConstCastExpr *S) {
2025 VisitCXXNamedCastExpr(S);
2028void StmtProfiler::VisitBuiltinBitCastExpr(
const BuiltinBitCastExpr *S) {
2033void StmtProfiler::VisitCXXAddrspaceCastExpr(
const CXXAddrspaceCastExpr *S) {
2034 VisitCXXNamedCastExpr(S);
2037void StmtProfiler::VisitUserDefinedLiteral(
const UserDefinedLiteral *S) {
2041void StmtProfiler::VisitCXXBoolLiteralExpr(
const CXXBoolLiteralExpr *S) {
2046void StmtProfiler::VisitCXXNullPtrLiteralExpr(
const CXXNullPtrLiteralExpr *S) {
2050void StmtProfiler::VisitCXXStdInitializerListExpr(
2051 const CXXStdInitializerListExpr *S) {
2055void StmtProfiler::VisitCXXTypeidExpr(
const CXXTypeidExpr *S) {
2061void StmtProfiler::VisitCXXUuidofExpr(
const CXXUuidofExpr *S) {
2067void StmtProfiler::VisitMSPropertyRefExpr(
const MSPropertyRefExpr *S) {
2072void StmtProfiler::VisitMSPropertySubscriptExpr(
2073 const MSPropertySubscriptExpr *S) {
2077void StmtProfiler::VisitCXXThisExpr(
const CXXThisExpr *S) {
2083void StmtProfiler::VisitCXXThrowExpr(
const CXXThrowExpr *S) {
2087void StmtProfiler::VisitCXXDefaultArgExpr(
const CXXDefaultArgExpr *S) {
2092void StmtProfiler::VisitCXXDefaultInitExpr(
const CXXDefaultInitExpr *S) {
2097void StmtProfiler::VisitCXXBindTemporaryExpr(
const CXXBindTemporaryExpr *S) {
2103void StmtProfiler::VisitCXXConstructExpr(
const CXXConstructExpr *S) {
2109void StmtProfiler::VisitCXXInheritedCtorInitExpr(
2110 const CXXInheritedCtorInitExpr *S) {
2115void StmtProfiler::VisitCXXFunctionalCastExpr(
const CXXFunctionalCastExpr *S) {
2116 VisitExplicitCastExpr(S);
2120StmtProfiler::VisitCXXTemporaryObjectExpr(
const CXXTemporaryObjectExpr *S) {
2121 VisitCXXConstructExpr(S);
2125StmtProfiler::VisitLambdaExpr(
const LambdaExpr *S) {
2126 if (!ProfileLambdaExpr) {
2130 VisitStmtNoChildren(S);
2141 ID.AddInteger(
Capture.getCaptureKind());
2142 if (
Capture.capturesVariable())
2143 VisitDecl(
Capture.getCapturedVar());
2152 for (
auto *SubDecl : Lambda->
decls()) {
2153 FunctionDecl *
Call =
nullptr;
2154 if (
auto *FTD = dyn_cast<FunctionTemplateDecl>(SubDecl))
2155 Call = FTD->getTemplatedDecl();
2156 else if (
auto *FD = dyn_cast<FunctionDecl>(SubDecl))
2168StmtProfiler::VisitCXXScalarValueInitExpr(
const CXXScalarValueInitExpr *S) {
2172void StmtProfiler::VisitCXXDeleteExpr(
const CXXDeleteExpr *S) {
2179void StmtProfiler::VisitCXXNewExpr(
const CXXNewExpr *S) {
2192StmtProfiler::VisitCXXPseudoDestructorExpr(
const CXXPseudoDestructorExpr *S) {
2206void StmtProfiler::VisitOverloadExpr(
const OverloadExpr *S) {
2208 bool DescribingDependentVarTemplate =
2210 if (DescribingDependentVarTemplate) {
2214 VisitName(S->
getName(),
true);
2222StmtProfiler::VisitUnresolvedLookupExpr(
const UnresolvedLookupExpr *S) {
2223 VisitOverloadExpr(S);
2226void StmtProfiler::VisitTypeTraitExpr(
const TypeTraitExpr *S) {
2230 for (
unsigned I = 0, N = S->
getNumArgs(); I != N; ++I)
2234void StmtProfiler::VisitArrayTypeTraitExpr(
const ArrayTypeTraitExpr *S) {
2240void StmtProfiler::VisitExpressionTraitExpr(
const ExpressionTraitExpr *S) {
2246void StmtProfiler::VisitDependentScopeDeclRefExpr(
2247 const DependentScopeDeclRefExpr *S) {
2256void StmtProfiler::VisitExprWithCleanups(
const ExprWithCleanups *S) {
2260void StmtProfiler::VisitCXXUnresolvedConstructExpr(
2261 const CXXUnresolvedConstructExpr *S) {
2267void StmtProfiler::VisitCXXDependentScopeMemberExpr(
2268 const CXXDependentScopeMemberExpr *S) {
2281void StmtProfiler::VisitUnresolvedMemberExpr(
const UnresolvedMemberExpr *S) {
2294void StmtProfiler::VisitCXXNoexceptExpr(
const CXXNoexceptExpr *S) {
2298void StmtProfiler::VisitPackExpansionExpr(
const PackExpansionExpr *S) {
2302void StmtProfiler::VisitSizeOfPackExpr(
const SizeOfPackExpr *S) {
2306 ID.AddInteger(Args.size());
2307 for (
const auto &TA : Args)
2308 VisitTemplateArgument(TA);
2315void StmtProfiler::VisitPackIndexingExpr(
const PackIndexingExpr *E) {
2327void StmtProfiler::VisitSubstNonTypeTemplateParmPackExpr(
2328 const SubstNonTypeTemplateParmPackExpr *S) {
2334void StmtProfiler::VisitSubstNonTypeTemplateParmExpr(
2335 const SubstNonTypeTemplateParmExpr *E) {
2340void StmtProfiler::VisitFunctionParmPackExpr(
const FunctionParmPackExpr *S) {
2348void StmtProfiler::VisitMaterializeTemporaryExpr(
2349 const MaterializeTemporaryExpr *S) {
2353void StmtProfiler::VisitCXXFoldExpr(
const CXXFoldExpr *S) {
2358void StmtProfiler::VisitCXXParenListInitExpr(
const CXXParenListInitExpr *S) {
2362void StmtProfiler::VisitCoroutineBodyStmt(
const CoroutineBodyStmt *S) {
2366void StmtProfiler::VisitCoreturnStmt(
const CoreturnStmt *S) {
2370void StmtProfiler::VisitCoawaitExpr(
const CoawaitExpr *S) {
2374void StmtProfiler::VisitDependentCoawaitExpr(
const DependentCoawaitExpr *S) {
2378void StmtProfiler::VisitCoyieldExpr(
const CoyieldExpr *S) {
2382void StmtProfiler::VisitOpaqueValueExpr(
const OpaqueValueExpr *E) {
2386void StmtProfiler::VisitSourceLocExpr(
const SourceLocExpr *E) {
2390void StmtProfiler::VisitEmbedExpr(
const EmbedExpr *E) { VisitExpr(E); }
2392void StmtProfiler::VisitRecoveryExpr(
const RecoveryExpr *E) { VisitExpr(E); }
2394void StmtProfiler::VisitObjCStringLiteral(
const ObjCStringLiteral *S) {
2398void StmtProfiler::VisitObjCBoxedExpr(
const ObjCBoxedExpr *E) {
2402void StmtProfiler::VisitObjCArrayLiteral(
const ObjCArrayLiteral *E) {
2406void StmtProfiler::VisitObjCDictionaryLiteral(
const ObjCDictionaryLiteral *E) {
2410void StmtProfiler::VisitObjCEncodeExpr(
const ObjCEncodeExpr *S) {
2415void StmtProfiler::VisitObjCSelectorExpr(
const ObjCSelectorExpr *S) {
2420void StmtProfiler::VisitObjCProtocolExpr(
const ObjCProtocolExpr *S) {
2425void StmtProfiler::VisitObjCIvarRefExpr(
const ObjCIvarRefExpr *S) {
2432void StmtProfiler::VisitObjCPropertyRefExpr(
const ObjCPropertyRefExpr *S) {
2446void StmtProfiler::VisitObjCSubscriptRefExpr(
const ObjCSubscriptRefExpr *S) {
2452void StmtProfiler::VisitObjCMessageExpr(
const ObjCMessageExpr *S) {
2458void StmtProfiler::VisitObjCIsaExpr(
const ObjCIsaExpr *S) {
2463void StmtProfiler::VisitObjCBoolLiteralExpr(
const ObjCBoolLiteralExpr *S) {
2468void StmtProfiler::VisitObjCIndirectCopyRestoreExpr(
2469 const ObjCIndirectCopyRestoreExpr *S) {
2474void StmtProfiler::VisitObjCBridgedCastExpr(
const ObjCBridgedCastExpr *S) {
2475 VisitExplicitCastExpr(S);
2479void StmtProfiler::VisitObjCAvailabilityCheckExpr(
2480 const ObjCAvailabilityCheckExpr *S) {
2484void StmtProfiler::VisitTemplateArguments(
const TemplateArgumentLoc *Args,
2486 ID.AddInteger(NumArgs);
2487 for (
unsigned I = 0; I != NumArgs; ++I)
2491void StmtProfiler::VisitTemplateArgument(
const TemplateArgument &Arg) {
2534 VisitTemplateArgument(P);
2540class OpenACCClauseProfiler
2541 :
public OpenACCClauseVisitor<OpenACCClauseProfiler> {
2542 StmtProfiler &Profiler;
2545 OpenACCClauseProfiler(StmtProfiler &P) : Profiler(P) {}
2547 void VisitOpenACCClauseList(ArrayRef<const OpenACCClause *> Clauses) {
2548 for (
const OpenACCClause *Clause : Clauses) {
2555 void VisitClauseWithVarList(
const OpenACCClauseWithVarList &Clause) {
2557 Profiler.VisitStmt(E);
2560#define VISIT_CLAUSE(CLAUSE_NAME) \
2561 void Visit##CLAUSE_NAME##Clause(const OpenACC##CLAUSE_NAME##Clause &Clause);
2563#include "clang/Basic/OpenACCClauses.def"
2567void OpenACCClauseProfiler::VisitDefaultClause(
2568 const OpenACCDefaultClause &Clause) {}
2570void OpenACCClauseProfiler::VisitIfClause(
const OpenACCIfClause &Clause) {
2572 "if clause requires a valid condition expr");
2576void OpenACCClauseProfiler::VisitCopyClause(
const OpenACCCopyClause &Clause) {
2577 VisitClauseWithVarList(Clause);
2580void OpenACCClauseProfiler::VisitLinkClause(
const OpenACCLinkClause &Clause) {
2581 VisitClauseWithVarList(Clause);
2584void OpenACCClauseProfiler::VisitDeviceResidentClause(
2585 const OpenACCDeviceResidentClause &Clause) {
2586 VisitClauseWithVarList(Clause);
2589void OpenACCClauseProfiler::VisitCopyInClause(
2590 const OpenACCCopyInClause &Clause) {
2591 VisitClauseWithVarList(Clause);
2594void OpenACCClauseProfiler::VisitCopyOutClause(
2595 const OpenACCCopyOutClause &Clause) {
2596 VisitClauseWithVarList(Clause);
2599void OpenACCClauseProfiler::VisitCreateClause(
2600 const OpenACCCreateClause &Clause) {
2601 VisitClauseWithVarList(Clause);
2604void OpenACCClauseProfiler::VisitHostClause(
const OpenACCHostClause &Clause) {
2605 VisitClauseWithVarList(Clause);
2608void OpenACCClauseProfiler::VisitDeviceClause(
2609 const OpenACCDeviceClause &Clause) {
2610 VisitClauseWithVarList(Clause);
2613void OpenACCClauseProfiler::VisitSelfClause(
const OpenACCSelfClause &Clause) {
2619 Profiler.VisitStmt(E);
2623void OpenACCClauseProfiler::VisitFinalizeClause(
2624 const OpenACCFinalizeClause &Clause) {}
2626void OpenACCClauseProfiler::VisitIfPresentClause(
2627 const OpenACCIfPresentClause &Clause) {}
2629void OpenACCClauseProfiler::VisitNumGangsClause(
2630 const OpenACCNumGangsClause &Clause) {
2632 Profiler.VisitStmt(E);
2635void OpenACCClauseProfiler::VisitTileClause(
const OpenACCTileClause &Clause) {
2637 Profiler.VisitStmt(E);
2640void OpenACCClauseProfiler::VisitNumWorkersClause(
2641 const OpenACCNumWorkersClause &Clause) {
2642 assert(Clause.
hasIntExpr() &&
"num_workers clause requires a valid int expr");
2646void OpenACCClauseProfiler::VisitCollapseClause(
2647 const OpenACCCollapseClause &Clause) {
2648 assert(Clause.
getLoopCount() &&
"collapse clause requires a valid int expr");
2652void OpenACCClauseProfiler::VisitPrivateClause(
2653 const OpenACCPrivateClause &Clause) {
2654 VisitClauseWithVarList(Clause);
2657 Profiler.VisitDecl(Recipe.AllocaDecl);
2658 if (Recipe.InitExpr)
2659 Profiler.VisitExpr(Recipe.InitExpr);
2663void OpenACCClauseProfiler::VisitFirstPrivateClause(
2664 const OpenACCFirstPrivateClause &Clause) {
2665 VisitClauseWithVarList(Clause);
2668 Profiler.VisitDecl(Recipe.AllocaDecl);
2669 if (Recipe.InitExpr)
2670 Profiler.VisitExpr(Recipe.InitExpr);
2671 Profiler.VisitDecl(Recipe.InitFromTemporary);
2675void OpenACCClauseProfiler::VisitAttachClause(
2676 const OpenACCAttachClause &Clause) {
2677 VisitClauseWithVarList(Clause);
2680void OpenACCClauseProfiler::VisitDetachClause(
2681 const OpenACCDetachClause &Clause) {
2682 VisitClauseWithVarList(Clause);
2685void OpenACCClauseProfiler::VisitDeleteClause(
2686 const OpenACCDeleteClause &Clause) {
2687 VisitClauseWithVarList(Clause);
2690void OpenACCClauseProfiler::VisitDevicePtrClause(
2691 const OpenACCDevicePtrClause &Clause) {
2692 VisitClauseWithVarList(Clause);
2695void OpenACCClauseProfiler::VisitNoCreateClause(
2696 const OpenACCNoCreateClause &Clause) {
2697 VisitClauseWithVarList(Clause);
2700void OpenACCClauseProfiler::VisitPresentClause(
2701 const OpenACCPresentClause &Clause) {
2702 VisitClauseWithVarList(Clause);
2705void OpenACCClauseProfiler::VisitUseDeviceClause(
2706 const OpenACCUseDeviceClause &Clause) {
2707 VisitClauseWithVarList(Clause);
2710void OpenACCClauseProfiler::VisitVectorLengthClause(
2711 const OpenACCVectorLengthClause &Clause) {
2713 "vector_length clause requires a valid int expr");
2717void OpenACCClauseProfiler::VisitAsyncClause(
const OpenACCAsyncClause &Clause) {
2722void OpenACCClauseProfiler::VisitDeviceNumClause(
2723 const OpenACCDeviceNumClause &Clause) {
2727void OpenACCClauseProfiler::VisitDefaultAsyncClause(
2728 const OpenACCDefaultAsyncClause &Clause) {
2732void OpenACCClauseProfiler::VisitWorkerClause(
2733 const OpenACCWorkerClause &Clause) {
2738void OpenACCClauseProfiler::VisitVectorClause(
2739 const OpenACCVectorClause &Clause) {
2744void OpenACCClauseProfiler::VisitWaitClause(
const OpenACCWaitClause &Clause) {
2748 Profiler.VisitStmt(E);
2752void OpenACCClauseProfiler::VisitDeviceTypeClause(
2753 const OpenACCDeviceTypeClause &Clause) {}
2755void OpenACCClauseProfiler::VisitAutoClause(
const OpenACCAutoClause &Clause) {}
2757void OpenACCClauseProfiler::VisitIndependentClause(
2758 const OpenACCIndependentClause &Clause) {}
2760void OpenACCClauseProfiler::VisitSeqClause(
const OpenACCSeqClause &Clause) {}
2761void OpenACCClauseProfiler::VisitNoHostClause(
2762 const OpenACCNoHostClause &Clause) {}
2764void OpenACCClauseProfiler::VisitGangClause(
const OpenACCGangClause &Clause) {
2765 for (
unsigned I = 0; I < Clause.
getNumExprs(); ++I) {
2766 Profiler.VisitStmt(Clause.
getExpr(I).second);
2770void OpenACCClauseProfiler::VisitReductionClause(
2771 const OpenACCReductionClause &Clause) {
2772 VisitClauseWithVarList(Clause);
2775 Profiler.VisitDecl(Recipe.AllocaDecl);
2776 if (Recipe.InitExpr)
2777 Profiler.VisitExpr(Recipe.InitExpr);
2781 static_assert(
sizeof(OpenACCReductionRecipe) == 2 *
sizeof(
int *));
2785void OpenACCClauseProfiler::VisitBindClause(
const OpenACCBindClause &Clause) {
2786 assert(
false &&
"not implemented... what can we do about our expr?");
2790void StmtProfiler::VisitOpenACCComputeConstruct(
2795 OpenACCClauseProfiler P{*
this};
2796 P.VisitOpenACCClauseList(S->clauses());
2799void StmtProfiler::VisitOpenACCLoopConstruct(
const OpenACCLoopConstruct *S) {
2803 OpenACCClauseProfiler P{*
this};
2804 P.VisitOpenACCClauseList(S->clauses());
2807void StmtProfiler::VisitOpenACCCombinedConstruct(
2808 const OpenACCCombinedConstruct *S) {
2812 OpenACCClauseProfiler P{*
this};
2813 P.VisitOpenACCClauseList(S->clauses());
2816void StmtProfiler::VisitOpenACCDataConstruct(
const OpenACCDataConstruct *S) {
2819 OpenACCClauseProfiler P{*
this};
2820 P.VisitOpenACCClauseList(S->clauses());
2823void StmtProfiler::VisitOpenACCEnterDataConstruct(
2824 const OpenACCEnterDataConstruct *S) {
2827 OpenACCClauseProfiler P{*
this};
2828 P.VisitOpenACCClauseList(S->clauses());
2831void StmtProfiler::VisitOpenACCExitDataConstruct(
2832 const OpenACCExitDataConstruct *S) {
2835 OpenACCClauseProfiler P{*
this};
2836 P.VisitOpenACCClauseList(S->clauses());
2839void StmtProfiler::VisitOpenACCHostDataConstruct(
2840 const OpenACCHostDataConstruct *S) {
2843 OpenACCClauseProfiler P{*
this};
2844 P.VisitOpenACCClauseList(S->clauses());
2847void StmtProfiler::VisitOpenACCWaitConstruct(
const OpenACCWaitConstruct *S) {
2851 OpenACCClauseProfiler P{*
this};
2852 P.VisitOpenACCClauseList(S->clauses());
2855void StmtProfiler::VisitOpenACCCacheConstruct(
const OpenACCCacheConstruct *S) {
2860void StmtProfiler::VisitOpenACCInitConstruct(
const OpenACCInitConstruct *S) {
2862 OpenACCClauseProfiler P{*
this};
2863 P.VisitOpenACCClauseList(S->clauses());
2866void StmtProfiler::VisitOpenACCShutdownConstruct(
2867 const OpenACCShutdownConstruct *S) {
2869 OpenACCClauseProfiler P{*
this};
2870 P.VisitOpenACCClauseList(S->clauses());
2873void StmtProfiler::VisitOpenACCSetConstruct(
const OpenACCSetConstruct *S) {
2875 OpenACCClauseProfiler P{*
this};
2876 P.VisitOpenACCClauseList(S->clauses());
2879void StmtProfiler::VisitOpenACCUpdateConstruct(
2880 const OpenACCUpdateConstruct *S) {
2882 OpenACCClauseProfiler P{*
this};
2883 P.VisitOpenACCClauseList(S->clauses());
2886void StmtProfiler::VisitOpenACCAtomicConstruct(
2887 const OpenACCAtomicConstruct *S) {
2889 OpenACCClauseProfiler P{*
this};
2890 P.VisitOpenACCClauseList(S->clauses());
2893void StmtProfiler::VisitHLSLOutArgExpr(
const HLSLOutArgExpr *S) {
2898 bool Canonical,
bool ProfileLambdaExpr)
const {
2899 StmtProfilerWithPointers Profiler(ID, Context, Canonical, ProfileLambdaExpr);
2900 Profiler.Visit(
this);
2905 StmtProfilerWithoutPointers Profiler(ID, Hash);
2906 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.