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) {
44 HandleStmtClass(S->getStmtClass());
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 {
87 StmtProfilerWithPointers(llvm::FoldingSetNodeID &ID,
89 bool ProfileLambdaExpr)
90 : StmtProfiler(
ID, Canonical, ProfileLambdaExpr), Context(Context) {}
97 void VisitDecl(
const Decl *
D)
override {
100 if (Canonical &&
D) {
102 dyn_cast<NonTypeTemplateParmDecl>(
D)) {
103 ID.AddInteger(NTTP->getDepth());
104 ID.AddInteger(NTTP->getIndex());
105 ID.AddBoolean(NTTP->isParameterPack());
118 if (
const ParmVarDecl *Parm = dyn_cast<ParmVarDecl>(
D)) {
129 VisitType(Parm->getType());
130 ID.AddInteger(Parm->getFunctionScopeDepth());
131 ID.AddInteger(Parm->getFunctionScopeIndex());
136 dyn_cast<TemplateTypeParmDecl>(
D)) {
137 ID.AddInteger(TTP->getDepth());
138 ID.AddInteger(TTP->getIndex());
139 ID.AddBoolean(TTP->isParameterPack());
144 dyn_cast<TemplateTemplateParmDecl>(
D)) {
145 ID.AddInteger(TTP->getDepth());
146 ID.AddInteger(TTP->getIndex());
147 ID.AddBoolean(TTP->isParameterPack());
156 if (Canonical && !
T.isNull())
159 ID.AddPointer(
T.getAsOpaquePtr());
163 ID.AddPointer(Name.getAsOpaquePtr());
184 class StmtProfilerWithoutPointers :
public StmtProfiler {
187 StmtProfilerWithoutPointers(llvm::FoldingSetNodeID &ID,
ODRHash &Hash)
193 if (SC == Stmt::UnresolvedLookupExprClass) {
196 ID.AddInteger(Stmt::DeclRefExprClass);
220 void VisitDecl(
const Decl *
D)
override {
238void StmtProfiler::VisitStmt(
const Stmt *S) {
239 assert(S &&
"Requires non-null Stmt pointer");
241 VisitStmtNoChildren(S);
243 for (
const Stmt *SubStmt : S->children()) {
251void StmtProfiler::VisitDeclStmt(
const DeclStmt *S) {
253 for (
const auto *
D : S->decls())
257void StmtProfiler::VisitNullStmt(
const NullStmt *S) {
261void StmtProfiler::VisitCompoundStmt(
const CompoundStmt *S) {
265void StmtProfiler::VisitCaseStmt(
const CaseStmt *S) {
269void StmtProfiler::VisitDefaultStmt(
const DefaultStmt *S) {
273void StmtProfiler::VisitLabelStmt(
const LabelStmt *S) {
275 VisitDecl(S->getDecl());
283void StmtProfiler::VisitIfStmt(
const IfStmt *S) {
285 VisitDecl(S->getConditionVariable());
288void StmtProfiler::VisitSwitchStmt(
const SwitchStmt *S) {
290 VisitDecl(S->getConditionVariable());
293void StmtProfiler::VisitWhileStmt(
const WhileStmt *S) {
295 VisitDecl(S->getConditionVariable());
298void StmtProfiler::VisitDoStmt(
const DoStmt *S) {
302void StmtProfiler::VisitForStmt(
const ForStmt *S) {
306void StmtProfiler::VisitGotoStmt(
const GotoStmt *S) {
308 VisitDecl(S->getLabel());
315void StmtProfiler::VisitContinueStmt(
const ContinueStmt *S) {
319void StmtProfiler::VisitBreakStmt(
const BreakStmt *S) {
323void StmtProfiler::VisitReturnStmt(
const ReturnStmt *S) {
327void StmtProfiler::VisitGCCAsmStmt(
const GCCAsmStmt *S) {
329 ID.AddBoolean(S->isVolatile());
330 ID.AddBoolean(S->isSimple());
331 VisitStringLiteral(S->getAsmString());
332 ID.AddInteger(S->getNumOutputs());
333 for (
unsigned I = 0, N = S->getNumOutputs(); I != N; ++I) {
334 ID.AddString(S->getOutputName(I));
335 VisitStringLiteral(S->getOutputConstraintLiteral(I));
337 ID.AddInteger(S->getNumInputs());
338 for (
unsigned I = 0, N = S->getNumInputs(); I != N; ++I) {
339 ID.AddString(S->getInputName(I));
340 VisitStringLiteral(S->getInputConstraintLiteral(I));
342 ID.AddInteger(S->getNumClobbers());
343 for (
unsigned I = 0, N = S->getNumClobbers(); I != N; ++I)
344 VisitStringLiteral(S->getClobberStringLiteral(I));
345 ID.AddInteger(S->getNumLabels());
346 for (
auto *L : S->labels())
347 VisitDecl(L->getLabel());
350void StmtProfiler::VisitMSAsmStmt(
const MSAsmStmt *S) {
355void StmtProfiler::VisitCXXCatchStmt(
const CXXCatchStmt *S) {
357 VisitType(S->getCaughtType());
360void StmtProfiler::VisitCXXTryStmt(
const CXXTryStmt *S) {
370 ID.AddBoolean(S->isIfExists());
371 VisitNestedNameSpecifier(S->getQualifierLoc().getNestedNameSpecifier());
372 VisitName(S->getNameInfo().getName());
375void StmtProfiler::VisitSEHTryStmt(
const SEHTryStmt *S) {
383void StmtProfiler::VisitSEHExceptStmt(
const SEHExceptStmt *S) {
387void StmtProfiler::VisitSEHLeaveStmt(
const SEHLeaveStmt *S) {
391void StmtProfiler::VisitCapturedStmt(
const CapturedStmt *S) {
401 ID.AddBoolean(S->hasEllipsis());
402 if (S->getCatchParamDecl())
403 VisitType(S->getCatchParamDecl()->getType());
410void StmtProfiler::VisitObjCAtTryStmt(
const ObjCAtTryStmt *S) {
430 StmtProfiler *Profiler;
432 template <
typename T>
433 void VisitOMPClauseList(
T *
Node);
436 OMPClauseProfiler(StmtProfiler *
P) : Profiler(
P) { }
437#define GEN_CLANG_CLAUSE_CLASS
438#define CLAUSE_CLASS(Enum, Str, Class) void Visit##Class(const Class *C);
439#include "llvm/Frontend/OpenMP/OMP.inc"
444void OMPClauseProfiler::VistOMPClauseWithPreInit(
446 if (
auto *S =
C->getPreInitStmt())
447 Profiler->VisitStmt(S);
450void OMPClauseProfiler::VistOMPClauseWithPostUpdate(
452 VistOMPClauseWithPreInit(
C);
453 if (
auto *
E =
C->getPostUpdateExpr())
454 Profiler->VisitStmt(
E);
457void OMPClauseProfiler::VisitOMPIfClause(
const OMPIfClause *
C) {
458 VistOMPClauseWithPreInit(
C);
459 if (
C->getCondition())
460 Profiler->VisitStmt(
C->getCondition());
464 VistOMPClauseWithPreInit(
C);
465 if (
C->getCondition())
466 Profiler->VisitStmt(
C->getCondition());
470 VistOMPClauseWithPreInit(
C);
471 if (
C->getNumThreads())
472 Profiler->VisitStmt(
C->getNumThreads());
476 if (
C->getAlignment())
477 Profiler->VisitStmt(
C->getAlignment());
482 Profiler->VisitStmt(
C->getSafelen());
487 Profiler->VisitStmt(
C->getSimdlen());
491 for (
auto *
E :
C->getSizesRefs())
493 Profiler->VisitExpr(
E);
496void OMPClauseProfiler::VisitOMPPermutationClause(
498 for (
Expr *
E :
C->getArgsRefs())
500 Profiler->VisitExpr(
E);
503void OMPClauseProfiler::VisitOMPFullClause(
const OMPFullClause *
C) {}
506 if (
const Expr *Factor =
C->getFactor())
507 Profiler->VisitExpr(Factor);
511 if (
C->getAllocator())
512 Profiler->VisitStmt(
C->getAllocator());
516 if (
C->getNumForLoops())
517 Profiler->VisitStmt(
C->getNumForLoops());
521 if (
Expr *Evt =
C->getEventHandler())
522 Profiler->VisitStmt(Evt);
526 VistOMPClauseWithPreInit(
C);
527 if (
C->getCondition())
528 Profiler->VisitStmt(
C->getCondition());
532 VistOMPClauseWithPreInit(
C);
533 if (
C->getCondition())
534 Profiler->VisitStmt(
C->getCondition());
541void OMPClauseProfiler::VisitOMPUnifiedAddressClause(
544void OMPClauseProfiler::VisitOMPUnifiedSharedMemoryClause(
547void OMPClauseProfiler::VisitOMPReverseOffloadClause(
550void OMPClauseProfiler::VisitOMPDynamicAllocatorsClause(
553void OMPClauseProfiler::VisitOMPAtomicDefaultMemOrderClause(
556void OMPClauseProfiler::VisitOMPAtClause(
const OMPAtClause *
C) {}
561 if (
C->getMessageString())
562 Profiler->VisitStmt(
C->getMessageString());
566 VistOMPClauseWithPreInit(
C);
567 if (
auto *S =
C->getChunkSize())
568 Profiler->VisitStmt(S);
572 if (
auto *
Num =
C->getNumForLoops())
573 Profiler->VisitStmt(
Num);
576void OMPClauseProfiler::VisitOMPNowaitClause(
const OMPNowaitClause *) {}
578void OMPClauseProfiler::VisitOMPUntiedClause(
const OMPUntiedClause *) {}
582void OMPClauseProfiler::VisitOMPReadClause(
const OMPReadClause *) {}
584void OMPClauseProfiler::VisitOMPWriteClause(
const OMPWriteClause *) {}
586void OMPClauseProfiler::VisitOMPUpdateClause(
const OMPUpdateClause *) {}
592void OMPClauseProfiler::VisitOMPFailClause(
const OMPFailClause *) {}
594void OMPClauseProfiler::VisitOMPAbsentClause(
const OMPAbsentClause *) {}
596void OMPClauseProfiler::VisitOMPHoldsClause(
const OMPHoldsClause *) {}
602void OMPClauseProfiler::VisitOMPNoOpenMPRoutinesClause(
605void OMPClauseProfiler::VisitOMPNoParallelismClause(
608void OMPClauseProfiler::VisitOMPSeqCstClause(
const OMPSeqCstClause *) {}
610void OMPClauseProfiler::VisitOMPAcqRelClause(
const OMPAcqRelClause *) {}
618void OMPClauseProfiler::VisitOMPWeakClause(
const OMPWeakClause *) {}
622void OMPClauseProfiler::VisitOMPSIMDClause(
const OMPSIMDClause *) {}
626void OMPClauseProfiler::VisitOMPInitClause(
const OMPInitClause *
C) {
627 VisitOMPClauseList(
C);
630void OMPClauseProfiler::VisitOMPUseClause(
const OMPUseClause *
C) {
631 if (
C->getInteropVar())
632 Profiler->VisitStmt(
C->getInteropVar());
636 if (
C->getInteropVar())
637 Profiler->VisitStmt(
C->getInteropVar());
641 VistOMPClauseWithPreInit(
C);
642 if (
C->getThreadID())
643 Profiler->VisitStmt(
C->getThreadID());
647void OMPClauseProfiler::VisitOMPClauseList(
T *
Node) {
648 for (
auto *
E :
Node->varlist()) {
650 Profiler->VisitStmt(
E);
655 VisitOMPClauseList(
C);
656 for (
auto *
E :
C->private_copies()) {
658 Profiler->VisitStmt(
E);
663 VisitOMPClauseList(
C);
664 VistOMPClauseWithPreInit(
C);
665 for (
auto *
E :
C->private_copies()) {
667 Profiler->VisitStmt(
E);
669 for (
auto *
E :
C->inits()) {
671 Profiler->VisitStmt(
E);
676 VisitOMPClauseList(
C);
677 VistOMPClauseWithPostUpdate(
C);
678 for (
auto *
E :
C->source_exprs()) {
680 Profiler->VisitStmt(
E);
682 for (
auto *
E :
C->destination_exprs()) {
684 Profiler->VisitStmt(
E);
686 for (
auto *
E :
C->assignment_ops()) {
688 Profiler->VisitStmt(
E);
692 VisitOMPClauseList(
C);
694void OMPClauseProfiler::VisitOMPReductionClause(
696 Profiler->VisitNestedNameSpecifier(
697 C->getQualifierLoc().getNestedNameSpecifier());
698 Profiler->VisitName(
C->getNameInfo().getName());
699 VisitOMPClauseList(
C);
700 VistOMPClauseWithPostUpdate(
C);
701 for (
auto *
E :
C->privates()) {
703 Profiler->VisitStmt(
E);
705 for (
auto *
E :
C->lhs_exprs()) {
707 Profiler->VisitStmt(
E);
709 for (
auto *
E :
C->rhs_exprs()) {
711 Profiler->VisitStmt(
E);
713 for (
auto *
E :
C->reduction_ops()) {
715 Profiler->VisitStmt(
E);
717 if (
C->getModifier() == clang::OMPC_REDUCTION_inscan) {
718 for (
auto *
E :
C->copy_ops()) {
720 Profiler->VisitStmt(
E);
722 for (
auto *
E :
C->copy_array_temps()) {
724 Profiler->VisitStmt(
E);
726 for (
auto *
E :
C->copy_array_elems()) {
728 Profiler->VisitStmt(
E);
732void OMPClauseProfiler::VisitOMPTaskReductionClause(
734 Profiler->VisitNestedNameSpecifier(
735 C->getQualifierLoc().getNestedNameSpecifier());
736 Profiler->VisitName(
C->getNameInfo().getName());
737 VisitOMPClauseList(
C);
738 VistOMPClauseWithPostUpdate(
C);
739 for (
auto *
E :
C->privates()) {
741 Profiler->VisitStmt(
E);
743 for (
auto *
E :
C->lhs_exprs()) {
745 Profiler->VisitStmt(
E);
747 for (
auto *
E :
C->rhs_exprs()) {
749 Profiler->VisitStmt(
E);
751 for (
auto *
E :
C->reduction_ops()) {
753 Profiler->VisitStmt(
E);
756void OMPClauseProfiler::VisitOMPInReductionClause(
758 Profiler->VisitNestedNameSpecifier(
759 C->getQualifierLoc().getNestedNameSpecifier());
760 Profiler->VisitName(
C->getNameInfo().getName());
761 VisitOMPClauseList(
C);
762 VistOMPClauseWithPostUpdate(
C);
763 for (
auto *
E :
C->privates()) {
765 Profiler->VisitStmt(
E);
767 for (
auto *
E :
C->lhs_exprs()) {
769 Profiler->VisitStmt(
E);
771 for (
auto *
E :
C->rhs_exprs()) {
773 Profiler->VisitStmt(
E);
775 for (
auto *
E :
C->reduction_ops()) {
777 Profiler->VisitStmt(
E);
779 for (
auto *
E :
C->taskgroup_descriptors()) {
781 Profiler->VisitStmt(
E);
785 VisitOMPClauseList(
C);
786 VistOMPClauseWithPostUpdate(
C);
787 for (
auto *
E :
C->privates()) {
789 Profiler->VisitStmt(
E);
791 for (
auto *
E :
C->inits()) {
793 Profiler->VisitStmt(
E);
795 for (
auto *
E :
C->updates()) {
797 Profiler->VisitStmt(
E);
799 for (
auto *
E :
C->finals()) {
801 Profiler->VisitStmt(
E);
804 Profiler->VisitStmt(
C->getStep());
805 if (
C->getCalcStep())
806 Profiler->VisitStmt(
C->getCalcStep());
809 VisitOMPClauseList(
C);
810 if (
C->getAlignment())
811 Profiler->VisitStmt(
C->getAlignment());
814 VisitOMPClauseList(
C);
815 for (
auto *
E :
C->source_exprs()) {
817 Profiler->VisitStmt(
E);
819 for (
auto *
E :
C->destination_exprs()) {
821 Profiler->VisitStmt(
E);
823 for (
auto *
E :
C->assignment_ops()) {
825 Profiler->VisitStmt(
E);
830 VisitOMPClauseList(
C);
831 for (
auto *
E :
C->source_exprs()) {
833 Profiler->VisitStmt(
E);
835 for (
auto *
E :
C->destination_exprs()) {
837 Profiler->VisitStmt(
E);
839 for (
auto *
E :
C->assignment_ops()) {
841 Profiler->VisitStmt(
E);
845 VisitOMPClauseList(
C);
848 if (
const Expr *Depobj =
C->getDepobj())
849 Profiler->VisitStmt(Depobj);
852 VisitOMPClauseList(
C);
856 Profiler->VisitStmt(
C->getDevice());
858void OMPClauseProfiler::VisitOMPMapClause(
const OMPMapClause *
C) {
859 VisitOMPClauseList(
C);
862 if (
Expr *Allocator =
C->getAllocator())
863 Profiler->VisitStmt(Allocator);
864 VisitOMPClauseList(
C);
867 VisitOMPClauseList(
C);
868 VistOMPClauseWithPreInit(
C);
870void OMPClauseProfiler::VisitOMPThreadLimitClause(
872 VisitOMPClauseList(
C);
873 VistOMPClauseWithPreInit(
C);
876 VistOMPClauseWithPreInit(
C);
877 if (
C->getPriority())
878 Profiler->VisitStmt(
C->getPriority());
881 VistOMPClauseWithPreInit(
C);
882 if (
C->getGrainsize())
883 Profiler->VisitStmt(
C->getGrainsize());
886 VistOMPClauseWithPreInit(
C);
887 if (
C->getNumTasks())
888 Profiler->VisitStmt(
C->getNumTasks());
890void OMPClauseProfiler::VisitOMPHintClause(
const OMPHintClause *
C) {
892 Profiler->VisitStmt(
C->getHint());
894void OMPClauseProfiler::VisitOMPToClause(
const OMPToClause *
C) {
895 VisitOMPClauseList(
C);
897void OMPClauseProfiler::VisitOMPFromClause(
const OMPFromClause *
C) {
898 VisitOMPClauseList(
C);
900void OMPClauseProfiler::VisitOMPUseDevicePtrClause(
902 VisitOMPClauseList(
C);
904void OMPClauseProfiler::VisitOMPUseDeviceAddrClause(
906 VisitOMPClauseList(
C);
908void OMPClauseProfiler::VisitOMPIsDevicePtrClause(
910 VisitOMPClauseList(
C);
912void OMPClauseProfiler::VisitOMPHasDeviceAddrClause(
914 VisitOMPClauseList(
C);
916void OMPClauseProfiler::VisitOMPNontemporalClause(
918 VisitOMPClauseList(
C);
919 for (
auto *
E :
C->private_refs())
920 Profiler->VisitStmt(
E);
923 VisitOMPClauseList(
C);
926 VisitOMPClauseList(
C);
928void OMPClauseProfiler::VisitOMPUsesAllocatorsClause(
930 for (
unsigned I = 0,
E =
C->getNumberOfAllocators(); I <
E; ++I) {
932 Profiler->VisitStmt(
D.Allocator);
933 if (
D.AllocatorTraits)
934 Profiler->VisitStmt(
D.AllocatorTraits);
938 if (
const Expr *Modifier =
C->getModifier())
939 Profiler->VisitStmt(Modifier);
940 for (
const Expr *
E :
C->varlist())
941 Profiler->VisitStmt(
E);
944void OMPClauseProfiler::VisitOMPBindClause(
const OMPBindClause *
C) {}
945void OMPClauseProfiler::VisitOMPXDynCGroupMemClause(
947 VistOMPClauseWithPreInit(
C);
948 if (
Expr *Size =
C->getSize())
949 Profiler->VisitStmt(Size);
952 VisitOMPClauseList(
C);
962 OMPClauseProfiler
P(
this);
975 VisitOMPExecutableDirective(S);
979 VisitOMPLoopBasedDirective(S);
983 VisitOMPExecutableDirective(S);
987 VisitOMPExecutableDirective(S);
991 VisitOMPLoopDirective(S);
994void StmtProfiler::VisitOMPLoopTransformationDirective(
996 VisitOMPLoopBasedDirective(S);
1000 VisitOMPLoopTransformationDirective(S);
1004 VisitOMPLoopTransformationDirective(S);
1008 VisitOMPLoopTransformationDirective(S);
1011void StmtProfiler::VisitOMPInterchangeDirective(
1013 VisitOMPLoopTransformationDirective(S);
1017 VisitOMPLoopDirective(S);
1021 VisitOMPLoopDirective(S);
1025 VisitOMPExecutableDirective(S);
1029 VisitOMPExecutableDirective(S);
1033 VisitOMPExecutableDirective(S);
1037 VisitOMPExecutableDirective(S);
1041 VisitOMPExecutableDirective(S);
1045 VisitOMPExecutableDirective(S);
1046 VisitName(S->getDirectiveName().getName());
1051 VisitOMPLoopDirective(S);
1054void StmtProfiler::VisitOMPParallelForSimdDirective(
1056 VisitOMPLoopDirective(S);
1059void StmtProfiler::VisitOMPParallelMasterDirective(
1061 VisitOMPExecutableDirective(S);
1064void StmtProfiler::VisitOMPParallelMaskedDirective(
1066 VisitOMPExecutableDirective(S);
1069void StmtProfiler::VisitOMPParallelSectionsDirective(
1071 VisitOMPExecutableDirective(S);
1075 VisitOMPExecutableDirective(S);
1079 VisitOMPExecutableDirective(S);
1083 VisitOMPExecutableDirective(S);
1087 VisitOMPExecutableDirective(S);
1091 VisitOMPExecutableDirective(S);
1095 VisitOMPExecutableDirective(S);
1098 VisitOMPExecutableDirective(S);
1099 if (
const Expr *
E = S->getReductionRef())
1104 VisitOMPExecutableDirective(S);
1108 VisitOMPExecutableDirective(S);
1112 VisitOMPExecutableDirective(S);
1116 VisitOMPExecutableDirective(S);
1120 VisitOMPExecutableDirective(S);
1124 VisitOMPExecutableDirective(S);
1128 VisitOMPExecutableDirective(S);
1131void StmtProfiler::VisitOMPTargetEnterDataDirective(
1133 VisitOMPExecutableDirective(S);
1136void StmtProfiler::VisitOMPTargetExitDataDirective(
1138 VisitOMPExecutableDirective(S);
1141void StmtProfiler::VisitOMPTargetParallelDirective(
1143 VisitOMPExecutableDirective(S);
1146void StmtProfiler::VisitOMPTargetParallelForDirective(
1148 VisitOMPExecutableDirective(S);
1152 VisitOMPExecutableDirective(S);
1155void StmtProfiler::VisitOMPCancellationPointDirective(
1157 VisitOMPExecutableDirective(S);
1161 VisitOMPExecutableDirective(S);
1165 VisitOMPLoopDirective(S);
1168void StmtProfiler::VisitOMPTaskLoopSimdDirective(
1170 VisitOMPLoopDirective(S);
1173void StmtProfiler::VisitOMPMasterTaskLoopDirective(
1175 VisitOMPLoopDirective(S);
1178void StmtProfiler::VisitOMPMaskedTaskLoopDirective(
1180 VisitOMPLoopDirective(S);
1183void StmtProfiler::VisitOMPMasterTaskLoopSimdDirective(
1185 VisitOMPLoopDirective(S);
1188void StmtProfiler::VisitOMPMaskedTaskLoopSimdDirective(
1190 VisitOMPLoopDirective(S);
1193void StmtProfiler::VisitOMPParallelMasterTaskLoopDirective(
1195 VisitOMPLoopDirective(S);
1198void StmtProfiler::VisitOMPParallelMaskedTaskLoopDirective(
1200 VisitOMPLoopDirective(S);
1203void StmtProfiler::VisitOMPParallelMasterTaskLoopSimdDirective(
1205 VisitOMPLoopDirective(S);
1208void StmtProfiler::VisitOMPParallelMaskedTaskLoopSimdDirective(
1210 VisitOMPLoopDirective(S);
1213void StmtProfiler::VisitOMPDistributeDirective(
1215 VisitOMPLoopDirective(S);
1218void OMPClauseProfiler::VisitOMPDistScheduleClause(
1220 VistOMPClauseWithPreInit(
C);
1221 if (
auto *S =
C->getChunkSize())
1222 Profiler->VisitStmt(S);
1227void StmtProfiler::VisitOMPTargetUpdateDirective(
1229 VisitOMPExecutableDirective(S);
1232void StmtProfiler::VisitOMPDistributeParallelForDirective(
1234 VisitOMPLoopDirective(S);
1237void StmtProfiler::VisitOMPDistributeParallelForSimdDirective(
1239 VisitOMPLoopDirective(S);
1242void StmtProfiler::VisitOMPDistributeSimdDirective(
1244 VisitOMPLoopDirective(S);
1247void StmtProfiler::VisitOMPTargetParallelForSimdDirective(
1249 VisitOMPLoopDirective(S);
1252void StmtProfiler::VisitOMPTargetSimdDirective(
1254 VisitOMPLoopDirective(S);
1257void StmtProfiler::VisitOMPTeamsDistributeDirective(
1259 VisitOMPLoopDirective(S);
1262void StmtProfiler::VisitOMPTeamsDistributeSimdDirective(
1264 VisitOMPLoopDirective(S);
1267void StmtProfiler::VisitOMPTeamsDistributeParallelForSimdDirective(
1269 VisitOMPLoopDirective(S);
1272void StmtProfiler::VisitOMPTeamsDistributeParallelForDirective(
1274 VisitOMPLoopDirective(S);
1277void StmtProfiler::VisitOMPTargetTeamsDirective(
1279 VisitOMPExecutableDirective(S);
1282void StmtProfiler::VisitOMPTargetTeamsDistributeDirective(
1284 VisitOMPLoopDirective(S);
1287void StmtProfiler::VisitOMPTargetTeamsDistributeParallelForDirective(
1289 VisitOMPLoopDirective(S);
1292void StmtProfiler::VisitOMPTargetTeamsDistributeParallelForSimdDirective(
1294 VisitOMPLoopDirective(S);
1297void StmtProfiler::VisitOMPTargetTeamsDistributeSimdDirective(
1299 VisitOMPLoopDirective(S);
1303 VisitOMPExecutableDirective(S);
1307 VisitOMPExecutableDirective(S);
1311 VisitOMPExecutableDirective(S);
1314void StmtProfiler::VisitOMPGenericLoopDirective(
1316 VisitOMPLoopDirective(S);
1319void StmtProfiler::VisitOMPTeamsGenericLoopDirective(
1321 VisitOMPLoopDirective(S);
1324void StmtProfiler::VisitOMPTargetTeamsGenericLoopDirective(
1326 VisitOMPLoopDirective(S);
1329void StmtProfiler::VisitOMPParallelGenericLoopDirective(
1331 VisitOMPLoopDirective(S);
1334void StmtProfiler::VisitOMPTargetParallelGenericLoopDirective(
1336 VisitOMPLoopDirective(S);
1339void StmtProfiler::VisitExpr(
const Expr *S) {
1343void StmtProfiler::VisitConstantExpr(
const ConstantExpr *S) {
1347void StmtProfiler::VisitDeclRefExpr(
const DeclRefExpr *S) {
1350 VisitNestedNameSpecifier(S->getQualifier());
1351 VisitDecl(S->getDecl());
1353 ID.AddBoolean(S->hasExplicitTemplateArgs());
1354 if (S->hasExplicitTemplateArgs())
1355 VisitTemplateArguments(S->getTemplateArgs(), S->getNumTemplateArgs());
1359void StmtProfiler::VisitSYCLUniqueStableNameExpr(
1362 VisitType(S->getTypeSourceInfo()->getType());
1367 ID.AddInteger(llvm::to_underlying(S->getIdentKind()));
1370void StmtProfiler::VisitOpenACCAsteriskSizeExpr(
1377 S->getValue().Profile(ID);
1381 T =
T.getCanonicalType();
1384 BitIntT->Profile(ID);
1391 S->getValue().Profile(ID);
1397 ID.AddInteger(llvm::to_underlying(S->getKind()));
1398 ID.AddInteger(S->getValue());
1403 S->getValue().Profile(ID);
1404 ID.AddBoolean(S->isExact());
1412void StmtProfiler::VisitStringLiteral(
const StringLiteral *S) {
1414 ID.AddString(S->getBytes());
1415 ID.AddInteger(llvm::to_underlying(S->getKind()));
1418void StmtProfiler::VisitParenExpr(
const ParenExpr *S) {
1422void StmtProfiler::VisitParenListExpr(
const ParenListExpr *S) {
1426void StmtProfiler::VisitUnaryOperator(
const UnaryOperator *S) {
1428 ID.AddInteger(S->getOpcode());
1431void StmtProfiler::VisitOffsetOfExpr(
const OffsetOfExpr *S) {
1432 VisitType(S->getTypeSourceInfo()->getType());
1433 unsigned n = S->getNumComponents();
1434 for (
unsigned i = 0; i < n; ++i) {
1462 ID.AddInteger(S->getKind());
1463 if (S->isArgumentType())
1464 VisitType(S->getArgumentType());
1485 for (
unsigned I = 0,
E = S->numOfIterators(); I <
E; ++I)
1486 VisitDecl(S->getIteratorDecl(I));
1489void StmtProfiler::VisitCallExpr(
const CallExpr *S) {
1493void StmtProfiler::VisitMemberExpr(
const MemberExpr *S) {
1495 VisitDecl(S->getMemberDecl());
1497 VisitNestedNameSpecifier(S->getQualifier());
1498 ID.AddBoolean(S->isArrow());
1503 ID.AddBoolean(S->isFileScope());
1506void StmtProfiler::VisitCastExpr(
const CastExpr *S) {
1512 ID.AddInteger(S->getValueKind());
1517 VisitType(S->getTypeAsWritten());
1521 VisitExplicitCastExpr(S);
1526 ID.AddInteger(S->getOpcode());
1531 VisitBinaryOperator(S);
1538void StmtProfiler::VisitBinaryConditionalOperator(
1543void StmtProfiler::VisitAddrLabelExpr(
const AddrLabelExpr *S) {
1545 VisitDecl(S->getLabel());
1548void StmtProfiler::VisitStmtExpr(
const StmtExpr *S) {
1560void StmtProfiler::VisitChooseExpr(
const ChooseExpr *S) {
1564void StmtProfiler::VisitGNUNullExpr(
const GNUNullExpr *S) {
1568void StmtProfiler::VisitVAArgExpr(
const VAArgExpr *S) {
1572void StmtProfiler::VisitInitListExpr(
const InitListExpr *S) {
1573 if (S->getSyntacticForm()) {
1574 VisitInitListExpr(S->getSyntacticForm());
1583 ID.AddBoolean(S->usesGNUSyntax());
1585 if (
D.isFieldDesignator()) {
1587 VisitName(
D.getFieldName());
1591 if (
D.isArrayDesignator()) {
1594 assert(
D.isArrayRangeDesignator());
1597 ID.AddInteger(
D.getArrayIndex());
1603void StmtProfiler::VisitDesignatedInitUpdateExpr(
1605 llvm_unreachable(
"Unexpected DesignatedInitUpdateExpr in syntactic form of "
1617void StmtProfiler::VisitNoInitExpr(
const NoInitExpr *S) {
1618 llvm_unreachable(
"Unexpected NoInitExpr in syntactic form of initializer");
1627 VisitName(&S->getAccessor());
1630void StmtProfiler::VisitBlockExpr(
const BlockExpr *S) {
1632 VisitDecl(S->getBlockDecl());
1638 S->associations()) {
1641 ID.AddPointer(
nullptr);
1644 VisitExpr(Assoc.getAssociationExpr());
1651 i = S->semantics_begin(), e = S->semantics_end(); i != e; ++i)
1654 Visit(OVE->getSourceExpr());
1657void StmtProfiler::VisitAtomicExpr(
const AtomicExpr *S) {
1659 ID.AddInteger(S->getOp());
1662void StmtProfiler::VisitConceptSpecializationExpr(
1665 VisitDecl(S->getNamedConcept());
1667 VisitTemplateArgument(Arg);
1670void StmtProfiler::VisitRequiresExpr(
const RequiresExpr *S) {
1672 ID.AddInteger(S->getLocalParameters().size());
1673 for (
ParmVarDecl *LocalParam : S->getLocalParameters())
1674 VisitDecl(LocalParam);
1675 ID.AddInteger(S->getRequirements().size());
1677 if (
auto *TypeReq = dyn_cast<concepts::TypeRequirement>(Req)) {
1679 ID.AddBoolean(TypeReq->isSubstitutionFailure());
1680 if (!TypeReq->isSubstitutionFailure())
1681 VisitType(TypeReq->getType()->getType());
1682 }
else if (
auto *ExprReq = dyn_cast<concepts::ExprRequirement>(Req)) {
1684 ID.AddBoolean(ExprReq->isExprSubstitutionFailure());
1685 if (!ExprReq->isExprSubstitutionFailure())
1686 Visit(ExprReq->getExpr());
1691 ID.AddBoolean(ExprReq->getNoexceptLoc().isValid());
1693 ExprReq->getReturnTypeRequirement();
1705 auto *NestedReq = cast<concepts::NestedRequirement>(Req);
1706 ID.AddBoolean(NestedReq->hasInvalidConstraint());
1707 if (!NestedReq->hasInvalidConstraint())
1708 Visit(NestedReq->getConstraintExpr());
1716 unsigned &NumArgs) {
1717 switch (S->getOperator()) {
1722 case OO_Array_Delete:
1724 case OO_Conditional:
1726 llvm_unreachable(
"Invalid operator call kind");
1731 return Stmt::UnaryOperatorClass;
1735 return Stmt::BinaryOperatorClass;
1740 return Stmt::UnaryOperatorClass;
1744 return Stmt::BinaryOperatorClass;
1749 return Stmt::UnaryOperatorClass;
1753 return Stmt::BinaryOperatorClass;
1757 return Stmt::BinaryOperatorClass;
1761 return Stmt::BinaryOperatorClass;
1765 return Stmt::BinaryOperatorClass;
1769 UnaryOp = UO_AddrOf;
1770 return Stmt::UnaryOperatorClass;
1774 return Stmt::BinaryOperatorClass;
1778 return Stmt::BinaryOperatorClass;
1782 return Stmt::UnaryOperatorClass;
1786 return Stmt::UnaryOperatorClass;
1789 BinaryOp = BO_Assign;
1790 return Stmt::BinaryOperatorClass;
1794 return Stmt::BinaryOperatorClass;
1798 return Stmt::BinaryOperatorClass;
1801 BinaryOp = BO_AddAssign;
1802 return Stmt::CompoundAssignOperatorClass;
1805 BinaryOp = BO_SubAssign;
1806 return Stmt::CompoundAssignOperatorClass;
1809 BinaryOp = BO_MulAssign;
1810 return Stmt::CompoundAssignOperatorClass;
1813 BinaryOp = BO_DivAssign;
1814 return Stmt::CompoundAssignOperatorClass;
1816 case OO_PercentEqual:
1817 BinaryOp = BO_RemAssign;
1818 return Stmt::CompoundAssignOperatorClass;
1821 BinaryOp = BO_XorAssign;
1822 return Stmt::CompoundAssignOperatorClass;
1825 BinaryOp = BO_AndAssign;
1826 return Stmt::CompoundAssignOperatorClass;
1829 BinaryOp = BO_OrAssign;
1830 return Stmt::CompoundAssignOperatorClass;
1834 return Stmt::BinaryOperatorClass;
1836 case OO_GreaterGreater:
1838 return Stmt::BinaryOperatorClass;
1840 case OO_LessLessEqual:
1841 BinaryOp = BO_ShlAssign;
1842 return Stmt::CompoundAssignOperatorClass;
1844 case OO_GreaterGreaterEqual:
1845 BinaryOp = BO_ShrAssign;
1846 return Stmt::CompoundAssignOperatorClass;
1850 return Stmt::BinaryOperatorClass;
1852 case OO_ExclaimEqual:
1854 return Stmt::BinaryOperatorClass;
1858 return Stmt::BinaryOperatorClass;
1860 case OO_GreaterEqual:
1862 return Stmt::BinaryOperatorClass;
1866 return Stmt::BinaryOperatorClass;
1870 return Stmt::BinaryOperatorClass;
1874 return Stmt::BinaryOperatorClass;
1877 UnaryOp = NumArgs == 1 ? UO_PreInc : UO_PostInc;
1879 return Stmt::UnaryOperatorClass;
1882 UnaryOp = NumArgs == 1 ? UO_PreDec : UO_PostDec;
1884 return Stmt::UnaryOperatorClass;
1887 BinaryOp = BO_Comma;
1888 return Stmt::BinaryOperatorClass;
1891 BinaryOp = BO_PtrMemI;
1892 return Stmt::BinaryOperatorClass;
1895 return Stmt::ArraySubscriptExprClass;
1898 return Stmt::CallExprClass;
1901 UnaryOp = UO_Coawait;
1902 return Stmt::UnaryOperatorClass;
1905 llvm_unreachable(
"Invalid overloaded operator expression");
1908#if defined(_MSC_VER) && !defined(__clang__)
1913#pragma optimize("", off)
1918 if (S->isTypeDependent()) {
1924 if (S->getOperator() == OO_Arrow)
1925 return Visit(S->getArg(0));
1929 unsigned NumArgs = S->getNumArgs();
1933 for (
unsigned I = 0; I != NumArgs; ++I)
1934 Visit(S->getArg(I));
1935 if (SC == Stmt::UnaryOperatorClass)
1936 ID.AddInteger(UnaryOp);
1937 else if (SC == Stmt::BinaryOperatorClass ||
1938 SC == Stmt::CompoundAssignOperatorClass)
1939 ID.AddInteger(BinaryOp);
1941 assert(SC == Stmt::ArraySubscriptExprClass || SC == Stmt::CallExprClass);
1947 ID.AddInteger(S->getOperator());
1950void StmtProfiler::VisitCXXRewrittenBinaryOperator(
1954 assert(!S->isTypeDependent() &&
1955 "resolved rewritten operator should never be type-dependent");
1956 ID.AddBoolean(S->isReversed());
1957 VisitExpr(S->getSemanticForm());
1960#if defined(_MSC_VER) && !defined(__clang__)
1962#pragma optimize("", on)
1974void StmtProfiler::VisitAsTypeExpr(
const AsTypeExpr *S) {
1979 VisitExplicitCastExpr(S);
1983 VisitCXXNamedCastExpr(S);
1987 VisitCXXNamedCastExpr(S);
1992 VisitCXXNamedCastExpr(S);
1996 VisitCXXNamedCastExpr(S);
2001 VisitType(S->getTypeInfoAsWritten()->getType());
2005 VisitCXXNamedCastExpr(S);
2014 ID.AddBoolean(S->getValue());
2021void StmtProfiler::VisitCXXStdInitializerListExpr(
2026void StmtProfiler::VisitCXXTypeidExpr(
const CXXTypeidExpr *S) {
2028 if (S->isTypeOperand())
2029 VisitType(S->getTypeOperandSourceInfo()->getType());
2032void StmtProfiler::VisitCXXUuidofExpr(
const CXXUuidofExpr *S) {
2034 if (S->isTypeOperand())
2035 VisitType(S->getTypeOperandSourceInfo()->getType());
2040 VisitDecl(S->getPropertyDecl());
2043void StmtProfiler::VisitMSPropertySubscriptExpr(
2048void StmtProfiler::VisitCXXThisExpr(
const CXXThisExpr *S) {
2050 ID.AddBoolean(S->isImplicit());
2051 ID.AddBoolean(S->isCapturedByCopyInLambdaWithExplicitObjectParameter());
2054void StmtProfiler::VisitCXXThrowExpr(
const CXXThrowExpr *S) {
2060 VisitDecl(S->getParam());
2065 VisitDecl(S->getField());
2076 VisitDecl(S->getConstructor());
2077 ID.AddBoolean(S->isElidable());
2080void StmtProfiler::VisitCXXInheritedCtorInitExpr(
2083 VisitDecl(S->getConstructor());
2087 VisitExplicitCastExpr(S);
2092 VisitCXXConstructExpr(S);
2096StmtProfiler::VisitLambdaExpr(
const LambdaExpr *S) {
2097 if (!ProfileLambdaExpr) {
2101 VisitStmtNoChildren(S);
2105 VisitDecl(S->getLambdaClass());
2112 ID.AddInteger(
Capture.getCaptureKind());
2113 if (
Capture.capturesVariable())
2114 VisitDecl(
Capture.getCapturedVar());
2123 for (
auto *SubDecl : Lambda->
decls()) {
2125 if (
auto *FTD = dyn_cast<FunctionTemplateDecl>(SubDecl))
2126 Call = FTD->getTemplatedDecl();
2127 else if (
auto *FD = dyn_cast<FunctionDecl>(SubDecl))
2143void StmtProfiler::VisitCXXDeleteExpr(
const CXXDeleteExpr *S) {
2145 ID.AddBoolean(S->isGlobalDelete());
2146 ID.AddBoolean(S->isArrayForm());
2147 VisitDecl(S->getOperatorDelete());
2150void StmtProfiler::VisitCXXNewExpr(
const CXXNewExpr *S) {
2152 VisitType(S->getAllocatedType());
2153 VisitDecl(S->getOperatorNew());
2154 VisitDecl(S->getOperatorDelete());
2155 ID.AddBoolean(S->isArray());
2156 ID.AddInteger(S->getNumPlacementArgs());
2157 ID.AddBoolean(S->isGlobalNew());
2158 ID.AddBoolean(S->isParenTypeId());
2159 ID.AddInteger(llvm::to_underlying(S->getInitializationStyle()));
2165 ID.AddBoolean(S->isArrow());
2166 VisitNestedNameSpecifier(S->getQualifier());
2167 ID.AddBoolean(S->getScopeTypeInfo() !=
nullptr);
2168 if (S->getScopeTypeInfo())
2169 VisitType(S->getScopeTypeInfo()->getType());
2170 ID.AddBoolean(S->getDestroyedTypeInfo() !=
nullptr);
2171 if (S->getDestroyedTypeInfo())
2172 VisitType(S->getDestroyedType());
2174 VisitIdentifierInfo(S->getDestroyedTypeIdentifier());
2177void StmtProfiler::VisitOverloadExpr(
const OverloadExpr *S) {
2179 VisitNestedNameSpecifier(S->getQualifier());
2180 VisitName(S->getName(),
true);
2181 ID.AddBoolean(S->hasExplicitTemplateArgs());
2182 if (S->hasExplicitTemplateArgs())
2183 VisitTemplateArguments(S->getTemplateArgs(), S->getNumTemplateArgs());
2188 VisitOverloadExpr(S);
2191void StmtProfiler::VisitTypeTraitExpr(
const TypeTraitExpr *S) {
2193 ID.AddInteger(S->getTrait());
2194 ID.AddInteger(S->getNumArgs());
2195 for (
unsigned I = 0, N = S->getNumArgs(); I != N; ++I)
2196 VisitType(S->getArg(I)->getType());
2201 ID.AddInteger(S->getTrait());
2202 VisitType(S->getQueriedType());
2207 ID.AddInteger(S->getTrait());
2208 VisitExpr(S->getQueriedExpression());
2211void StmtProfiler::VisitDependentScopeDeclRefExpr(
2214 VisitName(S->getDeclName());
2215 VisitNestedNameSpecifier(S->getQualifier());
2216 ID.AddBoolean(S->hasExplicitTemplateArgs());
2217 if (S->hasExplicitTemplateArgs())
2218 VisitTemplateArguments(S->getTemplateArgs(), S->getNumTemplateArgs());
2225void StmtProfiler::VisitCXXUnresolvedConstructExpr(
2228 VisitType(S->getTypeAsWritten());
2229 ID.AddInteger(S->isListInitialization());
2232void StmtProfiler::VisitCXXDependentScopeMemberExpr(
2234 ID.AddBoolean(S->isImplicitAccess());
2235 if (!S->isImplicitAccess()) {
2237 ID.AddBoolean(S->isArrow());
2239 VisitNestedNameSpecifier(S->getQualifier());
2240 VisitName(S->getMember());
2241 ID.AddBoolean(S->hasExplicitTemplateArgs());
2242 if (S->hasExplicitTemplateArgs())
2243 VisitTemplateArguments(S->getTemplateArgs(), S->getNumTemplateArgs());
2247 ID.AddBoolean(S->isImplicitAccess());
2248 if (!S->isImplicitAccess()) {
2250 ID.AddBoolean(S->isArrow());
2252 VisitNestedNameSpecifier(S->getQualifier());
2253 VisitName(S->getMemberName());
2254 ID.AddBoolean(S->hasExplicitTemplateArgs());
2255 if (S->hasExplicitTemplateArgs())
2256 VisitTemplateArguments(S->getTemplateArgs(), S->getNumTemplateArgs());
2269 VisitDecl(S->getPack());
2270 if (S->isPartiallySubstituted()) {
2271 auto Args = S->getPartialArguments();
2272 ID.AddInteger(Args.size());
2273 for (
const auto &TA : Args)
2274 VisitTemplateArgument(TA);
2282 VisitExpr(
E->getPackIdExpression());
2283 VisitExpr(
E->getIndexExpr());
2286void StmtProfiler::VisitSubstNonTypeTemplateParmPackExpr(
2289 VisitDecl(S->getParameterPack());
2290 VisitTemplateArgument(S->getArgumentPack());
2293void StmtProfiler::VisitSubstNonTypeTemplateParmExpr(
2296 Visit(
E->getReplacement());
2301 VisitDecl(S->getParameterPack());
2302 ID.AddInteger(S->getNumExpansions());
2307void StmtProfiler::VisitMaterializeTemporaryExpr(
2312void StmtProfiler::VisitCXXFoldExpr(
const CXXFoldExpr *S) {
2314 ID.AddInteger(S->getOperator());
2325void StmtProfiler::VisitCoreturnStmt(
const CoreturnStmt *S) {
2329void StmtProfiler::VisitCoawaitExpr(
const CoawaitExpr *S) {
2337void StmtProfiler::VisitCoyieldExpr(
const CoyieldExpr *S) {
2345void StmtProfiler::VisitTypoExpr(
const TypoExpr *
E) {
2353void StmtProfiler::VisitEmbedExpr(
const EmbedExpr *
E) { VisitExpr(
E); }
2355void StmtProfiler::VisitRecoveryExpr(
const RecoveryExpr *
E) { VisitExpr(
E); }
2375 VisitType(S->getEncodedType());
2380 VisitName(S->getSelector());
2385 VisitDecl(S->getProtocol());
2390 VisitDecl(S->getDecl());
2391 ID.AddBoolean(S->isArrow());
2392 ID.AddBoolean(S->isFreeIvar());
2397 if (S->isImplicitProperty()) {
2398 VisitDecl(S->getImplicitPropertyGetter());
2399 VisitDecl(S->getImplicitPropertySetter());
2401 VisitDecl(S->getExplicitProperty());
2403 if (S->isSuperReceiver()) {
2404 ID.AddBoolean(S->isSuperReceiver());
2405 VisitType(S->getSuperReceiverType());
2411 VisitDecl(S->getAtIndexMethodDecl());
2412 VisitDecl(S->setAtIndexMethodDecl());
2417 VisitName(S->getSelector());
2418 VisitDecl(S->getMethodDecl());
2421void StmtProfiler::VisitObjCIsaExpr(
const ObjCIsaExpr *S) {
2423 ID.AddBoolean(S->isArrow());
2428 ID.AddBoolean(S->getValue());
2431void StmtProfiler::VisitObjCIndirectCopyRestoreExpr(
2434 ID.AddBoolean(S->shouldCopy());
2438 VisitExplicitCastExpr(S);
2439 ID.AddBoolean(S->getBridgeKind());
2442void StmtProfiler::VisitObjCAvailabilityCheckExpr(
2449 ID.AddInteger(NumArgs);
2450 for (
unsigned I = 0; I != NumArgs; ++I)
2497 VisitTemplateArgument(
P);
2503class OpenACCClauseProfiler
2505 StmtProfiler &Profiler;
2508 OpenACCClauseProfiler(StmtProfiler &
P) : Profiler(
P) {}
2520 Profiler.VisitStmt(
E);
2523#define VISIT_CLAUSE(CLAUSE_NAME) \
2524 void Visit##CLAUSE_NAME##Clause(const OpenACC##CLAUSE_NAME##Clause &Clause);
2526#include "clang/Basic/OpenACCClauses.def"
2530void OpenACCClauseProfiler::VisitDefaultClause(
2533void OpenACCClauseProfiler::VisitIfClause(
const OpenACCIfClause &Clause) {
2535 "if clause requires a valid condition expr");
2540 VisitClauseWithVarList(Clause);
2542void OpenACCClauseProfiler::VisitCopyInClause(
2544 VisitClauseWithVarList(Clause);
2547void OpenACCClauseProfiler::VisitCopyOutClause(
2549 VisitClauseWithVarList(Clause);
2552void OpenACCClauseProfiler::VisitCreateClause(
2554 VisitClauseWithVarList(Clause);
2562void OpenACCClauseProfiler::VisitFinalizeClause(
2565void OpenACCClauseProfiler::VisitIfPresentClause(
2568void OpenACCClauseProfiler::VisitNumGangsClause(
2571 Profiler.VisitStmt(
E);
2576 Profiler.VisitStmt(
E);
2579void OpenACCClauseProfiler::VisitNumWorkersClause(
2581 assert(Clause.
hasIntExpr() &&
"num_workers clause requires a valid int expr");
2585void OpenACCClauseProfiler::VisitCollapseClause(
2587 assert(Clause.
getLoopCount() &&
"collapse clause requires a valid int expr");
2591void OpenACCClauseProfiler::VisitPrivateClause(
2593 VisitClauseWithVarList(Clause);
2596void OpenACCClauseProfiler::VisitFirstPrivateClause(
2598 VisitClauseWithVarList(Clause);
2601void OpenACCClauseProfiler::VisitAttachClause(
2603 VisitClauseWithVarList(Clause);
2606void OpenACCClauseProfiler::VisitDetachClause(
2608 VisitClauseWithVarList(Clause);
2611void OpenACCClauseProfiler::VisitDeleteClause(
2613 VisitClauseWithVarList(Clause);
2616void OpenACCClauseProfiler::VisitDevicePtrClause(
2618 VisitClauseWithVarList(Clause);
2621void OpenACCClauseProfiler::VisitNoCreateClause(
2623 VisitClauseWithVarList(Clause);
2626void OpenACCClauseProfiler::VisitPresentClause(
2628 VisitClauseWithVarList(Clause);
2631void OpenACCClauseProfiler::VisitUseDeviceClause(
2633 VisitClauseWithVarList(Clause);
2636void OpenACCClauseProfiler::VisitVectorLengthClause(
2639 "vector_length clause requires a valid int expr");
2648void OpenACCClauseProfiler::VisitDeviceNumClause(
2653void OpenACCClauseProfiler::VisitWorkerClause(
2659void OpenACCClauseProfiler::VisitVectorClause(
2669 Profiler.VisitStmt(
E);
2672void OpenACCClauseProfiler::VisitDeviceTypeClause(
2677void OpenACCClauseProfiler::VisitIndependentClause(
2680void OpenACCClauseProfiler::VisitSeqClause(
const OpenACCSeqClause &Clause) {}
2683 for (
unsigned I = 0; I < Clause.
getNumExprs(); ++I) {
2684 Profiler.VisitStmt(Clause.
getExpr(I).second);
2688void OpenACCClauseProfiler::VisitReductionClause(
2690 VisitClauseWithVarList(Clause);
2694void StmtProfiler::VisitOpenACCComputeConstruct(
2699 OpenACCClauseProfiler
P{*
this};
2700 P.VisitOpenACCClauseList(S->clauses());
2707 OpenACCClauseProfiler
P{*
this};
2708 P.VisitOpenACCClauseList(S->clauses());
2711void StmtProfiler::VisitOpenACCCombinedConstruct(
2716 OpenACCClauseProfiler
P{*
this};
2717 P.VisitOpenACCClauseList(S->clauses());
2723 OpenACCClauseProfiler
P{*
this};
2724 P.VisitOpenACCClauseList(S->clauses());
2727void StmtProfiler::VisitOpenACCEnterDataConstruct(
2731 OpenACCClauseProfiler
P{*
this};
2732 P.VisitOpenACCClauseList(S->clauses());
2735void StmtProfiler::VisitOpenACCExitDataConstruct(
2739 OpenACCClauseProfiler
P{*
this};
2740 P.VisitOpenACCClauseList(S->clauses());
2743void StmtProfiler::VisitOpenACCHostDataConstruct(
2747 OpenACCClauseProfiler
P{*
this};
2748 P.VisitOpenACCClauseList(S->clauses());
2755 OpenACCClauseProfiler
P{*
this};
2756 P.VisitOpenACCClauseList(S->clauses());
2761 OpenACCClauseProfiler
P{*
this};
2762 P.VisitOpenACCClauseList(S->clauses());
2765void StmtProfiler::VisitOpenACCShutdownConstruct(
2768 OpenACCClauseProfiler
P{*
this};
2769 P.VisitOpenACCClauseList(S->clauses());
2777 bool Canonical,
bool ProfileLambdaExpr)
const {
2778 StmtProfilerWithPointers Profiler(ID, Context, Canonical, ProfileLambdaExpr);
2779 Profiler.Visit(
this);
2784 StmtProfilerWithoutPointers Profiler(ID, Hash);
2785 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)
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 ...
CanQualType getCanonicalType(QualType T) const
Return the canonical (structural) type corresponding to the specified potentially non-canonical type ...
TemplateName getCanonicalTemplateName(TemplateName Name, bool IgnoreDeduced=false) const
Retrieves the "canonical" template name that refers to a given template.
QualType getUnconstrainedType(QualType T) const
Remove any type constraints from a template parameter type, for equivalence comparison of template pa...
NestedNameSpecifier * getCanonicalNestedNameSpecifier(NestedNameSpecifier *NNS) const
Retrieves the "canonical" nested name specifier for a given nested name specifier.
AddrLabelExpr - The GNU address of label extension, representing &&label.
Represents the index of the current element of an array being initialized by an ArrayInitLoopExpr.
Represents a loop initializing the elements of an array.
This class represents BOTH the OpenMP Array Section and OpenACC 'subarray', with a boolean differenti...
ArraySubscriptExpr - [C99 6.5.2.1] Array Subscripting.
An Embarcadero array type trait, as used in the implementation of __array_rank and __array_extent.
AsTypeExpr - Clang builtin function __builtin_astype [OpenCL 6.2.4.2] This AST node provides support ...
AtomicExpr - Variadic atomic builtins: __atomic_exchange, __atomic_fetch_*, __atomic_load,...
Represents an attribute applied to a statement.
BinaryConditionalOperator - The GNU extension to the conditional operator which allows the middle ope...
A builtin binary operation expression such as "x + y" or "x <= y".
A fixed int type of a specified bitwidth.
BlockExpr - Adaptor class for mixing a BlockDecl with expressions.
BreakStmt - This represents a break.
Represents a C++2a __builtin_bit_cast(T, v) expression.
This class is used for builtin types like 'int'.
CStyleCastExpr - An explicit cast in C (C99 6.5.4) or a C-style cast in C++ (C++ [expr....
Represents a call to a CUDA kernel function.
A C++ addrspace_cast expression (currently only enabled for OpenCL).
Represents binding an expression to a temporary.
A boolean literal, per ([C++ lex.bool] Boolean literals).
CXXCatchStmt - This represents a C++ catch block.
A C++ const_cast expression (C++ [expr.const.cast]).
Represents a call to a C++ constructor.
A default argument (C++ [dcl.fct.default]).
A use of a default initializer in a constructor or in aggregate initialization.
Represents a delete expression for memory deallocation and destructor calls, e.g.
Represents a C++ member access expression where the actual member referenced could not be resolved be...
Represents a C++ destructor within a class.
A C++ dynamic_cast expression (C++ [expr.dynamic.cast]).
Represents a folding of a pack over an operator.
CXXForRangeStmt - This represents C++0x [stmt.ranged]'s ranged for statement, represented as 'for (ra...
Represents an explicit C++ type conversion that uses "functional" notation (C++ [expr....
Represents a call to an inherited base class constructor from an inheriting constructor.
Represents a call to a member function that may be written either with member call syntax (e....
Abstract class common to all of the C++ "named"/"keyword" casts.
Represents a new-expression for memory allocation and constructor calls, e.g: "new CXXNewExpr(foo)".
Represents a C++11 noexcept expression (C++ [expr.unary.noexcept]).
The null pointer literal (C++11 [lex.nullptr])
A call to an overloaded operator written using operator syntax.
Represents a list-initialization with parenthesis.
Represents a C++ pseudo-destructor (C++ [expr.pseudo]).
Represents a C++ struct/union/class.
capture_const_range captures() const
A C++ reinterpret_cast expression (C++ [expr.reinterpret.cast]).
A rewritten comparison expression that was originally written using operator syntax.
An expression "T()" which creates an rvalue of a non-class type T.
A C++ static_cast expression (C++ [expr.static.cast]).
Implicit construction of a std::initializer_list<T> object from an array temporary within list-initia...
Represents a C++ functional cast expression that builds a temporary object.
Represents the this expression in C++.
A C++ throw-expression (C++ [except.throw]).
CXXTryStmt - A C++ try block, including all handlers.
A C++ typeid expression (C++ [expr.typeid]), which gets the type_info that corresponds to the supplie...
Describes an explicit type conversion that uses functional notion but could not be resolved because o...
A Microsoft C++ __uuidof expression, which gets the _GUID that corresponds to the supplied type or ex...
CallExpr - Represents a function call (C99 6.5.2.2, C++ [expr.call]).
This captures a statement into a function.
CaseStmt - Represent a case statement.
CastExpr - Base class for type casts, including both implicit casts (ImplicitCastExpr) and explicit c...
ChooseExpr - GNU builtin-in function __builtin_choose_expr.
Represents a 'co_await' expression.
CompoundAssignOperator - For compound assignments (e.g.
CompoundLiteralExpr - [C99 6.5.2.5].
CompoundStmt - This represents a group of statements like { stmt stmt }.
Represents the specialization of a concept - evaluates to a prvalue of type bool.
ConditionalOperator - The ?: ternary operator.
ConstStmtVisitor - This class implements a simple visitor for Stmt subclasses.
ConstantExpr - An expression that occurs in a constant context and optionally the result of evaluatin...
ContinueStmt - This represents a continue.
ConvertVectorExpr - Clang builtin function __builtin_convertvector This AST node provides support for...
Represents a 'co_return' statement in the C++ Coroutines TS.
Represents the body of a coroutine.
Represents a 'co_yield' expression.
decl_range decls() const
decls_begin/decls_end - Iterate over the declarations stored in this context.
A reference to a declared variable, function, enum, etc.
DeclStmt - Adaptor class for mixing declarations with statements and expressions.
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.
Represents a 'co_await' expression while the type of the promise is dependent.
A qualified reference to a name whose declaration cannot yet be resolved.
Represents a single C99 designator.
Represents a C99 designated initializer expression.
DoStmt - This represents a 'do/while' stmt.
Represents a reference to #emded data.
ExplicitCastExpr - An explicit cast written in the source code.
Represents an expression – generally a full-expression – that introduces cleanups to be run at the en...
This represents one expression.
An expression trait intrinsic.
ExtVectorElementExpr - This represents access to specific elements of a vector, and may occur on the ...
ForStmt - This represents a 'for (init;cond;inc)' stmt.
Represents a function declaration or definition.
Represents a reference to a function parameter pack or init-capture pack that has been substituted bu...
VarDecl *const * iterator
Iterators over the parameters which the parameter pack expanded into.
This represents a GCC inline-assembly statement extension.
GNUNullExpr - Implements the GNU __null extension, which is a name for a null pointer constant that h...
Represents a C11 generic selection.
AssociationTy< true > ConstAssociation
GotoStmt - This represents a direct goto.
This class represents temporary values used to represent inout and out arguments in HLSL.
One of these records is kept for each identifier that is lexed.
IfStmt - This represents an if/then/else.
ImaginaryLiteral - We support imaginary integer and floating point literals, like "1....
ImplicitCastExpr - Allows us to explicitly represent implicit type conversions, which have no direct ...
Represents an implicitly-generated value initialization of an object of a given type.
IndirectGotoStmt - This represents an indirect goto.
Describes an C or C++ initializer list.
LabelStmt - Represents a label, which has a substatement.
A C++ lambda expression, which produces a function object (of unspecified type) that can be invoked l...
This represents a Microsoft inline-assembly statement extension.
Representation of a Microsoft __if_exists or __if_not_exists statement with a dependent name.
A member reference to an MSPropertyDecl.
MS property subscript expression.
Represents a prvalue temporary that is written into memory so that a reference can bind to it.
MatrixSubscriptExpr - Matrix subscript expression for the MatrixType extension.
MemberExpr - [C99 6.5.2.3] Structure and Union Members.
Represents a C++ nested name specifier, such as "\::std::vector<int>::".
Represents a place-holder for an object not to be initialized by anything.
NonTypeTemplateParmDecl - Declares a non-type template parameter, e.g., "Size" in.
NullStmt - This is the null statement ";": C99 6.8.3p3.
void AddDecl(const Decl *D)
void AddIdentifierInfo(const IdentifierInfo *II)
void AddDeclarationName(DeclarationName Name, bool TreatAsDecl=false)
void AddNestedNameSpecifier(const NestedNameSpecifier *NNS)
void AddFunctionDecl(const FunctionDecl *Function, bool SkipBody=false)
void AddTemplateName(TemplateName Name)
void AddQualType(QualType T)
This represents the 'absent' clause in the '#pragma omp assume' directive.
This represents 'acq_rel' clause in the '#pragma omp atomic|flush' directives.
This represents 'acquire' clause in the '#pragma omp atomic|flush' directives.
This represents clause 'affinity' in the '#pragma omp task'-based directives.
This represents the 'align' clause in the '#pragma omp allocate' directive.
This represents clause 'aligned' in the '#pragma omp ...' directives.
This represents clause 'allocate' in the '#pragma omp ...' directives.
This represents 'allocator' clause in the '#pragma omp ...' directive.
An explicit cast in C or a C-style cast in C++, which uses the syntax ([s1][s2]......
This represents 'at' clause in the '#pragma omp error' directive.
This represents 'atomic_default_mem_order' clause in the '#pragma omp requires' directive.
This represents '#pragma omp atomic' directive.
This represents '#pragma omp barrier' directive.
This represents 'bind' clause in the '#pragma omp ...' directives.
This represents '#pragma omp cancel' directive.
This represents '#pragma omp cancellation point' directive.
Representation of an OpenMP canonical loop.
This represents 'capture' clause in the '#pragma omp atomic' directive.
Class that handles post-update expression for some clauses, like 'lastprivate', 'reduction' etc.
Class that handles pre-initialization statement for some clauses, like 'schedule',...
This represents 'collapse' clause in the '#pragma omp ...' directive.
This represents 'compare' clause in the '#pragma omp atomic' directive.
This represents the 'contains' clause in the '#pragma omp assume' directive.
This represents clause 'copyin' in the '#pragma omp ...' directives.
This represents clause 'copyprivate' in the '#pragma omp ...' directives.
This represents '#pragma omp critical' directive.
This represents 'default' clause in the '#pragma omp ...' directive.
This represents 'defaultmap' clause in the '#pragma omp ...' directive.
This represents implicit clause 'depend' for the '#pragma omp task' directive.
This represents implicit clause 'depobj' for the '#pragma omp depobj' directive.
This represents '#pragma omp depobj' directive.
This represents 'destroy' clause in the '#pragma omp depobj' directive or the '#pragma omp interop' d...
This represents 'detach' clause in the '#pragma omp task' directive.
This represents 'device' clause in the '#pragma omp ...' directive.
This represents '#pragma omp dispatch' directive.
This represents 'dist_schedule' clause in the '#pragma omp ...' directive.
This represents '#pragma omp distribute' directive.
This represents '#pragma omp distribute parallel for' composite directive.
This represents '#pragma omp distribute parallel for simd' composite directive.
This represents '#pragma omp distribute simd' composite directive.
This represents the 'doacross' clause for the '#pragma omp ordered' directive.
This represents 'dynamic_allocators' clause in the '#pragma omp requires' directive.
This represents '#pragma omp error' directive.
This represents clause 'exclusive' in the '#pragma omp scan' directive.
This is a basic class for representing single OpenMP executable directive.
This represents 'fail' clause in the '#pragma omp atomic' directive.
This represents 'filter' clause in the '#pragma omp ...' directive.
This represents 'final' clause in the '#pragma omp ...' directive.
This represents clause 'firstprivate' in the '#pragma omp ...' directives.
This represents implicit clause 'flush' for the '#pragma omp flush' directive.
This represents '#pragma omp flush' directive.
This represents '#pragma omp for' directive.
This represents '#pragma omp for simd' directive.
This represents clause 'from' in the '#pragma omp ...' directives.
Representation of the 'full' clause of the '#pragma omp unroll' directive.
This represents '#pragma omp loop' directive.
This represents 'grainsize' clause in the '#pragma omp ...' directive.
This represents clause 'has_device_ptr' in the '#pragma omp ...' directives.
This represents 'hint' clause in the '#pragma omp ...' directive.
This represents the 'holds' clause in the '#pragma omp assume' directive.
This represents 'if' clause in the '#pragma omp ...' directive.
This represents clause 'in_reduction' in the '#pragma omp task' directives.
This represents clause 'inclusive' in the '#pragma omp scan' directive.
This represents the 'init' clause in '#pragma omp ...' directives.
Represents the '#pragma omp interchange' loop transformation directive.
This represents '#pragma omp interop' directive.
This represents clause 'is_device_ptr' in the '#pragma omp ...' directives.
OpenMP 5.0 [2.1.6 Iterators] Iterators are identifiers that expand to multiple values in the clause o...
This represents clause 'lastprivate' in the '#pragma omp ...' directives.
This represents clause 'linear' in the '#pragma omp ...' directives.
The base class for all loop-based directives, including loop transformation directives.
This is a common base class for loop directives ('omp simd', 'omp for', 'omp for simd' etc....
This represents clause 'map' in the '#pragma omp ...' directives.
This represents '#pragma omp masked' directive.
This represents '#pragma omp masked taskloop' directive.
This represents '#pragma omp masked taskloop simd' directive.
This represents '#pragma omp master' directive.
This represents '#pragma omp master taskloop' directive.
This represents '#pragma omp master taskloop simd' directive.
This represents 'mergeable' clause in the '#pragma omp ...' directive.
This represents 'message' clause in the '#pragma omp error' directive.
This represents the 'no_openmp' clause in the '#pragma omp assume' directive.
This represents the 'no_openmp_routines' clause in the '#pragma omp assume' directive.
This represents the 'no_parallelism' clause in the '#pragma omp assume' directive.
This represents 'nocontext' clause in the '#pragma omp ...' directive.
This represents 'nogroup' clause in the '#pragma omp ...' directive.
This represents clause 'nontemporal' in the '#pragma omp ...' directives.
This represents 'novariants' clause in the '#pragma omp ...' directive.
This represents 'nowait' clause in the '#pragma omp ...' directive.
This represents 'num_tasks' clause in the '#pragma omp ...' directive.
This represents 'num_teams' clause in the '#pragma omp ...' directive.
This represents 'num_threads' clause in the '#pragma omp ...' directive.
This represents 'order' clause in the '#pragma omp ...' directive.
This represents 'ordered' clause in the '#pragma omp ...' directive.
This represents '#pragma omp ordered' directive.
This represents '#pragma omp parallel' directive.
This represents '#pragma omp parallel for' directive.
This represents '#pragma omp parallel for simd' directive.
This represents '#pragma omp parallel loop' directive.
This represents '#pragma omp parallel masked' directive.
This represents '#pragma omp parallel masked taskloop' directive.
This represents '#pragma omp parallel masked taskloop simd' directive.
This represents '#pragma omp parallel master' directive.
This represents '#pragma omp parallel master taskloop' directive.
This represents '#pragma omp parallel master taskloop simd' directive.
This represents '#pragma omp parallel sections' directive.
Representation of the 'partial' clause of the '#pragma omp unroll' directive.
This class represents the 'permutation' clause in the '#pragma omp interchange' directive.
This represents 'priority' clause in the '#pragma omp ...' directive.
This represents clause 'private' in the '#pragma omp ...' directives.
This represents 'proc_bind' clause in the '#pragma omp ...' directive.
This represents 'read' clause in the '#pragma omp atomic' directive.
This represents clause 'reduction' in the '#pragma omp ...' directives.
This represents 'relaxed' clause in the '#pragma omp atomic' directives.
This represents 'release' clause in the '#pragma omp atomic|flush' directives.
Represents the '#pragma omp reverse' loop transformation directive.
This represents 'reverse_offload' clause in the '#pragma omp requires' directive.
This represents 'simd' clause in the '#pragma omp ...' directive.
This represents 'safelen' clause in the '#pragma omp ...' directive.
This represents '#pragma omp scan' directive.
This represents 'schedule' clause in the '#pragma omp ...' directive.
This represents '#pragma omp scope' directive.
This represents '#pragma omp section' directive.
This represents '#pragma omp sections' directive.
This represents 'seq_cst' clause in the '#pragma omp atomic|flush' directives.
This represents 'severity' clause in the '#pragma omp error' directive.
This represents clause 'shared' in the '#pragma omp ...' directives.
This represents '#pragma omp simd' directive.
This represents 'simdlen' clause in the '#pragma omp ...' directive.
This represents '#pragma omp single' directive.
This represents the 'sizes' clause in the '#pragma omp tile' directive.
This represents '#pragma omp target data' directive.
This represents '#pragma omp target' directive.
This represents '#pragma omp target enter data' directive.
This represents '#pragma omp target exit data' directive.
This represents '#pragma omp target parallel' directive.
This represents '#pragma omp target parallel for' directive.
This represents '#pragma omp target parallel for simd' directive.
This represents '#pragma omp target parallel loop' directive.
This represents '#pragma omp target simd' directive.
This represents '#pragma omp target teams' directive.
This represents '#pragma omp target teams distribute' combined directive.
This represents '#pragma omp target teams distribute parallel for' combined directive.
This represents '#pragma omp target teams distribute parallel for simd' combined directive.
This represents '#pragma omp target teams distribute simd' combined directive.
This represents '#pragma omp target teams loop' directive.
This represents '#pragma omp target update' directive.
This represents '#pragma omp task' directive.
This represents '#pragma omp taskloop' directive.
This represents '#pragma omp taskloop simd' directive.
This represents clause 'task_reduction' in the '#pragma omp taskgroup' directives.
This represents '#pragma omp taskgroup' directive.
This represents '#pragma omp taskwait' directive.
This represents '#pragma omp taskyield' directive.
This represents '#pragma omp teams' directive.
This represents '#pragma omp teams distribute' directive.
This represents '#pragma omp teams distribute parallel for' composite directive.
This represents '#pragma omp teams distribute parallel for simd' composite directive.
This represents '#pragma omp teams distribute simd' combined directive.
This represents '#pragma omp teams loop' directive.
This represents 'thread_limit' clause in the '#pragma omp ...' directive.
This represents 'threads' clause in the '#pragma omp ...' directive.
This represents the '#pragma omp tile' loop transformation directive.
This represents clause 'to' in the '#pragma omp ...' directives.
This represents 'unified_address' clause in the '#pragma omp requires' directive.
This represents 'unified_shared_memory' clause in the '#pragma omp requires' directive.
This represents the '#pragma omp unroll' loop transformation directive.
This represents 'untied' clause in the '#pragma omp ...' directive.
This represents 'update' clause in the '#pragma omp atomic' directive.
This represents the 'use' clause in '#pragma omp ...' directives.
This represents clause 'use_device_addr' in the '#pragma omp ...' directives.
This represents clause 'use_device_ptr' in the '#pragma omp ...' directives.
This represents clause 'uses_allocators' in the '#pragma omp target'-based directives.
This represents 'weak' clause in the '#pragma omp atomic' directives.
This represents 'write' clause in the '#pragma omp atomic' directive.
This represents 'ompx_attribute' clause in a directive that might generate an outlined function.
This represents 'ompx_bare' clause in the '#pragma omp target teams ...' directive.
This represents 'ompx_dyn_cgroup_mem' clause in the '#pragma omp target ...' directive.
ObjCArrayLiteral - used for objective-c array containers; as in: @["Hello", NSApp,...
Represents Objective-C's @catch statement.
Represents Objective-C's @finally statement.
Represents Objective-C's @synchronized statement.
Represents Objective-C's @throw statement.
Represents Objective-C's @try ... @catch ... @finally statement.
Represents Objective-C's @autoreleasepool Statement.
A runtime availability query.
ObjCBoolLiteralExpr - Objective-C Boolean Literal.
ObjCBoxedExpr - used for generalized expression boxing.
An Objective-C "bridged" cast expression, which casts between Objective-C pointers and C pointers,...
ObjCDictionaryLiteral - AST node to represent objective-c dictionary literals; as in:"name" : NSUserN...
ObjCEncodeExpr, used for @encode in Objective-C.
Represents Objective-C's collection statement.
ObjCIndirectCopyRestoreExpr - Represents the passing of a function argument by indirect copy-restore ...
ObjCIsaExpr - Represent X->isa and X.isa when X is an ObjC 'id' type.
ObjCIvarRefExpr - A reference to an ObjC instance variable.
An expression that sends a message to the given Objective-C object or class.
ObjCPropertyRefExpr - A dot-syntax expression to access an ObjC property.
ObjCProtocolExpr used for protocol expression in Objective-C.
ObjCSelectorExpr used for @selector in Objective-C.
ObjCStringLiteral, used for Objective-C string literals i.e.
ObjCSubscriptRefExpr - used for array and dictionary subscripting.
OffsetOfExpr - [C99 7.17] - This represents an expression of the form offsetof(record-type,...
Helper class for OffsetOfExpr.
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.
OpaqueValueExpr - An expression referring to an opaque object of a fixed type and value class.
This expression type represents an asterisk in an OpenACC Size-Expr, used in the 'tile' and 'gang' cl...
void Visit(const OpenACCClause *C)
bool hasConditionExpr() const
const Expr * getConditionExpr() const
const Expr * getIntExpr() const
Represents a clause with one or more 'var' objects, represented as an expr, as its arguments.
ArrayRef< Expr * > getVarList()
This is the base type for all OpenACC Clauses.
Represents a 'collapse' clause on a 'loop' construct.
const Expr * getLoopCount() const
This class represents a compute construct, representing a 'Kind' of ‘parallel’, 'serial',...
A 'default' clause, has the optional 'none' or 'present' argument.
A 'device_type' or 'dtype' clause, takes a list of either an 'asterisk' or an identifier.
unsigned getNumExprs() const
std::pair< OpenACCGangKind, const Expr * > getExpr(unsigned I) const
An 'if' clause, which has a required condition expression.
This class represents a 'loop' construct.
llvm::ArrayRef< Expr * > getIntExprs()
A 'self' clause, which has an optional condition expression.
llvm::ArrayRef< Expr * > getSizeExprs()
Expr * getDevNumExpr() const
llvm::ArrayRef< Expr * > getQueueIdExprs()
bool hasDevNumExpr() const
A reference to an overloaded function set, either an UnresolvedLookupExpr or an UnresolvedMemberExpr.
Represents a C++11 pack expansion that produces a sequence of expressions.
ParenExpr - This represents a parenthesized expression, e.g.
Represents a parameter to a function.
[C99 6.4.2.2] - A predefined identifier such as func.
PseudoObjectExpr - An expression which accesses a pseudo-object l-value.
const Expr *const * const_semantics_iterator
A (possibly-)qualified type.
Frontend produces RecoveryExprs on semantic errors that prevent creating other well-formed expression...
C++2a [expr.prim.req]: A requires-expression provides a concise way to express requirements on templa...
ReturnStmt - This represents a return, optionally of an expression: return; return 4;.
Represents a __leave statement.
ShuffleVectorExpr - clang-specific builtin-in function __builtin_shufflevector.
Represents an expression that computes the length of a parameter pack.
Represents a function call to one of __builtin_LINE(), __builtin_COLUMN(), __builtin_FUNCTION(),...
StmtExpr - This is the GNU Statement Expression extension: ({int X=4; X;}).
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.
void Profile(llvm::FoldingSetNodeID &ID, const ASTContext &Context, bool Canonical, bool ProfileLambdaExpr=false) const
Produce a unique representation of the given statement.
StringLiteral - This represents a string literal expression, e.g.
Represents a reference to a non-type template parameter that has been substituted with a template arg...
Represents a reference to a non-type template parameter pack that has been substituted with a non-tem...
SwitchStmt - This represents a 'switch' stmt.
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.
TemplateTemplateParmDecl - Declares a template template parameter, e.g., "T" in.
Declaration of a template type parameter.
Expr * getImmediatelyDeclaredConstraint() const
Get the immediately-declared constraint expression introduced by this type-constraint,...
A type trait used in the implementation of various C++11 and Library TR1 trait templates.
const T * castAs() const
Member-template castAs<specific type>.
TypeClass getTypeClass() const
const T * getAs() const
Member-template getAs<specific type>'.
TypoExpr - Internal placeholder for expressions where typo correction still needs to be performed and...
UnaryExprOrTypeTraitExpr - expression with either a type or (unevaluated) expression operand.
UnaryOperator - This represents the unary-expression's (except sizeof and alignof),...
A reference to a name which we were able to look up during parsing but could not resolve to a specifi...
Represents a C++ member access expression for which lookup produced a set of overloaded functions.
A call to a literal operator (C++11 [over.literal]) written as a user-defined literal (C++11 [lit....
Represents a call to the builtin function __builtin_va_arg.
WhileStmt - This represents a 'while' stmt.
bool isTypeConstraint() const
const TypeConstraint * getTypeConstraint() const
bool isSubstitutionFailure() const
A static requirement that can be used in a requires-expression to check properties of types and expre...
The JSON file list parser is used to communicate input to InstallAPI.
@ OO_None
Not an overloaded operator.
@ NUM_OVERLOADED_OPERATORS
const FunctionProtoType * T
Data for list of allocators.