Location via proxy:   [ UP ]  
[Report a bug]   [Manage cookies]                
clang 20.0.0git
StmtProfile.cpp
Go to the documentation of this file.
1//===---- StmtProfile.cpp - Profile implementation for Stmt ASTs ----------===//
2//
3// Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.
4// See https://llvm.org/LICENSE.txt for license information.
5// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception
6//
7//===----------------------------------------------------------------------===//
8//
9// This file implements the Stmt::Profile method, which builds a unique bit
10// representation that identifies a statement/expression.
11//
12//===----------------------------------------------------------------------===//
14#include "clang/AST/DeclCXX.h"
15#include "clang/AST/DeclObjC.h"
17#include "clang/AST/Expr.h"
18#include "clang/AST/ExprCXX.h"
19#include "clang/AST/ExprObjC.h"
21#include "clang/AST/ODRHash.h"
24#include "llvm/ADT/FoldingSet.h"
25using namespace clang;
26
27namespace {
28 class StmtProfiler : public ConstStmtVisitor<StmtProfiler> {
29 protected:
30 llvm::FoldingSetNodeID &ID;
31 bool Canonical;
32 bool ProfileLambdaExpr;
33
34 public:
35 StmtProfiler(llvm::FoldingSetNodeID &ID, bool Canonical,
36 bool ProfileLambdaExpr)
37 : ID(ID), Canonical(Canonical), ProfileLambdaExpr(ProfileLambdaExpr) {}
38
39 virtual ~StmtProfiler() {}
40
41 void VisitStmt(const Stmt *S);
42
43 void VisitStmtNoChildren(const Stmt *S) {
44 HandleStmtClass(S->getStmtClass());
45 }
46
47 virtual void HandleStmtClass(Stmt::StmtClass SC) = 0;
48
49#define STMT(Node, Base) void Visit##Node(const Node *S);
50#include "clang/AST/StmtNodes.inc"
51
52 /// Visit a declaration that is referenced within an expression
53 /// or statement.
54 virtual void VisitDecl(const Decl *D) = 0;
55
56 /// Visit a type that is referenced within an expression or
57 /// statement.
58 virtual void VisitType(QualType T) = 0;
59
60 /// Visit a name that occurs within an expression or statement.
61 virtual void VisitName(DeclarationName Name, bool TreatAsDecl = false) = 0;
62
63 /// Visit identifiers that are not in Decl's or Type's.
64 virtual void VisitIdentifierInfo(const IdentifierInfo *II) = 0;
65
66 /// Visit a nested-name-specifier that occurs within an expression
67 /// or statement.
68 virtual void VisitNestedNameSpecifier(NestedNameSpecifier *NNS) = 0;
69
70 /// Visit a template name that occurs within an expression or
71 /// statement.
72 virtual void VisitTemplateName(TemplateName Name) = 0;
73
74 /// Visit template arguments that occur within an expression or
75 /// statement.
76 void VisitTemplateArguments(const TemplateArgumentLoc *Args,
77 unsigned NumArgs);
78
79 /// Visit a single template argument.
80 void VisitTemplateArgument(const TemplateArgument &Arg);
81 };
82
83 class StmtProfilerWithPointers : public StmtProfiler {
84 const ASTContext &Context;
85
86 public:
87 StmtProfilerWithPointers(llvm::FoldingSetNodeID &ID,
88 const ASTContext &Context, bool Canonical,
89 bool ProfileLambdaExpr)
90 : StmtProfiler(ID, Canonical, ProfileLambdaExpr), Context(Context) {}
91
92 private:
93 void HandleStmtClass(Stmt::StmtClass SC) override {
94 ID.AddInteger(SC);
95 }
96
97 void VisitDecl(const Decl *D) override {
98 ID.AddInteger(D ? D->getKind() : 0);
99
100 if (Canonical && D) {
101 if (const NonTypeTemplateParmDecl *NTTP =
102 dyn_cast<NonTypeTemplateParmDecl>(D)) {
103 ID.AddInteger(NTTP->getDepth());
104 ID.AddInteger(NTTP->getIndex());
105 ID.AddBoolean(NTTP->isParameterPack());
106 // C++20 [temp.over.link]p6:
107 // Two template-parameters are equivalent under the following
108 // conditions: [...] if they declare non-type template parameters,
109 // they have equivalent types ignoring the use of type-constraints
110 // for placeholder types
111 //
112 // TODO: Why do we need to include the type in the profile? It's not
113 // part of the mangling.
114 VisitType(Context.getUnconstrainedType(NTTP->getType()));
115 return;
116 }
117
118 if (const ParmVarDecl *Parm = dyn_cast<ParmVarDecl>(D)) {
119 // The Itanium C++ ABI uses the type, scope depth, and scope
120 // index of a parameter when mangling expressions that involve
121 // function parameters, so we will use the parameter's type for
122 // establishing function parameter identity. That way, our
123 // definition of "equivalent" (per C++ [temp.over.link]) is at
124 // least as strong as the definition of "equivalent" used for
125 // name mangling.
126 //
127 // TODO: The Itanium C++ ABI only uses the top-level cv-qualifiers,
128 // not the entirety of the type.
129 VisitType(Parm->getType());
130 ID.AddInteger(Parm->getFunctionScopeDepth());
131 ID.AddInteger(Parm->getFunctionScopeIndex());
132 return;
133 }
134
135 if (const TemplateTypeParmDecl *TTP =
136 dyn_cast<TemplateTypeParmDecl>(D)) {
137 ID.AddInteger(TTP->getDepth());
138 ID.AddInteger(TTP->getIndex());
139 ID.AddBoolean(TTP->isParameterPack());
140 return;
141 }
142
143 if (const TemplateTemplateParmDecl *TTP =
144 dyn_cast<TemplateTemplateParmDecl>(D)) {
145 ID.AddInteger(TTP->getDepth());
146 ID.AddInteger(TTP->getIndex());
147 ID.AddBoolean(TTP->isParameterPack());
148 return;
149 }
150 }
151
152 ID.AddPointer(D ? D->getCanonicalDecl() : nullptr);
153 }
154
155 void VisitType(QualType T) override {
156 if (Canonical && !T.isNull())
157 T = Context.getCanonicalType(T);
158
159 ID.AddPointer(T.getAsOpaquePtr());
160 }
161
162 void VisitName(DeclarationName Name, bool /*TreatAsDecl*/) override {
163 ID.AddPointer(Name.getAsOpaquePtr());
164 }
165
166 void VisitIdentifierInfo(const IdentifierInfo *II) override {
167 ID.AddPointer(II);
168 }
169
170 void VisitNestedNameSpecifier(NestedNameSpecifier *NNS) override {
171 if (Canonical)
172 NNS = Context.getCanonicalNestedNameSpecifier(NNS);
173 ID.AddPointer(NNS);
174 }
175
176 void VisitTemplateName(TemplateName Name) override {
177 if (Canonical)
178 Name = Context.getCanonicalTemplateName(Name);
179
180 Name.Profile(ID);
181 }
182 };
183
184 class StmtProfilerWithoutPointers : public StmtProfiler {
185 ODRHash &Hash;
186 public:
187 StmtProfilerWithoutPointers(llvm::FoldingSetNodeID &ID, ODRHash &Hash)
188 : StmtProfiler(ID, /*Canonical=*/false, /*ProfileLambdaExpr=*/false),
189 Hash(Hash) {}
190
191 private:
192 void HandleStmtClass(Stmt::StmtClass SC) override {
193 if (SC == Stmt::UnresolvedLookupExprClass) {
194 // Pretend that the name looked up is a Decl due to how templates
195 // handle some Decl lookups.
196 ID.AddInteger(Stmt::DeclRefExprClass);
197 } else {
198 ID.AddInteger(SC);
199 }
200 }
201
202 void VisitType(QualType T) override {
203 Hash.AddQualType(T);
204 }
205
206 void VisitName(DeclarationName Name, bool TreatAsDecl) override {
207 if (TreatAsDecl) {
208 // A Decl can be null, so each Decl is preceded by a boolean to
209 // store its nullness. Add a boolean here to match.
210 ID.AddBoolean(true);
211 }
212 Hash.AddDeclarationName(Name, TreatAsDecl);
213 }
214 void VisitIdentifierInfo(const IdentifierInfo *II) override {
215 ID.AddBoolean(II);
216 if (II) {
217 Hash.AddIdentifierInfo(II);
218 }
219 }
220 void VisitDecl(const Decl *D) override {
221 ID.AddBoolean(D);
222 if (D) {
223 Hash.AddDecl(D);
224 }
225 }
226 void VisitTemplateName(TemplateName Name) override {
227 Hash.AddTemplateName(Name);
228 }
229 void VisitNestedNameSpecifier(NestedNameSpecifier *NNS) override {
230 ID.AddBoolean(NNS);
231 if (NNS) {
232 Hash.AddNestedNameSpecifier(NNS);
233 }
234 }
235 };
236}
237
238void StmtProfiler::VisitStmt(const Stmt *S) {
239 assert(S && "Requires non-null Stmt pointer");
240
241 VisitStmtNoChildren(S);
242
243 for (const Stmt *SubStmt : S->children()) {
244 if (SubStmt)
245 Visit(SubStmt);
246 else
247 ID.AddInteger(0);
248 }
249}
250
251void StmtProfiler::VisitDeclStmt(const DeclStmt *S) {
252 VisitStmt(S);
253 for (const auto *D : S->decls())
254 VisitDecl(D);
255}
256
257void StmtProfiler::VisitNullStmt(const NullStmt *S) {
258 VisitStmt(S);
259}
260
261void StmtProfiler::VisitCompoundStmt(const CompoundStmt *S) {
262 VisitStmt(S);
263}
264
265void StmtProfiler::VisitCaseStmt(const CaseStmt *S) {
266 VisitStmt(S);
267}
268
269void StmtProfiler::VisitDefaultStmt(const DefaultStmt *S) {
270 VisitStmt(S);
271}
272
273void StmtProfiler::VisitLabelStmt(const LabelStmt *S) {
274 VisitStmt(S);
275 VisitDecl(S->getDecl());
276}
277
278void StmtProfiler::VisitAttributedStmt(const AttributedStmt *S) {
279 VisitStmt(S);
280 // TODO: maybe visit attributes?
281}
282
283void StmtProfiler::VisitIfStmt(const IfStmt *S) {
284 VisitStmt(S);
285 VisitDecl(S->getConditionVariable());
286}
287
288void StmtProfiler::VisitSwitchStmt(const SwitchStmt *S) {
289 VisitStmt(S);
290 VisitDecl(S->getConditionVariable());
291}
292
293void StmtProfiler::VisitWhileStmt(const WhileStmt *S) {
294 VisitStmt(S);
295 VisitDecl(S->getConditionVariable());
296}
297
298void StmtProfiler::VisitDoStmt(const DoStmt *S) {
299 VisitStmt(S);
300}
301
302void StmtProfiler::VisitForStmt(const ForStmt *S) {
303 VisitStmt(S);
304}
305
306void StmtProfiler::VisitGotoStmt(const GotoStmt *S) {
307 VisitStmt(S);
308 VisitDecl(S->getLabel());
309}
310
311void StmtProfiler::VisitIndirectGotoStmt(const IndirectGotoStmt *S) {
312 VisitStmt(S);
313}
314
315void StmtProfiler::VisitContinueStmt(const ContinueStmt *S) {
316 VisitStmt(S);
317}
318
319void StmtProfiler::VisitBreakStmt(const BreakStmt *S) {
320 VisitStmt(S);
321}
322
323void StmtProfiler::VisitReturnStmt(const ReturnStmt *S) {
324 VisitStmt(S);
325}
326
327void StmtProfiler::VisitGCCAsmStmt(const GCCAsmStmt *S) {
328 VisitStmt(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));
336 }
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));
341 }
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());
348}
349
350void StmtProfiler::VisitMSAsmStmt(const MSAsmStmt *S) {
351 // FIXME: Implement MS style inline asm statement profiler.
352 VisitStmt(S);
353}
354
355void StmtProfiler::VisitCXXCatchStmt(const CXXCatchStmt *S) {
356 VisitStmt(S);
357 VisitType(S->getCaughtType());
358}
359
360void StmtProfiler::VisitCXXTryStmt(const CXXTryStmt *S) {
361 VisitStmt(S);
362}
363
364void StmtProfiler::VisitCXXForRangeStmt(const CXXForRangeStmt *S) {
365 VisitStmt(S);
366}
367
368void StmtProfiler::VisitMSDependentExistsStmt(const MSDependentExistsStmt *S) {
369 VisitStmt(S);
370 ID.AddBoolean(S->isIfExists());
371 VisitNestedNameSpecifier(S->getQualifierLoc().getNestedNameSpecifier());
372 VisitName(S->getNameInfo().getName());
373}
374
375void StmtProfiler::VisitSEHTryStmt(const SEHTryStmt *S) {
376 VisitStmt(S);
377}
378
379void StmtProfiler::VisitSEHFinallyStmt(const SEHFinallyStmt *S) {
380 VisitStmt(S);
381}
382
383void StmtProfiler::VisitSEHExceptStmt(const SEHExceptStmt *S) {
384 VisitStmt(S);
385}
386
387void StmtProfiler::VisitSEHLeaveStmt(const SEHLeaveStmt *S) {
388 VisitStmt(S);
389}
390
391void StmtProfiler::VisitCapturedStmt(const CapturedStmt *S) {
392 VisitStmt(S);
393}
394
395void StmtProfiler::VisitSYCLKernelCallStmt(const SYCLKernelCallStmt *S) {
396 VisitStmt(S);
397}
398
399void StmtProfiler::VisitObjCForCollectionStmt(const ObjCForCollectionStmt *S) {
400 VisitStmt(S);
401}
402
403void StmtProfiler::VisitObjCAtCatchStmt(const ObjCAtCatchStmt *S) {
404 VisitStmt(S);
405 ID.AddBoolean(S->hasEllipsis());
406 if (S->getCatchParamDecl())
407 VisitType(S->getCatchParamDecl()->getType());
408}
409
410void StmtProfiler::VisitObjCAtFinallyStmt(const ObjCAtFinallyStmt *S) {
411 VisitStmt(S);
412}
413
414void StmtProfiler::VisitObjCAtTryStmt(const ObjCAtTryStmt *S) {
415 VisitStmt(S);
416}
417
418void
419StmtProfiler::VisitObjCAtSynchronizedStmt(const ObjCAtSynchronizedStmt *S) {
420 VisitStmt(S);
421}
422
423void StmtProfiler::VisitObjCAtThrowStmt(const ObjCAtThrowStmt *S) {
424 VisitStmt(S);
425}
426
427void
428StmtProfiler::VisitObjCAutoreleasePoolStmt(const ObjCAutoreleasePoolStmt *S) {
429 VisitStmt(S);
430}
431
432namespace {
433class OMPClauseProfiler : public ConstOMPClauseVisitor<OMPClauseProfiler> {
434 StmtProfiler *Profiler;
435 /// Process clauses with list of variables.
436 template <typename T>
437 void VisitOMPClauseList(T *Node);
438
439public:
440 OMPClauseProfiler(StmtProfiler *P) : Profiler(P) { }
441#define GEN_CLANG_CLAUSE_CLASS
442#define CLAUSE_CLASS(Enum, Str, Class) void Visit##Class(const Class *C);
443#include "llvm/Frontend/OpenMP/OMP.inc"
444 void VistOMPClauseWithPreInit(const OMPClauseWithPreInit *C);
445 void VistOMPClauseWithPostUpdate(const OMPClauseWithPostUpdate *C);
446};
447
448void OMPClauseProfiler::VistOMPClauseWithPreInit(
449 const OMPClauseWithPreInit *C) {
450 if (auto *S = C->getPreInitStmt())
451 Profiler->VisitStmt(S);
452}
453
454void OMPClauseProfiler::VistOMPClauseWithPostUpdate(
455 const OMPClauseWithPostUpdate *C) {
456 VistOMPClauseWithPreInit(C);
457 if (auto *E = C->getPostUpdateExpr())
458 Profiler->VisitStmt(E);
459}
460
461void OMPClauseProfiler::VisitOMPIfClause(const OMPIfClause *C) {
462 VistOMPClauseWithPreInit(C);
463 if (C->getCondition())
464 Profiler->VisitStmt(C->getCondition());
465}
466
467void OMPClauseProfiler::VisitOMPFinalClause(const OMPFinalClause *C) {
468 VistOMPClauseWithPreInit(C);
469 if (C->getCondition())
470 Profiler->VisitStmt(C->getCondition());
471}
472
473void OMPClauseProfiler::VisitOMPNumThreadsClause(const OMPNumThreadsClause *C) {
474 VistOMPClauseWithPreInit(C);
475 if (C->getNumThreads())
476 Profiler->VisitStmt(C->getNumThreads());
477}
478
479void OMPClauseProfiler::VisitOMPAlignClause(const OMPAlignClause *C) {
480 if (C->getAlignment())
481 Profiler->VisitStmt(C->getAlignment());
482}
483
484void OMPClauseProfiler::VisitOMPSafelenClause(const OMPSafelenClause *C) {
485 if (C->getSafelen())
486 Profiler->VisitStmt(C->getSafelen());
487}
488
489void OMPClauseProfiler::VisitOMPSimdlenClause(const OMPSimdlenClause *C) {
490 if (C->getSimdlen())
491 Profiler->VisitStmt(C->getSimdlen());
492}
493
494void OMPClauseProfiler::VisitOMPSizesClause(const OMPSizesClause *C) {
495 for (auto *E : C->getSizesRefs())
496 if (E)
497 Profiler->VisitExpr(E);
498}
499
500void OMPClauseProfiler::VisitOMPPermutationClause(
501 const OMPPermutationClause *C) {
502 for (Expr *E : C->getArgsRefs())
503 if (E)
504 Profiler->VisitExpr(E);
505}
506
507void OMPClauseProfiler::VisitOMPFullClause(const OMPFullClause *C) {}
508
509void OMPClauseProfiler::VisitOMPPartialClause(const OMPPartialClause *C) {
510 if (const Expr *Factor = C->getFactor())
511 Profiler->VisitExpr(Factor);
512}
513
514void OMPClauseProfiler::VisitOMPAllocatorClause(const OMPAllocatorClause *C) {
515 if (C->getAllocator())
516 Profiler->VisitStmt(C->getAllocator());
517}
518
519void OMPClauseProfiler::VisitOMPCollapseClause(const OMPCollapseClause *C) {
520 if (C->getNumForLoops())
521 Profiler->VisitStmt(C->getNumForLoops());
522}
523
524void OMPClauseProfiler::VisitOMPDetachClause(const OMPDetachClause *C) {
525 if (Expr *Evt = C->getEventHandler())
526 Profiler->VisitStmt(Evt);
527}
528
529void OMPClauseProfiler::VisitOMPNovariantsClause(const OMPNovariantsClause *C) {
530 VistOMPClauseWithPreInit(C);
531 if (C->getCondition())
532 Profiler->VisitStmt(C->getCondition());
533}
534
535void OMPClauseProfiler::VisitOMPNocontextClause(const OMPNocontextClause *C) {
536 VistOMPClauseWithPreInit(C);
537 if (C->getCondition())
538 Profiler->VisitStmt(C->getCondition());
539}
540
541void OMPClauseProfiler::VisitOMPDefaultClause(const OMPDefaultClause *C) { }
542
543void OMPClauseProfiler::VisitOMPProcBindClause(const OMPProcBindClause *C) { }
544
545void OMPClauseProfiler::VisitOMPUnifiedAddressClause(
546 const OMPUnifiedAddressClause *C) {}
547
548void OMPClauseProfiler::VisitOMPUnifiedSharedMemoryClause(
550
551void OMPClauseProfiler::VisitOMPReverseOffloadClause(
552 const OMPReverseOffloadClause *C) {}
553
554void OMPClauseProfiler::VisitOMPDynamicAllocatorsClause(
556
557void OMPClauseProfiler::VisitOMPAtomicDefaultMemOrderClause(
559
560void OMPClauseProfiler::VisitOMPAtClause(const OMPAtClause *C) {}
561
562void OMPClauseProfiler::VisitOMPSeverityClause(const OMPSeverityClause *C) {}
563
564void OMPClauseProfiler::VisitOMPMessageClause(const OMPMessageClause *C) {
565 if (C->getMessageString())
566 Profiler->VisitStmt(C->getMessageString());
567}
568
569void OMPClauseProfiler::VisitOMPScheduleClause(const OMPScheduleClause *C) {
570 VistOMPClauseWithPreInit(C);
571 if (auto *S = C->getChunkSize())
572 Profiler->VisitStmt(S);
573}
574
575void OMPClauseProfiler::VisitOMPOrderedClause(const OMPOrderedClause *C) {
576 if (auto *Num = C->getNumForLoops())
577 Profiler->VisitStmt(Num);
578}
579
580void OMPClauseProfiler::VisitOMPNowaitClause(const OMPNowaitClause *) {}
581
582void OMPClauseProfiler::VisitOMPUntiedClause(const OMPUntiedClause *) {}
583
584void OMPClauseProfiler::VisitOMPMergeableClause(const OMPMergeableClause *) {}
585
586void OMPClauseProfiler::VisitOMPReadClause(const OMPReadClause *) {}
587
588void OMPClauseProfiler::VisitOMPWriteClause(const OMPWriteClause *) {}
589
590void OMPClauseProfiler::VisitOMPUpdateClause(const OMPUpdateClause *) {}
591
592void OMPClauseProfiler::VisitOMPCaptureClause(const OMPCaptureClause *) {}
593
594void OMPClauseProfiler::VisitOMPCompareClause(const OMPCompareClause *) {}
595
596void OMPClauseProfiler::VisitOMPFailClause(const OMPFailClause *) {}
597
598void OMPClauseProfiler::VisitOMPAbsentClause(const OMPAbsentClause *) {}
599
600void OMPClauseProfiler::VisitOMPHoldsClause(const OMPHoldsClause *) {}
601
602void OMPClauseProfiler::VisitOMPContainsClause(const OMPContainsClause *) {}
603
604void OMPClauseProfiler::VisitOMPNoOpenMPClause(const OMPNoOpenMPClause *) {}
605
606void OMPClauseProfiler::VisitOMPNoOpenMPRoutinesClause(
607 const OMPNoOpenMPRoutinesClause *) {}
608
609void OMPClauseProfiler::VisitOMPNoParallelismClause(
610 const OMPNoParallelismClause *) {}
611
612void OMPClauseProfiler::VisitOMPSeqCstClause(const OMPSeqCstClause *) {}
613
614void OMPClauseProfiler::VisitOMPAcqRelClause(const OMPAcqRelClause *) {}
615
616void OMPClauseProfiler::VisitOMPAcquireClause(const OMPAcquireClause *) {}
617
618void OMPClauseProfiler::VisitOMPReleaseClause(const OMPReleaseClause *) {}
619
620void OMPClauseProfiler::VisitOMPRelaxedClause(const OMPRelaxedClause *) {}
621
622void OMPClauseProfiler::VisitOMPWeakClause(const OMPWeakClause *) {}
623
624void OMPClauseProfiler::VisitOMPThreadsClause(const OMPThreadsClause *) {}
625
626void OMPClauseProfiler::VisitOMPSIMDClause(const OMPSIMDClause *) {}
627
628void OMPClauseProfiler::VisitOMPNogroupClause(const OMPNogroupClause *) {}
629
630void OMPClauseProfiler::VisitOMPInitClause(const OMPInitClause *C) {
631 VisitOMPClauseList(C);
632}
633
634void OMPClauseProfiler::VisitOMPUseClause(const OMPUseClause *C) {
635 if (C->getInteropVar())
636 Profiler->VisitStmt(C->getInteropVar());
637}
638
639void OMPClauseProfiler::VisitOMPDestroyClause(const OMPDestroyClause *C) {
640 if (C->getInteropVar())
641 Profiler->VisitStmt(C->getInteropVar());
642}
643
644void OMPClauseProfiler::VisitOMPFilterClause(const OMPFilterClause *C) {
645 VistOMPClauseWithPreInit(C);
646 if (C->getThreadID())
647 Profiler->VisitStmt(C->getThreadID());
648}
649
650template<typename T>
651void OMPClauseProfiler::VisitOMPClauseList(T *Node) {
652 for (auto *E : Node->varlist()) {
653 if (E)
654 Profiler->VisitStmt(E);
655 }
656}
657
658void OMPClauseProfiler::VisitOMPPrivateClause(const OMPPrivateClause *C) {
659 VisitOMPClauseList(C);
660 for (auto *E : C->private_copies()) {
661 if (E)
662 Profiler->VisitStmt(E);
663 }
664}
665void
666OMPClauseProfiler::VisitOMPFirstprivateClause(const OMPFirstprivateClause *C) {
667 VisitOMPClauseList(C);
668 VistOMPClauseWithPreInit(C);
669 for (auto *E : C->private_copies()) {
670 if (E)
671 Profiler->VisitStmt(E);
672 }
673 for (auto *E : C->inits()) {
674 if (E)
675 Profiler->VisitStmt(E);
676 }
677}
678void
679OMPClauseProfiler::VisitOMPLastprivateClause(const OMPLastprivateClause *C) {
680 VisitOMPClauseList(C);
681 VistOMPClauseWithPostUpdate(C);
682 for (auto *E : C->source_exprs()) {
683 if (E)
684 Profiler->VisitStmt(E);
685 }
686 for (auto *E : C->destination_exprs()) {
687 if (E)
688 Profiler->VisitStmt(E);
689 }
690 for (auto *E : C->assignment_ops()) {
691 if (E)
692 Profiler->VisitStmt(E);
693 }
694}
695void OMPClauseProfiler::VisitOMPSharedClause(const OMPSharedClause *C) {
696 VisitOMPClauseList(C);
697}
698void OMPClauseProfiler::VisitOMPReductionClause(
699 const OMPReductionClause *C) {
700 Profiler->VisitNestedNameSpecifier(
701 C->getQualifierLoc().getNestedNameSpecifier());
702 Profiler->VisitName(C->getNameInfo().getName());
703 VisitOMPClauseList(C);
704 VistOMPClauseWithPostUpdate(C);
705 for (auto *E : C->privates()) {
706 if (E)
707 Profiler->VisitStmt(E);
708 }
709 for (auto *E : C->lhs_exprs()) {
710 if (E)
711 Profiler->VisitStmt(E);
712 }
713 for (auto *E : C->rhs_exprs()) {
714 if (E)
715 Profiler->VisitStmt(E);
716 }
717 for (auto *E : C->reduction_ops()) {
718 if (E)
719 Profiler->VisitStmt(E);
720 }
721 if (C->getModifier() == clang::OMPC_REDUCTION_inscan) {
722 for (auto *E : C->copy_ops()) {
723 if (E)
724 Profiler->VisitStmt(E);
725 }
726 for (auto *E : C->copy_array_temps()) {
727 if (E)
728 Profiler->VisitStmt(E);
729 }
730 for (auto *E : C->copy_array_elems()) {
731 if (E)
732 Profiler->VisitStmt(E);
733 }
734 }
735}
736void OMPClauseProfiler::VisitOMPTaskReductionClause(
737 const OMPTaskReductionClause *C) {
738 Profiler->VisitNestedNameSpecifier(
739 C->getQualifierLoc().getNestedNameSpecifier());
740 Profiler->VisitName(C->getNameInfo().getName());
741 VisitOMPClauseList(C);
742 VistOMPClauseWithPostUpdate(C);
743 for (auto *E : C->privates()) {
744 if (E)
745 Profiler->VisitStmt(E);
746 }
747 for (auto *E : C->lhs_exprs()) {
748 if (E)
749 Profiler->VisitStmt(E);
750 }
751 for (auto *E : C->rhs_exprs()) {
752 if (E)
753 Profiler->VisitStmt(E);
754 }
755 for (auto *E : C->reduction_ops()) {
756 if (E)
757 Profiler->VisitStmt(E);
758 }
759}
760void OMPClauseProfiler::VisitOMPInReductionClause(
761 const OMPInReductionClause *C) {
762 Profiler->VisitNestedNameSpecifier(
763 C->getQualifierLoc().getNestedNameSpecifier());
764 Profiler->VisitName(C->getNameInfo().getName());
765 VisitOMPClauseList(C);
766 VistOMPClauseWithPostUpdate(C);
767 for (auto *E : C->privates()) {
768 if (E)
769 Profiler->VisitStmt(E);
770 }
771 for (auto *E : C->lhs_exprs()) {
772 if (E)
773 Profiler->VisitStmt(E);
774 }
775 for (auto *E : C->rhs_exprs()) {
776 if (E)
777 Profiler->VisitStmt(E);
778 }
779 for (auto *E : C->reduction_ops()) {
780 if (E)
781 Profiler->VisitStmt(E);
782 }
783 for (auto *E : C->taskgroup_descriptors()) {
784 if (E)
785 Profiler->VisitStmt(E);
786 }
787}
788void OMPClauseProfiler::VisitOMPLinearClause(const OMPLinearClause *C) {
789 VisitOMPClauseList(C);
790 VistOMPClauseWithPostUpdate(C);
791 for (auto *E : C->privates()) {
792 if (E)
793 Profiler->VisitStmt(E);
794 }
795 for (auto *E : C->inits()) {
796 if (E)
797 Profiler->VisitStmt(E);
798 }
799 for (auto *E : C->updates()) {
800 if (E)
801 Profiler->VisitStmt(E);
802 }
803 for (auto *E : C->finals()) {
804 if (E)
805 Profiler->VisitStmt(E);
806 }
807 if (C->getStep())
808 Profiler->VisitStmt(C->getStep());
809 if (C->getCalcStep())
810 Profiler->VisitStmt(C->getCalcStep());
811}
812void OMPClauseProfiler::VisitOMPAlignedClause(const OMPAlignedClause *C) {
813 VisitOMPClauseList(C);
814 if (C->getAlignment())
815 Profiler->VisitStmt(C->getAlignment());
816}
817void OMPClauseProfiler::VisitOMPCopyinClause(const OMPCopyinClause *C) {
818 VisitOMPClauseList(C);
819 for (auto *E : C->source_exprs()) {
820 if (E)
821 Profiler->VisitStmt(E);
822 }
823 for (auto *E : C->destination_exprs()) {
824 if (E)
825 Profiler->VisitStmt(E);
826 }
827 for (auto *E : C->assignment_ops()) {
828 if (E)
829 Profiler->VisitStmt(E);
830 }
831}
832void
833OMPClauseProfiler::VisitOMPCopyprivateClause(const OMPCopyprivateClause *C) {
834 VisitOMPClauseList(C);
835 for (auto *E : C->source_exprs()) {
836 if (E)
837 Profiler->VisitStmt(E);
838 }
839 for (auto *E : C->destination_exprs()) {
840 if (E)
841 Profiler->VisitStmt(E);
842 }
843 for (auto *E : C->assignment_ops()) {
844 if (E)
845 Profiler->VisitStmt(E);
846 }
847}
848void OMPClauseProfiler::VisitOMPFlushClause(const OMPFlushClause *C) {
849 VisitOMPClauseList(C);
850}
851void OMPClauseProfiler::VisitOMPDepobjClause(const OMPDepobjClause *C) {
852 if (const Expr *Depobj = C->getDepobj())
853 Profiler->VisitStmt(Depobj);
854}
855void OMPClauseProfiler::VisitOMPDependClause(const OMPDependClause *C) {
856 VisitOMPClauseList(C);
857}
858void OMPClauseProfiler::VisitOMPDeviceClause(const OMPDeviceClause *C) {
859 if (C->getDevice())
860 Profiler->VisitStmt(C->getDevice());
861}
862void OMPClauseProfiler::VisitOMPMapClause(const OMPMapClause *C) {
863 VisitOMPClauseList(C);
864}
865void OMPClauseProfiler::VisitOMPAllocateClause(const OMPAllocateClause *C) {
866 if (Expr *Allocator = C->getAllocator())
867 Profiler->VisitStmt(Allocator);
868 VisitOMPClauseList(C);
869}
870void OMPClauseProfiler::VisitOMPNumTeamsClause(const OMPNumTeamsClause *C) {
871 VisitOMPClauseList(C);
872 VistOMPClauseWithPreInit(C);
873}
874void OMPClauseProfiler::VisitOMPThreadLimitClause(
875 const OMPThreadLimitClause *C) {
876 VisitOMPClauseList(C);
877 VistOMPClauseWithPreInit(C);
878}
879void OMPClauseProfiler::VisitOMPPriorityClause(const OMPPriorityClause *C) {
880 VistOMPClauseWithPreInit(C);
881 if (C->getPriority())
882 Profiler->VisitStmt(C->getPriority());
883}
884void OMPClauseProfiler::VisitOMPGrainsizeClause(const OMPGrainsizeClause *C) {
885 VistOMPClauseWithPreInit(C);
886 if (C->getGrainsize())
887 Profiler->VisitStmt(C->getGrainsize());
888}
889void OMPClauseProfiler::VisitOMPNumTasksClause(const OMPNumTasksClause *C) {
890 VistOMPClauseWithPreInit(C);
891 if (C->getNumTasks())
892 Profiler->VisitStmt(C->getNumTasks());
893}
894void OMPClauseProfiler::VisitOMPHintClause(const OMPHintClause *C) {
895 if (C->getHint())
896 Profiler->VisitStmt(C->getHint());
897}
898void OMPClauseProfiler::VisitOMPToClause(const OMPToClause *C) {
899 VisitOMPClauseList(C);
900}
901void OMPClauseProfiler::VisitOMPFromClause(const OMPFromClause *C) {
902 VisitOMPClauseList(C);
903}
904void OMPClauseProfiler::VisitOMPUseDevicePtrClause(
905 const OMPUseDevicePtrClause *C) {
906 VisitOMPClauseList(C);
907}
908void OMPClauseProfiler::VisitOMPUseDeviceAddrClause(
909 const OMPUseDeviceAddrClause *C) {
910 VisitOMPClauseList(C);
911}
912void OMPClauseProfiler::VisitOMPIsDevicePtrClause(
913 const OMPIsDevicePtrClause *C) {
914 VisitOMPClauseList(C);
915}
916void OMPClauseProfiler::VisitOMPHasDeviceAddrClause(
917 const OMPHasDeviceAddrClause *C) {
918 VisitOMPClauseList(C);
919}
920void OMPClauseProfiler::VisitOMPNontemporalClause(
921 const OMPNontemporalClause *C) {
922 VisitOMPClauseList(C);
923 for (auto *E : C->private_refs())
924 Profiler->VisitStmt(E);
925}
926void OMPClauseProfiler::VisitOMPInclusiveClause(const OMPInclusiveClause *C) {
927 VisitOMPClauseList(C);
928}
929void OMPClauseProfiler::VisitOMPExclusiveClause(const OMPExclusiveClause *C) {
930 VisitOMPClauseList(C);
931}
932void OMPClauseProfiler::VisitOMPUsesAllocatorsClause(
933 const OMPUsesAllocatorsClause *C) {
934 for (unsigned I = 0, E = C->getNumberOfAllocators(); I < E; ++I) {
935 OMPUsesAllocatorsClause::Data D = C->getAllocatorData(I);
936 Profiler->VisitStmt(D.Allocator);
937 if (D.AllocatorTraits)
938 Profiler->VisitStmt(D.AllocatorTraits);
939 }
940}
941void OMPClauseProfiler::VisitOMPAffinityClause(const OMPAffinityClause *C) {
942 if (const Expr *Modifier = C->getModifier())
943 Profiler->VisitStmt(Modifier);
944 for (const Expr *E : C->varlist())
945 Profiler->VisitStmt(E);
946}
947void OMPClauseProfiler::VisitOMPOrderClause(const OMPOrderClause *C) {}
948void OMPClauseProfiler::VisitOMPBindClause(const OMPBindClause *C) {}
949void OMPClauseProfiler::VisitOMPXDynCGroupMemClause(
950 const OMPXDynCGroupMemClause *C) {
951 VistOMPClauseWithPreInit(C);
952 if (Expr *Size = C->getSize())
953 Profiler->VisitStmt(Size);
954}
955void OMPClauseProfiler::VisitOMPDoacrossClause(const OMPDoacrossClause *C) {
956 VisitOMPClauseList(C);
957}
958void OMPClauseProfiler::VisitOMPXAttributeClause(const OMPXAttributeClause *C) {
959}
960void OMPClauseProfiler::VisitOMPXBareClause(const OMPXBareClause *C) {}
961} // namespace
962
963void
964StmtProfiler::VisitOMPExecutableDirective(const OMPExecutableDirective *S) {
965 VisitStmt(S);
966 OMPClauseProfiler P(this);
967 ArrayRef<OMPClause *> Clauses = S->clauses();
968 for (ArrayRef<OMPClause *>::iterator I = Clauses.begin(), E = Clauses.end();
969 I != E; ++I)
970 if (*I)
971 P.Visit(*I);
972}
973
974void StmtProfiler::VisitOMPCanonicalLoop(const OMPCanonicalLoop *L) {
975 VisitStmt(L);
976}
977
978void StmtProfiler::VisitOMPLoopBasedDirective(const OMPLoopBasedDirective *S) {
979 VisitOMPExecutableDirective(S);
980}
981
982void StmtProfiler::VisitOMPLoopDirective(const OMPLoopDirective *S) {
983 VisitOMPLoopBasedDirective(S);
984}
985
986void StmtProfiler::VisitOMPMetaDirective(const OMPMetaDirective *S) {
987 VisitOMPExecutableDirective(S);
988}
989
990void StmtProfiler::VisitOMPParallelDirective(const OMPParallelDirective *S) {
991 VisitOMPExecutableDirective(S);
992}
993
994void StmtProfiler::VisitOMPSimdDirective(const OMPSimdDirective *S) {
995 VisitOMPLoopDirective(S);
996}
997
998void StmtProfiler::VisitOMPLoopTransformationDirective(
1000 VisitOMPLoopBasedDirective(S);
1001}
1002
1003void StmtProfiler::VisitOMPTileDirective(const OMPTileDirective *S) {
1004 VisitOMPLoopTransformationDirective(S);
1005}
1006
1007void StmtProfiler::VisitOMPUnrollDirective(const OMPUnrollDirective *S) {
1008 VisitOMPLoopTransformationDirective(S);
1009}
1010
1011void StmtProfiler::VisitOMPReverseDirective(const OMPReverseDirective *S) {
1012 VisitOMPLoopTransformationDirective(S);
1013}
1014
1015void StmtProfiler::VisitOMPInterchangeDirective(
1016 const OMPInterchangeDirective *S) {
1017 VisitOMPLoopTransformationDirective(S);
1018}
1019
1020void StmtProfiler::VisitOMPForDirective(const OMPForDirective *S) {
1021 VisitOMPLoopDirective(S);
1022}
1023
1024void StmtProfiler::VisitOMPForSimdDirective(const OMPForSimdDirective *S) {
1025 VisitOMPLoopDirective(S);
1026}
1027
1028void StmtProfiler::VisitOMPSectionsDirective(const OMPSectionsDirective *S) {
1029 VisitOMPExecutableDirective(S);
1030}
1031
1032void StmtProfiler::VisitOMPSectionDirective(const OMPSectionDirective *S) {
1033 VisitOMPExecutableDirective(S);
1034}
1035
1036void StmtProfiler::VisitOMPScopeDirective(const OMPScopeDirective *S) {
1037 VisitOMPExecutableDirective(S);
1038}
1039
1040void StmtProfiler::VisitOMPSingleDirective(const OMPSingleDirective *S) {
1041 VisitOMPExecutableDirective(S);
1042}
1043
1044void StmtProfiler::VisitOMPMasterDirective(const OMPMasterDirective *S) {
1045 VisitOMPExecutableDirective(S);
1046}
1047
1048void StmtProfiler::VisitOMPCriticalDirective(const OMPCriticalDirective *S) {
1049 VisitOMPExecutableDirective(S);
1050 VisitName(S->getDirectiveName().getName());
1051}
1052
1053void
1054StmtProfiler::VisitOMPParallelForDirective(const OMPParallelForDirective *S) {
1055 VisitOMPLoopDirective(S);
1056}
1057
1058void StmtProfiler::VisitOMPParallelForSimdDirective(
1059 const OMPParallelForSimdDirective *S) {
1060 VisitOMPLoopDirective(S);
1061}
1062
1063void StmtProfiler::VisitOMPParallelMasterDirective(
1064 const OMPParallelMasterDirective *S) {
1065 VisitOMPExecutableDirective(S);
1066}
1067
1068void StmtProfiler::VisitOMPParallelMaskedDirective(
1069 const OMPParallelMaskedDirective *S) {
1070 VisitOMPExecutableDirective(S);
1071}
1072
1073void StmtProfiler::VisitOMPParallelSectionsDirective(
1075 VisitOMPExecutableDirective(S);
1076}
1077
1078void StmtProfiler::VisitOMPTaskDirective(const OMPTaskDirective *S) {
1079 VisitOMPExecutableDirective(S);
1080}
1081
1082void StmtProfiler::VisitOMPTaskyieldDirective(const OMPTaskyieldDirective *S) {
1083 VisitOMPExecutableDirective(S);
1084}
1085
1086void StmtProfiler::VisitOMPBarrierDirective(const OMPBarrierDirective *S) {
1087 VisitOMPExecutableDirective(S);
1088}
1089
1090void StmtProfiler::VisitOMPTaskwaitDirective(const OMPTaskwaitDirective *S) {
1091 VisitOMPExecutableDirective(S);
1092}
1093
1094void StmtProfiler::VisitOMPAssumeDirective(const OMPAssumeDirective *S) {
1095 VisitOMPExecutableDirective(S);
1096}
1097
1098void StmtProfiler::VisitOMPErrorDirective(const OMPErrorDirective *S) {
1099 VisitOMPExecutableDirective(S);
1100}
1101void StmtProfiler::VisitOMPTaskgroupDirective(const OMPTaskgroupDirective *S) {
1102 VisitOMPExecutableDirective(S);
1103 if (const Expr *E = S->getReductionRef())
1104 VisitStmt(E);
1105}
1106
1107void StmtProfiler::VisitOMPFlushDirective(const OMPFlushDirective *S) {
1108 VisitOMPExecutableDirective(S);
1109}
1110
1111void StmtProfiler::VisitOMPDepobjDirective(const OMPDepobjDirective *S) {
1112 VisitOMPExecutableDirective(S);
1113}
1114
1115void StmtProfiler::VisitOMPScanDirective(const OMPScanDirective *S) {
1116 VisitOMPExecutableDirective(S);
1117}
1118
1119void StmtProfiler::VisitOMPOrderedDirective(const OMPOrderedDirective *S) {
1120 VisitOMPExecutableDirective(S);
1121}
1122
1123void StmtProfiler::VisitOMPAtomicDirective(const OMPAtomicDirective *S) {
1124 VisitOMPExecutableDirective(S);
1125}
1126
1127void StmtProfiler::VisitOMPTargetDirective(const OMPTargetDirective *S) {
1128 VisitOMPExecutableDirective(S);
1129}
1130
1131void StmtProfiler::VisitOMPTargetDataDirective(const OMPTargetDataDirective *S) {
1132 VisitOMPExecutableDirective(S);
1133}
1134
1135void StmtProfiler::VisitOMPTargetEnterDataDirective(
1136 const OMPTargetEnterDataDirective *S) {
1137 VisitOMPExecutableDirective(S);
1138}
1139
1140void StmtProfiler::VisitOMPTargetExitDataDirective(
1141 const OMPTargetExitDataDirective *S) {
1142 VisitOMPExecutableDirective(S);
1143}
1144
1145void StmtProfiler::VisitOMPTargetParallelDirective(
1146 const OMPTargetParallelDirective *S) {
1147 VisitOMPExecutableDirective(S);
1148}
1149
1150void StmtProfiler::VisitOMPTargetParallelForDirective(
1152 VisitOMPExecutableDirective(S);
1153}
1154
1155void StmtProfiler::VisitOMPTeamsDirective(const OMPTeamsDirective *S) {
1156 VisitOMPExecutableDirective(S);
1157}
1158
1159void StmtProfiler::VisitOMPCancellationPointDirective(
1161 VisitOMPExecutableDirective(S);
1162}
1163
1164void StmtProfiler::VisitOMPCancelDirective(const OMPCancelDirective *S) {
1165 VisitOMPExecutableDirective(S);
1166}
1167
1168void StmtProfiler::VisitOMPTaskLoopDirective(const OMPTaskLoopDirective *S) {
1169 VisitOMPLoopDirective(S);
1170}
1171
1172void StmtProfiler::VisitOMPTaskLoopSimdDirective(
1173 const OMPTaskLoopSimdDirective *S) {
1174 VisitOMPLoopDirective(S);
1175}
1176
1177void StmtProfiler::VisitOMPMasterTaskLoopDirective(
1178 const OMPMasterTaskLoopDirective *S) {
1179 VisitOMPLoopDirective(S);
1180}
1181
1182void StmtProfiler::VisitOMPMaskedTaskLoopDirective(
1183 const OMPMaskedTaskLoopDirective *S) {
1184 VisitOMPLoopDirective(S);
1185}
1186
1187void StmtProfiler::VisitOMPMasterTaskLoopSimdDirective(
1189 VisitOMPLoopDirective(S);
1190}
1191
1192void StmtProfiler::VisitOMPMaskedTaskLoopSimdDirective(
1194 VisitOMPLoopDirective(S);
1195}
1196
1197void StmtProfiler::VisitOMPParallelMasterTaskLoopDirective(
1199 VisitOMPLoopDirective(S);
1200}
1201
1202void StmtProfiler::VisitOMPParallelMaskedTaskLoopDirective(
1204 VisitOMPLoopDirective(S);
1205}
1206
1207void StmtProfiler::VisitOMPParallelMasterTaskLoopSimdDirective(
1209 VisitOMPLoopDirective(S);
1210}
1211
1212void StmtProfiler::VisitOMPParallelMaskedTaskLoopSimdDirective(
1214 VisitOMPLoopDirective(S);
1215}
1216
1217void StmtProfiler::VisitOMPDistributeDirective(
1218 const OMPDistributeDirective *S) {
1219 VisitOMPLoopDirective(S);
1220}
1221
1222void OMPClauseProfiler::VisitOMPDistScheduleClause(
1223 const OMPDistScheduleClause *C) {
1224 VistOMPClauseWithPreInit(C);
1225 if (auto *S = C->getChunkSize())
1226 Profiler->VisitStmt(S);
1227}
1228
1229void OMPClauseProfiler::VisitOMPDefaultmapClause(const OMPDefaultmapClause *) {}
1230
1231void StmtProfiler::VisitOMPTargetUpdateDirective(
1232 const OMPTargetUpdateDirective *S) {
1233 VisitOMPExecutableDirective(S);
1234}
1235
1236void StmtProfiler::VisitOMPDistributeParallelForDirective(
1238 VisitOMPLoopDirective(S);
1239}
1240
1241void StmtProfiler::VisitOMPDistributeParallelForSimdDirective(
1243 VisitOMPLoopDirective(S);
1244}
1245
1246void StmtProfiler::VisitOMPDistributeSimdDirective(
1247 const OMPDistributeSimdDirective *S) {
1248 VisitOMPLoopDirective(S);
1249}
1250
1251void StmtProfiler::VisitOMPTargetParallelForSimdDirective(
1253 VisitOMPLoopDirective(S);
1254}
1255
1256void StmtProfiler::VisitOMPTargetSimdDirective(
1257 const OMPTargetSimdDirective *S) {
1258 VisitOMPLoopDirective(S);
1259}
1260
1261void StmtProfiler::VisitOMPTeamsDistributeDirective(
1262 const OMPTeamsDistributeDirective *S) {
1263 VisitOMPLoopDirective(S);
1264}
1265
1266void StmtProfiler::VisitOMPTeamsDistributeSimdDirective(
1268 VisitOMPLoopDirective(S);
1269}
1270
1271void StmtProfiler::VisitOMPTeamsDistributeParallelForSimdDirective(
1273 VisitOMPLoopDirective(S);
1274}
1275
1276void StmtProfiler::VisitOMPTeamsDistributeParallelForDirective(
1278 VisitOMPLoopDirective(S);
1279}
1280
1281void StmtProfiler::VisitOMPTargetTeamsDirective(
1282 const OMPTargetTeamsDirective *S) {
1283 VisitOMPExecutableDirective(S);
1284}
1285
1286void StmtProfiler::VisitOMPTargetTeamsDistributeDirective(
1288 VisitOMPLoopDirective(S);
1289}
1290
1291void StmtProfiler::VisitOMPTargetTeamsDistributeParallelForDirective(
1293 VisitOMPLoopDirective(S);
1294}
1295
1296void StmtProfiler::VisitOMPTargetTeamsDistributeParallelForSimdDirective(
1298 VisitOMPLoopDirective(S);
1299}
1300
1301void StmtProfiler::VisitOMPTargetTeamsDistributeSimdDirective(
1303 VisitOMPLoopDirective(S);
1304}
1305
1306void StmtProfiler::VisitOMPInteropDirective(const OMPInteropDirective *S) {
1307 VisitOMPExecutableDirective(S);
1308}
1309
1310void StmtProfiler::VisitOMPDispatchDirective(const OMPDispatchDirective *S) {
1311 VisitOMPExecutableDirective(S);
1312}
1313
1314void StmtProfiler::VisitOMPMaskedDirective(const OMPMaskedDirective *S) {
1315 VisitOMPExecutableDirective(S);
1316}
1317
1318void StmtProfiler::VisitOMPGenericLoopDirective(
1319 const OMPGenericLoopDirective *S) {
1320 VisitOMPLoopDirective(S);
1321}
1322
1323void StmtProfiler::VisitOMPTeamsGenericLoopDirective(
1325 VisitOMPLoopDirective(S);
1326}
1327
1328void StmtProfiler::VisitOMPTargetTeamsGenericLoopDirective(
1330 VisitOMPLoopDirective(S);
1331}
1332
1333void StmtProfiler::VisitOMPParallelGenericLoopDirective(
1335 VisitOMPLoopDirective(S);
1336}
1337
1338void StmtProfiler::VisitOMPTargetParallelGenericLoopDirective(
1340 VisitOMPLoopDirective(S);
1341}
1342
1343void StmtProfiler::VisitExpr(const Expr *S) {
1344 VisitStmt(S);
1345}
1346
1347void StmtProfiler::VisitConstantExpr(const ConstantExpr *S) {
1348 VisitExpr(S);
1349}
1350
1351void StmtProfiler::VisitDeclRefExpr(const DeclRefExpr *S) {
1352 VisitExpr(S);
1353 if (!Canonical)
1354 VisitNestedNameSpecifier(S->getQualifier());
1355 VisitDecl(S->getDecl());
1356 if (!Canonical) {
1357 ID.AddBoolean(S->hasExplicitTemplateArgs());
1358 if (S->hasExplicitTemplateArgs())
1359 VisitTemplateArguments(S->getTemplateArgs(), S->getNumTemplateArgs());
1360 }
1361}
1362
1363void StmtProfiler::VisitSYCLUniqueStableNameExpr(
1364 const SYCLUniqueStableNameExpr *S) {
1365 VisitExpr(S);
1366 VisitType(S->getTypeSourceInfo()->getType());
1367}
1368
1369void StmtProfiler::VisitPredefinedExpr(const PredefinedExpr *S) {
1370 VisitExpr(S);
1371 ID.AddInteger(llvm::to_underlying(S->getIdentKind()));
1372}
1373
1374void StmtProfiler::VisitOpenACCAsteriskSizeExpr(
1375 const OpenACCAsteriskSizeExpr *S) {
1376 VisitExpr(S);
1377}
1378
1379void StmtProfiler::VisitIntegerLiteral(const IntegerLiteral *S) {
1380 VisitExpr(S);
1381 S->getValue().Profile(ID);
1382
1383 QualType T = S->getType();
1384 if (Canonical)
1385 T = T.getCanonicalType();
1386 ID.AddInteger(T->getTypeClass());
1387 if (auto BitIntT = T->getAs<BitIntType>())
1388 BitIntT->Profile(ID);
1389 else
1390 ID.AddInteger(T->castAs<BuiltinType>()->getKind());
1391}
1392
1393void StmtProfiler::VisitFixedPointLiteral(const FixedPointLiteral *S) {
1394 VisitExpr(S);
1395 S->getValue().Profile(ID);
1396 ID.AddInteger(S->getType()->castAs<BuiltinType>()->getKind());
1397}
1398
1399void StmtProfiler::VisitCharacterLiteral(const CharacterLiteral *S) {
1400 VisitExpr(S);
1401 ID.AddInteger(llvm::to_underlying(S->getKind()));
1402 ID.AddInteger(S->getValue());
1403}
1404
1405void StmtProfiler::VisitFloatingLiteral(const FloatingLiteral *S) {
1406 VisitExpr(S);
1407 S->getValue().Profile(ID);
1408 ID.AddBoolean(S->isExact());
1409 ID.AddInteger(S->getType()->castAs<BuiltinType>()->getKind());
1410}
1411
1412void StmtProfiler::VisitImaginaryLiteral(const ImaginaryLiteral *S) {
1413 VisitExpr(S);
1414}
1415
1416void StmtProfiler::VisitStringLiteral(const StringLiteral *S) {
1417 VisitExpr(S);
1418 ID.AddString(S->getBytes());
1419 ID.AddInteger(llvm::to_underlying(S->getKind()));
1420}
1421
1422void StmtProfiler::VisitParenExpr(const ParenExpr *S) {
1423 VisitExpr(S);
1424}
1425
1426void StmtProfiler::VisitParenListExpr(const ParenListExpr *S) {
1427 VisitExpr(S);
1428}
1429
1430void StmtProfiler::VisitUnaryOperator(const UnaryOperator *S) {
1431 VisitExpr(S);
1432 ID.AddInteger(S->getOpcode());
1433}
1434
1435void StmtProfiler::VisitOffsetOfExpr(const OffsetOfExpr *S) {
1436 VisitType(S->getTypeSourceInfo()->getType());
1437 unsigned n = S->getNumComponents();
1438 for (unsigned i = 0; i < n; ++i) {
1439 const OffsetOfNode &ON = S->getComponent(i);
1440 ID.AddInteger(ON.getKind());
1441 switch (ON.getKind()) {
1443 // Expressions handled below.
1444 break;
1445
1447 VisitDecl(ON.getField());
1448 break;
1449
1451 VisitIdentifierInfo(ON.getFieldName());
1452 break;
1453
1454 case OffsetOfNode::Base:
1455 // These nodes are implicit, and therefore don't need profiling.
1456 break;
1457 }
1458 }
1459
1460 VisitExpr(S);
1461}
1462
1463void
1464StmtProfiler::VisitUnaryExprOrTypeTraitExpr(const UnaryExprOrTypeTraitExpr *S) {
1465 VisitExpr(S);
1466 ID.AddInteger(S->getKind());
1467 if (S->isArgumentType())
1468 VisitType(S->getArgumentType());
1469}
1470
1471void StmtProfiler::VisitArraySubscriptExpr(const ArraySubscriptExpr *S) {
1472 VisitExpr(S);
1473}
1474
1475void StmtProfiler::VisitMatrixSubscriptExpr(const MatrixSubscriptExpr *S) {
1476 VisitExpr(S);
1477}
1478
1479void StmtProfiler::VisitArraySectionExpr(const ArraySectionExpr *S) {
1480 VisitExpr(S);
1481}
1482
1483void StmtProfiler::VisitOMPArrayShapingExpr(const OMPArrayShapingExpr *S) {
1484 VisitExpr(S);
1485}
1486
1487void StmtProfiler::VisitOMPIteratorExpr(const OMPIteratorExpr *S) {
1488 VisitExpr(S);
1489 for (unsigned I = 0, E = S->numOfIterators(); I < E; ++I)
1490 VisitDecl(S->getIteratorDecl(I));
1491}
1492
1493void StmtProfiler::VisitCallExpr(const CallExpr *S) {
1494 VisitExpr(S);
1495}
1496
1497void StmtProfiler::VisitMemberExpr(const MemberExpr *S) {
1498 VisitExpr(S);
1499 VisitDecl(S->getMemberDecl());
1500 if (!Canonical)
1501 VisitNestedNameSpecifier(S->getQualifier());
1502 ID.AddBoolean(S->isArrow());
1503}
1504
1505void StmtProfiler::VisitCompoundLiteralExpr(const CompoundLiteralExpr *S) {
1506 VisitExpr(S);
1507 ID.AddBoolean(S->isFileScope());
1508}
1509
1510void StmtProfiler::VisitCastExpr(const CastExpr *S) {
1511 VisitExpr(S);
1512}
1513
1514void StmtProfiler::VisitImplicitCastExpr(const ImplicitCastExpr *S) {
1515 VisitCastExpr(S);
1516 ID.AddInteger(S->getValueKind());
1517}
1518
1519void StmtProfiler::VisitExplicitCastExpr(const ExplicitCastExpr *S) {
1520 VisitCastExpr(S);
1521 VisitType(S->getTypeAsWritten());
1522}
1523
1524void StmtProfiler::VisitCStyleCastExpr(const CStyleCastExpr *S) {
1525 VisitExplicitCastExpr(S);
1526}
1527
1528void StmtProfiler::VisitBinaryOperator(const BinaryOperator *S) {
1529 VisitExpr(S);
1530 ID.AddInteger(S->getOpcode());
1531}
1532
1533void
1534StmtProfiler::VisitCompoundAssignOperator(const CompoundAssignOperator *S) {
1535 VisitBinaryOperator(S);
1536}
1537
1538void StmtProfiler::VisitConditionalOperator(const ConditionalOperator *S) {
1539 VisitExpr(S);
1540}
1541
1542void StmtProfiler::VisitBinaryConditionalOperator(
1543 const BinaryConditionalOperator *S) {
1544 VisitExpr(S);
1545}
1546
1547void StmtProfiler::VisitAddrLabelExpr(const AddrLabelExpr *S) {
1548 VisitExpr(S);
1549 VisitDecl(S->getLabel());
1550}
1551
1552void StmtProfiler::VisitStmtExpr(const StmtExpr *S) {
1553 VisitExpr(S);
1554}
1555
1556void StmtProfiler::VisitShuffleVectorExpr(const ShuffleVectorExpr *S) {
1557 VisitExpr(S);
1558}
1559
1560void StmtProfiler::VisitConvertVectorExpr(const ConvertVectorExpr *S) {
1561 VisitExpr(S);
1562}
1563
1564void StmtProfiler::VisitChooseExpr(const ChooseExpr *S) {
1565 VisitExpr(S);
1566}
1567
1568void StmtProfiler::VisitGNUNullExpr(const GNUNullExpr *S) {
1569 VisitExpr(S);
1570}
1571
1572void StmtProfiler::VisitVAArgExpr(const VAArgExpr *S) {
1573 VisitExpr(S);
1574}
1575
1576void StmtProfiler::VisitInitListExpr(const InitListExpr *S) {
1577 if (S->getSyntacticForm()) {
1578 VisitInitListExpr(S->getSyntacticForm());
1579 return;
1580 }
1581
1582 VisitExpr(S);
1583}
1584
1585void StmtProfiler::VisitDesignatedInitExpr(const DesignatedInitExpr *S) {
1586 VisitExpr(S);
1587 ID.AddBoolean(S->usesGNUSyntax());
1588 for (const DesignatedInitExpr::Designator &D : S->designators()) {
1589 if (D.isFieldDesignator()) {
1590 ID.AddInteger(0);
1591 VisitName(D.getFieldName());
1592 continue;
1593 }
1594
1595 if (D.isArrayDesignator()) {
1596 ID.AddInteger(1);
1597 } else {
1598 assert(D.isArrayRangeDesignator());
1599 ID.AddInteger(2);
1600 }
1601 ID.AddInteger(D.getArrayIndex());
1602 }
1603}
1604
1605// Seems that if VisitInitListExpr() only works on the syntactic form of an
1606// InitListExpr, then a DesignatedInitUpdateExpr is not encountered.
1607void StmtProfiler::VisitDesignatedInitUpdateExpr(
1608 const DesignatedInitUpdateExpr *S) {
1609 llvm_unreachable("Unexpected DesignatedInitUpdateExpr in syntactic form of "
1610 "initializer");
1611}
1612
1613void StmtProfiler::VisitArrayInitLoopExpr(const ArrayInitLoopExpr *S) {
1614 VisitExpr(S);
1615}
1616
1617void StmtProfiler::VisitArrayInitIndexExpr(const ArrayInitIndexExpr *S) {
1618 VisitExpr(S);
1619}
1620
1621void StmtProfiler::VisitNoInitExpr(const NoInitExpr *S) {
1622 llvm_unreachable("Unexpected NoInitExpr in syntactic form of initializer");
1623}
1624
1625void StmtProfiler::VisitImplicitValueInitExpr(const ImplicitValueInitExpr *S) {
1626 VisitExpr(S);
1627}
1628
1629void StmtProfiler::VisitExtVectorElementExpr(const ExtVectorElementExpr *S) {
1630 VisitExpr(S);
1631 VisitName(&S->getAccessor());
1632}
1633
1634void StmtProfiler::VisitBlockExpr(const BlockExpr *S) {
1635 VisitExpr(S);
1636 VisitDecl(S->getBlockDecl());
1637}
1638
1639void StmtProfiler::VisitGenericSelectionExpr(const GenericSelectionExpr *S) {
1640 VisitExpr(S);
1642 S->associations()) {
1643 QualType T = Assoc.getType();
1644 if (T.isNull())
1645 ID.AddPointer(nullptr);
1646 else
1647 VisitType(T);
1648 VisitExpr(Assoc.getAssociationExpr());
1649 }
1650}
1651
1652void StmtProfiler::VisitPseudoObjectExpr(const PseudoObjectExpr *S) {
1653 VisitExpr(S);
1655 i = S->semantics_begin(), e = S->semantics_end(); i != e; ++i)
1656 // Normally, we would not profile the source expressions of OVEs.
1657 if (const OpaqueValueExpr *OVE = dyn_cast<OpaqueValueExpr>(*i))
1658 Visit(OVE->getSourceExpr());
1659}
1660
1661void StmtProfiler::VisitAtomicExpr(const AtomicExpr *S) {
1662 VisitExpr(S);
1663 ID.AddInteger(S->getOp());
1664}
1665
1666void StmtProfiler::VisitConceptSpecializationExpr(
1667 const ConceptSpecializationExpr *S) {
1668 VisitExpr(S);
1669 VisitDecl(S->getNamedConcept());
1670 for (const TemplateArgument &Arg : S->getTemplateArguments())
1671 VisitTemplateArgument(Arg);
1672}
1673
1674void StmtProfiler::VisitRequiresExpr(const RequiresExpr *S) {
1675 VisitExpr(S);
1676 ID.AddInteger(S->getLocalParameters().size());
1677 for (ParmVarDecl *LocalParam : S->getLocalParameters())
1678 VisitDecl(LocalParam);
1679 ID.AddInteger(S->getRequirements().size());
1680 for (concepts::Requirement *Req : S->getRequirements()) {
1681 if (auto *TypeReq = dyn_cast<concepts::TypeRequirement>(Req)) {
1683 ID.AddBoolean(TypeReq->isSubstitutionFailure());
1684 if (!TypeReq->isSubstitutionFailure())
1685 VisitType(TypeReq->getType()->getType());
1686 } else if (auto *ExprReq = dyn_cast<concepts::ExprRequirement>(Req)) {
1688 ID.AddBoolean(ExprReq->isExprSubstitutionFailure());
1689 if (!ExprReq->isExprSubstitutionFailure())
1690 Visit(ExprReq->getExpr());
1691 // C++2a [expr.prim.req.compound]p1 Example:
1692 // [...] The compound-requirement in C1 requires that x++ is a valid
1693 // expression. It is equivalent to the simple-requirement x++; [...]
1694 // We therefore do not profile isSimple() here.
1695 ID.AddBoolean(ExprReq->getNoexceptLoc().isValid());
1697 ExprReq->getReturnTypeRequirement();
1698 if (RetReq.isEmpty()) {
1699 ID.AddInteger(0);
1700 } else if (RetReq.isTypeConstraint()) {
1701 ID.AddInteger(1);
1703 } else {
1704 assert(RetReq.isSubstitutionFailure());
1705 ID.AddInteger(2);
1706 }
1707 } else {
1709 auto *NestedReq = cast<concepts::NestedRequirement>(Req);
1710 ID.AddBoolean(NestedReq->hasInvalidConstraint());
1711 if (!NestedReq->hasInvalidConstraint())
1712 Visit(NestedReq->getConstraintExpr());
1713 }
1714 }
1715}
1716
1718 UnaryOperatorKind &UnaryOp,
1719 BinaryOperatorKind &BinaryOp,
1720 unsigned &NumArgs) {
1721 switch (S->getOperator()) {
1722 case OO_None:
1723 case OO_New:
1724 case OO_Delete:
1725 case OO_Array_New:
1726 case OO_Array_Delete:
1727 case OO_Arrow:
1728 case OO_Conditional:
1730 llvm_unreachable("Invalid operator call kind");
1731
1732 case OO_Plus:
1733 if (NumArgs == 1) {
1734 UnaryOp = UO_Plus;
1735 return Stmt::UnaryOperatorClass;
1736 }
1737
1738 BinaryOp = BO_Add;
1739 return Stmt::BinaryOperatorClass;
1740
1741 case OO_Minus:
1742 if (NumArgs == 1) {
1743 UnaryOp = UO_Minus;
1744 return Stmt::UnaryOperatorClass;
1745 }
1746
1747 BinaryOp = BO_Sub;
1748 return Stmt::BinaryOperatorClass;
1749
1750 case OO_Star:
1751 if (NumArgs == 1) {
1752 UnaryOp = UO_Deref;
1753 return Stmt::UnaryOperatorClass;
1754 }
1755
1756 BinaryOp = BO_Mul;
1757 return Stmt::BinaryOperatorClass;
1758
1759 case OO_Slash:
1760 BinaryOp = BO_Div;
1761 return Stmt::BinaryOperatorClass;
1762
1763 case OO_Percent:
1764 BinaryOp = BO_Rem;
1765 return Stmt::BinaryOperatorClass;
1766
1767 case OO_Caret:
1768 BinaryOp = BO_Xor;
1769 return Stmt::BinaryOperatorClass;
1770
1771 case OO_Amp:
1772 if (NumArgs == 1) {
1773 UnaryOp = UO_AddrOf;
1774 return Stmt::UnaryOperatorClass;
1775 }
1776
1777 BinaryOp = BO_And;
1778 return Stmt::BinaryOperatorClass;
1779
1780 case OO_Pipe:
1781 BinaryOp = BO_Or;
1782 return Stmt::BinaryOperatorClass;
1783
1784 case OO_Tilde:
1785 UnaryOp = UO_Not;
1786 return Stmt::UnaryOperatorClass;
1787
1788 case OO_Exclaim:
1789 UnaryOp = UO_LNot;
1790 return Stmt::UnaryOperatorClass;
1791
1792 case OO_Equal:
1793 BinaryOp = BO_Assign;
1794 return Stmt::BinaryOperatorClass;
1795
1796 case OO_Less:
1797 BinaryOp = BO_LT;
1798 return Stmt::BinaryOperatorClass;
1799
1800 case OO_Greater:
1801 BinaryOp = BO_GT;
1802 return Stmt::BinaryOperatorClass;
1803
1804 case OO_PlusEqual:
1805 BinaryOp = BO_AddAssign;
1806 return Stmt::CompoundAssignOperatorClass;
1807
1808 case OO_MinusEqual:
1809 BinaryOp = BO_SubAssign;
1810 return Stmt::CompoundAssignOperatorClass;
1811
1812 case OO_StarEqual:
1813 BinaryOp = BO_MulAssign;
1814 return Stmt::CompoundAssignOperatorClass;
1815
1816 case OO_SlashEqual:
1817 BinaryOp = BO_DivAssign;
1818 return Stmt::CompoundAssignOperatorClass;
1819
1820 case OO_PercentEqual:
1821 BinaryOp = BO_RemAssign;
1822 return Stmt::CompoundAssignOperatorClass;
1823
1824 case OO_CaretEqual:
1825 BinaryOp = BO_XorAssign;
1826 return Stmt::CompoundAssignOperatorClass;
1827
1828 case OO_AmpEqual:
1829 BinaryOp = BO_AndAssign;
1830 return Stmt::CompoundAssignOperatorClass;
1831
1832 case OO_PipeEqual:
1833 BinaryOp = BO_OrAssign;
1834 return Stmt::CompoundAssignOperatorClass;
1835
1836 case OO_LessLess:
1837 BinaryOp = BO_Shl;
1838 return Stmt::BinaryOperatorClass;
1839
1840 case OO_GreaterGreater:
1841 BinaryOp = BO_Shr;
1842 return Stmt::BinaryOperatorClass;
1843
1844 case OO_LessLessEqual:
1845 BinaryOp = BO_ShlAssign;
1846 return Stmt::CompoundAssignOperatorClass;
1847
1848 case OO_GreaterGreaterEqual:
1849 BinaryOp = BO_ShrAssign;
1850 return Stmt::CompoundAssignOperatorClass;
1851
1852 case OO_EqualEqual:
1853 BinaryOp = BO_EQ;
1854 return Stmt::BinaryOperatorClass;
1855
1856 case OO_ExclaimEqual:
1857 BinaryOp = BO_NE;
1858 return Stmt::BinaryOperatorClass;
1859
1860 case OO_LessEqual:
1861 BinaryOp = BO_LE;
1862 return Stmt::BinaryOperatorClass;
1863
1864 case OO_GreaterEqual:
1865 BinaryOp = BO_GE;
1866 return Stmt::BinaryOperatorClass;
1867
1868 case OO_Spaceship:
1869 BinaryOp = BO_Cmp;
1870 return Stmt::BinaryOperatorClass;
1871
1872 case OO_AmpAmp:
1873 BinaryOp = BO_LAnd;
1874 return Stmt::BinaryOperatorClass;
1875
1876 case OO_PipePipe:
1877 BinaryOp = BO_LOr;
1878 return Stmt::BinaryOperatorClass;
1879
1880 case OO_PlusPlus:
1881 UnaryOp = NumArgs == 1 ? UO_PreInc : UO_PostInc;
1882 NumArgs = 1;
1883 return Stmt::UnaryOperatorClass;
1884
1885 case OO_MinusMinus:
1886 UnaryOp = NumArgs == 1 ? UO_PreDec : UO_PostDec;
1887 NumArgs = 1;
1888 return Stmt::UnaryOperatorClass;
1889
1890 case OO_Comma:
1891 BinaryOp = BO_Comma;
1892 return Stmt::BinaryOperatorClass;
1893
1894 case OO_ArrowStar:
1895 BinaryOp = BO_PtrMemI;
1896 return Stmt::BinaryOperatorClass;
1897
1898 case OO_Subscript:
1899 return Stmt::ArraySubscriptExprClass;
1900
1901 case OO_Call:
1902 return Stmt::CallExprClass;
1903
1904 case OO_Coawait:
1905 UnaryOp = UO_Coawait;
1906 return Stmt::UnaryOperatorClass;
1907 }
1908
1909 llvm_unreachable("Invalid overloaded operator expression");
1910}
1911
1912#if defined(_MSC_VER) && !defined(__clang__)
1913#if _MSC_VER == 1911
1914// Work around https://developercommunity.visualstudio.com/content/problem/84002/clang-cl-when-built-with-vc-2017-crashes-cause-vc.html
1915// MSVC 2017 update 3 miscompiles this function, and a clang built with it
1916// will crash in stage 2 of a bootstrap build.
1917#pragma optimize("", off)
1918#endif
1919#endif
1920
1921void StmtProfiler::VisitCXXOperatorCallExpr(const CXXOperatorCallExpr *S) {
1922 if (S->isTypeDependent()) {
1923 // Type-dependent operator calls are profiled like their underlying
1924 // syntactic operator.
1925 //
1926 // An operator call to operator-> is always implicit, so just skip it. The
1927 // enclosing MemberExpr will profile the actual member access.
1928 if (S->getOperator() == OO_Arrow)
1929 return Visit(S->getArg(0));
1930
1931 UnaryOperatorKind UnaryOp = UO_Extension;
1932 BinaryOperatorKind BinaryOp = BO_Comma;
1933 unsigned NumArgs = S->getNumArgs();
1934 Stmt::StmtClass SC = DecodeOperatorCall(S, UnaryOp, BinaryOp, NumArgs);
1935
1936 ID.AddInteger(SC);
1937 for (unsigned I = 0; I != NumArgs; ++I)
1938 Visit(S->getArg(I));
1939 if (SC == Stmt::UnaryOperatorClass)
1940 ID.AddInteger(UnaryOp);
1941 else if (SC == Stmt::BinaryOperatorClass ||
1942 SC == Stmt::CompoundAssignOperatorClass)
1943 ID.AddInteger(BinaryOp);
1944 else
1945 assert(SC == Stmt::ArraySubscriptExprClass || SC == Stmt::CallExprClass);
1946
1947 return;
1948 }
1949
1950 VisitCallExpr(S);
1951 ID.AddInteger(S->getOperator());
1952}
1953
1954void StmtProfiler::VisitCXXRewrittenBinaryOperator(
1955 const CXXRewrittenBinaryOperator *S) {
1956 // If a rewritten operator were ever to be type-dependent, we should profile
1957 // it following its syntactic operator.
1958 assert(!S->isTypeDependent() &&
1959 "resolved rewritten operator should never be type-dependent");
1960 ID.AddBoolean(S->isReversed());
1961 VisitExpr(S->getSemanticForm());
1962}
1963
1964#if defined(_MSC_VER) && !defined(__clang__)
1965#if _MSC_VER == 1911
1966#pragma optimize("", on)
1967#endif
1968#endif
1969
1970void StmtProfiler::VisitCXXMemberCallExpr(const CXXMemberCallExpr *S) {
1971 VisitCallExpr(S);
1972}
1973
1974void StmtProfiler::VisitCUDAKernelCallExpr(const CUDAKernelCallExpr *S) {
1975 VisitCallExpr(S);
1976}
1977
1978void StmtProfiler::VisitAsTypeExpr(const AsTypeExpr *S) {
1979 VisitExpr(S);
1980}
1981
1982void StmtProfiler::VisitCXXNamedCastExpr(const CXXNamedCastExpr *S) {
1983 VisitExplicitCastExpr(S);
1984}
1985
1986void StmtProfiler::VisitCXXStaticCastExpr(const CXXStaticCastExpr *S) {
1987 VisitCXXNamedCastExpr(S);
1988}
1989
1990void StmtProfiler::VisitCXXDynamicCastExpr(const CXXDynamicCastExpr *S) {
1991 VisitCXXNamedCastExpr(S);
1992}
1993
1994void
1995StmtProfiler::VisitCXXReinterpretCastExpr(const CXXReinterpretCastExpr *S) {
1996 VisitCXXNamedCastExpr(S);
1997}
1998
1999void StmtProfiler::VisitCXXConstCastExpr(const CXXConstCastExpr *S) {
2000 VisitCXXNamedCastExpr(S);
2001}
2002
2003void StmtProfiler::VisitBuiltinBitCastExpr(const BuiltinBitCastExpr *S) {
2004 VisitExpr(S);
2005 VisitType(S->getTypeInfoAsWritten()->getType());
2006}
2007
2008void StmtProfiler::VisitCXXAddrspaceCastExpr(const CXXAddrspaceCastExpr *S) {
2009 VisitCXXNamedCastExpr(S);
2010}
2011
2012void StmtProfiler::VisitUserDefinedLiteral(const UserDefinedLiteral *S) {
2013 VisitCallExpr(S);
2014}
2015
2016void StmtProfiler::VisitCXXBoolLiteralExpr(const CXXBoolLiteralExpr *S) {
2017 VisitExpr(S);
2018 ID.AddBoolean(S->getValue());
2019}
2020
2021void StmtProfiler::VisitCXXNullPtrLiteralExpr(const CXXNullPtrLiteralExpr *S) {
2022 VisitExpr(S);
2023}
2024
2025void StmtProfiler::VisitCXXStdInitializerListExpr(
2026 const CXXStdInitializerListExpr *S) {
2027 VisitExpr(S);
2028}
2029
2030void StmtProfiler::VisitCXXTypeidExpr(const CXXTypeidExpr *S) {
2031 VisitExpr(S);
2032 if (S->isTypeOperand())
2033 VisitType(S->getTypeOperandSourceInfo()->getType());
2034}
2035
2036void StmtProfiler::VisitCXXUuidofExpr(const CXXUuidofExpr *S) {
2037 VisitExpr(S);
2038 if (S->isTypeOperand())
2039 VisitType(S->getTypeOperandSourceInfo()->getType());
2040}
2041
2042void StmtProfiler::VisitMSPropertyRefExpr(const MSPropertyRefExpr *S) {
2043 VisitExpr(S);
2044 VisitDecl(S->getPropertyDecl());
2045}
2046
2047void StmtProfiler::VisitMSPropertySubscriptExpr(
2048 const MSPropertySubscriptExpr *S) {
2049 VisitExpr(S);
2050}
2051
2052void StmtProfiler::VisitCXXThisExpr(const CXXThisExpr *S) {
2053 VisitExpr(S);
2054 ID.AddBoolean(S->isImplicit());
2055 ID.AddBoolean(S->isCapturedByCopyInLambdaWithExplicitObjectParameter());
2056}
2057
2058void StmtProfiler::VisitCXXThrowExpr(const CXXThrowExpr *S) {
2059 VisitExpr(S);
2060}
2061
2062void StmtProfiler::VisitCXXDefaultArgExpr(const CXXDefaultArgExpr *S) {
2063 VisitExpr(S);
2064 VisitDecl(S->getParam());
2065}
2066
2067void StmtProfiler::VisitCXXDefaultInitExpr(const CXXDefaultInitExpr *S) {
2068 VisitExpr(S);
2069 VisitDecl(S->getField());
2070}
2071
2072void StmtProfiler::VisitCXXBindTemporaryExpr(const CXXBindTemporaryExpr *S) {
2073 VisitExpr(S);
2074 VisitDecl(
2075 const_cast<CXXDestructorDecl *>(S->getTemporary()->getDestructor()));
2076}
2077
2078void StmtProfiler::VisitCXXConstructExpr(const CXXConstructExpr *S) {
2079 VisitExpr(S);
2080 VisitDecl(S->getConstructor());
2081 ID.AddBoolean(S->isElidable());
2082}
2083
2084void StmtProfiler::VisitCXXInheritedCtorInitExpr(
2085 const CXXInheritedCtorInitExpr *S) {
2086 VisitExpr(S);
2087 VisitDecl(S->getConstructor());
2088}
2089
2090void StmtProfiler::VisitCXXFunctionalCastExpr(const CXXFunctionalCastExpr *S) {
2091 VisitExplicitCastExpr(S);
2092}
2093
2094void
2095StmtProfiler::VisitCXXTemporaryObjectExpr(const CXXTemporaryObjectExpr *S) {
2096 VisitCXXConstructExpr(S);
2097}
2098
2099void
2100StmtProfiler::VisitLambdaExpr(const LambdaExpr *S) {
2101 if (!ProfileLambdaExpr) {
2102 // Do not recursively visit the children of this expression. Profiling the
2103 // body would result in unnecessary work, and is not safe to do during
2104 // deserialization.
2105 VisitStmtNoChildren(S);
2106
2107 // C++20 [temp.over.link]p5:
2108 // Two lambda-expressions are never considered equivalent.
2109 VisitDecl(S->getLambdaClass());
2110
2111 return;
2112 }
2113
2114 CXXRecordDecl *Lambda = S->getLambdaClass();
2115 for (const auto &Capture : Lambda->captures()) {
2116 ID.AddInteger(Capture.getCaptureKind());
2117 if (Capture.capturesVariable())
2118 VisitDecl(Capture.getCapturedVar());
2119 }
2120
2121 // Profiling the body of the lambda may be dangerous during deserialization.
2122 // So we'd like only to profile the signature here.
2123 ODRHash Hasher;
2124 // FIXME: We can't get the operator call easily by
2125 // `CXXRecordDecl::getLambdaCallOperator()` if we're in deserialization.
2126 // So we have to do something raw here.
2127 for (auto *SubDecl : Lambda->decls()) {
2128 FunctionDecl *Call = nullptr;
2129 if (auto *FTD = dyn_cast<FunctionTemplateDecl>(SubDecl))
2130 Call = FTD->getTemplatedDecl();
2131 else if (auto *FD = dyn_cast<FunctionDecl>(SubDecl))
2132 Call = FD;
2133
2134 if (!Call)
2135 continue;
2136
2137 Hasher.AddFunctionDecl(Call, /*SkipBody=*/true);
2138 }
2139 ID.AddInteger(Hasher.CalculateHash());
2140}
2141
2142void
2143StmtProfiler::VisitCXXScalarValueInitExpr(const CXXScalarValueInitExpr *S) {
2144 VisitExpr(S);
2145}
2146
2147void StmtProfiler::VisitCXXDeleteExpr(const CXXDeleteExpr *S) {
2148 VisitExpr(S);
2149 ID.AddBoolean(S->isGlobalDelete());
2150 ID.AddBoolean(S->isArrayForm());
2151 VisitDecl(S->getOperatorDelete());
2152}
2153
2154void StmtProfiler::VisitCXXNewExpr(const CXXNewExpr *S) {
2155 VisitExpr(S);
2156 VisitType(S->getAllocatedType());
2157 VisitDecl(S->getOperatorNew());
2158 VisitDecl(S->getOperatorDelete());
2159 ID.AddBoolean(S->isArray());
2160 ID.AddInteger(S->getNumPlacementArgs());
2161 ID.AddBoolean(S->isGlobalNew());
2162 ID.AddBoolean(S->isParenTypeId());
2163 ID.AddInteger(llvm::to_underlying(S->getInitializationStyle()));
2164}
2165
2166void
2167StmtProfiler::VisitCXXPseudoDestructorExpr(const CXXPseudoDestructorExpr *S) {
2168 VisitExpr(S);
2169 ID.AddBoolean(S->isArrow());
2170 VisitNestedNameSpecifier(S->getQualifier());
2171 ID.AddBoolean(S->getScopeTypeInfo() != nullptr);
2172 if (S->getScopeTypeInfo())
2173 VisitType(S->getScopeTypeInfo()->getType());
2174 ID.AddBoolean(S->getDestroyedTypeInfo() != nullptr);
2175 if (S->getDestroyedTypeInfo())
2176 VisitType(S->getDestroyedType());
2177 else
2178 VisitIdentifierInfo(S->getDestroyedTypeIdentifier());
2179}
2180
2181void StmtProfiler::VisitOverloadExpr(const OverloadExpr *S) {
2182 VisitExpr(S);
2183 VisitNestedNameSpecifier(S->getQualifier());
2184 VisitName(S->getName(), /*TreatAsDecl*/ true);
2185 ID.AddBoolean(S->hasExplicitTemplateArgs());
2186 if (S->hasExplicitTemplateArgs())
2187 VisitTemplateArguments(S->getTemplateArgs(), S->getNumTemplateArgs());
2188}
2189
2190void
2191StmtProfiler::VisitUnresolvedLookupExpr(const UnresolvedLookupExpr *S) {
2192 VisitOverloadExpr(S);
2193}
2194
2195void StmtProfiler::VisitTypeTraitExpr(const TypeTraitExpr *S) {
2196 VisitExpr(S);
2197 ID.AddInteger(S->getTrait());
2198 ID.AddInteger(S->getNumArgs());
2199 for (unsigned I = 0, N = S->getNumArgs(); I != N; ++I)
2200 VisitType(S->getArg(I)->getType());
2201}
2202
2203void StmtProfiler::VisitArrayTypeTraitExpr(const ArrayTypeTraitExpr *S) {
2204 VisitExpr(S);
2205 ID.AddInteger(S->getTrait());
2206 VisitType(S->getQueriedType());
2207}
2208
2209void StmtProfiler::VisitExpressionTraitExpr(const ExpressionTraitExpr *S) {
2210 VisitExpr(S);
2211 ID.AddInteger(S->getTrait());
2212 VisitExpr(S->getQueriedExpression());
2213}
2214
2215void StmtProfiler::VisitDependentScopeDeclRefExpr(
2216 const DependentScopeDeclRefExpr *S) {
2217 VisitExpr(S);
2218 VisitName(S->getDeclName());
2219 VisitNestedNameSpecifier(S->getQualifier());
2220 ID.AddBoolean(S->hasExplicitTemplateArgs());
2221 if (S->hasExplicitTemplateArgs())
2222 VisitTemplateArguments(S->getTemplateArgs(), S->getNumTemplateArgs());
2223}
2224
2225void StmtProfiler::VisitExprWithCleanups(const ExprWithCleanups *S) {
2226 VisitExpr(S);
2227}
2228
2229void StmtProfiler::VisitCXXUnresolvedConstructExpr(
2230 const CXXUnresolvedConstructExpr *S) {
2231 VisitExpr(S);
2232 VisitType(S->getTypeAsWritten());
2233 ID.AddInteger(S->isListInitialization());
2234}
2235
2236void StmtProfiler::VisitCXXDependentScopeMemberExpr(
2237 const CXXDependentScopeMemberExpr *S) {
2238 ID.AddBoolean(S->isImplicitAccess());
2239 if (!S->isImplicitAccess()) {
2240 VisitExpr(S);
2241 ID.AddBoolean(S->isArrow());
2242 }
2243 VisitNestedNameSpecifier(S->getQualifier());
2244 VisitName(S->getMember());
2245 ID.AddBoolean(S->hasExplicitTemplateArgs());
2246 if (S->hasExplicitTemplateArgs())
2247 VisitTemplateArguments(S->getTemplateArgs(), S->getNumTemplateArgs());
2248}
2249
2250void StmtProfiler::VisitUnresolvedMemberExpr(const UnresolvedMemberExpr *S) {
2251 ID.AddBoolean(S->isImplicitAccess());
2252 if (!S->isImplicitAccess()) {
2253 VisitExpr(S);
2254 ID.AddBoolean(S->isArrow());
2255 }
2256 VisitNestedNameSpecifier(S->getQualifier());
2257 VisitName(S->getMemberName());
2258 ID.AddBoolean(S->hasExplicitTemplateArgs());
2259 if (S->hasExplicitTemplateArgs())
2260 VisitTemplateArguments(S->getTemplateArgs(), S->getNumTemplateArgs());
2261}
2262
2263void StmtProfiler::VisitCXXNoexceptExpr(const CXXNoexceptExpr *S) {
2264 VisitExpr(S);
2265}
2266
2267void StmtProfiler::VisitPackExpansionExpr(const PackExpansionExpr *S) {
2268 VisitExpr(S);
2269}
2270
2271void StmtProfiler::VisitSizeOfPackExpr(const SizeOfPackExpr *S) {
2272 VisitExpr(S);
2273 VisitDecl(S->getPack());
2274 if (S->isPartiallySubstituted()) {
2275 auto Args = S->getPartialArguments();
2276 ID.AddInteger(Args.size());
2277 for (const auto &TA : Args)
2278 VisitTemplateArgument(TA);
2279 } else {
2280 ID.AddInteger(0);
2281 }
2282}
2283
2284void StmtProfiler::VisitPackIndexingExpr(const PackIndexingExpr *E) {
2285 VisitExpr(E);
2286 VisitExpr(E->getPackIdExpression());
2287 VisitExpr(E->getIndexExpr());
2288}
2289
2290void StmtProfiler::VisitSubstNonTypeTemplateParmPackExpr(
2292 VisitExpr(S);
2293 VisitDecl(S->getParameterPack());
2294 VisitTemplateArgument(S->getArgumentPack());
2295}
2296
2297void StmtProfiler::VisitSubstNonTypeTemplateParmExpr(
2299 // Profile exactly as the replacement expression.
2300 Visit(E->getReplacement());
2301}
2302
2303void StmtProfiler::VisitFunctionParmPackExpr(const FunctionParmPackExpr *S) {
2304 VisitExpr(S);
2305 VisitDecl(S->getParameterPack());
2306 ID.AddInteger(S->getNumExpansions());
2307 for (FunctionParmPackExpr::iterator I = S->begin(), E = S->end(); I != E; ++I)
2308 VisitDecl(*I);
2309}
2310
2311void StmtProfiler::VisitMaterializeTemporaryExpr(
2312 const MaterializeTemporaryExpr *S) {
2313 VisitExpr(S);
2314}
2315
2316void StmtProfiler::VisitCXXFoldExpr(const CXXFoldExpr *S) {
2317 VisitExpr(S);
2318 ID.AddInteger(S->getOperator());
2319}
2320
2321void StmtProfiler::VisitCXXParenListInitExpr(const CXXParenListInitExpr *S) {
2322 VisitExpr(S);
2323}
2324
2325void StmtProfiler::VisitCoroutineBodyStmt(const CoroutineBodyStmt *S) {
2326 VisitStmt(S);
2327}
2328
2329void StmtProfiler::VisitCoreturnStmt(const CoreturnStmt *S) {
2330 VisitStmt(S);
2331}
2332
2333void StmtProfiler::VisitCoawaitExpr(const CoawaitExpr *S) {
2334 VisitExpr(S);
2335}
2336
2337void StmtProfiler::VisitDependentCoawaitExpr(const DependentCoawaitExpr *S) {
2338 VisitExpr(S);
2339}
2340
2341void StmtProfiler::VisitCoyieldExpr(const CoyieldExpr *S) {
2342 VisitExpr(S);
2343}
2344
2345void StmtProfiler::VisitOpaqueValueExpr(const OpaqueValueExpr *E) {
2346 VisitExpr(E);
2347}
2348
2349void StmtProfiler::VisitTypoExpr(const TypoExpr *E) {
2350 VisitExpr(E);
2351}
2352
2353void StmtProfiler::VisitSourceLocExpr(const SourceLocExpr *E) {
2354 VisitExpr(E);
2355}
2356
2357void StmtProfiler::VisitEmbedExpr(const EmbedExpr *E) { VisitExpr(E); }
2358
2359void StmtProfiler::VisitRecoveryExpr(const RecoveryExpr *E) { VisitExpr(E); }
2360
2361void StmtProfiler::VisitObjCStringLiteral(const ObjCStringLiteral *S) {
2362 VisitExpr(S);
2363}
2364
2365void StmtProfiler::VisitObjCBoxedExpr(const ObjCBoxedExpr *E) {
2366 VisitExpr(E);
2367}
2368
2369void StmtProfiler::VisitObjCArrayLiteral(const ObjCArrayLiteral *E) {
2370 VisitExpr(E);
2371}
2372
2373void StmtProfiler::VisitObjCDictionaryLiteral(const ObjCDictionaryLiteral *E) {
2374 VisitExpr(E);
2375}
2376
2377void StmtProfiler::VisitObjCEncodeExpr(const ObjCEncodeExpr *S) {
2378 VisitExpr(S);
2379 VisitType(S->getEncodedType());
2380}
2381
2382void StmtProfiler::VisitObjCSelectorExpr(const ObjCSelectorExpr *S) {
2383 VisitExpr(S);
2384 VisitName(S->getSelector());
2385}
2386
2387void StmtProfiler::VisitObjCProtocolExpr(const ObjCProtocolExpr *S) {
2388 VisitExpr(S);
2389 VisitDecl(S->getProtocol());
2390}
2391
2392void StmtProfiler::VisitObjCIvarRefExpr(const ObjCIvarRefExpr *S) {
2393 VisitExpr(S);
2394 VisitDecl(S->getDecl());
2395 ID.AddBoolean(S->isArrow());
2396 ID.AddBoolean(S->isFreeIvar());
2397}
2398
2399void StmtProfiler::VisitObjCPropertyRefExpr(const ObjCPropertyRefExpr *S) {
2400 VisitExpr(S);
2401 if (S->isImplicitProperty()) {
2402 VisitDecl(S->getImplicitPropertyGetter());
2403 VisitDecl(S->getImplicitPropertySetter());
2404 } else {
2405 VisitDecl(S->getExplicitProperty());
2406 }
2407 if (S->isSuperReceiver()) {
2408 ID.AddBoolean(S->isSuperReceiver());
2409 VisitType(S->getSuperReceiverType());
2410 }
2411}
2412
2413void StmtProfiler::VisitObjCSubscriptRefExpr(const ObjCSubscriptRefExpr *S) {
2414 VisitExpr(S);
2415 VisitDecl(S->getAtIndexMethodDecl());
2416 VisitDecl(S->setAtIndexMethodDecl());
2417}
2418
2419void StmtProfiler::VisitObjCMessageExpr(const ObjCMessageExpr *S) {
2420 VisitExpr(S);
2421 VisitName(S->getSelector());
2422 VisitDecl(S->getMethodDecl());
2423}
2424
2425void StmtProfiler::VisitObjCIsaExpr(const ObjCIsaExpr *S) {
2426 VisitExpr(S);
2427 ID.AddBoolean(S->isArrow());
2428}
2429
2430void StmtProfiler::VisitObjCBoolLiteralExpr(const ObjCBoolLiteralExpr *S) {
2431 VisitExpr(S);
2432 ID.AddBoolean(S->getValue());
2433}
2434
2435void StmtProfiler::VisitObjCIndirectCopyRestoreExpr(
2436 const ObjCIndirectCopyRestoreExpr *S) {
2437 VisitExpr(S);
2438 ID.AddBoolean(S->shouldCopy());
2439}
2440
2441void StmtProfiler::VisitObjCBridgedCastExpr(const ObjCBridgedCastExpr *S) {
2442 VisitExplicitCastExpr(S);
2443 ID.AddBoolean(S->getBridgeKind());
2444}
2445
2446void StmtProfiler::VisitObjCAvailabilityCheckExpr(
2447 const ObjCAvailabilityCheckExpr *S) {
2448 VisitExpr(S);
2449}
2450
2451void StmtProfiler::VisitTemplateArguments(const TemplateArgumentLoc *Args,
2452 unsigned NumArgs) {
2453 ID.AddInteger(NumArgs);
2454 for (unsigned I = 0; I != NumArgs; ++I)
2455 VisitTemplateArgument(Args[I].getArgument());
2456}
2457
2458void StmtProfiler::VisitTemplateArgument(const TemplateArgument &Arg) {
2459 // Mostly repetitive with TemplateArgument::Profile!
2460 ID.AddInteger(Arg.getKind());
2461 switch (Arg.getKind()) {
2463 break;
2464
2466 VisitType(Arg.getAsType());
2467 break;
2468
2471 VisitTemplateName(Arg.getAsTemplateOrTemplatePattern());
2472 break;
2473
2475 VisitType(Arg.getParamTypeForDecl());
2476 // FIXME: Do we need to recursively decompose template parameter objects?
2477 VisitDecl(Arg.getAsDecl());
2478 break;
2479
2481 VisitType(Arg.getNullPtrType());
2482 break;
2483
2485 VisitType(Arg.getIntegralType());
2486 Arg.getAsIntegral().Profile(ID);
2487 break;
2488
2490 VisitType(Arg.getStructuralValueType());
2491 // FIXME: Do we need to recursively decompose this ourselves?
2492 Arg.getAsStructuralValue().Profile(ID);
2493 break;
2494
2496 Visit(Arg.getAsExpr());
2497 break;
2498
2500 for (const auto &P : Arg.pack_elements())
2501 VisitTemplateArgument(P);
2502 break;
2503 }
2504}
2505
2506namespace {
2507class OpenACCClauseProfiler
2508 : public OpenACCClauseVisitor<OpenACCClauseProfiler> {
2509 StmtProfiler &Profiler;
2510
2511public:
2512 OpenACCClauseProfiler(StmtProfiler &P) : Profiler(P) {}
2513
2514 void VisitOpenACCClauseList(ArrayRef<const OpenACCClause *> Clauses) {
2515 for (const OpenACCClause *Clause : Clauses) {
2516 // TODO OpenACC: When we have clauses with expressions, we should
2517 // profile them too.
2518 Visit(Clause);
2519 }
2520 }
2521
2522 void VisitClauseWithVarList(const OpenACCClauseWithVarList &Clause) {
2523 for (auto *E : Clause.getVarList())
2524 Profiler.VisitStmt(E);
2525 }
2526
2527#define VISIT_CLAUSE(CLAUSE_NAME) \
2528 void Visit##CLAUSE_NAME##Clause(const OpenACC##CLAUSE_NAME##Clause &Clause);
2529
2530#include "clang/Basic/OpenACCClauses.def"
2531};
2532
2533/// Nothing to do here, there are no sub-statements.
2534void OpenACCClauseProfiler::VisitDefaultClause(
2535 const OpenACCDefaultClause &Clause) {}
2536
2537void OpenACCClauseProfiler::VisitIfClause(const OpenACCIfClause &Clause) {
2538 assert(Clause.hasConditionExpr() &&
2539 "if clause requires a valid condition expr");
2540 Profiler.VisitStmt(Clause.getConditionExpr());
2541}
2542
2543void OpenACCClauseProfiler::VisitCopyClause(const OpenACCCopyClause &Clause) {
2544 VisitClauseWithVarList(Clause);
2545}
2546void OpenACCClauseProfiler::VisitCopyInClause(
2547 const OpenACCCopyInClause &Clause) {
2548 VisitClauseWithVarList(Clause);
2549}
2550
2551void OpenACCClauseProfiler::VisitCopyOutClause(
2552 const OpenACCCopyOutClause &Clause) {
2553 VisitClauseWithVarList(Clause);
2554}
2555
2556void OpenACCClauseProfiler::VisitCreateClause(
2557 const OpenACCCreateClause &Clause) {
2558 VisitClauseWithVarList(Clause);
2559}
2560
2561void OpenACCClauseProfiler::VisitHostClause(const OpenACCHostClause &Clause) {
2562 VisitClauseWithVarList(Clause);
2563}
2564
2565void OpenACCClauseProfiler::VisitDeviceClause(
2566 const OpenACCDeviceClause &Clause) {
2567 VisitClauseWithVarList(Clause);
2568}
2569
2570void OpenACCClauseProfiler::VisitSelfClause(const OpenACCSelfClause &Clause) {
2571 if (Clause.isConditionExprClause()) {
2572 if (Clause.hasConditionExpr())
2573 Profiler.VisitStmt(Clause.getConditionExpr());
2574 } else {
2575 for (auto *E : Clause.getVarList())
2576 Profiler.VisitStmt(E);
2577 }
2578}
2579
2580void OpenACCClauseProfiler::VisitFinalizeClause(
2581 const OpenACCFinalizeClause &Clause) {}
2582
2583void OpenACCClauseProfiler::VisitIfPresentClause(
2584 const OpenACCIfPresentClause &Clause) {}
2585
2586void OpenACCClauseProfiler::VisitNumGangsClause(
2587 const OpenACCNumGangsClause &Clause) {
2588 for (auto *E : Clause.getIntExprs())
2589 Profiler.VisitStmt(E);
2590}
2591
2592void OpenACCClauseProfiler::VisitTileClause(const OpenACCTileClause &Clause) {
2593 for (auto *E : Clause.getSizeExprs())
2594 Profiler.VisitStmt(E);
2595}
2596
2597void OpenACCClauseProfiler::VisitNumWorkersClause(
2598 const OpenACCNumWorkersClause &Clause) {
2599 assert(Clause.hasIntExpr() && "num_workers clause requires a valid int expr");
2600 Profiler.VisitStmt(Clause.getIntExpr());
2601}
2602
2603void OpenACCClauseProfiler::VisitCollapseClause(
2604 const OpenACCCollapseClause &Clause) {
2605 assert(Clause.getLoopCount() && "collapse clause requires a valid int expr");
2606 Profiler.VisitStmt(Clause.getLoopCount());
2607}
2608
2609void OpenACCClauseProfiler::VisitPrivateClause(
2610 const OpenACCPrivateClause &Clause) {
2611 VisitClauseWithVarList(Clause);
2612}
2613
2614void OpenACCClauseProfiler::VisitFirstPrivateClause(
2615 const OpenACCFirstPrivateClause &Clause) {
2616 VisitClauseWithVarList(Clause);
2617}
2618
2619void OpenACCClauseProfiler::VisitAttachClause(
2620 const OpenACCAttachClause &Clause) {
2621 VisitClauseWithVarList(Clause);
2622}
2623
2624void OpenACCClauseProfiler::VisitDetachClause(
2625 const OpenACCDetachClause &Clause) {
2626 VisitClauseWithVarList(Clause);
2627}
2628
2629void OpenACCClauseProfiler::VisitDeleteClause(
2630 const OpenACCDeleteClause &Clause) {
2631 VisitClauseWithVarList(Clause);
2632}
2633
2634void OpenACCClauseProfiler::VisitDevicePtrClause(
2635 const OpenACCDevicePtrClause &Clause) {
2636 VisitClauseWithVarList(Clause);
2637}
2638
2639void OpenACCClauseProfiler::VisitNoCreateClause(
2640 const OpenACCNoCreateClause &Clause) {
2641 VisitClauseWithVarList(Clause);
2642}
2643
2644void OpenACCClauseProfiler::VisitPresentClause(
2645 const OpenACCPresentClause &Clause) {
2646 VisitClauseWithVarList(Clause);
2647}
2648
2649void OpenACCClauseProfiler::VisitUseDeviceClause(
2650 const OpenACCUseDeviceClause &Clause) {
2651 VisitClauseWithVarList(Clause);
2652}
2653
2654void OpenACCClauseProfiler::VisitVectorLengthClause(
2655 const OpenACCVectorLengthClause &Clause) {
2656 assert(Clause.hasIntExpr() &&
2657 "vector_length clause requires a valid int expr");
2658 Profiler.VisitStmt(Clause.getIntExpr());
2659}
2660
2661void OpenACCClauseProfiler::VisitAsyncClause(const OpenACCAsyncClause &Clause) {
2662 if (Clause.hasIntExpr())
2663 Profiler.VisitStmt(Clause.getIntExpr());
2664}
2665
2666void OpenACCClauseProfiler::VisitDeviceNumClause(
2667 const OpenACCDeviceNumClause &Clause) {
2668 Profiler.VisitStmt(Clause.getIntExpr());
2669}
2670
2671void OpenACCClauseProfiler::VisitDefaultAsyncClause(
2672 const OpenACCDefaultAsyncClause &Clause) {
2673 Profiler.VisitStmt(Clause.getIntExpr());
2674}
2675
2676void OpenACCClauseProfiler::VisitWorkerClause(
2677 const OpenACCWorkerClause &Clause) {
2678 if (Clause.hasIntExpr())
2679 Profiler.VisitStmt(Clause.getIntExpr());
2680}
2681
2682void OpenACCClauseProfiler::VisitVectorClause(
2683 const OpenACCVectorClause &Clause) {
2684 if (Clause.hasIntExpr())
2685 Profiler.VisitStmt(Clause.getIntExpr());
2686}
2687
2688void OpenACCClauseProfiler::VisitWaitClause(const OpenACCWaitClause &Clause) {
2689 if (Clause.hasDevNumExpr())
2690 Profiler.VisitStmt(Clause.getDevNumExpr());
2691 for (auto *E : Clause.getQueueIdExprs())
2692 Profiler.VisitStmt(E);
2693}
2694/// Nothing to do here, there are no sub-statements.
2695void OpenACCClauseProfiler::VisitDeviceTypeClause(
2696 const OpenACCDeviceTypeClause &Clause) {}
2697
2698void OpenACCClauseProfiler::VisitAutoClause(const OpenACCAutoClause &Clause) {}
2699
2700void OpenACCClauseProfiler::VisitIndependentClause(
2701 const OpenACCIndependentClause &Clause) {}
2702
2703void OpenACCClauseProfiler::VisitSeqClause(const OpenACCSeqClause &Clause) {}
2704
2705void OpenACCClauseProfiler::VisitGangClause(const OpenACCGangClause &Clause) {
2706 for (unsigned I = 0; I < Clause.getNumExprs(); ++I) {
2707 Profiler.VisitStmt(Clause.getExpr(I).second);
2708 }
2709}
2710
2711void OpenACCClauseProfiler::VisitReductionClause(
2712 const OpenACCReductionClause &Clause) {
2713 VisitClauseWithVarList(Clause);
2714}
2715} // namespace
2716
2717void StmtProfiler::VisitOpenACCComputeConstruct(
2718 const OpenACCComputeConstruct *S) {
2719 // VisitStmt handles children, so the AssociatedStmt is handled.
2720 VisitStmt(S);
2721
2722 OpenACCClauseProfiler P{*this};
2723 P.VisitOpenACCClauseList(S->clauses());
2724}
2725
2726void StmtProfiler::VisitOpenACCLoopConstruct(const OpenACCLoopConstruct *S) {
2727 // VisitStmt handles children, so the Loop is handled.
2728 VisitStmt(S);
2729
2730 OpenACCClauseProfiler P{*this};
2731 P.VisitOpenACCClauseList(S->clauses());
2732}
2733
2734void StmtProfiler::VisitOpenACCCombinedConstruct(
2735 const OpenACCCombinedConstruct *S) {
2736 // VisitStmt handles children, so the Loop is handled.
2737 VisitStmt(S);
2738
2739 OpenACCClauseProfiler P{*this};
2740 P.VisitOpenACCClauseList(S->clauses());
2741}
2742
2743void StmtProfiler::VisitOpenACCDataConstruct(const OpenACCDataConstruct *S) {
2744 VisitStmt(S);
2745
2746 OpenACCClauseProfiler P{*this};
2747 P.VisitOpenACCClauseList(S->clauses());
2748}
2749
2750void StmtProfiler::VisitOpenACCEnterDataConstruct(
2751 const OpenACCEnterDataConstruct *S) {
2752 VisitStmt(S);
2753
2754 OpenACCClauseProfiler P{*this};
2755 P.VisitOpenACCClauseList(S->clauses());
2756}
2757
2758void StmtProfiler::VisitOpenACCExitDataConstruct(
2759 const OpenACCExitDataConstruct *S) {
2760 VisitStmt(S);
2761
2762 OpenACCClauseProfiler P{*this};
2763 P.VisitOpenACCClauseList(S->clauses());
2764}
2765
2766void StmtProfiler::VisitOpenACCHostDataConstruct(
2767 const OpenACCHostDataConstruct *S) {
2768 VisitStmt(S);
2769
2770 OpenACCClauseProfiler P{*this};
2771 P.VisitOpenACCClauseList(S->clauses());
2772}
2773
2774void StmtProfiler::VisitOpenACCWaitConstruct(const OpenACCWaitConstruct *S) {
2775 // VisitStmt covers 'children', so the exprs inside of it are covered.
2776 VisitStmt(S);
2777
2778 OpenACCClauseProfiler P{*this};
2779 P.VisitOpenACCClauseList(S->clauses());
2780}
2781
2782void StmtProfiler::VisitOpenACCInitConstruct(const OpenACCInitConstruct *S) {
2783 VisitStmt(S);
2784 OpenACCClauseProfiler P{*this};
2785 P.VisitOpenACCClauseList(S->clauses());
2786}
2787
2788void StmtProfiler::VisitOpenACCShutdownConstruct(
2789 const OpenACCShutdownConstruct *S) {
2790 VisitStmt(S);
2791 OpenACCClauseProfiler P{*this};
2792 P.VisitOpenACCClauseList(S->clauses());
2793}
2794
2795void StmtProfiler::VisitOpenACCSetConstruct(const OpenACCSetConstruct *S) {
2796 VisitStmt(S);
2797 OpenACCClauseProfiler P{*this};
2798 P.VisitOpenACCClauseList(S->clauses());
2799}
2800
2801void StmtProfiler::VisitOpenACCUpdateConstruct(
2802 const OpenACCUpdateConstruct *S) {
2803 VisitStmt(S);
2804 OpenACCClauseProfiler P{*this};
2805 P.VisitOpenACCClauseList(S->clauses());
2806}
2807
2808void StmtProfiler::VisitHLSLOutArgExpr(const HLSLOutArgExpr *S) {
2809 VisitStmt(S);
2810}
2811
2812void Stmt::Profile(llvm::FoldingSetNodeID &ID, const ASTContext &Context,
2813 bool Canonical, bool ProfileLambdaExpr) const {
2814 StmtProfilerWithPointers Profiler(ID, Context, Canonical, ProfileLambdaExpr);
2815 Profiler.Visit(this);
2816}
2817
2818void Stmt::ProcessODRHash(llvm::FoldingSetNodeID &ID,
2819 class ODRHash &Hash) const {
2820 StmtProfilerWithoutPointers Profiler(ID, Hash);
2821 Profiler.Visit(this);
2822}
Defines the clang::ASTContext interface.
DynTypedNode Node
StringRef P
const Decl * D
Expr * E
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.
Definition: APValue.cpp:490
Holds long-lived AST nodes (such as types and decls) that can be referred to throughout the semantic ...
Definition: ASTContext.h:188
CanQualType getCanonicalType(QualType T) const
Return the canonical (structural) type corresponding to the specified potentially non-canonical type ...
Definition: ASTContext.h:2723
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.
Definition: Expr.h:4421
Represents the index of the current element of an array being initialized by an ArrayInitLoopExpr.
Definition: Expr.h:5805
Represents a loop initializing the elements of an array.
Definition: Expr.h:5752
This class represents BOTH the OpenMP Array Section and OpenACC 'subarray', with a boolean differenti...
Definition: Expr.h:6986
ArraySubscriptExpr - [C99 6.5.2.1] Array Subscripting.
Definition: Expr.h:2718
An Embarcadero array type trait, as used in the implementation of __array_rank and __array_extent.
Definition: ExprCXX.h:2853
AsTypeExpr - Clang builtin function __builtin_astype [OpenCL 6.2.4.2] This AST node provides support ...
Definition: Expr.h:6475
AtomicExpr - Variadic atomic builtins: __atomic_exchange, __atomic_fetch_*, __atomic_load,...
Definition: Expr.h:6678
Represents an attribute applied to a statement.
Definition: Stmt.h:2107
BinaryConditionalOperator - The GNU extension to the conditional operator which allows the middle ope...
Definition: Expr.h:4324
A builtin binary operation expression such as "x + y" or "x <= y".
Definition: Expr.h:3909
A fixed int type of a specified bitwidth.
Definition: Type.h:7819
BlockExpr - Adaptor class for mixing a BlockDecl with expressions.
Definition: Expr.h:6414
BreakStmt - This represents a break.
Definition: Stmt.h:3007
Represents a C++2a __builtin_bit_cast(T, v) expression.
Definition: ExprCXX.h:5298
This class is used for builtin types like 'int'.
Definition: Type.h:3034
Kind getKind() const
Definition: Type.h:3082
CStyleCastExpr - An explicit cast in C (C99 6.5.4) or a C-style cast in C++ (C++ [expr....
Definition: Expr.h:3840
Represents a call to a CUDA kernel function.
Definition: ExprCXX.h:231
A C++ addrspace_cast expression (currently only enabled for OpenCL).
Definition: ExprCXX.h:601
Represents binding an expression to a temporary.
Definition: ExprCXX.h:1491
A boolean literal, per ([C++ lex.bool] Boolean literals).
Definition: ExprCXX.h:720
CXXCatchStmt - This represents a C++ catch block.
Definition: StmtCXX.h:28
A C++ const_cast expression (C++ [expr.const.cast]).
Definition: ExprCXX.h:563
Represents a call to a C++ constructor.
Definition: ExprCXX.h:1546
A default argument (C++ [dcl.fct.default]).
Definition: ExprCXX.h:1268
A use of a default initializer in a constructor or in aggregate initialization.
Definition: ExprCXX.h:1375
Represents a delete expression for memory deallocation and destructor calls, e.g.
Definition: ExprCXX.h:2498
Represents a C++ member access expression where the actual member referenced could not be resolved be...
Definition: ExprCXX.h:3683
Represents a C++ destructor within a class.
Definition: DeclCXX.h:2817
A C++ dynamic_cast expression (C++ [expr.dynamic.cast]).
Definition: ExprCXX.h:478
Represents a folding of a pack over an operator.
Definition: ExprCXX.h:4846
CXXForRangeStmt - This represents C++0x [stmt.ranged]'s ranged for statement, represented as 'for (ra...
Definition: StmtCXX.h:135
Represents an explicit C++ type conversion that uses "functional" notation (C++ [expr....
Definition: ExprCXX.h:1817
Represents a call to an inherited base class constructor from an inheriting constructor.
Definition: ExprCXX.h:1737
Represents a call to a member function that may be written either with member call syntax (e....
Definition: ExprCXX.h:176
Abstract class common to all of the C++ "named"/"keyword" casts.
Definition: ExprCXX.h:372
Represents a new-expression for memory allocation and constructor calls, e.g: "new CXXNewExpr(foo)".
Definition: ExprCXX.h:2241
Represents a C++11 noexcept expression (C++ [expr.unary.noexcept]).
Definition: ExprCXX.h:4126
The null pointer literal (C++11 [lex.nullptr])
Definition: ExprCXX.h:765
A call to an overloaded operator written using operator syntax.
Definition: ExprCXX.h:81
Represents a list-initialization with parenthesis.
Definition: ExprCXX.h:4960
Represents a C++ pseudo-destructor (C++ [expr.pseudo]).
Definition: ExprCXX.h:2617
Represents a C++ struct/union/class.
Definition: DeclCXX.h:258
capture_const_range captures() const
Definition: DeclCXX.h:1109
A C++ reinterpret_cast expression (C++ [expr.reinterpret.cast]).
Definition: ExprCXX.h:523
A rewritten comparison expression that was originally written using operator syntax.
Definition: ExprCXX.h:283
An expression "T()" which creates an rvalue of a non-class type T.
Definition: ExprCXX.h:2182
A C++ static_cast expression (C++ [expr.static.cast]).
Definition: ExprCXX.h:433
Implicit construction of a std::initializer_list<T> object from an array temporary within list-initia...
Definition: ExprCXX.h:797
Represents a C++ functional cast expression that builds a temporary object.
Definition: ExprCXX.h:1885
Represents the this expression in C++.
Definition: ExprCXX.h:1152
A C++ throw-expression (C++ [except.throw]).
Definition: ExprCXX.h:1206
CXXTryStmt - A C++ try block, including all handlers.
Definition: StmtCXX.h:69
A C++ typeid expression (C++ [expr.typeid]), which gets the type_info that corresponds to the supplie...
Definition: ExprCXX.h:845
Describes an explicit type conversion that uses functional notion but could not be resolved because o...
Definition: ExprCXX.h:3557
A Microsoft C++ __uuidof expression, which gets the _GUID that corresponds to the supplied type or ex...
Definition: ExprCXX.h:1066
CallExpr - Represents a function call (C99 6.5.2.2, C++ [expr.call]).
Definition: Expr.h:2874
This captures a statement into a function.
Definition: Stmt.h:3784
CaseStmt - Represent a case statement.
Definition: Stmt.h:1828
CastExpr - Base class for type casts, including both implicit casts (ImplicitCastExpr) and explicit c...
Definition: Expr.h:3547
ChooseExpr - GNU builtin-in function __builtin_choose_expr.
Definition: Expr.h:4641
Represents a 'co_await' expression.
Definition: ExprCXX.h:5191
CompoundAssignOperator - For compound assignments (e.g.
Definition: Expr.h:4171
CompoundLiteralExpr - [C99 6.5.2.5].
Definition: Expr.h:3477
CompoundStmt - This represents a group of statements like { stmt stmt }.
Definition: Stmt.h:1628
Represents the specialization of a concept - evaluates to a prvalue of type bool.
Definition: ExprConcepts.h:42
ConditionalOperator - The ?: ternary operator.
Definition: Expr.h:4262
ConstStmtVisitor - This class implements a simple visitor for Stmt subclasses.
Definition: StmtVisitor.h:196
ConstantExpr - An expression that occurs in a constant context and optionally the result of evaluatin...
Definition: Expr.h:1077
ContinueStmt - This represents a continue.
Definition: Stmt.h:2977
ConvertVectorExpr - Clang builtin function __builtin_convertvector This AST node provides support for...
Definition: Expr.h:4582
Represents a 'co_return' statement in the C++ Coroutines TS.
Definition: StmtCXX.h:473
Represents the body of a coroutine.
Definition: StmtCXX.h:320
Represents a 'co_yield' expression.
Definition: ExprCXX.h:5272
decl_range decls() const
decls_begin/decls_end - Iterate over the declarations stored in this context.
Definition: DeclBase.h:2364
A reference to a declared variable, function, enum, etc.
Definition: Expr.h:1265
DeclStmt - Adaptor class for mixing declarations with statements and expressions.
Definition: Stmt.h:1519
Decl - This represents one declaration (or definition), e.g.
Definition: DeclBase.h:86
virtual Decl * getCanonicalDecl()
Retrieves the "canonical" declaration of the given declaration.
Definition: DeclBase.h:971
Kind getKind() const
Definition: DeclBase.h:445
The name of a declaration.
Represents a 'co_await' expression while the type of the promise is dependent.
Definition: ExprCXX.h:5223
A qualified reference to a name whose declaration cannot yet be resolved.
Definition: ExprCXX.h:3323
Represents a single C99 designator.
Definition: Expr.h:5376
Represents a C99 designated initializer expression.
Definition: Expr.h:5333
DoStmt - This represents a 'do/while' stmt.
Definition: Stmt.h:2752
Represents a reference to #emded data.
Definition: Expr.h:4916
ExplicitCastExpr - An explicit cast written in the source code.
Definition: Expr.h:3799
Represents an expression – generally a full-expression – that introduces cleanups to be run at the en...
Definition: ExprCXX.h:3474
This represents one expression.
Definition: Expr.h:110
An expression trait intrinsic.
Definition: ExprCXX.h:2924
ExtVectorElementExpr - This represents access to specific elements of a vector, and may occur on the ...
Definition: Expr.h:6354
ForStmt - This represents a 'for (init;cond;inc)' stmt.
Definition: Stmt.h:2808
Represents a function declaration or definition.
Definition: Decl.h:1935
Represents a reference to a function parameter pack or init-capture pack that has been substituted bu...
Definition: ExprCXX.h:4654
VarDecl *const * iterator
Iterators over the parameters which the parameter pack expanded into.
Definition: ExprCXX.h:4688
This represents a GCC inline-assembly statement extension.
Definition: Stmt.h:3286
GNUNullExpr - Implements the GNU __null extension, which is a name for a null pointer constant that h...
Definition: Expr.h:4716
Represents a C11 generic selection.
Definition: Expr.h:5966
AssociationTy< true > ConstAssociation
Definition: Expr.h:6198
GotoStmt - This represents a direct goto.
Definition: Stmt.h:2889
This class represents temporary values used to represent inout and out arguments in HLSL.
Definition: Expr.h:7152
One of these records is kept for each identifier that is lexed.
IfStmt - This represents an if/then/else.
Definition: Stmt.h:2165
ImaginaryLiteral - We support imaginary integer and floating point literals, like "1....
Definition: Expr.h:1717
ImplicitCastExpr - Allows us to explicitly represent implicit type conversions, which have no direct ...
Definition: Expr.h:3724
Represents an implicitly-generated value initialization of an object of a given type.
Definition: Expr.h:5841
IndirectGotoStmt - This represents an indirect goto.
Definition: Stmt.h:2928
Describes an C or C++ initializer list.
Definition: Expr.h:5088
LabelStmt - Represents a label, which has a substatement.
Definition: Stmt.h:2058
A C++ lambda expression, which produces a function object (of unspecified type) that can be invoked l...
Definition: ExprCXX.h:1954
This represents a Microsoft inline-assembly statement extension.
Definition: Stmt.h:3509
Representation of a Microsoft __if_exists or __if_not_exists statement with a dependent name.
Definition: StmtCXX.h:253
A member reference to an MSPropertyDecl.
Definition: ExprCXX.h:933
MS property subscript expression.
Definition: ExprCXX.h:1004
Represents a prvalue temporary that is written into memory so that a reference can bind to it.
Definition: ExprCXX.h:4734
MatrixSubscriptExpr - Matrix subscript expression for the MatrixType extension.
Definition: Expr.h:2796
MemberExpr - [C99 6.5.2.3] Structure and Union Members.
Definition: Expr.h:3236
Represents a C++ nested name specifier, such as "\::std::vector<int>::".
Represents a place-holder for an object not to be initialized by anything.
Definition: Expr.h:5661
NonTypeTemplateParmDecl - Declares a non-type template parameter, e.g., "Size" in.
NullStmt - This is the null statement ";": C99 6.8.3p3.
Definition: Stmt.h:1591
void AddDecl(const Decl *D)
Definition: ODRHash.cpp:808
void AddIdentifierInfo(const IdentifierInfo *II)
Definition: ODRHash.cpp:28
void AddDeclarationName(DeclarationName Name, bool TreatAsDecl=false)
Definition: ODRHash.cpp:33
void AddNestedNameSpecifier(const NestedNameSpecifier *NNS)
Definition: ODRHash.cpp:111
void AddFunctionDecl(const FunctionDecl *Function, bool SkipBody=false)
Definition: ODRHash.cpp:662
void AddTemplateName(TemplateName Name)
Definition: ODRHash.cpp:140
void AddQualType(QualType T)
Definition: ODRHash.cpp:1268
unsigned CalculateHash()
Definition: ODRHash.cpp:226
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.
Definition: OpenMPClause.h:448
This represents clause 'aligned' in the '#pragma omp ...' directives.
This represents clause 'allocate' in the '#pragma omp ...' directives.
Definition: OpenMPClause.h:493
This represents 'allocator' clause in the '#pragma omp ...' directive.
Definition: OpenMPClause.h:414
An explicit cast in C or a C-style cast in C++, which uses the syntax ([s1][s2]......
Definition: ExprOpenMP.h:24
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.
Definition: StmtOpenMP.h:2947
This represents '#pragma omp barrier' directive.
Definition: StmtOpenMP.h:2625
This represents 'bind' clause in the '#pragma omp ...' directives.
This represents '#pragma omp cancel' directive.
Definition: StmtOpenMP.h:3655
This represents '#pragma omp cancellation point' directive.
Definition: StmtOpenMP.h:3597
Representation of an OpenMP canonical loop.
Definition: StmtOpenMP.h:142
This represents 'capture' clause in the '#pragma omp atomic' directive.
Class that handles post-update expression for some clauses, like 'lastprivate', 'reduction' etc.
Definition: OpenMPClause.h:233
Class that handles pre-initialization statement for some clauses, like 'schedule',...
Definition: OpenMPClause.h:195
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.
Definition: StmtOpenMP.h:2076
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.
Definition: StmtOpenMP.h:2841
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.
Definition: StmtOpenMP.h:5948
This represents 'dist_schedule' clause in the '#pragma omp ...' directive.
This represents '#pragma omp distribute' directive.
Definition: StmtOpenMP.h:4425
This represents '#pragma omp distribute parallel for' composite directive.
Definition: StmtOpenMP.h:4547
This represents '#pragma omp distribute parallel for simd' composite directive.
Definition: StmtOpenMP.h:4643
This represents '#pragma omp distribute simd' composite directive.
Definition: StmtOpenMP.h:4708
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.
Definition: StmtOpenMP.h:6432
This represents clause 'exclusive' in the '#pragma omp scan' directive.
This is a basic class for representing single OpenMP executable directive.
Definition: StmtOpenMP.h:266
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.
Definition: OpenMPClause.h:785
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.
Definition: StmtOpenMP.h:2789
This represents '#pragma omp for' directive.
Definition: StmtOpenMP.h:1634
This represents '#pragma omp for simd' directive.
Definition: StmtOpenMP.h:1724
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.
Definition: StmtOpenMP.h:6103
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.
Definition: OpenMPClause.h:682
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.
Definition: StmtOpenMP.h:5769
This represents '#pragma omp interop' directive.
Definition: StmtOpenMP.h:5895
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...
Definition: ExprOpenMP.h:151
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.
Definition: StmtOpenMP.h:683
This is a common base class for loop directives ('omp simd', 'omp for', 'omp for simd' etc....
Definition: StmtOpenMP.h:1004
The base class for all loop transformation directives.
Definition: StmtOpenMP.h:960
This represents clause 'map' in the '#pragma omp ...' directives.
This represents '#pragma omp masked' directive.
Definition: StmtOpenMP.h:6013
This represents '#pragma omp masked taskloop' directive.
Definition: StmtOpenMP.h:3930
This represents '#pragma omp masked taskloop simd' directive.
Definition: StmtOpenMP.h:4071
This represents '#pragma omp master' directive.
Definition: StmtOpenMP.h:2028
This represents '#pragma omp master taskloop' directive.
Definition: StmtOpenMP.h:3854
This represents '#pragma omp master taskloop simd' directive.
Definition: StmtOpenMP.h:4006
This represents 'mergeable' clause in the '#pragma omp ...' directive.
This represents 'message' clause in the '#pragma omp error' directive.
This represents '#pragma omp metadirective' directive.
Definition: StmtOpenMP.h:6064
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.
Definition: OpenMPClause.h:831
This represents 'order' clause in the '#pragma omp ...' directive.
This represents 'ordered' clause in the '#pragma omp ...' directive.
This represents '#pragma omp ordered' directive.
Definition: StmtOpenMP.h:2893
This represents '#pragma omp parallel' directive.
Definition: StmtOpenMP.h:612
This represents '#pragma omp parallel for' directive.
Definition: StmtOpenMP.h:2147
This represents '#pragma omp parallel for simd' directive.
Definition: StmtOpenMP.h:2244
This represents '#pragma omp parallel loop' directive.
Definition: StmtOpenMP.h:6305
This represents '#pragma omp parallel masked' directive.
Definition: StmtOpenMP.h:2372
This represents '#pragma omp parallel masked taskloop' directive.
Definition: StmtOpenMP.h:4215
This represents '#pragma omp parallel masked taskloop simd' directive.
Definition: StmtOpenMP.h:4360
This represents '#pragma omp parallel master' directive.
Definition: StmtOpenMP.h:2309
This represents '#pragma omp parallel master taskloop' directive.
Definition: StmtOpenMP.h:4137
This represents '#pragma omp parallel master taskloop simd' directive.
Definition: StmtOpenMP.h:4293
This represents '#pragma omp parallel sections' directive.
Definition: StmtOpenMP.h:2436
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.
Definition: StmtOpenMP.h:5704
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.
Definition: OpenMPClause.h:876
This represents '#pragma omp scan' directive.
Definition: StmtOpenMP.h:5842
This represents 'schedule' clause in the '#pragma omp ...' directive.
This represents '#pragma omp scope' directive.
Definition: StmtOpenMP.h:1925
This represents '#pragma omp section' directive.
Definition: StmtOpenMP.h:1864
This represents '#pragma omp sections' directive.
Definition: StmtOpenMP.h:1787
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.
Definition: StmtOpenMP.h:1571
This represents 'simdlen' clause in the '#pragma omp ...' directive.
Definition: OpenMPClause.h:911
This represents '#pragma omp single' directive.
Definition: StmtOpenMP.h:1977
This represents the 'sizes' clause in the '#pragma omp tile' directive.
Definition: OpenMPClause.h:943
This represents '#pragma omp target data' directive.
Definition: StmtOpenMP.h:3206
This represents '#pragma omp target' directive.
Definition: StmtOpenMP.h:3152
This represents '#pragma omp target enter data' directive.
Definition: StmtOpenMP.h:3260
This represents '#pragma omp target exit data' directive.
Definition: StmtOpenMP.h:3315
This represents '#pragma omp target parallel' directive.
Definition: StmtOpenMP.h:3369
This represents '#pragma omp target parallel for' directive.
Definition: StmtOpenMP.h:3449
This represents '#pragma omp target parallel for simd' directive.
Definition: StmtOpenMP.h:4774
This represents '#pragma omp target parallel loop' directive.
Definition: StmtOpenMP.h:6370
This represents '#pragma omp target simd' directive.
Definition: StmtOpenMP.h:4841
This represents '#pragma omp target teams' directive.
Definition: StmtOpenMP.h:5199
This represents '#pragma omp target teams distribute' combined directive.
Definition: StmtOpenMP.h:5255
This represents '#pragma omp target teams distribute parallel for' combined directive.
Definition: StmtOpenMP.h:5322
This represents '#pragma omp target teams distribute parallel for simd' combined directive.
Definition: StmtOpenMP.h:5420
This represents '#pragma omp target teams distribute simd' combined directive.
Definition: StmtOpenMP.h:5490
This represents '#pragma omp target teams loop' directive.
Definition: StmtOpenMP.h:6230
This represents '#pragma omp target update' directive.
Definition: StmtOpenMP.h:4491
This represents '#pragma omp task' directive.
Definition: StmtOpenMP.h:2517
This represents '#pragma omp taskloop' directive.
Definition: StmtOpenMP.h:3715
This represents '#pragma omp taskloop simd' directive.
Definition: StmtOpenMP.h:3788
This represents clause 'task_reduction' in the '#pragma omp taskgroup' directives.
This represents '#pragma omp taskgroup' directive.
Definition: StmtOpenMP.h:2722
This represents '#pragma omp taskwait' directive.
Definition: StmtOpenMP.h:2671
This represents '#pragma omp taskyield' directive.
Definition: StmtOpenMP.h:2579
This represents '#pragma omp teams' directive.
Definition: StmtOpenMP.h:3544
This represents '#pragma omp teams distribute' directive.
Definition: StmtOpenMP.h:4906
This represents '#pragma omp teams distribute parallel for' composite directive.
Definition: StmtOpenMP.h:5106
This represents '#pragma omp teams distribute parallel for simd' composite directive.
Definition: StmtOpenMP.h:5040
This represents '#pragma omp teams distribute simd' combined directive.
Definition: StmtOpenMP.h:4972
This represents '#pragma omp teams loop' directive.
Definition: StmtOpenMP.h:6165
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.
Definition: StmtOpenMP.h:5548
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.
Definition: StmtOpenMP.h:5630
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,...
Definition: ExprObjC.h:191
Represents Objective-C's @catch statement.
Definition: StmtObjC.h:77
Represents Objective-C's @finally statement.
Definition: StmtObjC.h:127
Represents Objective-C's @synchronized statement.
Definition: StmtObjC.h:303
Represents Objective-C's @throw statement.
Definition: StmtObjC.h:358
Represents Objective-C's @try ... @catch ... @finally statement.
Definition: StmtObjC.h:167
Represents Objective-C's @autoreleasepool Statement.
Definition: StmtObjC.h:394
A runtime availability query.
Definition: ExprObjC.h:1692
ObjCBoolLiteralExpr - Objective-C Boolean Literal.
Definition: ExprObjC.h:87
ObjCBoxedExpr - used for generalized expression boxing.
Definition: ExprObjC.h:127
An Objective-C "bridged" cast expression, which casts between Objective-C pointers and C pointers,...
Definition: ExprObjC.h:1632
ObjCDictionaryLiteral - AST node to represent objective-c dictionary literals; as in:"name" : NSUserN...
Definition: ExprObjC.h:309
ObjCEncodeExpr, used for @encode in Objective-C.
Definition: ExprObjC.h:410
Represents Objective-C's collection statement.
Definition: StmtObjC.h:23
ObjCIndirectCopyRestoreExpr - Represents the passing of a function argument by indirect copy-restore ...
Definition: ExprObjC.h:1571
ObjCIsaExpr - Represent X->isa and X.isa when X is an ObjC 'id' type.
Definition: ExprObjC.h:1487
ObjCIvarRefExpr - A reference to an ObjC instance variable.
Definition: ExprObjC.h:549
An expression that sends a message to the given Objective-C object or class.
Definition: ExprObjC.h:941
ObjCPropertyRefExpr - A dot-syntax expression to access an ObjC property.
Definition: ExprObjC.h:617
ObjCProtocolExpr used for protocol expression in Objective-C.
Definition: ExprObjC.h:505
ObjCSelectorExpr used for @selector in Objective-C.
Definition: ExprObjC.h:455
ObjCStringLiteral, used for Objective-C string literals i.e.
Definition: ExprObjC.h:51
ObjCSubscriptRefExpr - used for array and dictionary subscripting.
Definition: ExprObjC.h:840
OffsetOfExpr - [C99 7.17] - This represents an expression of the form offsetof(record-type,...
Definition: Expr.h:2519
Helper class for OffsetOfExpr.
Definition: Expr.h:2413
FieldDecl * getField() const
For a field offsetof node, returns the field.
Definition: Expr.h:2477
IdentifierInfo * getFieldName() const
For a field or identifier offsetof node, returns the name of the field.
Definition: Expr.cpp:1707
@ Array
An index into an array.
Definition: Expr.h:2418
@ Identifier
A field in a dependent type, known only by its name.
Definition: Expr.h:2422
@ Field
A field.
Definition: Expr.h:2420
@ Base
An implicit indirection through a C++ base class, when the field found is in a base class.
Definition: Expr.h:2425
Kind getKind() const
Determine what kind of offsetof node this is.
Definition: Expr.h:2467
OpaqueValueExpr - An expression referring to an opaque object of a fixed type and value class.
Definition: Expr.h:1173
This expression type represents an asterisk in an OpenACC Size-Expr, used in the 'tile' and 'gang' cl...
Definition: Expr.h:2078
void Visit(const OpenACCClause *C)
const Expr * getConditionExpr() 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.
Definition: OpenACCClause.h:24
Represents a 'collapse' clause on a 'loop' construct.
const Expr * getLoopCount() const
This class represents a compute construct, representing a 'Kind' of ‘parallel’, 'serial',...
Definition: StmtOpenACC.h:131
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.
Definition: StmtOpenACC.h:194
llvm::ArrayRef< Expr * > getIntExprs()
A 'self' clause, which has an optional condition expression, or, in the event of an 'update' directiv...
const Expr * getConditionExpr() const
bool isConditionExprClause() const
ArrayRef< Expr * > getVarList()
bool hasConditionExpr() const
llvm::ArrayRef< Expr * > getSizeExprs()
Expr * getDevNumExpr() const
llvm::ArrayRef< Expr * > getQueueIdExprs()
A reference to an overloaded function set, either an UnresolvedLookupExpr or an UnresolvedMemberExpr.
Definition: ExprCXX.h:2983
Represents a C++11 pack expansion that produces a sequence of expressions.
Definition: ExprCXX.h:4180
ParenExpr - This represents a parenthesized expression, e.g.
Definition: Expr.h:2170
Represents a parameter to a function.
Definition: Decl.h:1725
[C99 6.4.2.2] - A predefined identifier such as func.
Definition: Expr.h:1991
PseudoObjectExpr - An expression which accesses a pseudo-object l-value.
Definition: Expr.h:6546
const Expr *const * const_semantics_iterator
Definition: Expr.h:6611
A (possibly-)qualified type.
Definition: Type.h:929
Frontend produces RecoveryExprs on semantic errors that prevent creating other well-formed expression...
Definition: Expr.h:7258
C++2a [expr.prim.req]: A requires-expression provides a concise way to express requirements on templa...
Definition: ExprConcepts.h:502
ReturnStmt - This represents a return, optionally of an expression: return; return 4;.
Definition: Stmt.h:3046
Represents a __leave statement.
Definition: Stmt.h:3745
SYCLKernelCallStmt represents the transformation that is applied to the body of a function declared w...
Definition: StmtSYCL.h:37
ShuffleVectorExpr - clang-specific builtin-in function __builtin_shufflevector.
Definition: Expr.h:4514
Represents an expression that computes the length of a parameter pack.
Definition: ExprCXX.h:4258
Represents a function call to one of __builtin_LINE(), __builtin_COLUMN(), __builtin_FUNCTION(),...
Definition: Expr.h:4810
StmtExpr - This is the GNU Statement Expression extension: ({int X=4; X;}).
Definition: Expr.h:4466
Stmt - This represents one statement.
Definition: Stmt.h:84
void ProcessODRHash(llvm::FoldingSetNodeID &ID, ODRHash &Hash) const
Calculate a unique representation for a statement that is stable across compiler invocations.
StmtClass
Definition: Stmt.h:86
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.
Definition: Expr.h:1778
Represents a reference to a non-type template parameter that has been substituted with a template arg...
Definition: ExprCXX.h:4490
Represents a reference to a non-type template parameter pack that has been substituted with a non-tem...
Definition: ExprCXX.h:4575
SwitchStmt - This represents a 'switch' stmt.
Definition: Stmt.h:2415
Location wrapper for a TemplateArgument.
Definition: TemplateBase.h:524
Represents a template argument.
Definition: TemplateBase.h:61
QualType getStructuralValueType() const
Get the type of a StructuralValue.
Definition: TemplateBase.h:399
QualType getParamTypeForDecl() const
Definition: TemplateBase.h:331
Expr * getAsExpr() const
Retrieve the template argument as an expression.
Definition: TemplateBase.h:408
QualType getAsType() const
Retrieve the type for a type template argument.
Definition: TemplateBase.h:319
llvm::APSInt getAsIntegral() const
Retrieve the template argument as an integral value.
Definition: TemplateBase.h:363
QualType getNullPtrType() const
Retrieve the type for null non-type template argument.
Definition: TemplateBase.h:337
QualType getIntegralType() const
Retrieve the type of the integral value.
Definition: TemplateBase.h:377
ValueDecl * getAsDecl() const
Retrieve the declaration for a declaration non-type template argument.
Definition: TemplateBase.h:326
ArrayRef< TemplateArgument > pack_elements() const
Iterator range referencing all of the elements of a template argument pack.
Definition: TemplateBase.h:432
@ Declaration
The template argument is a declaration that was provided for a pointer, reference,...
Definition: TemplateBase.h:74
@ Template
The template argument is a template name that was provided for a template template parameter.
Definition: TemplateBase.h:93
@ StructuralValue
The template argument is a non-type template argument that can't be represented by the special-case D...
Definition: TemplateBase.h:89
@ Pack
The template argument is actually a parameter pack.
Definition: TemplateBase.h:107
@ TemplateExpansion
The template argument is a pack expansion of a template name that was provided for a template templat...
Definition: TemplateBase.h:97
@ NullPtr
The template argument is a null pointer or null pointer to member that was provided for a non-type te...
Definition: TemplateBase.h:78
@ Type
The template argument is a type.
Definition: TemplateBase.h:70
@ Null
Represents an empty template argument, e.g., one that has not been deduced.
Definition: TemplateBase.h:67
@ Integral
The template argument is an integral value stored in an llvm::APSInt that was provided for an integra...
Definition: TemplateBase.h:82
@ Expression
The template argument is an expression, and we've not resolved it to one of the other forms yet,...
Definition: TemplateBase.h:103
ArgKind getKind() const
Return the kind of stored template argument.
Definition: TemplateBase.h:295
TemplateName getAsTemplateOrTemplatePattern() const
Retrieve the template argument as a template name; if the argument is a pack expansion,...
Definition: TemplateBase.h:350
const APValue & getAsStructuralValue() const
Get the value of a StructuralValue.
Definition: TemplateBase.h:396
Represents a C++ template name within the type system.
Definition: TemplateName.h:220
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,...
Definition: ASTConcept.h:242
A type trait used in the implementation of various C++11 and Library TR1 trait templates.
Definition: ExprCXX.h:2768
const T * castAs() const
Member-template castAs<specific type>.
Definition: Type.h:8805
TypeClass getTypeClass() const
Definition: Type.h:2341
const T * getAs() const
Member-template getAs<specific type>'.
Definition: Type.h:8736
TypoExpr - Internal placeholder for expressions where typo correction still needs to be performed and...
Definition: Expr.h:6837
UnaryExprOrTypeTraitExpr - expression with either a type or (unevaluated) expression operand.
Definition: Expr.h:2622
UnaryOperator - This represents the unary-expression's (except sizeof and alignof),...
Definition: Expr.h:2232
A reference to a name which we were able to look up during parsing but could not resolve to a specifi...
Definition: ExprCXX.h:3203
Represents a C++ member access expression for which lookup produced a set of overloaded functions.
Definition: ExprCXX.h:3943
A call to a literal operator (C++11 [over.literal]) written as a user-defined literal (C++11 [lit....
Definition: ExprCXX.h:637
Represents a call to the builtin function __builtin_va_arg.
Definition: Expr.h:4750
WhileStmt - This represents a 'while' stmt.
Definition: Stmt.h:2611
A static requirement that can be used in a requires-expression to check properties of types and expre...
Definition: ExprConcepts.h:168
The JSON file list parser is used to communicate input to InstallAPI.
@ OO_None
Not an overloaded operator.
Definition: OperatorKinds.h:22
@ NUM_OVERLOADED_OPERATORS
Definition: OperatorKinds.h:26
BinaryOperatorKind
UnaryOperatorKind
const FunctionProtoType * T
#define false
Definition: stdbool.h:26
Data for list of allocators.