clang 19.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(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(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(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::VisitObjCForCollectionStmt(const ObjCForCollectionStmt *S) {
396 VisitStmt(S);
397}
398
399void StmtProfiler::VisitObjCAtCatchStmt(const ObjCAtCatchStmt *S) {
400 VisitStmt(S);
401 ID.AddBoolean(S->hasEllipsis());
402 if (S->getCatchParamDecl())
403 VisitType(S->getCatchParamDecl()->getType());
404}
405
406void StmtProfiler::VisitObjCAtFinallyStmt(const ObjCAtFinallyStmt *S) {
407 VisitStmt(S);
408}
409
410void StmtProfiler::VisitObjCAtTryStmt(const ObjCAtTryStmt *S) {
411 VisitStmt(S);
412}
413
414void
415StmtProfiler::VisitObjCAtSynchronizedStmt(const ObjCAtSynchronizedStmt *S) {
416 VisitStmt(S);
417}
418
419void StmtProfiler::VisitObjCAtThrowStmt(const ObjCAtThrowStmt *S) {
420 VisitStmt(S);
421}
422
423void
424StmtProfiler::VisitObjCAutoreleasePoolStmt(const ObjCAutoreleasePoolStmt *S) {
425 VisitStmt(S);
426}
427
428namespace {
429class OMPClauseProfiler : public ConstOMPClauseVisitor<OMPClauseProfiler> {
430 StmtProfiler *Profiler;
431 /// Process clauses with list of variables.
432 template <typename T>
433 void VisitOMPClauseList(T *Node);
434
435public:
436 OMPClauseProfiler(StmtProfiler *P) : Profiler(P) { }
437#define GEN_CLANG_CLAUSE_CLASS
438#define CLAUSE_CLASS(Enum, Str, Class) void Visit##Class(const Class *C);
439#include "llvm/Frontend/OpenMP/OMP.inc"
440 void VistOMPClauseWithPreInit(const OMPClauseWithPreInit *C);
441 void VistOMPClauseWithPostUpdate(const OMPClauseWithPostUpdate *C);
442};
443
444void OMPClauseProfiler::VistOMPClauseWithPreInit(
445 const OMPClauseWithPreInit *C) {
446 if (auto *S = C->getPreInitStmt())
447 Profiler->VisitStmt(S);
448}
449
450void OMPClauseProfiler::VistOMPClauseWithPostUpdate(
451 const OMPClauseWithPostUpdate *C) {
452 VistOMPClauseWithPreInit(C);
453 if (auto *E = C->getPostUpdateExpr())
454 Profiler->VisitStmt(E);
455}
456
457void OMPClauseProfiler::VisitOMPIfClause(const OMPIfClause *C) {
458 VistOMPClauseWithPreInit(C);
459 if (C->getCondition())
460 Profiler->VisitStmt(C->getCondition());
461}
462
463void OMPClauseProfiler::VisitOMPFinalClause(const OMPFinalClause *C) {
464 VistOMPClauseWithPreInit(C);
465 if (C->getCondition())
466 Profiler->VisitStmt(C->getCondition());
467}
468
469void OMPClauseProfiler::VisitOMPNumThreadsClause(const OMPNumThreadsClause *C) {
470 VistOMPClauseWithPreInit(C);
471 if (C->getNumThreads())
472 Profiler->VisitStmt(C->getNumThreads());
473}
474
475void OMPClauseProfiler::VisitOMPAlignClause(const OMPAlignClause *C) {
476 if (C->getAlignment())
477 Profiler->VisitStmt(C->getAlignment());
478}
479
480void OMPClauseProfiler::VisitOMPSafelenClause(const OMPSafelenClause *C) {
481 if (C->getSafelen())
482 Profiler->VisitStmt(C->getSafelen());
483}
484
485void OMPClauseProfiler::VisitOMPSimdlenClause(const OMPSimdlenClause *C) {
486 if (C->getSimdlen())
487 Profiler->VisitStmt(C->getSimdlen());
488}
489
490void OMPClauseProfiler::VisitOMPSizesClause(const OMPSizesClause *C) {
491 for (auto *E : C->getSizesRefs())
492 if (E)
493 Profiler->VisitExpr(E);
494}
495
496void OMPClauseProfiler::VisitOMPFullClause(const OMPFullClause *C) {}
497
498void OMPClauseProfiler::VisitOMPPartialClause(const OMPPartialClause *C) {
499 if (const Expr *Factor = C->getFactor())
500 Profiler->VisitExpr(Factor);
501}
502
503void OMPClauseProfiler::VisitOMPAllocatorClause(const OMPAllocatorClause *C) {
504 if (C->getAllocator())
505 Profiler->VisitStmt(C->getAllocator());
506}
507
508void OMPClauseProfiler::VisitOMPCollapseClause(const OMPCollapseClause *C) {
509 if (C->getNumForLoops())
510 Profiler->VisitStmt(C->getNumForLoops());
511}
512
513void OMPClauseProfiler::VisitOMPDetachClause(const OMPDetachClause *C) {
514 if (Expr *Evt = C->getEventHandler())
515 Profiler->VisitStmt(Evt);
516}
517
518void OMPClauseProfiler::VisitOMPNovariantsClause(const OMPNovariantsClause *C) {
519 VistOMPClauseWithPreInit(C);
520 if (C->getCondition())
521 Profiler->VisitStmt(C->getCondition());
522}
523
524void OMPClauseProfiler::VisitOMPNocontextClause(const OMPNocontextClause *C) {
525 VistOMPClauseWithPreInit(C);
526 if (C->getCondition())
527 Profiler->VisitStmt(C->getCondition());
528}
529
530void OMPClauseProfiler::VisitOMPDefaultClause(const OMPDefaultClause *C) { }
531
532void OMPClauseProfiler::VisitOMPProcBindClause(const OMPProcBindClause *C) { }
533
534void OMPClauseProfiler::VisitOMPUnifiedAddressClause(
535 const OMPUnifiedAddressClause *C) {}
536
537void OMPClauseProfiler::VisitOMPUnifiedSharedMemoryClause(
539
540void OMPClauseProfiler::VisitOMPReverseOffloadClause(
541 const OMPReverseOffloadClause *C) {}
542
543void OMPClauseProfiler::VisitOMPDynamicAllocatorsClause(
545
546void OMPClauseProfiler::VisitOMPAtomicDefaultMemOrderClause(
548
549void OMPClauseProfiler::VisitOMPAtClause(const OMPAtClause *C) {}
550
551void OMPClauseProfiler::VisitOMPSeverityClause(const OMPSeverityClause *C) {}
552
553void OMPClauseProfiler::VisitOMPMessageClause(const OMPMessageClause *C) {
554 if (C->getMessageString())
555 Profiler->VisitStmt(C->getMessageString());
556}
557
558void OMPClauseProfiler::VisitOMPScheduleClause(const OMPScheduleClause *C) {
559 VistOMPClauseWithPreInit(C);
560 if (auto *S = C->getChunkSize())
561 Profiler->VisitStmt(S);
562}
563
564void OMPClauseProfiler::VisitOMPOrderedClause(const OMPOrderedClause *C) {
565 if (auto *Num = C->getNumForLoops())
566 Profiler->VisitStmt(Num);
567}
568
569void OMPClauseProfiler::VisitOMPNowaitClause(const OMPNowaitClause *) {}
570
571void OMPClauseProfiler::VisitOMPUntiedClause(const OMPUntiedClause *) {}
572
573void OMPClauseProfiler::VisitOMPMergeableClause(const OMPMergeableClause *) {}
574
575void OMPClauseProfiler::VisitOMPReadClause(const OMPReadClause *) {}
576
577void OMPClauseProfiler::VisitOMPWriteClause(const OMPWriteClause *) {}
578
579void OMPClauseProfiler::VisitOMPUpdateClause(const OMPUpdateClause *) {}
580
581void OMPClauseProfiler::VisitOMPCaptureClause(const OMPCaptureClause *) {}
582
583void OMPClauseProfiler::VisitOMPCompareClause(const OMPCompareClause *) {}
584
585void OMPClauseProfiler::VisitOMPFailClause(const OMPFailClause *) {}
586
587void OMPClauseProfiler::VisitOMPSeqCstClause(const OMPSeqCstClause *) {}
588
589void OMPClauseProfiler::VisitOMPAcqRelClause(const OMPAcqRelClause *) {}
590
591void OMPClauseProfiler::VisitOMPAcquireClause(const OMPAcquireClause *) {}
592
593void OMPClauseProfiler::VisitOMPReleaseClause(const OMPReleaseClause *) {}
594
595void OMPClauseProfiler::VisitOMPRelaxedClause(const OMPRelaxedClause *) {}
596
597void OMPClauseProfiler::VisitOMPWeakClause(const OMPWeakClause *) {}
598
599void OMPClauseProfiler::VisitOMPThreadsClause(const OMPThreadsClause *) {}
600
601void OMPClauseProfiler::VisitOMPSIMDClause(const OMPSIMDClause *) {}
602
603void OMPClauseProfiler::VisitOMPNogroupClause(const OMPNogroupClause *) {}
604
605void OMPClauseProfiler::VisitOMPInitClause(const OMPInitClause *C) {
606 VisitOMPClauseList(C);
607}
608
609void OMPClauseProfiler::VisitOMPUseClause(const OMPUseClause *C) {
610 if (C->getInteropVar())
611 Profiler->VisitStmt(C->getInteropVar());
612}
613
614void OMPClauseProfiler::VisitOMPDestroyClause(const OMPDestroyClause *C) {
615 if (C->getInteropVar())
616 Profiler->VisitStmt(C->getInteropVar());
617}
618
619void OMPClauseProfiler::VisitOMPFilterClause(const OMPFilterClause *C) {
620 VistOMPClauseWithPreInit(C);
621 if (C->getThreadID())
622 Profiler->VisitStmt(C->getThreadID());
623}
624
625template<typename T>
626void OMPClauseProfiler::VisitOMPClauseList(T *Node) {
627 for (auto *E : Node->varlists()) {
628 if (E)
629 Profiler->VisitStmt(E);
630 }
631}
632
633void OMPClauseProfiler::VisitOMPPrivateClause(const OMPPrivateClause *C) {
634 VisitOMPClauseList(C);
635 for (auto *E : C->private_copies()) {
636 if (E)
637 Profiler->VisitStmt(E);
638 }
639}
640void
641OMPClauseProfiler::VisitOMPFirstprivateClause(const OMPFirstprivateClause *C) {
642 VisitOMPClauseList(C);
643 VistOMPClauseWithPreInit(C);
644 for (auto *E : C->private_copies()) {
645 if (E)
646 Profiler->VisitStmt(E);
647 }
648 for (auto *E : C->inits()) {
649 if (E)
650 Profiler->VisitStmt(E);
651 }
652}
653void
654OMPClauseProfiler::VisitOMPLastprivateClause(const OMPLastprivateClause *C) {
655 VisitOMPClauseList(C);
656 VistOMPClauseWithPostUpdate(C);
657 for (auto *E : C->source_exprs()) {
658 if (E)
659 Profiler->VisitStmt(E);
660 }
661 for (auto *E : C->destination_exprs()) {
662 if (E)
663 Profiler->VisitStmt(E);
664 }
665 for (auto *E : C->assignment_ops()) {
666 if (E)
667 Profiler->VisitStmt(E);
668 }
669}
670void OMPClauseProfiler::VisitOMPSharedClause(const OMPSharedClause *C) {
671 VisitOMPClauseList(C);
672}
673void OMPClauseProfiler::VisitOMPReductionClause(
674 const OMPReductionClause *C) {
675 Profiler->VisitNestedNameSpecifier(
676 C->getQualifierLoc().getNestedNameSpecifier());
677 Profiler->VisitName(C->getNameInfo().getName());
678 VisitOMPClauseList(C);
679 VistOMPClauseWithPostUpdate(C);
680 for (auto *E : C->privates()) {
681 if (E)
682 Profiler->VisitStmt(E);
683 }
684 for (auto *E : C->lhs_exprs()) {
685 if (E)
686 Profiler->VisitStmt(E);
687 }
688 for (auto *E : C->rhs_exprs()) {
689 if (E)
690 Profiler->VisitStmt(E);
691 }
692 for (auto *E : C->reduction_ops()) {
693 if (E)
694 Profiler->VisitStmt(E);
695 }
696 if (C->getModifier() == clang::OMPC_REDUCTION_inscan) {
697 for (auto *E : C->copy_ops()) {
698 if (E)
699 Profiler->VisitStmt(E);
700 }
701 for (auto *E : C->copy_array_temps()) {
702 if (E)
703 Profiler->VisitStmt(E);
704 }
705 for (auto *E : C->copy_array_elems()) {
706 if (E)
707 Profiler->VisitStmt(E);
708 }
709 }
710}
711void OMPClauseProfiler::VisitOMPTaskReductionClause(
712 const OMPTaskReductionClause *C) {
713 Profiler->VisitNestedNameSpecifier(
714 C->getQualifierLoc().getNestedNameSpecifier());
715 Profiler->VisitName(C->getNameInfo().getName());
716 VisitOMPClauseList(C);
717 VistOMPClauseWithPostUpdate(C);
718 for (auto *E : C->privates()) {
719 if (E)
720 Profiler->VisitStmt(E);
721 }
722 for (auto *E : C->lhs_exprs()) {
723 if (E)
724 Profiler->VisitStmt(E);
725 }
726 for (auto *E : C->rhs_exprs()) {
727 if (E)
728 Profiler->VisitStmt(E);
729 }
730 for (auto *E : C->reduction_ops()) {
731 if (E)
732 Profiler->VisitStmt(E);
733 }
734}
735void OMPClauseProfiler::VisitOMPInReductionClause(
736 const OMPInReductionClause *C) {
737 Profiler->VisitNestedNameSpecifier(
738 C->getQualifierLoc().getNestedNameSpecifier());
739 Profiler->VisitName(C->getNameInfo().getName());
740 VisitOMPClauseList(C);
741 VistOMPClauseWithPostUpdate(C);
742 for (auto *E : C->privates()) {
743 if (E)
744 Profiler->VisitStmt(E);
745 }
746 for (auto *E : C->lhs_exprs()) {
747 if (E)
748 Profiler->VisitStmt(E);
749 }
750 for (auto *E : C->rhs_exprs()) {
751 if (E)
752 Profiler->VisitStmt(E);
753 }
754 for (auto *E : C->reduction_ops()) {
755 if (E)
756 Profiler->VisitStmt(E);
757 }
758 for (auto *E : C->taskgroup_descriptors()) {
759 if (E)
760 Profiler->VisitStmt(E);
761 }
762}
763void OMPClauseProfiler::VisitOMPLinearClause(const OMPLinearClause *C) {
764 VisitOMPClauseList(C);
765 VistOMPClauseWithPostUpdate(C);
766 for (auto *E : C->privates()) {
767 if (E)
768 Profiler->VisitStmt(E);
769 }
770 for (auto *E : C->inits()) {
771 if (E)
772 Profiler->VisitStmt(E);
773 }
774 for (auto *E : C->updates()) {
775 if (E)
776 Profiler->VisitStmt(E);
777 }
778 for (auto *E : C->finals()) {
779 if (E)
780 Profiler->VisitStmt(E);
781 }
782 if (C->getStep())
783 Profiler->VisitStmt(C->getStep());
784 if (C->getCalcStep())
785 Profiler->VisitStmt(C->getCalcStep());
786}
787void OMPClauseProfiler::VisitOMPAlignedClause(const OMPAlignedClause *C) {
788 VisitOMPClauseList(C);
789 if (C->getAlignment())
790 Profiler->VisitStmt(C->getAlignment());
791}
792void OMPClauseProfiler::VisitOMPCopyinClause(const OMPCopyinClause *C) {
793 VisitOMPClauseList(C);
794 for (auto *E : C->source_exprs()) {
795 if (E)
796 Profiler->VisitStmt(E);
797 }
798 for (auto *E : C->destination_exprs()) {
799 if (E)
800 Profiler->VisitStmt(E);
801 }
802 for (auto *E : C->assignment_ops()) {
803 if (E)
804 Profiler->VisitStmt(E);
805 }
806}
807void
808OMPClauseProfiler::VisitOMPCopyprivateClause(const OMPCopyprivateClause *C) {
809 VisitOMPClauseList(C);
810 for (auto *E : C->source_exprs()) {
811 if (E)
812 Profiler->VisitStmt(E);
813 }
814 for (auto *E : C->destination_exprs()) {
815 if (E)
816 Profiler->VisitStmt(E);
817 }
818 for (auto *E : C->assignment_ops()) {
819 if (E)
820 Profiler->VisitStmt(E);
821 }
822}
823void OMPClauseProfiler::VisitOMPFlushClause(const OMPFlushClause *C) {
824 VisitOMPClauseList(C);
825}
826void OMPClauseProfiler::VisitOMPDepobjClause(const OMPDepobjClause *C) {
827 if (const Expr *Depobj = C->getDepobj())
828 Profiler->VisitStmt(Depobj);
829}
830void OMPClauseProfiler::VisitOMPDependClause(const OMPDependClause *C) {
831 VisitOMPClauseList(C);
832}
833void OMPClauseProfiler::VisitOMPDeviceClause(const OMPDeviceClause *C) {
834 if (C->getDevice())
835 Profiler->VisitStmt(C->getDevice());
836}
837void OMPClauseProfiler::VisitOMPMapClause(const OMPMapClause *C) {
838 VisitOMPClauseList(C);
839}
840void OMPClauseProfiler::VisitOMPAllocateClause(const OMPAllocateClause *C) {
841 if (Expr *Allocator = C->getAllocator())
842 Profiler->VisitStmt(Allocator);
843 VisitOMPClauseList(C);
844}
845void OMPClauseProfiler::VisitOMPNumTeamsClause(const OMPNumTeamsClause *C) {
846 VistOMPClauseWithPreInit(C);
847 if (C->getNumTeams())
848 Profiler->VisitStmt(C->getNumTeams());
849}
850void OMPClauseProfiler::VisitOMPThreadLimitClause(
851 const OMPThreadLimitClause *C) {
852 VistOMPClauseWithPreInit(C);
853 if (C->getThreadLimit())
854 Profiler->VisitStmt(C->getThreadLimit());
855}
856void OMPClauseProfiler::VisitOMPPriorityClause(const OMPPriorityClause *C) {
857 VistOMPClauseWithPreInit(C);
858 if (C->getPriority())
859 Profiler->VisitStmt(C->getPriority());
860}
861void OMPClauseProfiler::VisitOMPGrainsizeClause(const OMPGrainsizeClause *C) {
862 VistOMPClauseWithPreInit(C);
863 if (C->getGrainsize())
864 Profiler->VisitStmt(C->getGrainsize());
865}
866void OMPClauseProfiler::VisitOMPNumTasksClause(const OMPNumTasksClause *C) {
867 VistOMPClauseWithPreInit(C);
868 if (C->getNumTasks())
869 Profiler->VisitStmt(C->getNumTasks());
870}
871void OMPClauseProfiler::VisitOMPHintClause(const OMPHintClause *C) {
872 if (C->getHint())
873 Profiler->VisitStmt(C->getHint());
874}
875void OMPClauseProfiler::VisitOMPToClause(const OMPToClause *C) {
876 VisitOMPClauseList(C);
877}
878void OMPClauseProfiler::VisitOMPFromClause(const OMPFromClause *C) {
879 VisitOMPClauseList(C);
880}
881void OMPClauseProfiler::VisitOMPUseDevicePtrClause(
882 const OMPUseDevicePtrClause *C) {
883 VisitOMPClauseList(C);
884}
885void OMPClauseProfiler::VisitOMPUseDeviceAddrClause(
886 const OMPUseDeviceAddrClause *C) {
887 VisitOMPClauseList(C);
888}
889void OMPClauseProfiler::VisitOMPIsDevicePtrClause(
890 const OMPIsDevicePtrClause *C) {
891 VisitOMPClauseList(C);
892}
893void OMPClauseProfiler::VisitOMPHasDeviceAddrClause(
894 const OMPHasDeviceAddrClause *C) {
895 VisitOMPClauseList(C);
896}
897void OMPClauseProfiler::VisitOMPNontemporalClause(
898 const OMPNontemporalClause *C) {
899 VisitOMPClauseList(C);
900 for (auto *E : C->private_refs())
901 Profiler->VisitStmt(E);
902}
903void OMPClauseProfiler::VisitOMPInclusiveClause(const OMPInclusiveClause *C) {
904 VisitOMPClauseList(C);
905}
906void OMPClauseProfiler::VisitOMPExclusiveClause(const OMPExclusiveClause *C) {
907 VisitOMPClauseList(C);
908}
909void OMPClauseProfiler::VisitOMPUsesAllocatorsClause(
910 const OMPUsesAllocatorsClause *C) {
911 for (unsigned I = 0, E = C->getNumberOfAllocators(); I < E; ++I) {
912 OMPUsesAllocatorsClause::Data D = C->getAllocatorData(I);
913 Profiler->VisitStmt(D.Allocator);
914 if (D.AllocatorTraits)
915 Profiler->VisitStmt(D.AllocatorTraits);
916 }
917}
918void OMPClauseProfiler::VisitOMPAffinityClause(const OMPAffinityClause *C) {
919 if (const Expr *Modifier = C->getModifier())
920 Profiler->VisitStmt(Modifier);
921 for (const Expr *E : C->varlists())
922 Profiler->VisitStmt(E);
923}
924void OMPClauseProfiler::VisitOMPOrderClause(const OMPOrderClause *C) {}
925void OMPClauseProfiler::VisitOMPBindClause(const OMPBindClause *C) {}
926void OMPClauseProfiler::VisitOMPXDynCGroupMemClause(
927 const OMPXDynCGroupMemClause *C) {
928 VistOMPClauseWithPreInit(C);
929 if (Expr *Size = C->getSize())
930 Profiler->VisitStmt(Size);
931}
932void OMPClauseProfiler::VisitOMPDoacrossClause(const OMPDoacrossClause *C) {
933 VisitOMPClauseList(C);
934}
935void OMPClauseProfiler::VisitOMPXAttributeClause(const OMPXAttributeClause *C) {
936}
937void OMPClauseProfiler::VisitOMPXBareClause(const OMPXBareClause *C) {}
938} // namespace
939
940void
941StmtProfiler::VisitOMPExecutableDirective(const OMPExecutableDirective *S) {
942 VisitStmt(S);
943 OMPClauseProfiler P(this);
944 ArrayRef<OMPClause *> Clauses = S->clauses();
945 for (ArrayRef<OMPClause *>::iterator I = Clauses.begin(), E = Clauses.end();
946 I != E; ++I)
947 if (*I)
948 P.Visit(*I);
949}
950
951void StmtProfiler::VisitOMPCanonicalLoop(const OMPCanonicalLoop *L) {
952 VisitStmt(L);
953}
954
955void StmtProfiler::VisitOMPLoopBasedDirective(const OMPLoopBasedDirective *S) {
956 VisitOMPExecutableDirective(S);
957}
958
959void StmtProfiler::VisitOMPLoopDirective(const OMPLoopDirective *S) {
960 VisitOMPLoopBasedDirective(S);
961}
962
963void StmtProfiler::VisitOMPMetaDirective(const OMPMetaDirective *S) {
964 VisitOMPExecutableDirective(S);
965}
966
967void StmtProfiler::VisitOMPParallelDirective(const OMPParallelDirective *S) {
968 VisitOMPExecutableDirective(S);
969}
970
971void StmtProfiler::VisitOMPSimdDirective(const OMPSimdDirective *S) {
972 VisitOMPLoopDirective(S);
973}
974
975void StmtProfiler::VisitOMPLoopTransformationDirective(
977 VisitOMPLoopBasedDirective(S);
978}
979
980void StmtProfiler::VisitOMPTileDirective(const OMPTileDirective *S) {
981 VisitOMPLoopTransformationDirective(S);
982}
983
984void StmtProfiler::VisitOMPUnrollDirective(const OMPUnrollDirective *S) {
985 VisitOMPLoopTransformationDirective(S);
986}
987
988void StmtProfiler::VisitOMPForDirective(const OMPForDirective *S) {
989 VisitOMPLoopDirective(S);
990}
991
992void StmtProfiler::VisitOMPForSimdDirective(const OMPForSimdDirective *S) {
993 VisitOMPLoopDirective(S);
994}
995
996void StmtProfiler::VisitOMPSectionsDirective(const OMPSectionsDirective *S) {
997 VisitOMPExecutableDirective(S);
998}
999
1000void StmtProfiler::VisitOMPSectionDirective(const OMPSectionDirective *S) {
1001 VisitOMPExecutableDirective(S);
1002}
1003
1004void StmtProfiler::VisitOMPScopeDirective(const OMPScopeDirective *S) {
1005 VisitOMPExecutableDirective(S);
1006}
1007
1008void StmtProfiler::VisitOMPSingleDirective(const OMPSingleDirective *S) {
1009 VisitOMPExecutableDirective(S);
1010}
1011
1012void StmtProfiler::VisitOMPMasterDirective(const OMPMasterDirective *S) {
1013 VisitOMPExecutableDirective(S);
1014}
1015
1016void StmtProfiler::VisitOMPCriticalDirective(const OMPCriticalDirective *S) {
1017 VisitOMPExecutableDirective(S);
1018 VisitName(S->getDirectiveName().getName());
1019}
1020
1021void
1022StmtProfiler::VisitOMPParallelForDirective(const OMPParallelForDirective *S) {
1023 VisitOMPLoopDirective(S);
1024}
1025
1026void StmtProfiler::VisitOMPParallelForSimdDirective(
1027 const OMPParallelForSimdDirective *S) {
1028 VisitOMPLoopDirective(S);
1029}
1030
1031void StmtProfiler::VisitOMPParallelMasterDirective(
1032 const OMPParallelMasterDirective *S) {
1033 VisitOMPExecutableDirective(S);
1034}
1035
1036void StmtProfiler::VisitOMPParallelMaskedDirective(
1037 const OMPParallelMaskedDirective *S) {
1038 VisitOMPExecutableDirective(S);
1039}
1040
1041void StmtProfiler::VisitOMPParallelSectionsDirective(
1043 VisitOMPExecutableDirective(S);
1044}
1045
1046void StmtProfiler::VisitOMPTaskDirective(const OMPTaskDirective *S) {
1047 VisitOMPExecutableDirective(S);
1048}
1049
1050void StmtProfiler::VisitOMPTaskyieldDirective(const OMPTaskyieldDirective *S) {
1051 VisitOMPExecutableDirective(S);
1052}
1053
1054void StmtProfiler::VisitOMPBarrierDirective(const OMPBarrierDirective *S) {
1055 VisitOMPExecutableDirective(S);
1056}
1057
1058void StmtProfiler::VisitOMPTaskwaitDirective(const OMPTaskwaitDirective *S) {
1059 VisitOMPExecutableDirective(S);
1060}
1061
1062void StmtProfiler::VisitOMPErrorDirective(const OMPErrorDirective *S) {
1063 VisitOMPExecutableDirective(S);
1064}
1065void StmtProfiler::VisitOMPTaskgroupDirective(const OMPTaskgroupDirective *S) {
1066 VisitOMPExecutableDirective(S);
1067 if (const Expr *E = S->getReductionRef())
1068 VisitStmt(E);
1069}
1070
1071void StmtProfiler::VisitOMPFlushDirective(const OMPFlushDirective *S) {
1072 VisitOMPExecutableDirective(S);
1073}
1074
1075void StmtProfiler::VisitOMPDepobjDirective(const OMPDepobjDirective *S) {
1076 VisitOMPExecutableDirective(S);
1077}
1078
1079void StmtProfiler::VisitOMPScanDirective(const OMPScanDirective *S) {
1080 VisitOMPExecutableDirective(S);
1081}
1082
1083void StmtProfiler::VisitOMPOrderedDirective(const OMPOrderedDirective *S) {
1084 VisitOMPExecutableDirective(S);
1085}
1086
1087void StmtProfiler::VisitOMPAtomicDirective(const OMPAtomicDirective *S) {
1088 VisitOMPExecutableDirective(S);
1089}
1090
1091void StmtProfiler::VisitOMPTargetDirective(const OMPTargetDirective *S) {
1092 VisitOMPExecutableDirective(S);
1093}
1094
1095void StmtProfiler::VisitOMPTargetDataDirective(const OMPTargetDataDirective *S) {
1096 VisitOMPExecutableDirective(S);
1097}
1098
1099void StmtProfiler::VisitOMPTargetEnterDataDirective(
1100 const OMPTargetEnterDataDirective *S) {
1101 VisitOMPExecutableDirective(S);
1102}
1103
1104void StmtProfiler::VisitOMPTargetExitDataDirective(
1105 const OMPTargetExitDataDirective *S) {
1106 VisitOMPExecutableDirective(S);
1107}
1108
1109void StmtProfiler::VisitOMPTargetParallelDirective(
1110 const OMPTargetParallelDirective *S) {
1111 VisitOMPExecutableDirective(S);
1112}
1113
1114void StmtProfiler::VisitOMPTargetParallelForDirective(
1116 VisitOMPExecutableDirective(S);
1117}
1118
1119void StmtProfiler::VisitOMPTeamsDirective(const OMPTeamsDirective *S) {
1120 VisitOMPExecutableDirective(S);
1121}
1122
1123void StmtProfiler::VisitOMPCancellationPointDirective(
1125 VisitOMPExecutableDirective(S);
1126}
1127
1128void StmtProfiler::VisitOMPCancelDirective(const OMPCancelDirective *S) {
1129 VisitOMPExecutableDirective(S);
1130}
1131
1132void StmtProfiler::VisitOMPTaskLoopDirective(const OMPTaskLoopDirective *S) {
1133 VisitOMPLoopDirective(S);
1134}
1135
1136void StmtProfiler::VisitOMPTaskLoopSimdDirective(
1137 const OMPTaskLoopSimdDirective *S) {
1138 VisitOMPLoopDirective(S);
1139}
1140
1141void StmtProfiler::VisitOMPMasterTaskLoopDirective(
1142 const OMPMasterTaskLoopDirective *S) {
1143 VisitOMPLoopDirective(S);
1144}
1145
1146void StmtProfiler::VisitOMPMaskedTaskLoopDirective(
1147 const OMPMaskedTaskLoopDirective *S) {
1148 VisitOMPLoopDirective(S);
1149}
1150
1151void StmtProfiler::VisitOMPMasterTaskLoopSimdDirective(
1153 VisitOMPLoopDirective(S);
1154}
1155
1156void StmtProfiler::VisitOMPMaskedTaskLoopSimdDirective(
1158 VisitOMPLoopDirective(S);
1159}
1160
1161void StmtProfiler::VisitOMPParallelMasterTaskLoopDirective(
1163 VisitOMPLoopDirective(S);
1164}
1165
1166void StmtProfiler::VisitOMPParallelMaskedTaskLoopDirective(
1168 VisitOMPLoopDirective(S);
1169}
1170
1171void StmtProfiler::VisitOMPParallelMasterTaskLoopSimdDirective(
1173 VisitOMPLoopDirective(S);
1174}
1175
1176void StmtProfiler::VisitOMPParallelMaskedTaskLoopSimdDirective(
1178 VisitOMPLoopDirective(S);
1179}
1180
1181void StmtProfiler::VisitOMPDistributeDirective(
1182 const OMPDistributeDirective *S) {
1183 VisitOMPLoopDirective(S);
1184}
1185
1186void OMPClauseProfiler::VisitOMPDistScheduleClause(
1187 const OMPDistScheduleClause *C) {
1188 VistOMPClauseWithPreInit(C);
1189 if (auto *S = C->getChunkSize())
1190 Profiler->VisitStmt(S);
1191}
1192
1193void OMPClauseProfiler::VisitOMPDefaultmapClause(const OMPDefaultmapClause *) {}
1194
1195void StmtProfiler::VisitOMPTargetUpdateDirective(
1196 const OMPTargetUpdateDirective *S) {
1197 VisitOMPExecutableDirective(S);
1198}
1199
1200void StmtProfiler::VisitOMPDistributeParallelForDirective(
1202 VisitOMPLoopDirective(S);
1203}
1204
1205void StmtProfiler::VisitOMPDistributeParallelForSimdDirective(
1207 VisitOMPLoopDirective(S);
1208}
1209
1210void StmtProfiler::VisitOMPDistributeSimdDirective(
1211 const OMPDistributeSimdDirective *S) {
1212 VisitOMPLoopDirective(S);
1213}
1214
1215void StmtProfiler::VisitOMPTargetParallelForSimdDirective(
1217 VisitOMPLoopDirective(S);
1218}
1219
1220void StmtProfiler::VisitOMPTargetSimdDirective(
1221 const OMPTargetSimdDirective *S) {
1222 VisitOMPLoopDirective(S);
1223}
1224
1225void StmtProfiler::VisitOMPTeamsDistributeDirective(
1226 const OMPTeamsDistributeDirective *S) {
1227 VisitOMPLoopDirective(S);
1228}
1229
1230void StmtProfiler::VisitOMPTeamsDistributeSimdDirective(
1232 VisitOMPLoopDirective(S);
1233}
1234
1235void StmtProfiler::VisitOMPTeamsDistributeParallelForSimdDirective(
1237 VisitOMPLoopDirective(S);
1238}
1239
1240void StmtProfiler::VisitOMPTeamsDistributeParallelForDirective(
1242 VisitOMPLoopDirective(S);
1243}
1244
1245void StmtProfiler::VisitOMPTargetTeamsDirective(
1246 const OMPTargetTeamsDirective *S) {
1247 VisitOMPExecutableDirective(S);
1248}
1249
1250void StmtProfiler::VisitOMPTargetTeamsDistributeDirective(
1252 VisitOMPLoopDirective(S);
1253}
1254
1255void StmtProfiler::VisitOMPTargetTeamsDistributeParallelForDirective(
1257 VisitOMPLoopDirective(S);
1258}
1259
1260void StmtProfiler::VisitOMPTargetTeamsDistributeParallelForSimdDirective(
1262 VisitOMPLoopDirective(S);
1263}
1264
1265void StmtProfiler::VisitOMPTargetTeamsDistributeSimdDirective(
1267 VisitOMPLoopDirective(S);
1268}
1269
1270void StmtProfiler::VisitOMPInteropDirective(const OMPInteropDirective *S) {
1271 VisitOMPExecutableDirective(S);
1272}
1273
1274void StmtProfiler::VisitOMPDispatchDirective(const OMPDispatchDirective *S) {
1275 VisitOMPExecutableDirective(S);
1276}
1277
1278void StmtProfiler::VisitOMPMaskedDirective(const OMPMaskedDirective *S) {
1279 VisitOMPExecutableDirective(S);
1280}
1281
1282void StmtProfiler::VisitOMPGenericLoopDirective(
1283 const OMPGenericLoopDirective *S) {
1284 VisitOMPLoopDirective(S);
1285}
1286
1287void StmtProfiler::VisitOMPTeamsGenericLoopDirective(
1289 VisitOMPLoopDirective(S);
1290}
1291
1292void StmtProfiler::VisitOMPTargetTeamsGenericLoopDirective(
1294 VisitOMPLoopDirective(S);
1295}
1296
1297void StmtProfiler::VisitOMPParallelGenericLoopDirective(
1299 VisitOMPLoopDirective(S);
1300}
1301
1302void StmtProfiler::VisitOMPTargetParallelGenericLoopDirective(
1304 VisitOMPLoopDirective(S);
1305}
1306
1307void StmtProfiler::VisitExpr(const Expr *S) {
1308 VisitStmt(S);
1309}
1310
1311void StmtProfiler::VisitConstantExpr(const ConstantExpr *S) {
1312 VisitExpr(S);
1313}
1314
1315void StmtProfiler::VisitDeclRefExpr(const DeclRefExpr *S) {
1316 VisitExpr(S);
1317 if (!Canonical)
1318 VisitNestedNameSpecifier(S->getQualifier());
1319 VisitDecl(S->getDecl());
1320 if (!Canonical) {
1321 ID.AddBoolean(S->hasExplicitTemplateArgs());
1322 if (S->hasExplicitTemplateArgs())
1323 VisitTemplateArguments(S->getTemplateArgs(), S->getNumTemplateArgs());
1324 }
1325}
1326
1327void StmtProfiler::VisitSYCLUniqueStableNameExpr(
1328 const SYCLUniqueStableNameExpr *S) {
1329 VisitExpr(S);
1330 VisitType(S->getTypeSourceInfo()->getType());
1331}
1332
1333void StmtProfiler::VisitPredefinedExpr(const PredefinedExpr *S) {
1334 VisitExpr(S);
1335 ID.AddInteger(llvm::to_underlying(S->getIdentKind()));
1336}
1337
1338void StmtProfiler::VisitIntegerLiteral(const IntegerLiteral *S) {
1339 VisitExpr(S);
1340 S->getValue().Profile(ID);
1341
1342 QualType T = S->getType();
1343 if (Canonical)
1344 T = T.getCanonicalType();
1345 ID.AddInteger(T->getTypeClass());
1346 if (auto BitIntT = T->getAs<BitIntType>())
1347 BitIntT->Profile(ID);
1348 else
1349 ID.AddInteger(T->castAs<BuiltinType>()->getKind());
1350}
1351
1352void StmtProfiler::VisitFixedPointLiteral(const FixedPointLiteral *S) {
1353 VisitExpr(S);
1354 S->getValue().Profile(ID);
1355 ID.AddInteger(S->getType()->castAs<BuiltinType>()->getKind());
1356}
1357
1358void StmtProfiler::VisitCharacterLiteral(const CharacterLiteral *S) {
1359 VisitExpr(S);
1360 ID.AddInteger(llvm::to_underlying(S->getKind()));
1361 ID.AddInteger(S->getValue());
1362}
1363
1364void StmtProfiler::VisitFloatingLiteral(const FloatingLiteral *S) {
1365 VisitExpr(S);
1366 S->getValue().Profile(ID);
1367 ID.AddBoolean(S->isExact());
1368 ID.AddInteger(S->getType()->castAs<BuiltinType>()->getKind());
1369}
1370
1371void StmtProfiler::VisitImaginaryLiteral(const ImaginaryLiteral *S) {
1372 VisitExpr(S);
1373}
1374
1375void StmtProfiler::VisitStringLiteral(const StringLiteral *S) {
1376 VisitExpr(S);
1377 ID.AddString(S->getBytes());
1378 ID.AddInteger(llvm::to_underlying(S->getKind()));
1379}
1380
1381void StmtProfiler::VisitParenExpr(const ParenExpr *S) {
1382 VisitExpr(S);
1383}
1384
1385void StmtProfiler::VisitParenListExpr(const ParenListExpr *S) {
1386 VisitExpr(S);
1387}
1388
1389void StmtProfiler::VisitUnaryOperator(const UnaryOperator *S) {
1390 VisitExpr(S);
1391 ID.AddInteger(S->getOpcode());
1392}
1393
1394void StmtProfiler::VisitOffsetOfExpr(const OffsetOfExpr *S) {
1395 VisitType(S->getTypeSourceInfo()->getType());
1396 unsigned n = S->getNumComponents();
1397 for (unsigned i = 0; i < n; ++i) {
1398 const OffsetOfNode &ON = S->getComponent(i);
1399 ID.AddInteger(ON.getKind());
1400 switch (ON.getKind()) {
1402 // Expressions handled below.
1403 break;
1404
1406 VisitDecl(ON.getField());
1407 break;
1408
1410 VisitIdentifierInfo(ON.getFieldName());
1411 break;
1412
1413 case OffsetOfNode::Base:
1414 // These nodes are implicit, and therefore don't need profiling.
1415 break;
1416 }
1417 }
1418
1419 VisitExpr(S);
1420}
1421
1422void
1423StmtProfiler::VisitUnaryExprOrTypeTraitExpr(const UnaryExprOrTypeTraitExpr *S) {
1424 VisitExpr(S);
1425 ID.AddInteger(S->getKind());
1426 if (S->isArgumentType())
1427 VisitType(S->getArgumentType());
1428}
1429
1430void StmtProfiler::VisitArraySubscriptExpr(const ArraySubscriptExpr *S) {
1431 VisitExpr(S);
1432}
1433
1434void StmtProfiler::VisitMatrixSubscriptExpr(const MatrixSubscriptExpr *S) {
1435 VisitExpr(S);
1436}
1437
1438void StmtProfiler::VisitOMPArraySectionExpr(const OMPArraySectionExpr *S) {
1439 VisitExpr(S);
1440}
1441
1442void StmtProfiler::VisitOMPArrayShapingExpr(const OMPArrayShapingExpr *S) {
1443 VisitExpr(S);
1444}
1445
1446void StmtProfiler::VisitOMPIteratorExpr(const OMPIteratorExpr *S) {
1447 VisitExpr(S);
1448 for (unsigned I = 0, E = S->numOfIterators(); I < E; ++I)
1449 VisitDecl(S->getIteratorDecl(I));
1450}
1451
1452void StmtProfiler::VisitCallExpr(const CallExpr *S) {
1453 VisitExpr(S);
1454}
1455
1456void StmtProfiler::VisitMemberExpr(const MemberExpr *S) {
1457 VisitExpr(S);
1458 VisitDecl(S->getMemberDecl());
1459 if (!Canonical)
1460 VisitNestedNameSpecifier(S->getQualifier());
1461 ID.AddBoolean(S->isArrow());
1462}
1463
1464void StmtProfiler::VisitCompoundLiteralExpr(const CompoundLiteralExpr *S) {
1465 VisitExpr(S);
1466 ID.AddBoolean(S->isFileScope());
1467}
1468
1469void StmtProfiler::VisitCastExpr(const CastExpr *S) {
1470 VisitExpr(S);
1471}
1472
1473void StmtProfiler::VisitImplicitCastExpr(const ImplicitCastExpr *S) {
1474 VisitCastExpr(S);
1475 ID.AddInteger(S->getValueKind());
1476}
1477
1478void StmtProfiler::VisitExplicitCastExpr(const ExplicitCastExpr *S) {
1479 VisitCastExpr(S);
1480 VisitType(S->getTypeAsWritten());
1481}
1482
1483void StmtProfiler::VisitCStyleCastExpr(const CStyleCastExpr *S) {
1484 VisitExplicitCastExpr(S);
1485}
1486
1487void StmtProfiler::VisitBinaryOperator(const BinaryOperator *S) {
1488 VisitExpr(S);
1489 ID.AddInteger(S->getOpcode());
1490}
1491
1492void
1493StmtProfiler::VisitCompoundAssignOperator(const CompoundAssignOperator *S) {
1494 VisitBinaryOperator(S);
1495}
1496
1497void StmtProfiler::VisitConditionalOperator(const ConditionalOperator *S) {
1498 VisitExpr(S);
1499}
1500
1501void StmtProfiler::VisitBinaryConditionalOperator(
1502 const BinaryConditionalOperator *S) {
1503 VisitExpr(S);
1504}
1505
1506void StmtProfiler::VisitAddrLabelExpr(const AddrLabelExpr *S) {
1507 VisitExpr(S);
1508 VisitDecl(S->getLabel());
1509}
1510
1511void StmtProfiler::VisitStmtExpr(const StmtExpr *S) {
1512 VisitExpr(S);
1513}
1514
1515void StmtProfiler::VisitShuffleVectorExpr(const ShuffleVectorExpr *S) {
1516 VisitExpr(S);
1517}
1518
1519void StmtProfiler::VisitConvertVectorExpr(const ConvertVectorExpr *S) {
1520 VisitExpr(S);
1521}
1522
1523void StmtProfiler::VisitChooseExpr(const ChooseExpr *S) {
1524 VisitExpr(S);
1525}
1526
1527void StmtProfiler::VisitGNUNullExpr(const GNUNullExpr *S) {
1528 VisitExpr(S);
1529}
1530
1531void StmtProfiler::VisitVAArgExpr(const VAArgExpr *S) {
1532 VisitExpr(S);
1533}
1534
1535void StmtProfiler::VisitInitListExpr(const InitListExpr *S) {
1536 if (S->getSyntacticForm()) {
1537 VisitInitListExpr(S->getSyntacticForm());
1538 return;
1539 }
1540
1541 VisitExpr(S);
1542}
1543
1544void StmtProfiler::VisitDesignatedInitExpr(const DesignatedInitExpr *S) {
1545 VisitExpr(S);
1546 ID.AddBoolean(S->usesGNUSyntax());
1547 for (const DesignatedInitExpr::Designator &D : S->designators()) {
1548 if (D.isFieldDesignator()) {
1549 ID.AddInteger(0);
1550 VisitName(D.getFieldName());
1551 continue;
1552 }
1553
1554 if (D.isArrayDesignator()) {
1555 ID.AddInteger(1);
1556 } else {
1557 assert(D.isArrayRangeDesignator());
1558 ID.AddInteger(2);
1559 }
1560 ID.AddInteger(D.getArrayIndex());
1561 }
1562}
1563
1564// Seems that if VisitInitListExpr() only works on the syntactic form of an
1565// InitListExpr, then a DesignatedInitUpdateExpr is not encountered.
1566void StmtProfiler::VisitDesignatedInitUpdateExpr(
1567 const DesignatedInitUpdateExpr *S) {
1568 llvm_unreachable("Unexpected DesignatedInitUpdateExpr in syntactic form of "
1569 "initializer");
1570}
1571
1572void StmtProfiler::VisitArrayInitLoopExpr(const ArrayInitLoopExpr *S) {
1573 VisitExpr(S);
1574}
1575
1576void StmtProfiler::VisitArrayInitIndexExpr(const ArrayInitIndexExpr *S) {
1577 VisitExpr(S);
1578}
1579
1580void StmtProfiler::VisitNoInitExpr(const NoInitExpr *S) {
1581 llvm_unreachable("Unexpected NoInitExpr in syntactic form of initializer");
1582}
1583
1584void StmtProfiler::VisitImplicitValueInitExpr(const ImplicitValueInitExpr *S) {
1585 VisitExpr(S);
1586}
1587
1588void StmtProfiler::VisitExtVectorElementExpr(const ExtVectorElementExpr *S) {
1589 VisitExpr(S);
1590 VisitName(&S->getAccessor());
1591}
1592
1593void StmtProfiler::VisitBlockExpr(const BlockExpr *S) {
1594 VisitExpr(S);
1595 VisitDecl(S->getBlockDecl());
1596}
1597
1598void StmtProfiler::VisitGenericSelectionExpr(const GenericSelectionExpr *S) {
1599 VisitExpr(S);
1601 S->associations()) {
1602 QualType T = Assoc.getType();
1603 if (T.isNull())
1604 ID.AddPointer(nullptr);
1605 else
1606 VisitType(T);
1607 VisitExpr(Assoc.getAssociationExpr());
1608 }
1609}
1610
1611void StmtProfiler::VisitPseudoObjectExpr(const PseudoObjectExpr *S) {
1612 VisitExpr(S);
1614 i = S->semantics_begin(), e = S->semantics_end(); i != e; ++i)
1615 // Normally, we would not profile the source expressions of OVEs.
1616 if (const OpaqueValueExpr *OVE = dyn_cast<OpaqueValueExpr>(*i))
1617 Visit(OVE->getSourceExpr());
1618}
1619
1620void StmtProfiler::VisitAtomicExpr(const AtomicExpr *S) {
1621 VisitExpr(S);
1622 ID.AddInteger(S->getOp());
1623}
1624
1625void StmtProfiler::VisitConceptSpecializationExpr(
1626 const ConceptSpecializationExpr *S) {
1627 VisitExpr(S);
1628 VisitDecl(S->getNamedConcept());
1629 for (const TemplateArgument &Arg : S->getTemplateArguments())
1630 VisitTemplateArgument(Arg);
1631}
1632
1633void StmtProfiler::VisitRequiresExpr(const RequiresExpr *S) {
1634 VisitExpr(S);
1635 ID.AddInteger(S->getLocalParameters().size());
1636 for (ParmVarDecl *LocalParam : S->getLocalParameters())
1637 VisitDecl(LocalParam);
1638 ID.AddInteger(S->getRequirements().size());
1639 for (concepts::Requirement *Req : S->getRequirements()) {
1640 if (auto *TypeReq = dyn_cast<concepts::TypeRequirement>(Req)) {
1642 ID.AddBoolean(TypeReq->isSubstitutionFailure());
1643 if (!TypeReq->isSubstitutionFailure())
1644 VisitType(TypeReq->getType()->getType());
1645 } else if (auto *ExprReq = dyn_cast<concepts::ExprRequirement>(Req)) {
1647 ID.AddBoolean(ExprReq->isExprSubstitutionFailure());
1648 if (!ExprReq->isExprSubstitutionFailure())
1649 Visit(ExprReq->getExpr());
1650 // C++2a [expr.prim.req.compound]p1 Example:
1651 // [...] The compound-requirement in C1 requires that x++ is a valid
1652 // expression. It is equivalent to the simple-requirement x++; [...]
1653 // We therefore do not profile isSimple() here.
1654 ID.AddBoolean(ExprReq->getNoexceptLoc().isValid());
1656 ExprReq->getReturnTypeRequirement();
1657 if (RetReq.isEmpty()) {
1658 ID.AddInteger(0);
1659 } else if (RetReq.isTypeConstraint()) {
1660 ID.AddInteger(1);
1662 } else {
1663 assert(RetReq.isSubstitutionFailure());
1664 ID.AddInteger(2);
1665 }
1666 } else {
1668 auto *NestedReq = cast<concepts::NestedRequirement>(Req);
1669 ID.AddBoolean(NestedReq->hasInvalidConstraint());
1670 if (!NestedReq->hasInvalidConstraint())
1671 Visit(NestedReq->getConstraintExpr());
1672 }
1673 }
1674}
1675
1677 UnaryOperatorKind &UnaryOp,
1678 BinaryOperatorKind &BinaryOp,
1679 unsigned &NumArgs) {
1680 switch (S->getOperator()) {
1681 case OO_None:
1682 case OO_New:
1683 case OO_Delete:
1684 case OO_Array_New:
1685 case OO_Array_Delete:
1686 case OO_Arrow:
1687 case OO_Conditional:
1689 llvm_unreachable("Invalid operator call kind");
1690
1691 case OO_Plus:
1692 if (NumArgs == 1) {
1693 UnaryOp = UO_Plus;
1694 return Stmt::UnaryOperatorClass;
1695 }
1696
1697 BinaryOp = BO_Add;
1698 return Stmt::BinaryOperatorClass;
1699
1700 case OO_Minus:
1701 if (NumArgs == 1) {
1702 UnaryOp = UO_Minus;
1703 return Stmt::UnaryOperatorClass;
1704 }
1705
1706 BinaryOp = BO_Sub;
1707 return Stmt::BinaryOperatorClass;
1708
1709 case OO_Star:
1710 if (NumArgs == 1) {
1711 UnaryOp = UO_Deref;
1712 return Stmt::UnaryOperatorClass;
1713 }
1714
1715 BinaryOp = BO_Mul;
1716 return Stmt::BinaryOperatorClass;
1717
1718 case OO_Slash:
1719 BinaryOp = BO_Div;
1720 return Stmt::BinaryOperatorClass;
1721
1722 case OO_Percent:
1723 BinaryOp = BO_Rem;
1724 return Stmt::BinaryOperatorClass;
1725
1726 case OO_Caret:
1727 BinaryOp = BO_Xor;
1728 return Stmt::BinaryOperatorClass;
1729
1730 case OO_Amp:
1731 if (NumArgs == 1) {
1732 UnaryOp = UO_AddrOf;
1733 return Stmt::UnaryOperatorClass;
1734 }
1735
1736 BinaryOp = BO_And;
1737 return Stmt::BinaryOperatorClass;
1738
1739 case OO_Pipe:
1740 BinaryOp = BO_Or;
1741 return Stmt::BinaryOperatorClass;
1742
1743 case OO_Tilde:
1744 UnaryOp = UO_Not;
1745 return Stmt::UnaryOperatorClass;
1746
1747 case OO_Exclaim:
1748 UnaryOp = UO_LNot;
1749 return Stmt::UnaryOperatorClass;
1750
1751 case OO_Equal:
1752 BinaryOp = BO_Assign;
1753 return Stmt::BinaryOperatorClass;
1754
1755 case OO_Less:
1756 BinaryOp = BO_LT;
1757 return Stmt::BinaryOperatorClass;
1758
1759 case OO_Greater:
1760 BinaryOp = BO_GT;
1761 return Stmt::BinaryOperatorClass;
1762
1763 case OO_PlusEqual:
1764 BinaryOp = BO_AddAssign;
1765 return Stmt::CompoundAssignOperatorClass;
1766
1767 case OO_MinusEqual:
1768 BinaryOp = BO_SubAssign;
1769 return Stmt::CompoundAssignOperatorClass;
1770
1771 case OO_StarEqual:
1772 BinaryOp = BO_MulAssign;
1773 return Stmt::CompoundAssignOperatorClass;
1774
1775 case OO_SlashEqual:
1776 BinaryOp = BO_DivAssign;
1777 return Stmt::CompoundAssignOperatorClass;
1778
1779 case OO_PercentEqual:
1780 BinaryOp = BO_RemAssign;
1781 return Stmt::CompoundAssignOperatorClass;
1782
1783 case OO_CaretEqual:
1784 BinaryOp = BO_XorAssign;
1785 return Stmt::CompoundAssignOperatorClass;
1786
1787 case OO_AmpEqual:
1788 BinaryOp = BO_AndAssign;
1789 return Stmt::CompoundAssignOperatorClass;
1790
1791 case OO_PipeEqual:
1792 BinaryOp = BO_OrAssign;
1793 return Stmt::CompoundAssignOperatorClass;
1794
1795 case OO_LessLess:
1796 BinaryOp = BO_Shl;
1797 return Stmt::BinaryOperatorClass;
1798
1799 case OO_GreaterGreater:
1800 BinaryOp = BO_Shr;
1801 return Stmt::BinaryOperatorClass;
1802
1803 case OO_LessLessEqual:
1804 BinaryOp = BO_ShlAssign;
1805 return Stmt::CompoundAssignOperatorClass;
1806
1807 case OO_GreaterGreaterEqual:
1808 BinaryOp = BO_ShrAssign;
1809 return Stmt::CompoundAssignOperatorClass;
1810
1811 case OO_EqualEqual:
1812 BinaryOp = BO_EQ;
1813 return Stmt::BinaryOperatorClass;
1814
1815 case OO_ExclaimEqual:
1816 BinaryOp = BO_NE;
1817 return Stmt::BinaryOperatorClass;
1818
1819 case OO_LessEqual:
1820 BinaryOp = BO_LE;
1821 return Stmt::BinaryOperatorClass;
1822
1823 case OO_GreaterEqual:
1824 BinaryOp = BO_GE;
1825 return Stmt::BinaryOperatorClass;
1826
1827 case OO_Spaceship:
1828 BinaryOp = BO_Cmp;
1829 return Stmt::BinaryOperatorClass;
1830
1831 case OO_AmpAmp:
1832 BinaryOp = BO_LAnd;
1833 return Stmt::BinaryOperatorClass;
1834
1835 case OO_PipePipe:
1836 BinaryOp = BO_LOr;
1837 return Stmt::BinaryOperatorClass;
1838
1839 case OO_PlusPlus:
1840 UnaryOp = NumArgs == 1 ? UO_PreInc : UO_PostInc;
1841 NumArgs = 1;
1842 return Stmt::UnaryOperatorClass;
1843
1844 case OO_MinusMinus:
1845 UnaryOp = NumArgs == 1 ? UO_PreDec : UO_PostDec;
1846 NumArgs = 1;
1847 return Stmt::UnaryOperatorClass;
1848
1849 case OO_Comma:
1850 BinaryOp = BO_Comma;
1851 return Stmt::BinaryOperatorClass;
1852
1853 case OO_ArrowStar:
1854 BinaryOp = BO_PtrMemI;
1855 return Stmt::BinaryOperatorClass;
1856
1857 case OO_Subscript:
1858 return Stmt::ArraySubscriptExprClass;
1859
1860 case OO_Call:
1861 return Stmt::CallExprClass;
1862
1863 case OO_Coawait:
1864 UnaryOp = UO_Coawait;
1865 return Stmt::UnaryOperatorClass;
1866 }
1867
1868 llvm_unreachable("Invalid overloaded operator expression");
1869}
1870
1871#if defined(_MSC_VER) && !defined(__clang__)
1872#if _MSC_VER == 1911
1873// Work around https://developercommunity.visualstudio.com/content/problem/84002/clang-cl-when-built-with-vc-2017-crashes-cause-vc.html
1874// MSVC 2017 update 3 miscompiles this function, and a clang built with it
1875// will crash in stage 2 of a bootstrap build.
1876#pragma optimize("", off)
1877#endif
1878#endif
1879
1880void StmtProfiler::VisitCXXOperatorCallExpr(const CXXOperatorCallExpr *S) {
1881 if (S->isTypeDependent()) {
1882 // Type-dependent operator calls are profiled like their underlying
1883 // syntactic operator.
1884 //
1885 // An operator call to operator-> is always implicit, so just skip it. The
1886 // enclosing MemberExpr will profile the actual member access.
1887 if (S->getOperator() == OO_Arrow)
1888 return Visit(S->getArg(0));
1889
1890 UnaryOperatorKind UnaryOp = UO_Extension;
1891 BinaryOperatorKind BinaryOp = BO_Comma;
1892 unsigned NumArgs = S->getNumArgs();
1893 Stmt::StmtClass SC = DecodeOperatorCall(S, UnaryOp, BinaryOp, NumArgs);
1894
1895 ID.AddInteger(SC);
1896 for (unsigned I = 0; I != NumArgs; ++I)
1897 Visit(S->getArg(I));
1898 if (SC == Stmt::UnaryOperatorClass)
1899 ID.AddInteger(UnaryOp);
1900 else if (SC == Stmt::BinaryOperatorClass ||
1901 SC == Stmt::CompoundAssignOperatorClass)
1902 ID.AddInteger(BinaryOp);
1903 else
1904 assert(SC == Stmt::ArraySubscriptExprClass || SC == Stmt::CallExprClass);
1905
1906 return;
1907 }
1908
1909 VisitCallExpr(S);
1910 ID.AddInteger(S->getOperator());
1911}
1912
1913void StmtProfiler::VisitCXXRewrittenBinaryOperator(
1914 const CXXRewrittenBinaryOperator *S) {
1915 // If a rewritten operator were ever to be type-dependent, we should profile
1916 // it following its syntactic operator.
1917 assert(!S->isTypeDependent() &&
1918 "resolved rewritten operator should never be type-dependent");
1919 ID.AddBoolean(S->isReversed());
1920 VisitExpr(S->getSemanticForm());
1921}
1922
1923#if defined(_MSC_VER) && !defined(__clang__)
1924#if _MSC_VER == 1911
1925#pragma optimize("", on)
1926#endif
1927#endif
1928
1929void StmtProfiler::VisitCXXMemberCallExpr(const CXXMemberCallExpr *S) {
1930 VisitCallExpr(S);
1931}
1932
1933void StmtProfiler::VisitCUDAKernelCallExpr(const CUDAKernelCallExpr *S) {
1934 VisitCallExpr(S);
1935}
1936
1937void StmtProfiler::VisitAsTypeExpr(const AsTypeExpr *S) {
1938 VisitExpr(S);
1939}
1940
1941void StmtProfiler::VisitCXXNamedCastExpr(const CXXNamedCastExpr *S) {
1942 VisitExplicitCastExpr(S);
1943}
1944
1945void StmtProfiler::VisitCXXStaticCastExpr(const CXXStaticCastExpr *S) {
1946 VisitCXXNamedCastExpr(S);
1947}
1948
1949void StmtProfiler::VisitCXXDynamicCastExpr(const CXXDynamicCastExpr *S) {
1950 VisitCXXNamedCastExpr(S);
1951}
1952
1953void
1954StmtProfiler::VisitCXXReinterpretCastExpr(const CXXReinterpretCastExpr *S) {
1955 VisitCXXNamedCastExpr(S);
1956}
1957
1958void StmtProfiler::VisitCXXConstCastExpr(const CXXConstCastExpr *S) {
1959 VisitCXXNamedCastExpr(S);
1960}
1961
1962void StmtProfiler::VisitBuiltinBitCastExpr(const BuiltinBitCastExpr *S) {
1963 VisitExpr(S);
1964 VisitType(S->getTypeInfoAsWritten()->getType());
1965}
1966
1967void StmtProfiler::VisitCXXAddrspaceCastExpr(const CXXAddrspaceCastExpr *S) {
1968 VisitCXXNamedCastExpr(S);
1969}
1970
1971void StmtProfiler::VisitUserDefinedLiteral(const UserDefinedLiteral *S) {
1972 VisitCallExpr(S);
1973}
1974
1975void StmtProfiler::VisitCXXBoolLiteralExpr(const CXXBoolLiteralExpr *S) {
1976 VisitExpr(S);
1977 ID.AddBoolean(S->getValue());
1978}
1979
1980void StmtProfiler::VisitCXXNullPtrLiteralExpr(const CXXNullPtrLiteralExpr *S) {
1981 VisitExpr(S);
1982}
1983
1984void StmtProfiler::VisitCXXStdInitializerListExpr(
1985 const CXXStdInitializerListExpr *S) {
1986 VisitExpr(S);
1987}
1988
1989void StmtProfiler::VisitCXXTypeidExpr(const CXXTypeidExpr *S) {
1990 VisitExpr(S);
1991 if (S->isTypeOperand())
1992 VisitType(S->getTypeOperandSourceInfo()->getType());
1993}
1994
1995void StmtProfiler::VisitCXXUuidofExpr(const CXXUuidofExpr *S) {
1996 VisitExpr(S);
1997 if (S->isTypeOperand())
1998 VisitType(S->getTypeOperandSourceInfo()->getType());
1999}
2000
2001void StmtProfiler::VisitMSPropertyRefExpr(const MSPropertyRefExpr *S) {
2002 VisitExpr(S);
2003 VisitDecl(S->getPropertyDecl());
2004}
2005
2006void StmtProfiler::VisitMSPropertySubscriptExpr(
2007 const MSPropertySubscriptExpr *S) {
2008 VisitExpr(S);
2009}
2010
2011void StmtProfiler::VisitCXXThisExpr(const CXXThisExpr *S) {
2012 VisitExpr(S);
2013 ID.AddBoolean(S->isImplicit());
2014}
2015
2016void StmtProfiler::VisitCXXThrowExpr(const CXXThrowExpr *S) {
2017 VisitExpr(S);
2018}
2019
2020void StmtProfiler::VisitCXXDefaultArgExpr(const CXXDefaultArgExpr *S) {
2021 VisitExpr(S);
2022 VisitDecl(S->getParam());
2023}
2024
2025void StmtProfiler::VisitCXXDefaultInitExpr(const CXXDefaultInitExpr *S) {
2026 VisitExpr(S);
2027 VisitDecl(S->getField());
2028}
2029
2030void StmtProfiler::VisitCXXBindTemporaryExpr(const CXXBindTemporaryExpr *S) {
2031 VisitExpr(S);
2032 VisitDecl(
2033 const_cast<CXXDestructorDecl *>(S->getTemporary()->getDestructor()));
2034}
2035
2036void StmtProfiler::VisitCXXConstructExpr(const CXXConstructExpr *S) {
2037 VisitExpr(S);
2038 VisitDecl(S->getConstructor());
2039 ID.AddBoolean(S->isElidable());
2040}
2041
2042void StmtProfiler::VisitCXXInheritedCtorInitExpr(
2043 const CXXInheritedCtorInitExpr *S) {
2044 VisitExpr(S);
2045 VisitDecl(S->getConstructor());
2046}
2047
2048void StmtProfiler::VisitCXXFunctionalCastExpr(const CXXFunctionalCastExpr *S) {
2049 VisitExplicitCastExpr(S);
2050}
2051
2052void
2053StmtProfiler::VisitCXXTemporaryObjectExpr(const CXXTemporaryObjectExpr *S) {
2054 VisitCXXConstructExpr(S);
2055}
2056
2057void
2058StmtProfiler::VisitLambdaExpr(const LambdaExpr *S) {
2059 if (!ProfileLambdaExpr) {
2060 // Do not recursively visit the children of this expression. Profiling the
2061 // body would result in unnecessary work, and is not safe to do during
2062 // deserialization.
2063 VisitStmtNoChildren(S);
2064
2065 // C++20 [temp.over.link]p5:
2066 // Two lambda-expressions are never considered equivalent.
2067 VisitDecl(S->getLambdaClass());
2068
2069 return;
2070 }
2071
2072 CXXRecordDecl *Lambda = S->getLambdaClass();
2073 ID.AddInteger(Lambda->getODRHash());
2074
2075 for (const auto &Capture : Lambda->captures()) {
2076 ID.AddInteger(Capture.getCaptureKind());
2077 if (Capture.capturesVariable())
2078 VisitDecl(Capture.getCapturedVar());
2079 }
2080}
2081
2082void
2083StmtProfiler::VisitCXXScalarValueInitExpr(const CXXScalarValueInitExpr *S) {
2084 VisitExpr(S);
2085}
2086
2087void StmtProfiler::VisitCXXDeleteExpr(const CXXDeleteExpr *S) {
2088 VisitExpr(S);
2089 ID.AddBoolean(S->isGlobalDelete());
2090 ID.AddBoolean(S->isArrayForm());
2091 VisitDecl(S->getOperatorDelete());
2092}
2093
2094void StmtProfiler::VisitCXXNewExpr(const CXXNewExpr *S) {
2095 VisitExpr(S);
2096 VisitType(S->getAllocatedType());
2097 VisitDecl(S->getOperatorNew());
2098 VisitDecl(S->getOperatorDelete());
2099 ID.AddBoolean(S->isArray());
2100 ID.AddInteger(S->getNumPlacementArgs());
2101 ID.AddBoolean(S->isGlobalNew());
2102 ID.AddBoolean(S->isParenTypeId());
2103 ID.AddInteger(llvm::to_underlying(S->getInitializationStyle()));
2104}
2105
2106void
2107StmtProfiler::VisitCXXPseudoDestructorExpr(const CXXPseudoDestructorExpr *S) {
2108 VisitExpr(S);
2109 ID.AddBoolean(S->isArrow());
2110 VisitNestedNameSpecifier(S->getQualifier());
2111 ID.AddBoolean(S->getScopeTypeInfo() != nullptr);
2112 if (S->getScopeTypeInfo())
2113 VisitType(S->getScopeTypeInfo()->getType());
2114 ID.AddBoolean(S->getDestroyedTypeInfo() != nullptr);
2115 if (S->getDestroyedTypeInfo())
2116 VisitType(S->getDestroyedType());
2117 else
2118 VisitIdentifierInfo(S->getDestroyedTypeIdentifier());
2119}
2120
2121void StmtProfiler::VisitOverloadExpr(const OverloadExpr *S) {
2122 VisitExpr(S);
2123 VisitNestedNameSpecifier(S->getQualifier());
2124 VisitName(S->getName(), /*TreatAsDecl*/ true);
2125 ID.AddBoolean(S->hasExplicitTemplateArgs());
2126 if (S->hasExplicitTemplateArgs())
2127 VisitTemplateArguments(S->getTemplateArgs(), S->getNumTemplateArgs());
2128}
2129
2130void
2131StmtProfiler::VisitUnresolvedLookupExpr(const UnresolvedLookupExpr *S) {
2132 VisitOverloadExpr(S);
2133}
2134
2135void StmtProfiler::VisitTypeTraitExpr(const TypeTraitExpr *S) {
2136 VisitExpr(S);
2137 ID.AddInteger(S->getTrait());
2138 ID.AddInteger(S->getNumArgs());
2139 for (unsigned I = 0, N = S->getNumArgs(); I != N; ++I)
2140 VisitType(S->getArg(I)->getType());
2141}
2142
2143void StmtProfiler::VisitArrayTypeTraitExpr(const ArrayTypeTraitExpr *S) {
2144 VisitExpr(S);
2145 ID.AddInteger(S->getTrait());
2146 VisitType(S->getQueriedType());
2147}
2148
2149void StmtProfiler::VisitExpressionTraitExpr(const ExpressionTraitExpr *S) {
2150 VisitExpr(S);
2151 ID.AddInteger(S->getTrait());
2152 VisitExpr(S->getQueriedExpression());
2153}
2154
2155void StmtProfiler::VisitDependentScopeDeclRefExpr(
2156 const DependentScopeDeclRefExpr *S) {
2157 VisitExpr(S);
2158 VisitName(S->getDeclName());
2159 VisitNestedNameSpecifier(S->getQualifier());
2160 ID.AddBoolean(S->hasExplicitTemplateArgs());
2161 if (S->hasExplicitTemplateArgs())
2162 VisitTemplateArguments(S->getTemplateArgs(), S->getNumTemplateArgs());
2163}
2164
2165void StmtProfiler::VisitExprWithCleanups(const ExprWithCleanups *S) {
2166 VisitExpr(S);
2167}
2168
2169void StmtProfiler::VisitCXXUnresolvedConstructExpr(
2170 const CXXUnresolvedConstructExpr *S) {
2171 VisitExpr(S);
2172 VisitType(S->getTypeAsWritten());
2173 ID.AddInteger(S->isListInitialization());
2174}
2175
2176void StmtProfiler::VisitCXXDependentScopeMemberExpr(
2177 const CXXDependentScopeMemberExpr *S) {
2178 ID.AddBoolean(S->isImplicitAccess());
2179 if (!S->isImplicitAccess()) {
2180 VisitExpr(S);
2181 ID.AddBoolean(S->isArrow());
2182 }
2183 VisitNestedNameSpecifier(S->getQualifier());
2184 VisitName(S->getMember());
2185 ID.AddBoolean(S->hasExplicitTemplateArgs());
2186 if (S->hasExplicitTemplateArgs())
2187 VisitTemplateArguments(S->getTemplateArgs(), S->getNumTemplateArgs());
2188}
2189
2190void StmtProfiler::VisitUnresolvedMemberExpr(const UnresolvedMemberExpr *S) {
2191 ID.AddBoolean(S->isImplicitAccess());
2192 if (!S->isImplicitAccess()) {
2193 VisitExpr(S);
2194 ID.AddBoolean(S->isArrow());
2195 }
2196 VisitNestedNameSpecifier(S->getQualifier());
2197 VisitName(S->getMemberName());
2198 ID.AddBoolean(S->hasExplicitTemplateArgs());
2199 if (S->hasExplicitTemplateArgs())
2200 VisitTemplateArguments(S->getTemplateArgs(), S->getNumTemplateArgs());
2201}
2202
2203void StmtProfiler::VisitCXXNoexceptExpr(const CXXNoexceptExpr *S) {
2204 VisitExpr(S);
2205}
2206
2207void StmtProfiler::VisitPackExpansionExpr(const PackExpansionExpr *S) {
2208 VisitExpr(S);
2209}
2210
2211void StmtProfiler::VisitSizeOfPackExpr(const SizeOfPackExpr *S) {
2212 VisitExpr(S);
2213 VisitDecl(S->getPack());
2214 if (S->isPartiallySubstituted()) {
2215 auto Args = S->getPartialArguments();
2216 ID.AddInteger(Args.size());
2217 for (const auto &TA : Args)
2218 VisitTemplateArgument(TA);
2219 } else {
2220 ID.AddInteger(0);
2221 }
2222}
2223
2224void StmtProfiler::VisitPackIndexingExpr(const PackIndexingExpr *E) {
2225 VisitExpr(E);
2226 VisitExpr(E->getPackIdExpression());
2227 VisitExpr(E->getIndexExpr());
2228}
2229
2230void StmtProfiler::VisitSubstNonTypeTemplateParmPackExpr(
2232 VisitExpr(S);
2233 VisitDecl(S->getParameterPack());
2234 VisitTemplateArgument(S->getArgumentPack());
2235}
2236
2237void StmtProfiler::VisitSubstNonTypeTemplateParmExpr(
2239 // Profile exactly as the replacement expression.
2240 Visit(E->getReplacement());
2241}
2242
2243void StmtProfiler::VisitFunctionParmPackExpr(const FunctionParmPackExpr *S) {
2244 VisitExpr(S);
2245 VisitDecl(S->getParameterPack());
2246 ID.AddInteger(S->getNumExpansions());
2247 for (FunctionParmPackExpr::iterator I = S->begin(), E = S->end(); I != E; ++I)
2248 VisitDecl(*I);
2249}
2250
2251void StmtProfiler::VisitMaterializeTemporaryExpr(
2252 const MaterializeTemporaryExpr *S) {
2253 VisitExpr(S);
2254}
2255
2256void StmtProfiler::VisitCXXFoldExpr(const CXXFoldExpr *S) {
2257 VisitExpr(S);
2258 ID.AddInteger(S->getOperator());
2259}
2260
2261void StmtProfiler::VisitCXXParenListInitExpr(const CXXParenListInitExpr *S) {
2262 VisitExpr(S);
2263}
2264
2265void StmtProfiler::VisitCoroutineBodyStmt(const CoroutineBodyStmt *S) {
2266 VisitStmt(S);
2267}
2268
2269void StmtProfiler::VisitCoreturnStmt(const CoreturnStmt *S) {
2270 VisitStmt(S);
2271}
2272
2273void StmtProfiler::VisitCoawaitExpr(const CoawaitExpr *S) {
2274 VisitExpr(S);
2275}
2276
2277void StmtProfiler::VisitDependentCoawaitExpr(const DependentCoawaitExpr *S) {
2278 VisitExpr(S);
2279}
2280
2281void StmtProfiler::VisitCoyieldExpr(const CoyieldExpr *S) {
2282 VisitExpr(S);
2283}
2284
2285void StmtProfiler::VisitOpaqueValueExpr(const OpaqueValueExpr *E) {
2286 VisitExpr(E);
2287}
2288
2289void StmtProfiler::VisitTypoExpr(const TypoExpr *E) {
2290 VisitExpr(E);
2291}
2292
2293void StmtProfiler::VisitSourceLocExpr(const SourceLocExpr *E) {
2294 VisitExpr(E);
2295}
2296
2297void StmtProfiler::VisitRecoveryExpr(const RecoveryExpr *E) { VisitExpr(E); }
2298
2299void StmtProfiler::VisitObjCStringLiteral(const ObjCStringLiteral *S) {
2300 VisitExpr(S);
2301}
2302
2303void StmtProfiler::VisitObjCBoxedExpr(const ObjCBoxedExpr *E) {
2304 VisitExpr(E);
2305}
2306
2307void StmtProfiler::VisitObjCArrayLiteral(const ObjCArrayLiteral *E) {
2308 VisitExpr(E);
2309}
2310
2311void StmtProfiler::VisitObjCDictionaryLiteral(const ObjCDictionaryLiteral *E) {
2312 VisitExpr(E);
2313}
2314
2315void StmtProfiler::VisitObjCEncodeExpr(const ObjCEncodeExpr *S) {
2316 VisitExpr(S);
2317 VisitType(S->getEncodedType());
2318}
2319
2320void StmtProfiler::VisitObjCSelectorExpr(const ObjCSelectorExpr *S) {
2321 VisitExpr(S);
2322 VisitName(S->getSelector());
2323}
2324
2325void StmtProfiler::VisitObjCProtocolExpr(const ObjCProtocolExpr *S) {
2326 VisitExpr(S);
2327 VisitDecl(S->getProtocol());
2328}
2329
2330void StmtProfiler::VisitObjCIvarRefExpr(const ObjCIvarRefExpr *S) {
2331 VisitExpr(S);
2332 VisitDecl(S->getDecl());
2333 ID.AddBoolean(S->isArrow());
2334 ID.AddBoolean(S->isFreeIvar());
2335}
2336
2337void StmtProfiler::VisitObjCPropertyRefExpr(const ObjCPropertyRefExpr *S) {
2338 VisitExpr(S);
2339 if (S->isImplicitProperty()) {
2340 VisitDecl(S->getImplicitPropertyGetter());
2341 VisitDecl(S->getImplicitPropertySetter());
2342 } else {
2343 VisitDecl(S->getExplicitProperty());
2344 }
2345 if (S->isSuperReceiver()) {
2346 ID.AddBoolean(S->isSuperReceiver());
2347 VisitType(S->getSuperReceiverType());
2348 }
2349}
2350
2351void StmtProfiler::VisitObjCSubscriptRefExpr(const ObjCSubscriptRefExpr *S) {
2352 VisitExpr(S);
2353 VisitDecl(S->getAtIndexMethodDecl());
2354 VisitDecl(S->setAtIndexMethodDecl());
2355}
2356
2357void StmtProfiler::VisitObjCMessageExpr(const ObjCMessageExpr *S) {
2358 VisitExpr(S);
2359 VisitName(S->getSelector());
2360 VisitDecl(S->getMethodDecl());
2361}
2362
2363void StmtProfiler::VisitObjCIsaExpr(const ObjCIsaExpr *S) {
2364 VisitExpr(S);
2365 ID.AddBoolean(S->isArrow());
2366}
2367
2368void StmtProfiler::VisitObjCBoolLiteralExpr(const ObjCBoolLiteralExpr *S) {
2369 VisitExpr(S);
2370 ID.AddBoolean(S->getValue());
2371}
2372
2373void StmtProfiler::VisitObjCIndirectCopyRestoreExpr(
2374 const ObjCIndirectCopyRestoreExpr *S) {
2375 VisitExpr(S);
2376 ID.AddBoolean(S->shouldCopy());
2377}
2378
2379void StmtProfiler::VisitObjCBridgedCastExpr(const ObjCBridgedCastExpr *S) {
2380 VisitExplicitCastExpr(S);
2381 ID.AddBoolean(S->getBridgeKind());
2382}
2383
2384void StmtProfiler::VisitObjCAvailabilityCheckExpr(
2385 const ObjCAvailabilityCheckExpr *S) {
2386 VisitExpr(S);
2387}
2388
2389void StmtProfiler::VisitTemplateArguments(const TemplateArgumentLoc *Args,
2390 unsigned NumArgs) {
2391 ID.AddInteger(NumArgs);
2392 for (unsigned I = 0; I != NumArgs; ++I)
2393 VisitTemplateArgument(Args[I].getArgument());
2394}
2395
2396void StmtProfiler::VisitTemplateArgument(const TemplateArgument &Arg) {
2397 // Mostly repetitive with TemplateArgument::Profile!
2398 ID.AddInteger(Arg.getKind());
2399 switch (Arg.getKind()) {
2401 break;
2402
2404 VisitType(Arg.getAsType());
2405 break;
2406
2409 VisitTemplateName(Arg.getAsTemplateOrTemplatePattern());
2410 break;
2411
2413 VisitType(Arg.getParamTypeForDecl());
2414 // FIXME: Do we need to recursively decompose template parameter objects?
2415 VisitDecl(Arg.getAsDecl());
2416 break;
2417
2419 VisitType(Arg.getNullPtrType());
2420 break;
2421
2423 VisitType(Arg.getIntegralType());
2424 Arg.getAsIntegral().Profile(ID);
2425 break;
2426
2428 VisitType(Arg.getStructuralValueType());
2429 // FIXME: Do we need to recursively decompose this ourselves?
2430 Arg.getAsStructuralValue().Profile(ID);
2431 break;
2432
2434 Visit(Arg.getAsExpr());
2435 break;
2436
2438 for (const auto &P : Arg.pack_elements())
2439 VisitTemplateArgument(P);
2440 break;
2441 }
2442}
2443
2444void StmtProfiler::VisitOpenACCComputeConstruct(
2445 const OpenACCComputeConstruct *S) {
2446 // VisitStmt handles children, so the AssociatedStmt is handled.
2447 VisitStmt(S);
2448 // TODO OpenACC: Visit Clauses.
2449}
2450
2451void Stmt::Profile(llvm::FoldingSetNodeID &ID, const ASTContext &Context,
2452 bool Canonical, bool ProfileLambdaExpr) const {
2453 StmtProfilerWithPointers Profiler(ID, Context, Canonical, ProfileLambdaExpr);
2454 Profiler.Visit(this);
2455}
2456
2457void Stmt::ProcessODRHash(llvm::FoldingSetNodeID &ID,
2458 class ODRHash &Hash) const {
2459 StmtProfilerWithoutPointers Profiler(ID, Hash);
2460 Profiler.Visit(this);
2461}
Defines the clang::ASTContext interface.
DynTypedNode Node
StringRef P
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:479
Holds long-lived AST nodes (such as types and decls) that can be referred to throughout the semantic ...
Definition: ASTContext.h:182
TemplateName getCanonicalTemplateName(const TemplateName &Name) const
Retrieves the "canonical" template name that refers to a given template.
CanQualType getCanonicalType(QualType T) const
Return the canonical (structural) type corresponding to the specified potentially non-canonical type ...
Definition: ASTContext.h:2549
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:4332
Represents the index of the current element of an array being initialized by an ArrayInitLoopExpr.
Definition: Expr.h:5558
Represents a loop initializing the elements of an array.
Definition: Expr.h:5505
ArraySubscriptExpr - [C99 6.5.2.1] Array Subscripting.
Definition: Expr.h:2663
An Embarcadero array type trait, as used in the implementation of __array_rank and __array_extent.
Definition: ExprCXX.h:2836
AsTypeExpr - Clang builtin function __builtin_astype [OpenCL 6.2.4.2] This AST node provides support ...
Definition: Expr.h:6228
AtomicExpr - Variadic atomic builtins: __atomic_exchange, __atomic_fetch_*, __atomic_load,...
Definition: Expr.h:6431
Represents an attribute applied to a statement.
Definition: Stmt.h:2078
BinaryConditionalOperator - The GNU extension to the conditional operator which allows the middle ope...
Definition: Expr.h:4235
A builtin binary operation expression such as "x + y" or "x <= y".
Definition: Expr.h:3834
A fixed int type of a specified bitwidth.
Definition: Type.h:6785
BlockExpr - Adaptor class for mixing a BlockDecl with expressions.
Definition: Expr.h:6167
BreakStmt - This represents a break.
Definition: Stmt.h:2978
Represents a C++2a __builtin_bit_cast(T, v) expression.
Definition: ExprCXX.h:5251
This class is used for builtin types like 'int'.
Definition: Type.h:2740
Kind getKind() const
Definition: Type.h:2782
CStyleCastExpr - An explicit cast in C (C99 6.5.4) or a C-style cast in C++ (C++ [expr....
Definition: Expr.h:3765
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:1475
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:1530
A default argument (C++ [dcl.fct.default]).
Definition: ExprCXX.h:1254
A use of a default initializer in a constructor or in aggregate initialization.
Definition: ExprCXX.h:1361
Represents a delete expression for memory deallocation and destructor calls, e.g.
Definition: ExprCXX.h:2481
Represents a C++ member access expression where the actual member referenced could not be resolved be...
Definition: ExprCXX.h:3645
Represents a C++ destructor within a class.
Definition: DeclCXX.h:2792
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:4791
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:1801
Represents a call to an inherited base class constructor from an inheriting constructor.
Definition: ExprCXX.h:1721
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:2224
Represents a C++11 noexcept expression (C++ [expr.unary.noexcept]).
Definition: ExprCXX.h:4088
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:4913
Represents a C++ pseudo-destructor (C++ [expr.pseudo]).
Definition: ExprCXX.h:2600
Represents a C++ struct/union/class.
Definition: DeclCXX.h:258
capture_const_range captures() const
Definition: DeclCXX.h:1100
unsigned getODRHash() const
Definition: DeclCXX.cpp:494
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 a value-initialized rvalue of type T, which is a non-class type.
Definition: ExprCXX.h:2165
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:1869
Represents the this expression in C++.
Definition: ExprCXX.h:1148
A C++ throw-expression (C++ [except.throw]).
Definition: ExprCXX.h:1192
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:3519
A Microsoft C++ __uuidof expression, which gets the _GUID that corresponds to the supplied type or ex...
Definition: ExprCXX.h:1062
CallExpr - Represents a function call (C99 6.5.2.2, C++ [expr.call]).
Definition: Expr.h:2819
This captures a statement into a function.
Definition: Stmt.h:3755
CaseStmt - Represent a case statement.
Definition: Stmt.h:1799
CastExpr - Base class for type casts, including both implicit casts (ImplicitCastExpr) and explicit c...
Definition: Expr.h:3489
ChooseExpr - GNU builtin-in function __builtin_choose_expr.
Definition: Expr.h:4552
Represents a 'co_await' expression.
Definition: ExprCXX.h:5144
CompoundAssignOperator - For compound assignments (e.g.
Definition: Expr.h:4082
CompoundLiteralExpr - [C99 6.5.2.5].
Definition: Expr.h:3419
CompoundStmt - This represents a group of statements like { stmt stmt }.
Definition: Stmt.h:1604
Represents the specialization of a concept - evaluates to a prvalue of type bool.
Definition: ExprConcepts.h:42
ConditionalOperator - The ?: ternary operator.
Definition: Expr.h:4173
ConstStmtVisitor - This class implements a simple visitor for Stmt subclasses.
Definition: StmtVisitor.h:195
ConstantExpr - An expression that occurs in a constant context and optionally the result of evaluatin...
Definition: Expr.h:1072
ContinueStmt - This represents a continue.
Definition: Stmt.h:2948
ConvertVectorExpr - Clang builtin function __builtin_convertvector This AST node provides support for...
Definition: Expr.h:4493
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:5225
A reference to a declared variable, function, enum, etc.
Definition: Expr.h:1260
DeclStmt - Adaptor class for mixing declarations with statements and expressions.
Definition: Stmt.h:1495
Decl - This represents one declaration (or definition), e.g.
Definition: DeclBase.h:85
virtual Decl * getCanonicalDecl()
Retrieves the "canonical" declaration of the given declaration.
Definition: DeclBase.h:978
Kind getKind() const
Definition: DeclBase.h:447
The name of a declaration.
Represents a 'co_await' expression while the type of the promise is dependent.
Definition: ExprCXX.h:5176
A qualified reference to a name whose declaration cannot yet be resolved.
Definition: ExprCXX.h:3285
Represents a single C99 designator.
Definition: Expr.h:5129
Represents a C99 designated initializer expression.
Definition: Expr.h:5086
DoStmt - This represents a 'do/while' stmt.
Definition: Stmt.h:2723
ExplicitCastExpr - An explicit cast written in the source code.
Definition: Expr.h:3724
Represents an expression – generally a full-expression – that introduces cleanups to be run at the en...
Definition: ExprCXX.h:3436
This represents one expression.
Definition: Expr.h:110
An expression trait intrinsic.
Definition: ExprCXX.h:2907
ExtVectorElementExpr - This represents access to specific elements of a vector, and may occur on the ...
Definition: Expr.h:6107
ForStmt - This represents a 'for (init;cond;inc)' stmt.
Definition: Stmt.h:2779
Represents a reference to a function parameter pack or init-capture pack that has been substituted bu...
Definition: ExprCXX.h:4599
VarDecl *const * iterator
Iterators over the parameters which the parameter pack expanded into.
Definition: ExprCXX.h:4633
This represents a GCC inline-assembly statement extension.
Definition: Stmt.h:3257
GNUNullExpr - Implements the GNU __null extension, which is a name for a null pointer constant that h...
Definition: Expr.h:4627
Represents a C11 generic selection.
Definition: Expr.h:5719
AssociationTy< true > ConstAssociation
Definition: Expr.h:5951
GotoStmt - This represents a direct goto.
Definition: Stmt.h:2860
One of these records is kept for each identifier that is lexed.
IfStmt - This represents an if/then/else.
Definition: Stmt.h:2136
ImaginaryLiteral - We support imaginary integer and floating point literals, like "1....
Definition: Expr.h:1712
ImplicitCastExpr - Allows us to explicitly represent implicit type conversions, which have no direct ...
Definition: Expr.h:3649
Represents an implicitly-generated value initialization of an object of a given type.
Definition: Expr.h:5594
IndirectGotoStmt - This represents an indirect goto.
Definition: Stmt.h:2899
Describes an C or C++ initializer list.
Definition: Expr.h:4841
LabelStmt - Represents a label, which has a substatement.
Definition: Stmt.h:2029
A C++ lambda expression, which produces a function object (of unspecified type) that can be invoked l...
Definition: ExprCXX.h:1938
This represents a Microsoft inline-assembly statement extension.
Definition: Stmt.h:3480
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:929
MS property subscript expression.
Definition: ExprCXX.h:1000
Represents a prvalue temporary that is written into memory so that a reference can bind to it.
Definition: ExprCXX.h:4679
MatrixSubscriptExpr - Matrix subscript expression for the MatrixType extension.
Definition: Expr.h:2741
MemberExpr - [C99 6.5.2.3] Structure and Union Members.
Definition: Expr.h:3182
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:5414
NonTypeTemplateParmDecl - Declares a non-type template parameter, e.g., "Size" in.
NullStmt - This is the null statement ";": C99 6.8.3p3.
Definition: Stmt.h:1567
void AddDecl(const Decl *D)
Definition: ODRHash.cpp:793
void AddIdentifierInfo(const IdentifierInfo *II)
Definition: ODRHash.cpp:29
void AddDeclarationName(DeclarationName Name, bool TreatAsDecl=false)
Definition: ODRHash.cpp:34
void AddNestedNameSpecifier(const NestedNameSpecifier *NNS)
Definition: ODRHash.cpp:112
void AddTemplateName(TemplateName Name)
Definition: ODRHash.cpp:141
void AddQualType(QualType T)
Definition: ODRHash.cpp:1244
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:388
This represents clause 'aligned' in the '#pragma omp ...' directives.
This represents clause 'allocate' in the '#pragma omp ...' directives.
Definition: OpenMPClause.h:432
This represents 'allocator' clause in the '#pragma omp ...' directive.
Definition: OpenMPClause.h:354
OpenMP 5.0 [2.1.5, Array Sections].
Definition: ExprOpenMP.h:56
An explicit cast in C or a C-style cast in C++, which uses the syntax ([s1][s2]......
Definition: ExprOpenMP.h:148
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:2963
This represents '#pragma omp barrier' directive.
Definition: StmtOpenMP.h:2641
This represents 'bind' clause in the '#pragma omp ...' directives.
This represents '#pragma omp cancel' directive.
Definition: StmtOpenMP.h:3671
This represents '#pragma omp cancellation point' directive.
Definition: StmtOpenMP.h:3613
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 'shedule', 'firstprivate' etc.
Definition: OpenMPClause.h:195
This represents 'collapse' clause in the '#pragma omp ...' directive.
Definition: OpenMPClause.h:977
This represents 'compare' clause in the '#pragma omp atomic' directive.
This represents clause 'copyin' in the '#pragma omp ...' directives.
This represents clause 'copyprivate' in the '#pragma omp ...' directives.
This represents '#pragma omp critical' directive.
Definition: StmtOpenMP.h:2092
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:2857
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:5827
This represents 'dist_schedule' clause in the '#pragma omp ...' directive.
This represents '#pragma omp distribute' directive.
Definition: StmtOpenMP.h:4441
This represents '#pragma omp distribute parallel for' composite directive.
Definition: StmtOpenMP.h:4564
This represents '#pragma omp distribute parallel for simd' composite directive.
Definition: StmtOpenMP.h:4660
This represents '#pragma omp distribute simd' composite directive.
Definition: StmtOpenMP.h:4725
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:6302
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:630
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:2805
This represents '#pragma omp for' directive.
Definition: StmtOpenMP.h:1649
This represents '#pragma omp for simd' directive.
Definition: StmtOpenMP.h:1740
This represents clause 'from' in the '#pragma omp ...' directives.
Representation of the 'full' clause of the '#pragma omp unroll' directive.
Definition: OpenMPClause.h:879
This represents '#pragma omp loop' directive.
Definition: StmtOpenMP.h:5982
This represents 'grainsize' clause in the '#pragma omp ...' directive.
This represents clause 'has_device_ptr' in the '#pragma omp ...' directives.
This represents 'hint' clause in the '#pragma omp ...' directive.
This represents 'if' clause in the '#pragma omp ...' directive.
Definition: OpenMPClause.h:527
This represents clause 'in_reduction' in the '#pragma omp task' directives.
This represents clause 'inclusive' in the '#pragma omp scan' directive.
This represents the 'init' clause in '#pragma omp ...' directives.
This represents '#pragma omp interop' directive.
Definition: StmtOpenMP.h:5774
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:275
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:698
This is a common base class for loop directives ('omp simd', 'omp for', 'omp for simd' etc....
Definition: StmtOpenMP.h:1018
The base class for all loop transformation directives.
Definition: StmtOpenMP.h:975
This represents clause 'map' in the '#pragma omp ...' directives.
This represents '#pragma omp masked' directive.
Definition: StmtOpenMP.h:5892
This represents '#pragma omp masked taskloop' directive.
Definition: StmtOpenMP.h:3946
This represents '#pragma omp masked taskloop simd' directive.
Definition: StmtOpenMP.h:4087
This represents '#pragma omp master' directive.
Definition: StmtOpenMP.h:2044
This represents '#pragma omp master taskloop' directive.
Definition: StmtOpenMP.h:3870
This represents '#pragma omp master taskloop simd' directive.
Definition: StmtOpenMP.h:4022
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:5943
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:676
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:2909
This represents '#pragma omp parallel' directive.
Definition: StmtOpenMP.h:627
This represents '#pragma omp parallel for' directive.
Definition: StmtOpenMP.h:2163
This represents '#pragma omp parallel for simd' directive.
Definition: StmtOpenMP.h:2260
This represents '#pragma omp parallel loop' directive.
Definition: StmtOpenMP.h:6175
This represents '#pragma omp parallel masked' directive.
Definition: StmtOpenMP.h:2388
This represents '#pragma omp parallel masked taskloop' directive.
Definition: StmtOpenMP.h:4231
This represents '#pragma omp parallel masked taskloop simd' directive.
Definition: StmtOpenMP.h:4376
This represents '#pragma omp parallel master' directive.
Definition: StmtOpenMP.h:2325
This represents '#pragma omp parallel master taskloop' directive.
Definition: StmtOpenMP.h:4153
This represents '#pragma omp parallel master taskloop simd' directive.
Definition: StmtOpenMP.h:4309
This represents '#pragma omp parallel sections' directive.
Definition: StmtOpenMP.h:2452
Representation of the 'partial' clause of the '#pragma omp unroll' directive.
Definition: OpenMPClause.h:907
This represents 'priority' clause in the '#pragma omp ...' directive.
This represents clause 'private' in the '#pragma omp ...' directives.
This represents 'proc_bind' clause in the '#pragma omp ...' directive.
This represents 'read' clause in the '#pragma omp atomic' directive.
This represents clause 'reduction' in the '#pragma omp ...' directives.
This represents 'relaxed' clause in the '#pragma omp atomic' directives.
This represents 'release' clause in the '#pragma omp atomic|flush' directives.
This represents 'reverse_offload' clause in the '#pragma omp requires' directive.
This represents 'simd' clause in the '#pragma omp ...' directive.
This represents 'safelen' clause in the '#pragma omp ...' directive.
Definition: OpenMPClause.h:721
This represents '#pragma omp scan' directive.
Definition: StmtOpenMP.h:5721
This represents 'schedule' clause in the '#pragma omp ...' directive.
This represents '#pragma omp scope' directive.
Definition: StmtOpenMP.h:1941
This represents '#pragma omp section' directive.
Definition: StmtOpenMP.h:1880
This represents '#pragma omp sections' directive.
Definition: StmtOpenMP.h:1803
This represents 'seq_cst' clause in the '#pragma omp atomic' directive.
This represents 'severity' clause in the '#pragma omp error' directive.
This represents clause 'shared' in the '#pragma omp ...' directives.
This represents '#pragma omp simd' directive.
Definition: StmtOpenMP.h:1585
This represents 'simdlen' clause in the '#pragma omp ...' directive.
Definition: OpenMPClause.h:756
This represents '#pragma omp single' directive.
Definition: StmtOpenMP.h:1993
This represents the 'sizes' clause in the '#pragma omp tile' directive.
Definition: OpenMPClause.h:788
This represents '#pragma omp target data' directive.
Definition: StmtOpenMP.h:3222
This represents '#pragma omp target' directive.
Definition: StmtOpenMP.h:3168
This represents '#pragma omp target enter data' directive.
Definition: StmtOpenMP.h:3276
This represents '#pragma omp target exit data' directive.
Definition: StmtOpenMP.h:3331
This represents '#pragma omp target parallel' directive.
Definition: StmtOpenMP.h:3385
This represents '#pragma omp target parallel for' directive.
Definition: StmtOpenMP.h:3465
This represents '#pragma omp target parallel for simd' directive.
Definition: StmtOpenMP.h:4791
This represents '#pragma omp target parallel loop' directive.
Definition: StmtOpenMP.h:6240
This represents '#pragma omp target simd' directive.
Definition: StmtOpenMP.h:4858
This represents '#pragma omp target teams' directive.
Definition: StmtOpenMP.h:5216
This represents '#pragma omp target teams distribute' combined directive.
Definition: StmtOpenMP.h:5272
This represents '#pragma omp target teams distribute parallel for' combined directive.
Definition: StmtOpenMP.h:5339
This represents '#pragma omp target teams distribute parallel for simd' combined directive.
Definition: StmtOpenMP.h:5437
This represents '#pragma omp target teams distribute simd' combined directive.
Definition: StmtOpenMP.h:5507
This represents '#pragma omp target teams loop' directive.
Definition: StmtOpenMP.h:6109
This represents '#pragma omp target update' directive.
Definition: StmtOpenMP.h:4508
This represents '#pragma omp task' directive.
Definition: StmtOpenMP.h:2533
This represents '#pragma omp taskloop' directive.
Definition: StmtOpenMP.h:3731
This represents '#pragma omp taskloop simd' directive.
Definition: StmtOpenMP.h:3804
This represents clause 'task_reduction' in the '#pragma omp taskgroup' directives.
This represents '#pragma omp taskgroup' directive.
Definition: StmtOpenMP.h:2738
This represents '#pragma omp taskwait' directive.
Definition: StmtOpenMP.h:2687
This represents '#pragma omp taskyield' directive.
Definition: StmtOpenMP.h:2595
This represents '#pragma omp teams' directive.
Definition: StmtOpenMP.h:3560
This represents '#pragma omp teams distribute' directive.
Definition: StmtOpenMP.h:4923
This represents '#pragma omp teams distribute parallel for' composite directive.
Definition: StmtOpenMP.h:5123
This represents '#pragma omp teams distribute parallel for simd' composite directive.
Definition: StmtOpenMP.h:5057
This represents '#pragma omp teams distribute simd' combined directive.
Definition: StmtOpenMP.h:4989
This represents '#pragma omp teams loop' directive.
Definition: StmtOpenMP.h:6044
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:5565
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:5647
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:1696
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:1636
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:1575
ObjCIsaExpr - Represent X->isa and X.isa when X is an ObjC 'id' type.
Definition: ExprObjC.h:1491
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:945
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:844
OffsetOfExpr - [C99 7.17] - This represents an expression of the form offsetof(record-type,...
Definition: Expr.h:2464
Helper class for OffsetOfExpr.
Definition: Expr.h:2358
FieldDecl * getField() const
For a field offsetof node, returns the field.
Definition: Expr.h:2422
IdentifierInfo * getFieldName() const
For a field or identifier offsetof node, returns the name of the field.
Definition: Expr.cpp:1672
@ Array
An index into an array.
Definition: Expr.h:2363
@ Identifier
A field in a dependent type, known only by its name.
Definition: Expr.h:2367
@ Field
A field.
Definition: Expr.h:2365
@ Base
An implicit indirection through a C++ base class, when the field found is in a base class.
Definition: Expr.h:2370
Kind getKind() const
Determine what kind of offsetof node this is.
Definition: Expr.h:2412
OpaqueValueExpr - An expression referring to an opaque object of a fixed type and value class.
Definition: Expr.h:1168
This class represents a compute construct, representing a 'Kind' of ‘parallel’, 'serial',...
Definition: StmtOpenACC.h:104
A reference to an overloaded function set, either an UnresolvedLookupExpr or an UnresolvedMemberExpr.
Definition: ExprCXX.h:2966
Represents a C++11 pack expansion that produces a sequence of expressions.
Definition: ExprCXX.h:4142
Expr * getIndexExpr() const
Definition: ExprCXX.h:4400
Expr * getPackIdExpression() const
Definition: ExprCXX.h:4396
ParenExpr - This represents a parethesized expression, e.g.
Definition: Expr.h:2129
Represents a parameter to a function.
Definition: Decl.h:1749
[C99 6.4.2.2] - A predefined identifier such as func.
Definition: Expr.h:1986
PseudoObjectExpr - An expression which accesses a pseudo-object l-value.
Definition: Expr.h:6299
const Expr *const * const_semantics_iterator
Definition: Expr.h:6364
A (possibly-)qualified type.
Definition: Type.h:737
bool isNull() const
Return true if this QualType doesn't point to a type yet.
Definition: Type.h:804
QualType getCanonicalType() const
Definition: Type.h:6954
void * getAsOpaquePtr() const
Definition: Type.h:784
Frontend produces RecoveryExprs on semantic errors that prevent creating other well-formed expression...
Definition: Expr.h:6634
C++2a [expr.prim.req]: A requires-expression provides a concise way to express requirements on templa...
Definition: ExprConcepts.h:510
ReturnStmt - This represents a return, optionally of an expression: return; return 4;.
Definition: Stmt.h:3017
Represents a __leave statement.
Definition: Stmt.h:3716
ShuffleVectorExpr - clang-specific builtin-in function __builtin_shufflevector.
Definition: Expr.h:4425
Represents an expression that computes the length of a parameter pack.
Definition: ExprCXX.h:4220
Represents a function call to one of __builtin_LINE(), __builtin_COLUMN(), __builtin_FUNCTION(),...
Definition: Expr.h:4721
StmtExpr - This is the GNU Statement Expression extension: ({int X=4; X;}).
Definition: Expr.h:4377
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:1773
Represents a reference to a non-type template parameter that has been substituted with a template arg...
Definition: ExprCXX.h:4435
Represents a reference to a non-type template parameter pack that has been substituted with a non-tem...
Definition: ExprCXX.h:4520
SwitchStmt - This represents a 'switch' stmt.
Definition: Stmt.h:2386
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:202
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:246
A type trait used in the implementation of various C++11 and Library TR1 trait templates.
Definition: ExprCXX.h:2751
const T * castAs() const
Member-template castAs<specific type>.
Definition: Type.h:7724
TypeClass getTypeClass() const
Definition: Type.h:2074
const T * getAs() const
Member-template getAs<specific type>'.
Definition: Type.h:7657
TypoExpr - Internal placeholder for expressions where typo correction still needs to be performed and...
Definition: Expr.h:6579
UnaryExprOrTypeTraitExpr - expression with either a type or (unevaluated) expression operand.
Definition: Expr.h:2567
UnaryOperator - This represents the unary-expression's (except sizeof and alignof),...
Definition: Expr.h:2182
A reference to a name which we were able to look up during parsing but could not resolve to a specifi...
Definition: ExprCXX.h:3163
Represents a C++ member access expression for which lookup produced a set of overloaded functions.
Definition: ExprCXX.h:3905
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:4661
WhileStmt - This represents a 'while' stmt.
Definition: Stmt.h:2582
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
#define false
Definition: stdbool.h:22
Data for list of allocators.
Expr * AllocatorTraits
Allocator traits.