24#include "llvm/ADT/FoldingSet.h"
30 llvm::FoldingSetNodeID &
ID;
34 StmtProfiler(llvm::FoldingSetNodeID &ID,
bool Canonical)
35 :
ID(
ID), Canonical(Canonical) {}
37 virtual ~StmtProfiler() {}
39 void VisitStmt(
const Stmt *S);
41 void VisitStmtNoChildren(
const Stmt *S) {
42 HandleStmtClass(S->getStmtClass());
47#define STMT(Node, Base) void Visit##Node(const Node *S);
48#include "clang/AST/StmtNodes.inc"
52 virtual void VisitDecl(
const Decl *D) = 0;
56 virtual void VisitType(
QualType T) = 0;
59 virtual void VisitName(
DeclarationName Name,
bool TreatAsDecl =
false) = 0;
81 class StmtProfilerWithPointers :
public StmtProfiler {
85 StmtProfilerWithPointers(llvm::FoldingSetNodeID &ID,
87 : StmtProfiler(
ID, Canonical), Context(Context) {}
93 void VisitDecl(
const Decl *D)
override {
98 dyn_cast<NonTypeTemplateParmDecl>(D)) {
99 ID.AddInteger(NTTP->getDepth());
100 ID.AddInteger(NTTP->getIndex());
101 ID.AddBoolean(NTTP->isParameterPack());
114 if (
const ParmVarDecl *Parm = dyn_cast<ParmVarDecl>(D)) {
125 VisitType(Parm->getType());
126 ID.AddInteger(Parm->getFunctionScopeDepth());
127 ID.AddInteger(Parm->getFunctionScopeIndex());
132 dyn_cast<TemplateTypeParmDecl>(D)) {
133 ID.AddInteger(TTP->getDepth());
134 ID.AddInteger(TTP->getIndex());
135 ID.AddBoolean(TTP->isParameterPack());
140 dyn_cast<TemplateTemplateParmDecl>(D)) {
141 ID.AddInteger(TTP->getDepth());
142 ID.AddInteger(TTP->getIndex());
143 ID.AddBoolean(TTP->isParameterPack());
151 void VisitType(
QualType T)
override {
152 if (Canonical && !T.
isNull())
159 ID.AddPointer(Name.getAsOpaquePtr());
180 class StmtProfilerWithoutPointers :
public StmtProfiler {
183 StmtProfilerWithoutPointers(llvm::FoldingSetNodeID &ID,
ODRHash &Hash)
184 : StmtProfiler(
ID,
false), Hash(Hash) {}
188 if (SC == Stmt::UnresolvedLookupExprClass) {
191 ID.AddInteger(Stmt::DeclRefExprClass);
197 void VisitType(
QualType T)
override {
215 void VisitDecl(
const Decl *D)
override {
233void StmtProfiler::VisitStmt(
const Stmt *S) {
234 assert(S &&
"Requires non-null Stmt pointer");
236 VisitStmtNoChildren(S);
238 for (
const Stmt *SubStmt : S->children()) {
246void StmtProfiler::VisitDeclStmt(
const DeclStmt *S) {
248 for (
const auto *D : S->decls())
252void StmtProfiler::VisitNullStmt(
const NullStmt *S) {
256void StmtProfiler::VisitCompoundStmt(
const CompoundStmt *S) {
260void StmtProfiler::VisitCaseStmt(
const CaseStmt *S) {
264void StmtProfiler::VisitDefaultStmt(
const DefaultStmt *S) {
268void StmtProfiler::VisitLabelStmt(
const LabelStmt *S) {
270 VisitDecl(S->getDecl());
278void StmtProfiler::VisitIfStmt(
const IfStmt *S) {
280 VisitDecl(S->getConditionVariable());
283void StmtProfiler::VisitSwitchStmt(
const SwitchStmt *S) {
285 VisitDecl(S->getConditionVariable());
288void StmtProfiler::VisitWhileStmt(
const WhileStmt *S) {
290 VisitDecl(S->getConditionVariable());
293void StmtProfiler::VisitDoStmt(
const DoStmt *S) {
297void StmtProfiler::VisitForStmt(
const ForStmt *S) {
301void StmtProfiler::VisitGotoStmt(
const GotoStmt *S) {
303 VisitDecl(S->getLabel());
310void StmtProfiler::VisitContinueStmt(
const ContinueStmt *S) {
314void StmtProfiler::VisitBreakStmt(
const BreakStmt *S) {
318void StmtProfiler::VisitReturnStmt(
const ReturnStmt *S) {
322void StmtProfiler::VisitGCCAsmStmt(
const GCCAsmStmt *S) {
324 ID.AddBoolean(S->isVolatile());
325 ID.AddBoolean(S->isSimple());
326 VisitStringLiteral(S->getAsmString());
327 ID.AddInteger(S->getNumOutputs());
328 for (
unsigned I = 0, N = S->getNumOutputs(); I != N; ++I) {
329 ID.AddString(S->getOutputName(I));
330 VisitStringLiteral(S->getOutputConstraintLiteral(I));
332 ID.AddInteger(S->getNumInputs());
333 for (
unsigned I = 0, N = S->getNumInputs(); I != N; ++I) {
334 ID.AddString(S->getInputName(I));
335 VisitStringLiteral(S->getInputConstraintLiteral(I));
337 ID.AddInteger(S->getNumClobbers());
338 for (
unsigned I = 0, N = S->getNumClobbers(); I != N; ++I)
339 VisitStringLiteral(S->getClobberStringLiteral(I));
340 ID.AddInteger(S->getNumLabels());
341 for (
auto *L : S->labels())
342 VisitDecl(L->getLabel());
345void StmtProfiler::VisitMSAsmStmt(
const MSAsmStmt *S) {
350void StmtProfiler::VisitCXXCatchStmt(
const CXXCatchStmt *S) {
352 VisitType(S->getCaughtType());
355void StmtProfiler::VisitCXXTryStmt(
const CXXTryStmt *S) {
365 ID.AddBoolean(S->isIfExists());
366 VisitNestedNameSpecifier(S->getQualifierLoc().getNestedNameSpecifier());
367 VisitName(S->getNameInfo().getName());
370void StmtProfiler::VisitSEHTryStmt(
const SEHTryStmt *S) {
378void StmtProfiler::VisitSEHExceptStmt(
const SEHExceptStmt *S) {
382void StmtProfiler::VisitSEHLeaveStmt(
const SEHLeaveStmt *S) {
386void StmtProfiler::VisitCapturedStmt(
const CapturedStmt *S) {
396 ID.AddBoolean(S->hasEllipsis());
397 if (S->getCatchParamDecl())
398 VisitType(S->getCatchParamDecl()->getType());
405void StmtProfiler::VisitObjCAtTryStmt(
const ObjCAtTryStmt *S) {
425 StmtProfiler *Profiler;
427 template <
typename T>
428 void VisitOMPClauseList(T *
Node);
431 OMPClauseProfiler(StmtProfiler *
P) : Profiler(
P) { }
432#define GEN_CLANG_CLAUSE_CLASS
433#define CLAUSE_CLASS(Enum, Str, Class) void Visit##Class(const Class *C);
434#include "llvm/Frontend/OpenMP/OMP.inc"
439void OMPClauseProfiler::VistOMPClauseWithPreInit(
441 if (
auto *S =
C->getPreInitStmt())
442 Profiler->VisitStmt(S);
445void OMPClauseProfiler::VistOMPClauseWithPostUpdate(
447 VistOMPClauseWithPreInit(
C);
448 if (
auto *E =
C->getPostUpdateExpr())
449 Profiler->VisitStmt(E);
452void OMPClauseProfiler::VisitOMPIfClause(
const OMPIfClause *
C) {
453 VistOMPClauseWithPreInit(
C);
454 if (
C->getCondition())
455 Profiler->VisitStmt(
C->getCondition());
459 VistOMPClauseWithPreInit(
C);
460 if (
C->getCondition())
461 Profiler->VisitStmt(
C->getCondition());
465 VistOMPClauseWithPreInit(
C);
466 if (
C->getNumThreads())
467 Profiler->VisitStmt(
C->getNumThreads());
471 if (
C->getAlignment())
472 Profiler->VisitStmt(
C->getAlignment());
477 Profiler->VisitStmt(
C->getSafelen());
482 Profiler->VisitStmt(
C->getSimdlen());
486 for (
auto *E :
C->getSizesRefs())
488 Profiler->VisitExpr(E);
491void OMPClauseProfiler::VisitOMPFullClause(
const OMPFullClause *
C) {}
494 if (
const Expr *Factor =
C->getFactor())
495 Profiler->VisitExpr(Factor);
499 if (
C->getAllocator())
500 Profiler->VisitStmt(
C->getAllocator());
504 if (
C->getNumForLoops())
505 Profiler->VisitStmt(
C->getNumForLoops());
509 if (
Expr *Evt =
C->getEventHandler())
510 Profiler->VisitStmt(Evt);
514 VistOMPClauseWithPreInit(
C);
515 if (
C->getCondition())
516 Profiler->VisitStmt(
C->getCondition());
520 VistOMPClauseWithPreInit(
C);
521 if (
C->getCondition())
522 Profiler->VisitStmt(
C->getCondition());
529void OMPClauseProfiler::VisitOMPUnifiedAddressClause(
532void OMPClauseProfiler::VisitOMPUnifiedSharedMemoryClause(
535void OMPClauseProfiler::VisitOMPReverseOffloadClause(
538void OMPClauseProfiler::VisitOMPDynamicAllocatorsClause(
541void OMPClauseProfiler::VisitOMPAtomicDefaultMemOrderClause(
544void OMPClauseProfiler::VisitOMPAtClause(
const OMPAtClause *
C) {}
549 if (
C->getMessageString())
550 Profiler->VisitStmt(
C->getMessageString());
554 VistOMPClauseWithPreInit(
C);
555 if (
auto *S =
C->getChunkSize())
556 Profiler->VisitStmt(S);
560 if (
auto *Num =
C->getNumForLoops())
561 Profiler->VisitStmt(Num);
564void OMPClauseProfiler::VisitOMPNowaitClause(
const OMPNowaitClause *) {}
566void OMPClauseProfiler::VisitOMPUntiedClause(
const OMPUntiedClause *) {}
570void OMPClauseProfiler::VisitOMPReadClause(
const OMPReadClause *) {}
572void OMPClauseProfiler::VisitOMPWriteClause(
const OMPWriteClause *) {}
574void OMPClauseProfiler::VisitOMPUpdateClause(
const OMPUpdateClause *) {}
580void OMPClauseProfiler::VisitOMPSeqCstClause(
const OMPSeqCstClause *) {}
582void OMPClauseProfiler::VisitOMPAcqRelClause(
const OMPAcqRelClause *) {}
592void OMPClauseProfiler::VisitOMPSIMDClause(
const OMPSIMDClause *) {}
596void OMPClauseProfiler::VisitOMPInitClause(
const OMPInitClause *
C) {
597 VisitOMPClauseList(
C);
600void OMPClauseProfiler::VisitOMPUseClause(
const OMPUseClause *
C) {
601 if (
C->getInteropVar())
602 Profiler->VisitStmt(
C->getInteropVar());
606 if (
C->getInteropVar())
607 Profiler->VisitStmt(
C->getInteropVar());
611 VistOMPClauseWithPreInit(
C);
612 if (
C->getThreadID())
613 Profiler->VisitStmt(
C->getThreadID());
617void OMPClauseProfiler::VisitOMPClauseList(T *
Node) {
618 for (
auto *E :
Node->varlists()) {
620 Profiler->VisitStmt(E);
625 VisitOMPClauseList(
C);
626 for (
auto *E :
C->private_copies()) {
628 Profiler->VisitStmt(E);
633 VisitOMPClauseList(
C);
634 VistOMPClauseWithPreInit(
C);
635 for (
auto *E :
C->private_copies()) {
637 Profiler->VisitStmt(E);
639 for (
auto *E :
C->inits()) {
641 Profiler->VisitStmt(E);
646 VisitOMPClauseList(
C);
647 VistOMPClauseWithPostUpdate(
C);
648 for (
auto *E :
C->source_exprs()) {
650 Profiler->VisitStmt(E);
652 for (
auto *E :
C->destination_exprs()) {
654 Profiler->VisitStmt(E);
656 for (
auto *E :
C->assignment_ops()) {
658 Profiler->VisitStmt(E);
662 VisitOMPClauseList(
C);
664void OMPClauseProfiler::VisitOMPReductionClause(
666 Profiler->VisitNestedNameSpecifier(
667 C->getQualifierLoc().getNestedNameSpecifier());
668 Profiler->VisitName(
C->getNameInfo().getName());
669 VisitOMPClauseList(
C);
670 VistOMPClauseWithPostUpdate(
C);
671 for (
auto *E :
C->privates()) {
673 Profiler->VisitStmt(E);
675 for (
auto *E :
C->lhs_exprs()) {
677 Profiler->VisitStmt(E);
679 for (
auto *E :
C->rhs_exprs()) {
681 Profiler->VisitStmt(E);
683 for (
auto *E :
C->reduction_ops()) {
685 Profiler->VisitStmt(E);
687 if (
C->getModifier() == clang::OMPC_REDUCTION_inscan) {
688 for (
auto *E :
C->copy_ops()) {
690 Profiler->VisitStmt(E);
692 for (
auto *E :
C->copy_array_temps()) {
694 Profiler->VisitStmt(E);
696 for (
auto *E :
C->copy_array_elems()) {
698 Profiler->VisitStmt(E);
702void OMPClauseProfiler::VisitOMPTaskReductionClause(
704 Profiler->VisitNestedNameSpecifier(
705 C->getQualifierLoc().getNestedNameSpecifier());
706 Profiler->VisitName(
C->getNameInfo().getName());
707 VisitOMPClauseList(
C);
708 VistOMPClauseWithPostUpdate(
C);
709 for (
auto *E :
C->privates()) {
711 Profiler->VisitStmt(E);
713 for (
auto *E :
C->lhs_exprs()) {
715 Profiler->VisitStmt(E);
717 for (
auto *E :
C->rhs_exprs()) {
719 Profiler->VisitStmt(E);
721 for (
auto *E :
C->reduction_ops()) {
723 Profiler->VisitStmt(E);
726void OMPClauseProfiler::VisitOMPInReductionClause(
728 Profiler->VisitNestedNameSpecifier(
729 C->getQualifierLoc().getNestedNameSpecifier());
730 Profiler->VisitName(
C->getNameInfo().getName());
731 VisitOMPClauseList(
C);
732 VistOMPClauseWithPostUpdate(
C);
733 for (
auto *E :
C->privates()) {
735 Profiler->VisitStmt(E);
737 for (
auto *E :
C->lhs_exprs()) {
739 Profiler->VisitStmt(E);
741 for (
auto *E :
C->rhs_exprs()) {
743 Profiler->VisitStmt(E);
745 for (
auto *E :
C->reduction_ops()) {
747 Profiler->VisitStmt(E);
749 for (
auto *E :
C->taskgroup_descriptors()) {
751 Profiler->VisitStmt(E);
755 VisitOMPClauseList(
C);
756 VistOMPClauseWithPostUpdate(
C);
757 for (
auto *E :
C->privates()) {
759 Profiler->VisitStmt(E);
761 for (
auto *E :
C->inits()) {
763 Profiler->VisitStmt(E);
765 for (
auto *E :
C->updates()) {
767 Profiler->VisitStmt(E);
769 for (
auto *E :
C->finals()) {
771 Profiler->VisitStmt(E);
774 Profiler->VisitStmt(
C->getStep());
775 if (
C->getCalcStep())
776 Profiler->VisitStmt(
C->getCalcStep());
779 VisitOMPClauseList(
C);
780 if (
C->getAlignment())
781 Profiler->VisitStmt(
C->getAlignment());
784 VisitOMPClauseList(
C);
785 for (
auto *E :
C->source_exprs()) {
787 Profiler->VisitStmt(E);
789 for (
auto *E :
C->destination_exprs()) {
791 Profiler->VisitStmt(E);
793 for (
auto *E :
C->assignment_ops()) {
795 Profiler->VisitStmt(E);
800 VisitOMPClauseList(
C);
801 for (
auto *E :
C->source_exprs()) {
803 Profiler->VisitStmt(E);
805 for (
auto *E :
C->destination_exprs()) {
807 Profiler->VisitStmt(E);
809 for (
auto *E :
C->assignment_ops()) {
811 Profiler->VisitStmt(E);
815 VisitOMPClauseList(
C);
818 if (
const Expr *Depobj =
C->getDepobj())
819 Profiler->VisitStmt(Depobj);
822 VisitOMPClauseList(
C);
826 Profiler->VisitStmt(
C->getDevice());
828void OMPClauseProfiler::VisitOMPMapClause(
const OMPMapClause *
C) {
829 VisitOMPClauseList(
C);
832 if (
Expr *Allocator =
C->getAllocator())
833 Profiler->VisitStmt(Allocator);
834 VisitOMPClauseList(
C);
837 VistOMPClauseWithPreInit(
C);
838 if (
C->getNumTeams())
839 Profiler->VisitStmt(
C->getNumTeams());
841void OMPClauseProfiler::VisitOMPThreadLimitClause(
843 VistOMPClauseWithPreInit(
C);
844 if (
C->getThreadLimit())
845 Profiler->VisitStmt(
C->getThreadLimit());
848 VistOMPClauseWithPreInit(
C);
849 if (
C->getPriority())
850 Profiler->VisitStmt(
C->getPriority());
853 VistOMPClauseWithPreInit(
C);
854 if (
C->getGrainsize())
855 Profiler->VisitStmt(
C->getGrainsize());
858 VistOMPClauseWithPreInit(
C);
859 if (
C->getNumTasks())
860 Profiler->VisitStmt(
C->getNumTasks());
862void OMPClauseProfiler::VisitOMPHintClause(
const OMPHintClause *
C) {
864 Profiler->VisitStmt(
C->getHint());
866void OMPClauseProfiler::VisitOMPToClause(
const OMPToClause *
C) {
867 VisitOMPClauseList(
C);
869void OMPClauseProfiler::VisitOMPFromClause(
const OMPFromClause *
C) {
870 VisitOMPClauseList(
C);
872void OMPClauseProfiler::VisitOMPUseDevicePtrClause(
874 VisitOMPClauseList(
C);
876void OMPClauseProfiler::VisitOMPUseDeviceAddrClause(
878 VisitOMPClauseList(
C);
880void OMPClauseProfiler::VisitOMPIsDevicePtrClause(
882 VisitOMPClauseList(
C);
884void OMPClauseProfiler::VisitOMPHasDeviceAddrClause(
886 VisitOMPClauseList(
C);
888void OMPClauseProfiler::VisitOMPNontemporalClause(
890 VisitOMPClauseList(
C);
891 for (
auto *E :
C->private_refs())
892 Profiler->VisitStmt(E);
895 VisitOMPClauseList(
C);
898 VisitOMPClauseList(
C);
900void OMPClauseProfiler::VisitOMPUsesAllocatorsClause(
902 for (
unsigned I = 0, E =
C->getNumberOfAllocators(); I < E; ++I) {
910 if (
const Expr *Modifier =
C->getModifier())
911 Profiler->VisitStmt(Modifier);
912 for (
const Expr *E :
C->varlists())
913 Profiler->VisitStmt(E);
916void OMPClauseProfiler::VisitOMPBindClause(
const OMPBindClause *
C) {}
917void OMPClauseProfiler::VisitOMPXDynCGroupMemClause(
919 VistOMPClauseWithPreInit(
C);
920 if (
Expr *Size =
C->getSize())
921 Profiler->VisitStmt(Size);
928 OMPClauseProfiler
P(
this);
941 VisitOMPExecutableDirective(S);
945 VisitOMPLoopBasedDirective(S);
949 VisitOMPExecutableDirective(S);
953 VisitOMPExecutableDirective(S);
957 VisitOMPLoopDirective(S);
960void StmtProfiler::VisitOMPLoopTransformationDirective(
962 VisitOMPLoopBasedDirective(S);
966 VisitOMPLoopTransformationDirective(S);
970 VisitOMPLoopTransformationDirective(S);
974 VisitOMPLoopDirective(S);
978 VisitOMPLoopDirective(S);
982 VisitOMPExecutableDirective(S);
986 VisitOMPExecutableDirective(S);
990 VisitOMPExecutableDirective(S);
994 VisitOMPExecutableDirective(S);
998 VisitOMPExecutableDirective(S);
999 VisitName(S->getDirectiveName().getName());
1004 VisitOMPLoopDirective(S);
1007void StmtProfiler::VisitOMPParallelForSimdDirective(
1009 VisitOMPLoopDirective(S);
1012void StmtProfiler::VisitOMPParallelMasterDirective(
1014 VisitOMPExecutableDirective(S);
1017void StmtProfiler::VisitOMPParallelMaskedDirective(
1019 VisitOMPExecutableDirective(S);
1022void StmtProfiler::VisitOMPParallelSectionsDirective(
1024 VisitOMPExecutableDirective(S);
1028 VisitOMPExecutableDirective(S);
1032 VisitOMPExecutableDirective(S);
1036 VisitOMPExecutableDirective(S);
1040 VisitOMPExecutableDirective(S);
1044 VisitOMPExecutableDirective(S);
1047 VisitOMPExecutableDirective(S);
1048 if (
const Expr *E = S->getReductionRef())
1053 VisitOMPExecutableDirective(S);
1057 VisitOMPExecutableDirective(S);
1061 VisitOMPExecutableDirective(S);
1065 VisitOMPExecutableDirective(S);
1069 VisitOMPExecutableDirective(S);
1073 VisitOMPExecutableDirective(S);
1077 VisitOMPExecutableDirective(S);
1080void StmtProfiler::VisitOMPTargetEnterDataDirective(
1082 VisitOMPExecutableDirective(S);
1085void StmtProfiler::VisitOMPTargetExitDataDirective(
1087 VisitOMPExecutableDirective(S);
1090void StmtProfiler::VisitOMPTargetParallelDirective(
1092 VisitOMPExecutableDirective(S);
1095void StmtProfiler::VisitOMPTargetParallelForDirective(
1097 VisitOMPExecutableDirective(S);
1101 VisitOMPExecutableDirective(S);
1104void StmtProfiler::VisitOMPCancellationPointDirective(
1106 VisitOMPExecutableDirective(S);
1110 VisitOMPExecutableDirective(S);
1114 VisitOMPLoopDirective(S);
1117void StmtProfiler::VisitOMPTaskLoopSimdDirective(
1119 VisitOMPLoopDirective(S);
1122void StmtProfiler::VisitOMPMasterTaskLoopDirective(
1124 VisitOMPLoopDirective(S);
1127void StmtProfiler::VisitOMPMaskedTaskLoopDirective(
1129 VisitOMPLoopDirective(S);
1132void StmtProfiler::VisitOMPMasterTaskLoopSimdDirective(
1134 VisitOMPLoopDirective(S);
1137void StmtProfiler::VisitOMPMaskedTaskLoopSimdDirective(
1139 VisitOMPLoopDirective(S);
1142void StmtProfiler::VisitOMPParallelMasterTaskLoopDirective(
1144 VisitOMPLoopDirective(S);
1147void StmtProfiler::VisitOMPParallelMaskedTaskLoopDirective(
1149 VisitOMPLoopDirective(S);
1152void StmtProfiler::VisitOMPParallelMasterTaskLoopSimdDirective(
1154 VisitOMPLoopDirective(S);
1157void StmtProfiler::VisitOMPParallelMaskedTaskLoopSimdDirective(
1159 VisitOMPLoopDirective(S);
1162void StmtProfiler::VisitOMPDistributeDirective(
1164 VisitOMPLoopDirective(S);
1167void OMPClauseProfiler::VisitOMPDistScheduleClause(
1169 VistOMPClauseWithPreInit(
C);
1170 if (
auto *S =
C->getChunkSize())
1171 Profiler->VisitStmt(S);
1176void StmtProfiler::VisitOMPTargetUpdateDirective(
1178 VisitOMPExecutableDirective(S);
1181void StmtProfiler::VisitOMPDistributeParallelForDirective(
1183 VisitOMPLoopDirective(S);
1186void StmtProfiler::VisitOMPDistributeParallelForSimdDirective(
1188 VisitOMPLoopDirective(S);
1191void StmtProfiler::VisitOMPDistributeSimdDirective(
1193 VisitOMPLoopDirective(S);
1196void StmtProfiler::VisitOMPTargetParallelForSimdDirective(
1198 VisitOMPLoopDirective(S);
1201void StmtProfiler::VisitOMPTargetSimdDirective(
1203 VisitOMPLoopDirective(S);
1206void StmtProfiler::VisitOMPTeamsDistributeDirective(
1208 VisitOMPLoopDirective(S);
1211void StmtProfiler::VisitOMPTeamsDistributeSimdDirective(
1213 VisitOMPLoopDirective(S);
1216void StmtProfiler::VisitOMPTeamsDistributeParallelForSimdDirective(
1218 VisitOMPLoopDirective(S);
1221void StmtProfiler::VisitOMPTeamsDistributeParallelForDirective(
1223 VisitOMPLoopDirective(S);
1226void StmtProfiler::VisitOMPTargetTeamsDirective(
1228 VisitOMPExecutableDirective(S);
1231void StmtProfiler::VisitOMPTargetTeamsDistributeDirective(
1233 VisitOMPLoopDirective(S);
1236void StmtProfiler::VisitOMPTargetTeamsDistributeParallelForDirective(
1238 VisitOMPLoopDirective(S);
1241void StmtProfiler::VisitOMPTargetTeamsDistributeParallelForSimdDirective(
1243 VisitOMPLoopDirective(S);
1246void StmtProfiler::VisitOMPTargetTeamsDistributeSimdDirective(
1248 VisitOMPLoopDirective(S);
1252 VisitOMPExecutableDirective(S);
1256 VisitOMPExecutableDirective(S);
1260 VisitOMPExecutableDirective(S);
1263void StmtProfiler::VisitOMPGenericLoopDirective(
1265 VisitOMPLoopDirective(S);
1268void StmtProfiler::VisitOMPTeamsGenericLoopDirective(
1270 VisitOMPLoopDirective(S);
1273void StmtProfiler::VisitOMPTargetTeamsGenericLoopDirective(
1275 VisitOMPLoopDirective(S);
1278void StmtProfiler::VisitOMPParallelGenericLoopDirective(
1280 VisitOMPLoopDirective(S);
1283void StmtProfiler::VisitOMPTargetParallelGenericLoopDirective(
1285 VisitOMPLoopDirective(S);
1288void StmtProfiler::VisitExpr(
const Expr *S) {
1292void StmtProfiler::VisitConstantExpr(
const ConstantExpr *S) {
1296void StmtProfiler::VisitDeclRefExpr(
const DeclRefExpr *S) {
1299 VisitNestedNameSpecifier(S->getQualifier());
1300 VisitDecl(S->getDecl());
1302 ID.AddBoolean(S->hasExplicitTemplateArgs());
1303 if (S->hasExplicitTemplateArgs())
1304 VisitTemplateArguments(S->getTemplateArgs(), S->getNumTemplateArgs());
1308void StmtProfiler::VisitSYCLUniqueStableNameExpr(
1311 VisitType(S->getTypeSourceInfo()->getType());
1316 ID.AddInteger(S->getIdentKind());
1321 S->getValue().Profile(ID);
1327 S->getValue().Profile(ID);
1333 ID.AddInteger(S->getKind());
1334 ID.AddInteger(S->getValue());
1339 S->getValue().Profile(ID);
1340 ID.AddBoolean(S->isExact());
1348void StmtProfiler::VisitStringLiteral(
const StringLiteral *S) {
1350 ID.AddString(S->getBytes());
1351 ID.AddInteger(S->getKind());
1354void StmtProfiler::VisitParenExpr(
const ParenExpr *S) {
1358void StmtProfiler::VisitParenListExpr(
const ParenListExpr *S) {
1362void StmtProfiler::VisitUnaryOperator(
const UnaryOperator *S) {
1364 ID.AddInteger(S->getOpcode());
1367void StmtProfiler::VisitOffsetOfExpr(
const OffsetOfExpr *S) {
1368 VisitType(S->getTypeSourceInfo()->getType());
1369 unsigned n = S->getNumComponents();
1370 for (
unsigned i = 0; i < n; ++i) {
1398 ID.AddInteger(S->getKind());
1399 if (S->isArgumentType())
1400 VisitType(S->getArgumentType());
1421 for (
unsigned I = 0, E = S->numOfIterators(); I < E; ++I)
1422 VisitDecl(S->getIteratorDecl(I));
1425void StmtProfiler::VisitCallExpr(
const CallExpr *S) {
1429void StmtProfiler::VisitMemberExpr(
const MemberExpr *S) {
1431 VisitDecl(S->getMemberDecl());
1433 VisitNestedNameSpecifier(S->getQualifier());
1434 ID.AddBoolean(S->isArrow());
1439 ID.AddBoolean(S->isFileScope());
1442void StmtProfiler::VisitCastExpr(
const CastExpr *S) {
1448 ID.AddInteger(S->getValueKind());
1453 VisitType(S->getTypeAsWritten());
1457 VisitExplicitCastExpr(S);
1462 ID.AddInteger(S->getOpcode());
1467 VisitBinaryOperator(S);
1474void StmtProfiler::VisitBinaryConditionalOperator(
1479void StmtProfiler::VisitAddrLabelExpr(
const AddrLabelExpr *S) {
1481 VisitDecl(S->getLabel());
1484void StmtProfiler::VisitStmtExpr(
const StmtExpr *S) {
1496void StmtProfiler::VisitChooseExpr(
const ChooseExpr *S) {
1500void StmtProfiler::VisitGNUNullExpr(
const GNUNullExpr *S) {
1504void StmtProfiler::VisitVAArgExpr(
const VAArgExpr *S) {
1508void StmtProfiler::VisitInitListExpr(
const InitListExpr *S) {
1509 if (S->getSyntacticForm()) {
1510 VisitInitListExpr(S->getSyntacticForm());
1519 ID.AddBoolean(S->usesGNUSyntax());
1521 if (D.isFieldDesignator()) {
1523 VisitName(D.getFieldName());
1527 if (D.isArrayDesignator()) {
1530 assert(D.isArrayRangeDesignator());
1533 ID.AddInteger(D.getArrayIndex());
1539void StmtProfiler::VisitDesignatedInitUpdateExpr(
1541 llvm_unreachable(
"Unexpected DesignatedInitUpdateExpr in syntactic form of "
1553void StmtProfiler::VisitNoInitExpr(
const NoInitExpr *S) {
1554 llvm_unreachable(
"Unexpected NoInitExpr in syntactic form of initializer");
1563 VisitName(&S->getAccessor());
1566void StmtProfiler::VisitBlockExpr(
const BlockExpr *S) {
1568 VisitDecl(S->getBlockDecl());
1574 S->associations()) {
1577 ID.AddPointer(
nullptr);
1580 VisitExpr(Assoc.getAssociationExpr());
1587 i = S->semantics_begin(), e = S->semantics_end(); i != e; ++i)
1590 Visit(OVE->getSourceExpr());
1593void StmtProfiler::VisitAtomicExpr(
const AtomicExpr *S) {
1595 ID.AddInteger(S->getOp());
1598void StmtProfiler::VisitConceptSpecializationExpr(
1601 VisitDecl(S->getNamedConcept());
1603 VisitTemplateArgument(Arg);
1606void StmtProfiler::VisitRequiresExpr(
const RequiresExpr *S) {
1608 ID.AddInteger(S->getLocalParameters().size());
1609 for (
ParmVarDecl *LocalParam : S->getLocalParameters())
1610 VisitDecl(LocalParam);
1611 ID.AddInteger(S->getRequirements().size());
1613 if (
auto *TypeReq = dyn_cast<concepts::TypeRequirement>(Req)) {
1615 ID.AddBoolean(TypeReq->isSubstitutionFailure());
1616 if (!TypeReq->isSubstitutionFailure())
1617 VisitType(TypeReq->getType()->getType());
1618 }
else if (
auto *ExprReq = dyn_cast<concepts::ExprRequirement>(Req)) {
1620 ID.AddBoolean(ExprReq->isExprSubstitutionFailure());
1621 if (!ExprReq->isExprSubstitutionFailure())
1622 Visit(ExprReq->getExpr());
1627 ID.AddBoolean(ExprReq->getNoexceptLoc().isValid());
1629 ExprReq->getReturnTypeRequirement();
1641 auto *NestedReq = cast<concepts::NestedRequirement>(Req);
1642 ID.AddBoolean(NestedReq->hasInvalidConstraint());
1643 if (!NestedReq->hasInvalidConstraint())
1644 Visit(NestedReq->getConstraintExpr());
1652 switch (S->getOperator()) {
1657 case OO_Array_Delete:
1659 case OO_Conditional:
1661 llvm_unreachable(
"Invalid operator call kind");
1664 if (S->getNumArgs() == 1) {
1666 return Stmt::UnaryOperatorClass;
1670 return Stmt::BinaryOperatorClass;
1673 if (S->getNumArgs() == 1) {
1675 return Stmt::UnaryOperatorClass;
1679 return Stmt::BinaryOperatorClass;
1682 if (S->getNumArgs() == 1) {
1684 return Stmt::UnaryOperatorClass;
1688 return Stmt::BinaryOperatorClass;
1692 return Stmt::BinaryOperatorClass;
1696 return Stmt::BinaryOperatorClass;
1700 return Stmt::BinaryOperatorClass;
1703 if (S->getNumArgs() == 1) {
1704 UnaryOp = UO_AddrOf;
1705 return Stmt::UnaryOperatorClass;
1709 return Stmt::BinaryOperatorClass;
1713 return Stmt::BinaryOperatorClass;
1717 return Stmt::UnaryOperatorClass;
1721 return Stmt::UnaryOperatorClass;
1724 BinaryOp = BO_Assign;
1725 return Stmt::BinaryOperatorClass;
1729 return Stmt::BinaryOperatorClass;
1733 return Stmt::BinaryOperatorClass;
1736 BinaryOp = BO_AddAssign;
1737 return Stmt::CompoundAssignOperatorClass;
1740 BinaryOp = BO_SubAssign;
1741 return Stmt::CompoundAssignOperatorClass;
1744 BinaryOp = BO_MulAssign;
1745 return Stmt::CompoundAssignOperatorClass;
1748 BinaryOp = BO_DivAssign;
1749 return Stmt::CompoundAssignOperatorClass;
1751 case OO_PercentEqual:
1752 BinaryOp = BO_RemAssign;
1753 return Stmt::CompoundAssignOperatorClass;
1756 BinaryOp = BO_XorAssign;
1757 return Stmt::CompoundAssignOperatorClass;
1760 BinaryOp = BO_AndAssign;
1761 return Stmt::CompoundAssignOperatorClass;
1764 BinaryOp = BO_OrAssign;
1765 return Stmt::CompoundAssignOperatorClass;
1769 return Stmt::BinaryOperatorClass;
1771 case OO_GreaterGreater:
1773 return Stmt::BinaryOperatorClass;
1775 case OO_LessLessEqual:
1776 BinaryOp = BO_ShlAssign;
1777 return Stmt::CompoundAssignOperatorClass;
1779 case OO_GreaterGreaterEqual:
1780 BinaryOp = BO_ShrAssign;
1781 return Stmt::CompoundAssignOperatorClass;
1785 return Stmt::BinaryOperatorClass;
1787 case OO_ExclaimEqual:
1789 return Stmt::BinaryOperatorClass;
1793 return Stmt::BinaryOperatorClass;
1795 case OO_GreaterEqual:
1797 return Stmt::BinaryOperatorClass;
1801 return Stmt::BinaryOperatorClass;
1805 return Stmt::BinaryOperatorClass;
1809 return Stmt::BinaryOperatorClass;
1812 UnaryOp = S->getNumArgs() == 1? UO_PreInc
1814 return Stmt::UnaryOperatorClass;
1817 UnaryOp = S->getNumArgs() == 1? UO_PreDec
1819 return Stmt::UnaryOperatorClass;
1822 BinaryOp = BO_Comma;
1823 return Stmt::BinaryOperatorClass;
1826 BinaryOp = BO_PtrMemI;
1827 return Stmt::BinaryOperatorClass;
1830 return Stmt::ArraySubscriptExprClass;
1833 return Stmt::CallExprClass;
1836 UnaryOp = UO_Coawait;
1837 return Stmt::UnaryOperatorClass;
1840 llvm_unreachable(
"Invalid overloaded operator expression");
1843#if defined(_MSC_VER) && !defined(__clang__)
1848#pragma optimize("", off)
1853 if (S->isTypeDependent()) {
1859 if (S->getOperator() == OO_Arrow)
1860 return Visit(S->getArg(0));
1867 for (
unsigned I = 0, N = S->getNumArgs(); I != N; ++I)
1868 Visit(S->getArg(I));
1869 if (SC == Stmt::UnaryOperatorClass)
1870 ID.AddInteger(UnaryOp);
1871 else if (SC == Stmt::BinaryOperatorClass ||
1872 SC == Stmt::CompoundAssignOperatorClass)
1873 ID.AddInteger(BinaryOp);
1875 assert(SC == Stmt::ArraySubscriptExprClass || SC == Stmt::CallExprClass);
1881 ID.AddInteger(S->getOperator());
1884void StmtProfiler::VisitCXXRewrittenBinaryOperator(
1888 assert(!S->isTypeDependent() &&
1889 "resolved rewritten operator should never be type-dependent");
1890 ID.AddBoolean(S->isReversed());
1891 VisitExpr(S->getSemanticForm());
1894#if defined(_MSC_VER) && !defined(__clang__)
1896#pragma optimize("", on)
1908void StmtProfiler::VisitAsTypeExpr(
const AsTypeExpr *S) {
1913 VisitExplicitCastExpr(S);
1917 VisitCXXNamedCastExpr(S);
1921 VisitCXXNamedCastExpr(S);
1926 VisitCXXNamedCastExpr(S);
1930 VisitCXXNamedCastExpr(S);
1935 VisitType(S->getTypeInfoAsWritten()->getType());
1939 VisitCXXNamedCastExpr(S);
1948 ID.AddBoolean(S->getValue());
1955void StmtProfiler::VisitCXXStdInitializerListExpr(
1960void StmtProfiler::VisitCXXTypeidExpr(
const CXXTypeidExpr *S) {
1962 if (S->isTypeOperand())
1963 VisitType(S->getTypeOperandSourceInfo()->getType());
1966void StmtProfiler::VisitCXXUuidofExpr(
const CXXUuidofExpr *S) {
1968 if (S->isTypeOperand())
1969 VisitType(S->getTypeOperandSourceInfo()->getType());
1974 VisitDecl(S->getPropertyDecl());
1977void StmtProfiler::VisitMSPropertySubscriptExpr(
1982void StmtProfiler::VisitCXXThisExpr(
const CXXThisExpr *S) {
1984 ID.AddBoolean(S->isImplicit());
1987void StmtProfiler::VisitCXXThrowExpr(
const CXXThrowExpr *S) {
1993 VisitDecl(S->getParam());
1998 VisitDecl(S->getField());
2009 VisitDecl(S->getConstructor());
2010 ID.AddBoolean(S->isElidable());
2013void StmtProfiler::VisitCXXInheritedCtorInitExpr(
2016 VisitDecl(S->getConstructor());
2020 VisitExplicitCastExpr(S);
2025 VisitCXXConstructExpr(S);
2029StmtProfiler::VisitLambdaExpr(
const LambdaExpr *S) {
2033 VisitStmtNoChildren(S);
2037 VisitDecl(S->getLambdaClass());
2045void StmtProfiler::VisitCXXDeleteExpr(
const CXXDeleteExpr *S) {
2047 ID.AddBoolean(S->isGlobalDelete());
2048 ID.AddBoolean(S->isArrayForm());
2049 VisitDecl(S->getOperatorDelete());
2052void StmtProfiler::VisitCXXNewExpr(
const CXXNewExpr *S) {
2054 VisitType(S->getAllocatedType());
2055 VisitDecl(S->getOperatorNew());
2056 VisitDecl(S->getOperatorDelete());
2057 ID.AddBoolean(S->isArray());
2058 ID.AddInteger(S->getNumPlacementArgs());
2059 ID.AddBoolean(S->isGlobalNew());
2060 ID.AddBoolean(S->isParenTypeId());
2061 ID.AddInteger(S->getInitializationStyle());
2067 ID.AddBoolean(S->isArrow());
2068 VisitNestedNameSpecifier(S->getQualifier());
2069 ID.AddBoolean(S->getScopeTypeInfo() !=
nullptr);
2070 if (S->getScopeTypeInfo())
2071 VisitType(S->getScopeTypeInfo()->getType());
2072 ID.AddBoolean(S->getDestroyedTypeInfo() !=
nullptr);
2073 if (S->getDestroyedTypeInfo())
2074 VisitType(S->getDestroyedType());
2076 VisitIdentifierInfo(S->getDestroyedTypeIdentifier());
2079void StmtProfiler::VisitOverloadExpr(
const OverloadExpr *S) {
2081 VisitNestedNameSpecifier(S->getQualifier());
2082 VisitName(S->getName(),
true);
2083 ID.AddBoolean(S->hasExplicitTemplateArgs());
2084 if (S->hasExplicitTemplateArgs())
2085 VisitTemplateArguments(S->getTemplateArgs(), S->getNumTemplateArgs());
2090 VisitOverloadExpr(S);
2093void StmtProfiler::VisitTypeTraitExpr(
const TypeTraitExpr *S) {
2095 ID.AddInteger(S->getTrait());
2096 ID.AddInteger(S->getNumArgs());
2097 for (
unsigned I = 0, N = S->getNumArgs(); I != N; ++I)
2098 VisitType(S->getArg(I)->getType());
2103 ID.AddInteger(S->getTrait());
2104 VisitType(S->getQueriedType());
2109 ID.AddInteger(S->getTrait());
2110 VisitExpr(S->getQueriedExpression());
2113void StmtProfiler::VisitDependentScopeDeclRefExpr(
2116 VisitName(S->getDeclName());
2117 VisitNestedNameSpecifier(S->getQualifier());
2118 ID.AddBoolean(S->hasExplicitTemplateArgs());
2119 if (S->hasExplicitTemplateArgs())
2120 VisitTemplateArguments(S->getTemplateArgs(), S->getNumTemplateArgs());
2127void StmtProfiler::VisitCXXUnresolvedConstructExpr(
2130 VisitType(S->getTypeAsWritten());
2131 ID.AddInteger(S->isListInitialization());
2134void StmtProfiler::VisitCXXDependentScopeMemberExpr(
2136 ID.AddBoolean(S->isImplicitAccess());
2137 if (!S->isImplicitAccess()) {
2139 ID.AddBoolean(S->isArrow());
2141 VisitNestedNameSpecifier(S->getQualifier());
2142 VisitName(S->getMember());
2143 ID.AddBoolean(S->hasExplicitTemplateArgs());
2144 if (S->hasExplicitTemplateArgs())
2145 VisitTemplateArguments(S->getTemplateArgs(), S->getNumTemplateArgs());
2149 ID.AddBoolean(S->isImplicitAccess());
2150 if (!S->isImplicitAccess()) {
2152 ID.AddBoolean(S->isArrow());
2154 VisitNestedNameSpecifier(S->getQualifier());
2155 VisitName(S->getMemberName());
2156 ID.AddBoolean(S->hasExplicitTemplateArgs());
2157 if (S->hasExplicitTemplateArgs())
2158 VisitTemplateArguments(S->getTemplateArgs(), S->getNumTemplateArgs());
2171 VisitDecl(S->getPack());
2172 if (S->isPartiallySubstituted()) {
2173 auto Args = S->getPartialArguments();
2174 ID.AddInteger(Args.size());
2175 for (
const auto &TA : Args)
2176 VisitTemplateArgument(TA);
2182void StmtProfiler::VisitSubstNonTypeTemplateParmPackExpr(
2185 VisitDecl(S->getParameterPack());
2186 VisitTemplateArgument(S->getArgumentPack());
2189void StmtProfiler::VisitSubstNonTypeTemplateParmExpr(
2197 VisitDecl(S->getParameterPack());
2198 ID.AddInteger(S->getNumExpansions());
2203void StmtProfiler::VisitMaterializeTemporaryExpr(
2208void StmtProfiler::VisitCXXFoldExpr(
const CXXFoldExpr *S) {
2210 ID.AddInteger(S->getOperator());
2221void StmtProfiler::VisitCoreturnStmt(
const CoreturnStmt *S) {
2225void StmtProfiler::VisitCoawaitExpr(
const CoawaitExpr *S) {
2233void StmtProfiler::VisitCoyieldExpr(
const CoyieldExpr *S) {
2241void StmtProfiler::VisitTypoExpr(
const TypoExpr *E) {
2245void StmtProfiler::VisitSourceLocExpr(
const SourceLocExpr *E) {
2249void StmtProfiler::VisitRecoveryExpr(
const RecoveryExpr *E) { VisitExpr(E); }
2255void StmtProfiler::VisitObjCBoxedExpr(
const ObjCBoxedExpr *E) {
2269 VisitType(S->getEncodedType());
2274 VisitName(S->getSelector());
2279 VisitDecl(S->getProtocol());
2284 VisitDecl(S->getDecl());
2285 ID.AddBoolean(S->isArrow());
2286 ID.AddBoolean(S->isFreeIvar());
2291 if (S->isImplicitProperty()) {
2292 VisitDecl(S->getImplicitPropertyGetter());
2293 VisitDecl(S->getImplicitPropertySetter());
2295 VisitDecl(S->getExplicitProperty());
2297 if (S->isSuperReceiver()) {
2298 ID.AddBoolean(S->isSuperReceiver());
2299 VisitType(S->getSuperReceiverType());
2305 VisitDecl(S->getAtIndexMethodDecl());
2306 VisitDecl(S->setAtIndexMethodDecl());
2311 VisitName(S->getSelector());
2312 VisitDecl(S->getMethodDecl());
2315void StmtProfiler::VisitObjCIsaExpr(
const ObjCIsaExpr *S) {
2317 ID.AddBoolean(S->isArrow());
2322 ID.AddBoolean(S->getValue());
2325void StmtProfiler::VisitObjCIndirectCopyRestoreExpr(
2328 ID.AddBoolean(S->shouldCopy());
2332 VisitExplicitCastExpr(S);
2333 ID.AddBoolean(S->getBridgeKind());
2336void StmtProfiler::VisitObjCAvailabilityCheckExpr(
2343 ID.AddInteger(NumArgs);
2344 for (
unsigned I = 0; I != NumArgs; ++I)
2385 VisitTemplateArgument(
P);
2391 bool Canonical)
const {
2392 StmtProfilerWithPointers Profiler(ID, Context, Canonical);
2393 Profiler.Visit(
this);
2398 StmtProfilerWithoutPointers Profiler(ID, Hash);
2399 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)
static const TemplateArgument & getArgument(const TemplateArgument &A)
Holds long-lived AST nodes (such as types and decls) that can be referred to throughout the semantic ...
TemplateName getCanonicalTemplateName(const TemplateName &Name) const
Retrieves the "canonical" template name that refers to a given template.
CanQualType getCanonicalType(QualType T) const
Return the canonical (structural) type corresponding to the specified potentially non-canonical type ...
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.
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".
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]).
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 a value-initialized rvalue of type T, which is a non-class type.
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.
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.
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 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.
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 AddTemplateName(TemplateName Name)
void AddQualType(QualType T)
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.
OpenMP 5.0 [2.1.5, Array Sections].
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 'shedule', 'firstprivate' etc.
This represents 'collapse' clause in the '#pragma omp ...' directive.
This represents 'compare' clause in the '#pragma omp atomic' 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 '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 '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 '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.
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 '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 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.
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 section' directive.
This represents '#pragma omp sections' directive.
This represents 'seq_cst' clause in the '#pragma omp atomic' directive.
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 'write' clause in the '#pragma omp atomic' 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.
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 parethesized 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.
bool isNull() const
Return true if this QualType doesn't point to a type yet.
void * getAsOpaquePtr() const
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) 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...
Expr * getReplacement() const
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 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.
@ 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,...
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.
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...
@ OO_None
Not an overloaded operator.
@ NUM_OVERLOADED_OPERATORS
@ C
Languages that the frontend can parse and compile.
Data for list of allocators.
Expr * AllocatorTraits
Allocator traits.
Expr * Allocator
Allocator.