clang 18.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::VisitOMPThreadsClause(const OMPThreadsClause *) {}
598
599void OMPClauseProfiler::VisitOMPSIMDClause(const OMPSIMDClause *) {}
600
601void OMPClauseProfiler::VisitOMPNogroupClause(const OMPNogroupClause *) {}
602
603void OMPClauseProfiler::VisitOMPInitClause(const OMPInitClause *C) {
604 VisitOMPClauseList(C);
605}
606
607void OMPClauseProfiler::VisitOMPUseClause(const OMPUseClause *C) {
608 if (C->getInteropVar())
609 Profiler->VisitStmt(C->getInteropVar());
610}
611
612void OMPClauseProfiler::VisitOMPDestroyClause(const OMPDestroyClause *C) {
613 if (C->getInteropVar())
614 Profiler->VisitStmt(C->getInteropVar());
615}
616
617void OMPClauseProfiler::VisitOMPFilterClause(const OMPFilterClause *C) {
618 VistOMPClauseWithPreInit(C);
619 if (C->getThreadID())
620 Profiler->VisitStmt(C->getThreadID());
621}
622
623template<typename T>
624void OMPClauseProfiler::VisitOMPClauseList(T *Node) {
625 for (auto *E : Node->varlists()) {
626 if (E)
627 Profiler->VisitStmt(E);
628 }
629}
630
631void OMPClauseProfiler::VisitOMPPrivateClause(const OMPPrivateClause *C) {
632 VisitOMPClauseList(C);
633 for (auto *E : C->private_copies()) {
634 if (E)
635 Profiler->VisitStmt(E);
636 }
637}
638void
639OMPClauseProfiler::VisitOMPFirstprivateClause(const OMPFirstprivateClause *C) {
640 VisitOMPClauseList(C);
641 VistOMPClauseWithPreInit(C);
642 for (auto *E : C->private_copies()) {
643 if (E)
644 Profiler->VisitStmt(E);
645 }
646 for (auto *E : C->inits()) {
647 if (E)
648 Profiler->VisitStmt(E);
649 }
650}
651void
652OMPClauseProfiler::VisitOMPLastprivateClause(const OMPLastprivateClause *C) {
653 VisitOMPClauseList(C);
654 VistOMPClauseWithPostUpdate(C);
655 for (auto *E : C->source_exprs()) {
656 if (E)
657 Profiler->VisitStmt(E);
658 }
659 for (auto *E : C->destination_exprs()) {
660 if (E)
661 Profiler->VisitStmt(E);
662 }
663 for (auto *E : C->assignment_ops()) {
664 if (E)
665 Profiler->VisitStmt(E);
666 }
667}
668void OMPClauseProfiler::VisitOMPSharedClause(const OMPSharedClause *C) {
669 VisitOMPClauseList(C);
670}
671void OMPClauseProfiler::VisitOMPReductionClause(
672 const OMPReductionClause *C) {
673 Profiler->VisitNestedNameSpecifier(
674 C->getQualifierLoc().getNestedNameSpecifier());
675 Profiler->VisitName(C->getNameInfo().getName());
676 VisitOMPClauseList(C);
677 VistOMPClauseWithPostUpdate(C);
678 for (auto *E : C->privates()) {
679 if (E)
680 Profiler->VisitStmt(E);
681 }
682 for (auto *E : C->lhs_exprs()) {
683 if (E)
684 Profiler->VisitStmt(E);
685 }
686 for (auto *E : C->rhs_exprs()) {
687 if (E)
688 Profiler->VisitStmt(E);
689 }
690 for (auto *E : C->reduction_ops()) {
691 if (E)
692 Profiler->VisitStmt(E);
693 }
694 if (C->getModifier() == clang::OMPC_REDUCTION_inscan) {
695 for (auto *E : C->copy_ops()) {
696 if (E)
697 Profiler->VisitStmt(E);
698 }
699 for (auto *E : C->copy_array_temps()) {
700 if (E)
701 Profiler->VisitStmt(E);
702 }
703 for (auto *E : C->copy_array_elems()) {
704 if (E)
705 Profiler->VisitStmt(E);
706 }
707 }
708}
709void OMPClauseProfiler::VisitOMPTaskReductionClause(
710 const OMPTaskReductionClause *C) {
711 Profiler->VisitNestedNameSpecifier(
712 C->getQualifierLoc().getNestedNameSpecifier());
713 Profiler->VisitName(C->getNameInfo().getName());
714 VisitOMPClauseList(C);
715 VistOMPClauseWithPostUpdate(C);
716 for (auto *E : C->privates()) {
717 if (E)
718 Profiler->VisitStmt(E);
719 }
720 for (auto *E : C->lhs_exprs()) {
721 if (E)
722 Profiler->VisitStmt(E);
723 }
724 for (auto *E : C->rhs_exprs()) {
725 if (E)
726 Profiler->VisitStmt(E);
727 }
728 for (auto *E : C->reduction_ops()) {
729 if (E)
730 Profiler->VisitStmt(E);
731 }
732}
733void OMPClauseProfiler::VisitOMPInReductionClause(
734 const OMPInReductionClause *C) {
735 Profiler->VisitNestedNameSpecifier(
736 C->getQualifierLoc().getNestedNameSpecifier());
737 Profiler->VisitName(C->getNameInfo().getName());
738 VisitOMPClauseList(C);
739 VistOMPClauseWithPostUpdate(C);
740 for (auto *E : C->privates()) {
741 if (E)
742 Profiler->VisitStmt(E);
743 }
744 for (auto *E : C->lhs_exprs()) {
745 if (E)
746 Profiler->VisitStmt(E);
747 }
748 for (auto *E : C->rhs_exprs()) {
749 if (E)
750 Profiler->VisitStmt(E);
751 }
752 for (auto *E : C->reduction_ops()) {
753 if (E)
754 Profiler->VisitStmt(E);
755 }
756 for (auto *E : C->taskgroup_descriptors()) {
757 if (E)
758 Profiler->VisitStmt(E);
759 }
760}
761void OMPClauseProfiler::VisitOMPLinearClause(const OMPLinearClause *C) {
762 VisitOMPClauseList(C);
763 VistOMPClauseWithPostUpdate(C);
764 for (auto *E : C->privates()) {
765 if (E)
766 Profiler->VisitStmt(E);
767 }
768 for (auto *E : C->inits()) {
769 if (E)
770 Profiler->VisitStmt(E);
771 }
772 for (auto *E : C->updates()) {
773 if (E)
774 Profiler->VisitStmt(E);
775 }
776 for (auto *E : C->finals()) {
777 if (E)
778 Profiler->VisitStmt(E);
779 }
780 if (C->getStep())
781 Profiler->VisitStmt(C->getStep());
782 if (C->getCalcStep())
783 Profiler->VisitStmt(C->getCalcStep());
784}
785void OMPClauseProfiler::VisitOMPAlignedClause(const OMPAlignedClause *C) {
786 VisitOMPClauseList(C);
787 if (C->getAlignment())
788 Profiler->VisitStmt(C->getAlignment());
789}
790void OMPClauseProfiler::VisitOMPCopyinClause(const OMPCopyinClause *C) {
791 VisitOMPClauseList(C);
792 for (auto *E : C->source_exprs()) {
793 if (E)
794 Profiler->VisitStmt(E);
795 }
796 for (auto *E : C->destination_exprs()) {
797 if (E)
798 Profiler->VisitStmt(E);
799 }
800 for (auto *E : C->assignment_ops()) {
801 if (E)
802 Profiler->VisitStmt(E);
803 }
804}
805void
806OMPClauseProfiler::VisitOMPCopyprivateClause(const OMPCopyprivateClause *C) {
807 VisitOMPClauseList(C);
808 for (auto *E : C->source_exprs()) {
809 if (E)
810 Profiler->VisitStmt(E);
811 }
812 for (auto *E : C->destination_exprs()) {
813 if (E)
814 Profiler->VisitStmt(E);
815 }
816 for (auto *E : C->assignment_ops()) {
817 if (E)
818 Profiler->VisitStmt(E);
819 }
820}
821void OMPClauseProfiler::VisitOMPFlushClause(const OMPFlushClause *C) {
822 VisitOMPClauseList(C);
823}
824void OMPClauseProfiler::VisitOMPDepobjClause(const OMPDepobjClause *C) {
825 if (const Expr *Depobj = C->getDepobj())
826 Profiler->VisitStmt(Depobj);
827}
828void OMPClauseProfiler::VisitOMPDependClause(const OMPDependClause *C) {
829 VisitOMPClauseList(C);
830}
831void OMPClauseProfiler::VisitOMPDeviceClause(const OMPDeviceClause *C) {
832 if (C->getDevice())
833 Profiler->VisitStmt(C->getDevice());
834}
835void OMPClauseProfiler::VisitOMPMapClause(const OMPMapClause *C) {
836 VisitOMPClauseList(C);
837}
838void OMPClauseProfiler::VisitOMPAllocateClause(const OMPAllocateClause *C) {
839 if (Expr *Allocator = C->getAllocator())
840 Profiler->VisitStmt(Allocator);
841 VisitOMPClauseList(C);
842}
843void OMPClauseProfiler::VisitOMPNumTeamsClause(const OMPNumTeamsClause *C) {
844 VistOMPClauseWithPreInit(C);
845 if (C->getNumTeams())
846 Profiler->VisitStmt(C->getNumTeams());
847}
848void OMPClauseProfiler::VisitOMPThreadLimitClause(
849 const OMPThreadLimitClause *C) {
850 VistOMPClauseWithPreInit(C);
851 if (C->getThreadLimit())
852 Profiler->VisitStmt(C->getThreadLimit());
853}
854void OMPClauseProfiler::VisitOMPPriorityClause(const OMPPriorityClause *C) {
855 VistOMPClauseWithPreInit(C);
856 if (C->getPriority())
857 Profiler->VisitStmt(C->getPriority());
858}
859void OMPClauseProfiler::VisitOMPGrainsizeClause(const OMPGrainsizeClause *C) {
860 VistOMPClauseWithPreInit(C);
861 if (C->getGrainsize())
862 Profiler->VisitStmt(C->getGrainsize());
863}
864void OMPClauseProfiler::VisitOMPNumTasksClause(const OMPNumTasksClause *C) {
865 VistOMPClauseWithPreInit(C);
866 if (C->getNumTasks())
867 Profiler->VisitStmt(C->getNumTasks());
868}
869void OMPClauseProfiler::VisitOMPHintClause(const OMPHintClause *C) {
870 if (C->getHint())
871 Profiler->VisitStmt(C->getHint());
872}
873void OMPClauseProfiler::VisitOMPToClause(const OMPToClause *C) {
874 VisitOMPClauseList(C);
875}
876void OMPClauseProfiler::VisitOMPFromClause(const OMPFromClause *C) {
877 VisitOMPClauseList(C);
878}
879void OMPClauseProfiler::VisitOMPUseDevicePtrClause(
880 const OMPUseDevicePtrClause *C) {
881 VisitOMPClauseList(C);
882}
883void OMPClauseProfiler::VisitOMPUseDeviceAddrClause(
884 const OMPUseDeviceAddrClause *C) {
885 VisitOMPClauseList(C);
886}
887void OMPClauseProfiler::VisitOMPIsDevicePtrClause(
888 const OMPIsDevicePtrClause *C) {
889 VisitOMPClauseList(C);
890}
891void OMPClauseProfiler::VisitOMPHasDeviceAddrClause(
892 const OMPHasDeviceAddrClause *C) {
893 VisitOMPClauseList(C);
894}
895void OMPClauseProfiler::VisitOMPNontemporalClause(
896 const OMPNontemporalClause *C) {
897 VisitOMPClauseList(C);
898 for (auto *E : C->private_refs())
899 Profiler->VisitStmt(E);
900}
901void OMPClauseProfiler::VisitOMPInclusiveClause(const OMPInclusiveClause *C) {
902 VisitOMPClauseList(C);
903}
904void OMPClauseProfiler::VisitOMPExclusiveClause(const OMPExclusiveClause *C) {
905 VisitOMPClauseList(C);
906}
907void OMPClauseProfiler::VisitOMPUsesAllocatorsClause(
908 const OMPUsesAllocatorsClause *C) {
909 for (unsigned I = 0, E = C->getNumberOfAllocators(); I < E; ++I) {
910 OMPUsesAllocatorsClause::Data D = C->getAllocatorData(I);
911 Profiler->VisitStmt(D.Allocator);
912 if (D.AllocatorTraits)
913 Profiler->VisitStmt(D.AllocatorTraits);
914 }
915}
916void OMPClauseProfiler::VisitOMPAffinityClause(const OMPAffinityClause *C) {
917 if (const Expr *Modifier = C->getModifier())
918 Profiler->VisitStmt(Modifier);
919 for (const Expr *E : C->varlists())
920 Profiler->VisitStmt(E);
921}
922void OMPClauseProfiler::VisitOMPOrderClause(const OMPOrderClause *C) {}
923void OMPClauseProfiler::VisitOMPBindClause(const OMPBindClause *C) {}
924void OMPClauseProfiler::VisitOMPXDynCGroupMemClause(
925 const OMPXDynCGroupMemClause *C) {
926 VistOMPClauseWithPreInit(C);
927 if (Expr *Size = C->getSize())
928 Profiler->VisitStmt(Size);
929}
930void OMPClauseProfiler::VisitOMPDoacrossClause(const OMPDoacrossClause *C) {
931 VisitOMPClauseList(C);
932}
933void OMPClauseProfiler::VisitOMPXAttributeClause(const OMPXAttributeClause *C) {
934}
935void OMPClauseProfiler::VisitOMPXBareClause(const OMPXBareClause *C) {}
936} // namespace
937
938void
939StmtProfiler::VisitOMPExecutableDirective(const OMPExecutableDirective *S) {
940 VisitStmt(S);
941 OMPClauseProfiler P(this);
942 ArrayRef<OMPClause *> Clauses = S->clauses();
943 for (ArrayRef<OMPClause *>::iterator I = Clauses.begin(), E = Clauses.end();
944 I != E; ++I)
945 if (*I)
946 P.Visit(*I);
947}
948
949void StmtProfiler::VisitOMPCanonicalLoop(const OMPCanonicalLoop *L) {
950 VisitStmt(L);
951}
952
953void StmtProfiler::VisitOMPLoopBasedDirective(const OMPLoopBasedDirective *S) {
954 VisitOMPExecutableDirective(S);
955}
956
957void StmtProfiler::VisitOMPLoopDirective(const OMPLoopDirective *S) {
958 VisitOMPLoopBasedDirective(S);
959}
960
961void StmtProfiler::VisitOMPMetaDirective(const OMPMetaDirective *S) {
962 VisitOMPExecutableDirective(S);
963}
964
965void StmtProfiler::VisitOMPParallelDirective(const OMPParallelDirective *S) {
966 VisitOMPExecutableDirective(S);
967}
968
969void StmtProfiler::VisitOMPSimdDirective(const OMPSimdDirective *S) {
970 VisitOMPLoopDirective(S);
971}
972
973void StmtProfiler::VisitOMPLoopTransformationDirective(
975 VisitOMPLoopBasedDirective(S);
976}
977
978void StmtProfiler::VisitOMPTileDirective(const OMPTileDirective *S) {
979 VisitOMPLoopTransformationDirective(S);
980}
981
982void StmtProfiler::VisitOMPUnrollDirective(const OMPUnrollDirective *S) {
983 VisitOMPLoopTransformationDirective(S);
984}
985
986void StmtProfiler::VisitOMPForDirective(const OMPForDirective *S) {
987 VisitOMPLoopDirective(S);
988}
989
990void StmtProfiler::VisitOMPForSimdDirective(const OMPForSimdDirective *S) {
991 VisitOMPLoopDirective(S);
992}
993
994void StmtProfiler::VisitOMPSectionsDirective(const OMPSectionsDirective *S) {
995 VisitOMPExecutableDirective(S);
996}
997
998void StmtProfiler::VisitOMPSectionDirective(const OMPSectionDirective *S) {
999 VisitOMPExecutableDirective(S);
1000}
1001
1002void StmtProfiler::VisitOMPScopeDirective(const OMPScopeDirective *S) {
1003 VisitOMPExecutableDirective(S);
1004}
1005
1006void StmtProfiler::VisitOMPSingleDirective(const OMPSingleDirective *S) {
1007 VisitOMPExecutableDirective(S);
1008}
1009
1010void StmtProfiler::VisitOMPMasterDirective(const OMPMasterDirective *S) {
1011 VisitOMPExecutableDirective(S);
1012}
1013
1014void StmtProfiler::VisitOMPCriticalDirective(const OMPCriticalDirective *S) {
1015 VisitOMPExecutableDirective(S);
1016 VisitName(S->getDirectiveName().getName());
1017}
1018
1019void
1020StmtProfiler::VisitOMPParallelForDirective(const OMPParallelForDirective *S) {
1021 VisitOMPLoopDirective(S);
1022}
1023
1024void StmtProfiler::VisitOMPParallelForSimdDirective(
1025 const OMPParallelForSimdDirective *S) {
1026 VisitOMPLoopDirective(S);
1027}
1028
1029void StmtProfiler::VisitOMPParallelMasterDirective(
1030 const OMPParallelMasterDirective *S) {
1031 VisitOMPExecutableDirective(S);
1032}
1033
1034void StmtProfiler::VisitOMPParallelMaskedDirective(
1035 const OMPParallelMaskedDirective *S) {
1036 VisitOMPExecutableDirective(S);
1037}
1038
1039void StmtProfiler::VisitOMPParallelSectionsDirective(
1041 VisitOMPExecutableDirective(S);
1042}
1043
1044void StmtProfiler::VisitOMPTaskDirective(const OMPTaskDirective *S) {
1045 VisitOMPExecutableDirective(S);
1046}
1047
1048void StmtProfiler::VisitOMPTaskyieldDirective(const OMPTaskyieldDirective *S) {
1049 VisitOMPExecutableDirective(S);
1050}
1051
1052void StmtProfiler::VisitOMPBarrierDirective(const OMPBarrierDirective *S) {
1053 VisitOMPExecutableDirective(S);
1054}
1055
1056void StmtProfiler::VisitOMPTaskwaitDirective(const OMPTaskwaitDirective *S) {
1057 VisitOMPExecutableDirective(S);
1058}
1059
1060void StmtProfiler::VisitOMPErrorDirective(const OMPErrorDirective *S) {
1061 VisitOMPExecutableDirective(S);
1062}
1063void StmtProfiler::VisitOMPTaskgroupDirective(const OMPTaskgroupDirective *S) {
1064 VisitOMPExecutableDirective(S);
1065 if (const Expr *E = S->getReductionRef())
1066 VisitStmt(E);
1067}
1068
1069void StmtProfiler::VisitOMPFlushDirective(const OMPFlushDirective *S) {
1070 VisitOMPExecutableDirective(S);
1071}
1072
1073void StmtProfiler::VisitOMPDepobjDirective(const OMPDepobjDirective *S) {
1074 VisitOMPExecutableDirective(S);
1075}
1076
1077void StmtProfiler::VisitOMPScanDirective(const OMPScanDirective *S) {
1078 VisitOMPExecutableDirective(S);
1079}
1080
1081void StmtProfiler::VisitOMPOrderedDirective(const OMPOrderedDirective *S) {
1082 VisitOMPExecutableDirective(S);
1083}
1084
1085void StmtProfiler::VisitOMPAtomicDirective(const OMPAtomicDirective *S) {
1086 VisitOMPExecutableDirective(S);
1087}
1088
1089void StmtProfiler::VisitOMPTargetDirective(const OMPTargetDirective *S) {
1090 VisitOMPExecutableDirective(S);
1091}
1092
1093void StmtProfiler::VisitOMPTargetDataDirective(const OMPTargetDataDirective *S) {
1094 VisitOMPExecutableDirective(S);
1095}
1096
1097void StmtProfiler::VisitOMPTargetEnterDataDirective(
1098 const OMPTargetEnterDataDirective *S) {
1099 VisitOMPExecutableDirective(S);
1100}
1101
1102void StmtProfiler::VisitOMPTargetExitDataDirective(
1103 const OMPTargetExitDataDirective *S) {
1104 VisitOMPExecutableDirective(S);
1105}
1106
1107void StmtProfiler::VisitOMPTargetParallelDirective(
1108 const OMPTargetParallelDirective *S) {
1109 VisitOMPExecutableDirective(S);
1110}
1111
1112void StmtProfiler::VisitOMPTargetParallelForDirective(
1114 VisitOMPExecutableDirective(S);
1115}
1116
1117void StmtProfiler::VisitOMPTeamsDirective(const OMPTeamsDirective *S) {
1118 VisitOMPExecutableDirective(S);
1119}
1120
1121void StmtProfiler::VisitOMPCancellationPointDirective(
1123 VisitOMPExecutableDirective(S);
1124}
1125
1126void StmtProfiler::VisitOMPCancelDirective(const OMPCancelDirective *S) {
1127 VisitOMPExecutableDirective(S);
1128}
1129
1130void StmtProfiler::VisitOMPTaskLoopDirective(const OMPTaskLoopDirective *S) {
1131 VisitOMPLoopDirective(S);
1132}
1133
1134void StmtProfiler::VisitOMPTaskLoopSimdDirective(
1135 const OMPTaskLoopSimdDirective *S) {
1136 VisitOMPLoopDirective(S);
1137}
1138
1139void StmtProfiler::VisitOMPMasterTaskLoopDirective(
1140 const OMPMasterTaskLoopDirective *S) {
1141 VisitOMPLoopDirective(S);
1142}
1143
1144void StmtProfiler::VisitOMPMaskedTaskLoopDirective(
1145 const OMPMaskedTaskLoopDirective *S) {
1146 VisitOMPLoopDirective(S);
1147}
1148
1149void StmtProfiler::VisitOMPMasterTaskLoopSimdDirective(
1151 VisitOMPLoopDirective(S);
1152}
1153
1154void StmtProfiler::VisitOMPMaskedTaskLoopSimdDirective(
1156 VisitOMPLoopDirective(S);
1157}
1158
1159void StmtProfiler::VisitOMPParallelMasterTaskLoopDirective(
1161 VisitOMPLoopDirective(S);
1162}
1163
1164void StmtProfiler::VisitOMPParallelMaskedTaskLoopDirective(
1166 VisitOMPLoopDirective(S);
1167}
1168
1169void StmtProfiler::VisitOMPParallelMasterTaskLoopSimdDirective(
1171 VisitOMPLoopDirective(S);
1172}
1173
1174void StmtProfiler::VisitOMPParallelMaskedTaskLoopSimdDirective(
1176 VisitOMPLoopDirective(S);
1177}
1178
1179void StmtProfiler::VisitOMPDistributeDirective(
1180 const OMPDistributeDirective *S) {
1181 VisitOMPLoopDirective(S);
1182}
1183
1184void OMPClauseProfiler::VisitOMPDistScheduleClause(
1185 const OMPDistScheduleClause *C) {
1186 VistOMPClauseWithPreInit(C);
1187 if (auto *S = C->getChunkSize())
1188 Profiler->VisitStmt(S);
1189}
1190
1191void OMPClauseProfiler::VisitOMPDefaultmapClause(const OMPDefaultmapClause *) {}
1192
1193void StmtProfiler::VisitOMPTargetUpdateDirective(
1194 const OMPTargetUpdateDirective *S) {
1195 VisitOMPExecutableDirective(S);
1196}
1197
1198void StmtProfiler::VisitOMPDistributeParallelForDirective(
1200 VisitOMPLoopDirective(S);
1201}
1202
1203void StmtProfiler::VisitOMPDistributeParallelForSimdDirective(
1205 VisitOMPLoopDirective(S);
1206}
1207
1208void StmtProfiler::VisitOMPDistributeSimdDirective(
1209 const OMPDistributeSimdDirective *S) {
1210 VisitOMPLoopDirective(S);
1211}
1212
1213void StmtProfiler::VisitOMPTargetParallelForSimdDirective(
1215 VisitOMPLoopDirective(S);
1216}
1217
1218void StmtProfiler::VisitOMPTargetSimdDirective(
1219 const OMPTargetSimdDirective *S) {
1220 VisitOMPLoopDirective(S);
1221}
1222
1223void StmtProfiler::VisitOMPTeamsDistributeDirective(
1224 const OMPTeamsDistributeDirective *S) {
1225 VisitOMPLoopDirective(S);
1226}
1227
1228void StmtProfiler::VisitOMPTeamsDistributeSimdDirective(
1230 VisitOMPLoopDirective(S);
1231}
1232
1233void StmtProfiler::VisitOMPTeamsDistributeParallelForSimdDirective(
1235 VisitOMPLoopDirective(S);
1236}
1237
1238void StmtProfiler::VisitOMPTeamsDistributeParallelForDirective(
1240 VisitOMPLoopDirective(S);
1241}
1242
1243void StmtProfiler::VisitOMPTargetTeamsDirective(
1244 const OMPTargetTeamsDirective *S) {
1245 VisitOMPExecutableDirective(S);
1246}
1247
1248void StmtProfiler::VisitOMPTargetTeamsDistributeDirective(
1250 VisitOMPLoopDirective(S);
1251}
1252
1253void StmtProfiler::VisitOMPTargetTeamsDistributeParallelForDirective(
1255 VisitOMPLoopDirective(S);
1256}
1257
1258void StmtProfiler::VisitOMPTargetTeamsDistributeParallelForSimdDirective(
1260 VisitOMPLoopDirective(S);
1261}
1262
1263void StmtProfiler::VisitOMPTargetTeamsDistributeSimdDirective(
1265 VisitOMPLoopDirective(S);
1266}
1267
1268void StmtProfiler::VisitOMPInteropDirective(const OMPInteropDirective *S) {
1269 VisitOMPExecutableDirective(S);
1270}
1271
1272void StmtProfiler::VisitOMPDispatchDirective(const OMPDispatchDirective *S) {
1273 VisitOMPExecutableDirective(S);
1274}
1275
1276void StmtProfiler::VisitOMPMaskedDirective(const OMPMaskedDirective *S) {
1277 VisitOMPExecutableDirective(S);
1278}
1279
1280void StmtProfiler::VisitOMPGenericLoopDirective(
1281 const OMPGenericLoopDirective *S) {
1282 VisitOMPLoopDirective(S);
1283}
1284
1285void StmtProfiler::VisitOMPTeamsGenericLoopDirective(
1287 VisitOMPLoopDirective(S);
1288}
1289
1290void StmtProfiler::VisitOMPTargetTeamsGenericLoopDirective(
1292 VisitOMPLoopDirective(S);
1293}
1294
1295void StmtProfiler::VisitOMPParallelGenericLoopDirective(
1297 VisitOMPLoopDirective(S);
1298}
1299
1300void StmtProfiler::VisitOMPTargetParallelGenericLoopDirective(
1302 VisitOMPLoopDirective(S);
1303}
1304
1305void StmtProfiler::VisitExpr(const Expr *S) {
1306 VisitStmt(S);
1307}
1308
1309void StmtProfiler::VisitConstantExpr(const ConstantExpr *S) {
1310 VisitExpr(S);
1311}
1312
1313void StmtProfiler::VisitDeclRefExpr(const DeclRefExpr *S) {
1314 VisitExpr(S);
1315 if (!Canonical)
1316 VisitNestedNameSpecifier(S->getQualifier());
1317 VisitDecl(S->getDecl());
1318 if (!Canonical) {
1319 ID.AddBoolean(S->hasExplicitTemplateArgs());
1320 if (S->hasExplicitTemplateArgs())
1321 VisitTemplateArguments(S->getTemplateArgs(), S->getNumTemplateArgs());
1322 }
1323}
1324
1325void StmtProfiler::VisitSYCLUniqueStableNameExpr(
1326 const SYCLUniqueStableNameExpr *S) {
1327 VisitExpr(S);
1328 VisitType(S->getTypeSourceInfo()->getType());
1329}
1330
1331void StmtProfiler::VisitPredefinedExpr(const PredefinedExpr *S) {
1332 VisitExpr(S);
1333 ID.AddInteger(llvm::to_underlying(S->getIdentKind()));
1334}
1335
1336void StmtProfiler::VisitIntegerLiteral(const IntegerLiteral *S) {
1337 VisitExpr(S);
1338 S->getValue().Profile(ID);
1339
1340 QualType T = S->getType();
1341 if (Canonical)
1342 T = T.getCanonicalType();
1343 ID.AddInteger(T->getTypeClass());
1344 if (auto BitIntT = T->getAs<BitIntType>())
1345 BitIntT->Profile(ID);
1346 else
1347 ID.AddInteger(T->castAs<BuiltinType>()->getKind());
1348}
1349
1350void StmtProfiler::VisitFixedPointLiteral(const FixedPointLiteral *S) {
1351 VisitExpr(S);
1352 S->getValue().Profile(ID);
1353 ID.AddInteger(S->getType()->castAs<BuiltinType>()->getKind());
1354}
1355
1356void StmtProfiler::VisitCharacterLiteral(const CharacterLiteral *S) {
1357 VisitExpr(S);
1358 ID.AddInteger(llvm::to_underlying(S->getKind()));
1359 ID.AddInteger(S->getValue());
1360}
1361
1362void StmtProfiler::VisitFloatingLiteral(const FloatingLiteral *S) {
1363 VisitExpr(S);
1364 S->getValue().Profile(ID);
1365 ID.AddBoolean(S->isExact());
1366 ID.AddInteger(S->getType()->castAs<BuiltinType>()->getKind());
1367}
1368
1369void StmtProfiler::VisitImaginaryLiteral(const ImaginaryLiteral *S) {
1370 VisitExpr(S);
1371}
1372
1373void StmtProfiler::VisitStringLiteral(const StringLiteral *S) {
1374 VisitExpr(S);
1375 ID.AddString(S->getBytes());
1376 ID.AddInteger(llvm::to_underlying(S->getKind()));
1377}
1378
1379void StmtProfiler::VisitParenExpr(const ParenExpr *S) {
1380 VisitExpr(S);
1381}
1382
1383void StmtProfiler::VisitParenListExpr(const ParenListExpr *S) {
1384 VisitExpr(S);
1385}
1386
1387void StmtProfiler::VisitUnaryOperator(const UnaryOperator *S) {
1388 VisitExpr(S);
1389 ID.AddInteger(S->getOpcode());
1390}
1391
1392void StmtProfiler::VisitOffsetOfExpr(const OffsetOfExpr *S) {
1393 VisitType(S->getTypeSourceInfo()->getType());
1394 unsigned n = S->getNumComponents();
1395 for (unsigned i = 0; i < n; ++i) {
1396 const OffsetOfNode &ON = S->getComponent(i);
1397 ID.AddInteger(ON.getKind());
1398 switch (ON.getKind()) {
1400 // Expressions handled below.
1401 break;
1402
1404 VisitDecl(ON.getField());
1405 break;
1406
1408 VisitIdentifierInfo(ON.getFieldName());
1409 break;
1410
1411 case OffsetOfNode::Base:
1412 // These nodes are implicit, and therefore don't need profiling.
1413 break;
1414 }
1415 }
1416
1417 VisitExpr(S);
1418}
1419
1420void
1421StmtProfiler::VisitUnaryExprOrTypeTraitExpr(const UnaryExprOrTypeTraitExpr *S) {
1422 VisitExpr(S);
1423 ID.AddInteger(S->getKind());
1424 if (S->isArgumentType())
1425 VisitType(S->getArgumentType());
1426}
1427
1428void StmtProfiler::VisitArraySubscriptExpr(const ArraySubscriptExpr *S) {
1429 VisitExpr(S);
1430}
1431
1432void StmtProfiler::VisitMatrixSubscriptExpr(const MatrixSubscriptExpr *S) {
1433 VisitExpr(S);
1434}
1435
1436void StmtProfiler::VisitOMPArraySectionExpr(const OMPArraySectionExpr *S) {
1437 VisitExpr(S);
1438}
1439
1440void StmtProfiler::VisitOMPArrayShapingExpr(const OMPArrayShapingExpr *S) {
1441 VisitExpr(S);
1442}
1443
1444void StmtProfiler::VisitOMPIteratorExpr(const OMPIteratorExpr *S) {
1445 VisitExpr(S);
1446 for (unsigned I = 0, E = S->numOfIterators(); I < E; ++I)
1447 VisitDecl(S->getIteratorDecl(I));
1448}
1449
1450void StmtProfiler::VisitCallExpr(const CallExpr *S) {
1451 VisitExpr(S);
1452}
1453
1454void StmtProfiler::VisitMemberExpr(const MemberExpr *S) {
1455 VisitExpr(S);
1456 VisitDecl(S->getMemberDecl());
1457 if (!Canonical)
1458 VisitNestedNameSpecifier(S->getQualifier());
1459 ID.AddBoolean(S->isArrow());
1460}
1461
1462void StmtProfiler::VisitCompoundLiteralExpr(const CompoundLiteralExpr *S) {
1463 VisitExpr(S);
1464 ID.AddBoolean(S->isFileScope());
1465}
1466
1467void StmtProfiler::VisitCastExpr(const CastExpr *S) {
1468 VisitExpr(S);
1469}
1470
1471void StmtProfiler::VisitImplicitCastExpr(const ImplicitCastExpr *S) {
1472 VisitCastExpr(S);
1473 ID.AddInteger(S->getValueKind());
1474}
1475
1476void StmtProfiler::VisitExplicitCastExpr(const ExplicitCastExpr *S) {
1477 VisitCastExpr(S);
1478 VisitType(S->getTypeAsWritten());
1479}
1480
1481void StmtProfiler::VisitCStyleCastExpr(const CStyleCastExpr *S) {
1482 VisitExplicitCastExpr(S);
1483}
1484
1485void StmtProfiler::VisitBinaryOperator(const BinaryOperator *S) {
1486 VisitExpr(S);
1487 ID.AddInteger(S->getOpcode());
1488}
1489
1490void
1491StmtProfiler::VisitCompoundAssignOperator(const CompoundAssignOperator *S) {
1492 VisitBinaryOperator(S);
1493}
1494
1495void StmtProfiler::VisitConditionalOperator(const ConditionalOperator *S) {
1496 VisitExpr(S);
1497}
1498
1499void StmtProfiler::VisitBinaryConditionalOperator(
1500 const BinaryConditionalOperator *S) {
1501 VisitExpr(S);
1502}
1503
1504void StmtProfiler::VisitAddrLabelExpr(const AddrLabelExpr *S) {
1505 VisitExpr(S);
1506 VisitDecl(S->getLabel());
1507}
1508
1509void StmtProfiler::VisitStmtExpr(const StmtExpr *S) {
1510 VisitExpr(S);
1511}
1512
1513void StmtProfiler::VisitShuffleVectorExpr(const ShuffleVectorExpr *S) {
1514 VisitExpr(S);
1515}
1516
1517void StmtProfiler::VisitConvertVectorExpr(const ConvertVectorExpr *S) {
1518 VisitExpr(S);
1519}
1520
1521void StmtProfiler::VisitChooseExpr(const ChooseExpr *S) {
1522 VisitExpr(S);
1523}
1524
1525void StmtProfiler::VisitGNUNullExpr(const GNUNullExpr *S) {
1526 VisitExpr(S);
1527}
1528
1529void StmtProfiler::VisitVAArgExpr(const VAArgExpr *S) {
1530 VisitExpr(S);
1531}
1532
1533void StmtProfiler::VisitInitListExpr(const InitListExpr *S) {
1534 if (S->getSyntacticForm()) {
1535 VisitInitListExpr(S->getSyntacticForm());
1536 return;
1537 }
1538
1539 VisitExpr(S);
1540}
1541
1542void StmtProfiler::VisitDesignatedInitExpr(const DesignatedInitExpr *S) {
1543 VisitExpr(S);
1544 ID.AddBoolean(S->usesGNUSyntax());
1545 for (const DesignatedInitExpr::Designator &D : S->designators()) {
1546 if (D.isFieldDesignator()) {
1547 ID.AddInteger(0);
1548 VisitName(D.getFieldName());
1549 continue;
1550 }
1551
1552 if (D.isArrayDesignator()) {
1553 ID.AddInteger(1);
1554 } else {
1555 assert(D.isArrayRangeDesignator());
1556 ID.AddInteger(2);
1557 }
1558 ID.AddInteger(D.getArrayIndex());
1559 }
1560}
1561
1562// Seems that if VisitInitListExpr() only works on the syntactic form of an
1563// InitListExpr, then a DesignatedInitUpdateExpr is not encountered.
1564void StmtProfiler::VisitDesignatedInitUpdateExpr(
1565 const DesignatedInitUpdateExpr *S) {
1566 llvm_unreachable("Unexpected DesignatedInitUpdateExpr in syntactic form of "
1567 "initializer");
1568}
1569
1570void StmtProfiler::VisitArrayInitLoopExpr(const ArrayInitLoopExpr *S) {
1571 VisitExpr(S);
1572}
1573
1574void StmtProfiler::VisitArrayInitIndexExpr(const ArrayInitIndexExpr *S) {
1575 VisitExpr(S);
1576}
1577
1578void StmtProfiler::VisitNoInitExpr(const NoInitExpr *S) {
1579 llvm_unreachable("Unexpected NoInitExpr in syntactic form of initializer");
1580}
1581
1582void StmtProfiler::VisitImplicitValueInitExpr(const ImplicitValueInitExpr *S) {
1583 VisitExpr(S);
1584}
1585
1586void StmtProfiler::VisitExtVectorElementExpr(const ExtVectorElementExpr *S) {
1587 VisitExpr(S);
1588 VisitName(&S->getAccessor());
1589}
1590
1591void StmtProfiler::VisitBlockExpr(const BlockExpr *S) {
1592 VisitExpr(S);
1593 VisitDecl(S->getBlockDecl());
1594}
1595
1596void StmtProfiler::VisitGenericSelectionExpr(const GenericSelectionExpr *S) {
1597 VisitExpr(S);
1599 S->associations()) {
1600 QualType T = Assoc.getType();
1601 if (T.isNull())
1602 ID.AddPointer(nullptr);
1603 else
1604 VisitType(T);
1605 VisitExpr(Assoc.getAssociationExpr());
1606 }
1607}
1608
1609void StmtProfiler::VisitPseudoObjectExpr(const PseudoObjectExpr *S) {
1610 VisitExpr(S);
1612 i = S->semantics_begin(), e = S->semantics_end(); i != e; ++i)
1613 // Normally, we would not profile the source expressions of OVEs.
1614 if (const OpaqueValueExpr *OVE = dyn_cast<OpaqueValueExpr>(*i))
1615 Visit(OVE->getSourceExpr());
1616}
1617
1618void StmtProfiler::VisitAtomicExpr(const AtomicExpr *S) {
1619 VisitExpr(S);
1620 ID.AddInteger(S->getOp());
1621}
1622
1623void StmtProfiler::VisitConceptSpecializationExpr(
1624 const ConceptSpecializationExpr *S) {
1625 VisitExpr(S);
1626 VisitDecl(S->getNamedConcept());
1627 for (const TemplateArgument &Arg : S->getTemplateArguments())
1628 VisitTemplateArgument(Arg);
1629}
1630
1631void StmtProfiler::VisitRequiresExpr(const RequiresExpr *S) {
1632 VisitExpr(S);
1633 ID.AddInteger(S->getLocalParameters().size());
1634 for (ParmVarDecl *LocalParam : S->getLocalParameters())
1635 VisitDecl(LocalParam);
1636 ID.AddInteger(S->getRequirements().size());
1637 for (concepts::Requirement *Req : S->getRequirements()) {
1638 if (auto *TypeReq = dyn_cast<concepts::TypeRequirement>(Req)) {
1640 ID.AddBoolean(TypeReq->isSubstitutionFailure());
1641 if (!TypeReq->isSubstitutionFailure())
1642 VisitType(TypeReq->getType()->getType());
1643 } else if (auto *ExprReq = dyn_cast<concepts::ExprRequirement>(Req)) {
1645 ID.AddBoolean(ExprReq->isExprSubstitutionFailure());
1646 if (!ExprReq->isExprSubstitutionFailure())
1647 Visit(ExprReq->getExpr());
1648 // C++2a [expr.prim.req.compound]p1 Example:
1649 // [...] The compound-requirement in C1 requires that x++ is a valid
1650 // expression. It is equivalent to the simple-requirement x++; [...]
1651 // We therefore do not profile isSimple() here.
1652 ID.AddBoolean(ExprReq->getNoexceptLoc().isValid());
1654 ExprReq->getReturnTypeRequirement();
1655 if (RetReq.isEmpty()) {
1656 ID.AddInteger(0);
1657 } else if (RetReq.isTypeConstraint()) {
1658 ID.AddInteger(1);
1660 } else {
1661 assert(RetReq.isSubstitutionFailure());
1662 ID.AddInteger(2);
1663 }
1664 } else {
1666 auto *NestedReq = cast<concepts::NestedRequirement>(Req);
1667 ID.AddBoolean(NestedReq->hasInvalidConstraint());
1668 if (!NestedReq->hasInvalidConstraint())
1669 Visit(NestedReq->getConstraintExpr());
1670 }
1671 }
1672}
1673
1675 UnaryOperatorKind &UnaryOp,
1676 BinaryOperatorKind &BinaryOp,
1677 unsigned &NumArgs) {
1678 switch (S->getOperator()) {
1679 case OO_None:
1680 case OO_New:
1681 case OO_Delete:
1682 case OO_Array_New:
1683 case OO_Array_Delete:
1684 case OO_Arrow:
1685 case OO_Conditional:
1687 llvm_unreachable("Invalid operator call kind");
1688
1689 case OO_Plus:
1690 if (NumArgs == 1) {
1691 UnaryOp = UO_Plus;
1692 return Stmt::UnaryOperatorClass;
1693 }
1694
1695 BinaryOp = BO_Add;
1696 return Stmt::BinaryOperatorClass;
1697
1698 case OO_Minus:
1699 if (NumArgs == 1) {
1700 UnaryOp = UO_Minus;
1701 return Stmt::UnaryOperatorClass;
1702 }
1703
1704 BinaryOp = BO_Sub;
1705 return Stmt::BinaryOperatorClass;
1706
1707 case OO_Star:
1708 if (NumArgs == 1) {
1709 UnaryOp = UO_Deref;
1710 return Stmt::UnaryOperatorClass;
1711 }
1712
1713 BinaryOp = BO_Mul;
1714 return Stmt::BinaryOperatorClass;
1715
1716 case OO_Slash:
1717 BinaryOp = BO_Div;
1718 return Stmt::BinaryOperatorClass;
1719
1720 case OO_Percent:
1721 BinaryOp = BO_Rem;
1722 return Stmt::BinaryOperatorClass;
1723
1724 case OO_Caret:
1725 BinaryOp = BO_Xor;
1726 return Stmt::BinaryOperatorClass;
1727
1728 case OO_Amp:
1729 if (NumArgs == 1) {
1730 UnaryOp = UO_AddrOf;
1731 return Stmt::UnaryOperatorClass;
1732 }
1733
1734 BinaryOp = BO_And;
1735 return Stmt::BinaryOperatorClass;
1736
1737 case OO_Pipe:
1738 BinaryOp = BO_Or;
1739 return Stmt::BinaryOperatorClass;
1740
1741 case OO_Tilde:
1742 UnaryOp = UO_Not;
1743 return Stmt::UnaryOperatorClass;
1744
1745 case OO_Exclaim:
1746 UnaryOp = UO_LNot;
1747 return Stmt::UnaryOperatorClass;
1748
1749 case OO_Equal:
1750 BinaryOp = BO_Assign;
1751 return Stmt::BinaryOperatorClass;
1752
1753 case OO_Less:
1754 BinaryOp = BO_LT;
1755 return Stmt::BinaryOperatorClass;
1756
1757 case OO_Greater:
1758 BinaryOp = BO_GT;
1759 return Stmt::BinaryOperatorClass;
1760
1761 case OO_PlusEqual:
1762 BinaryOp = BO_AddAssign;
1763 return Stmt::CompoundAssignOperatorClass;
1764
1765 case OO_MinusEqual:
1766 BinaryOp = BO_SubAssign;
1767 return Stmt::CompoundAssignOperatorClass;
1768
1769 case OO_StarEqual:
1770 BinaryOp = BO_MulAssign;
1771 return Stmt::CompoundAssignOperatorClass;
1772
1773 case OO_SlashEqual:
1774 BinaryOp = BO_DivAssign;
1775 return Stmt::CompoundAssignOperatorClass;
1776
1777 case OO_PercentEqual:
1778 BinaryOp = BO_RemAssign;
1779 return Stmt::CompoundAssignOperatorClass;
1780
1781 case OO_CaretEqual:
1782 BinaryOp = BO_XorAssign;
1783 return Stmt::CompoundAssignOperatorClass;
1784
1785 case OO_AmpEqual:
1786 BinaryOp = BO_AndAssign;
1787 return Stmt::CompoundAssignOperatorClass;
1788
1789 case OO_PipeEqual:
1790 BinaryOp = BO_OrAssign;
1791 return Stmt::CompoundAssignOperatorClass;
1792
1793 case OO_LessLess:
1794 BinaryOp = BO_Shl;
1795 return Stmt::BinaryOperatorClass;
1796
1797 case OO_GreaterGreater:
1798 BinaryOp = BO_Shr;
1799 return Stmt::BinaryOperatorClass;
1800
1801 case OO_LessLessEqual:
1802 BinaryOp = BO_ShlAssign;
1803 return Stmt::CompoundAssignOperatorClass;
1804
1805 case OO_GreaterGreaterEqual:
1806 BinaryOp = BO_ShrAssign;
1807 return Stmt::CompoundAssignOperatorClass;
1808
1809 case OO_EqualEqual:
1810 BinaryOp = BO_EQ;
1811 return Stmt::BinaryOperatorClass;
1812
1813 case OO_ExclaimEqual:
1814 BinaryOp = BO_NE;
1815 return Stmt::BinaryOperatorClass;
1816
1817 case OO_LessEqual:
1818 BinaryOp = BO_LE;
1819 return Stmt::BinaryOperatorClass;
1820
1821 case OO_GreaterEqual:
1822 BinaryOp = BO_GE;
1823 return Stmt::BinaryOperatorClass;
1824
1825 case OO_Spaceship:
1826 BinaryOp = BO_Cmp;
1827 return Stmt::BinaryOperatorClass;
1828
1829 case OO_AmpAmp:
1830 BinaryOp = BO_LAnd;
1831 return Stmt::BinaryOperatorClass;
1832
1833 case OO_PipePipe:
1834 BinaryOp = BO_LOr;
1835 return Stmt::BinaryOperatorClass;
1836
1837 case OO_PlusPlus:
1838 UnaryOp = NumArgs == 1 ? UO_PreInc : UO_PostInc;
1839 NumArgs = 1;
1840 return Stmt::UnaryOperatorClass;
1841
1842 case OO_MinusMinus:
1843 UnaryOp = NumArgs == 1 ? UO_PreDec : UO_PostDec;
1844 NumArgs = 1;
1845 return Stmt::UnaryOperatorClass;
1846
1847 case OO_Comma:
1848 BinaryOp = BO_Comma;
1849 return Stmt::BinaryOperatorClass;
1850
1851 case OO_ArrowStar:
1852 BinaryOp = BO_PtrMemI;
1853 return Stmt::BinaryOperatorClass;
1854
1855 case OO_Subscript:
1856 return Stmt::ArraySubscriptExprClass;
1857
1858 case OO_Call:
1859 return Stmt::CallExprClass;
1860
1861 case OO_Coawait:
1862 UnaryOp = UO_Coawait;
1863 return Stmt::UnaryOperatorClass;
1864 }
1865
1866 llvm_unreachable("Invalid overloaded operator expression");
1867}
1868
1869#if defined(_MSC_VER) && !defined(__clang__)
1870#if _MSC_VER == 1911
1871// Work around https://developercommunity.visualstudio.com/content/problem/84002/clang-cl-when-built-with-vc-2017-crashes-cause-vc.html
1872// MSVC 2017 update 3 miscompiles this function, and a clang built with it
1873// will crash in stage 2 of a bootstrap build.
1874#pragma optimize("", off)
1875#endif
1876#endif
1877
1878void StmtProfiler::VisitCXXOperatorCallExpr(const CXXOperatorCallExpr *S) {
1879 if (S->isTypeDependent()) {
1880 // Type-dependent operator calls are profiled like their underlying
1881 // syntactic operator.
1882 //
1883 // An operator call to operator-> is always implicit, so just skip it. The
1884 // enclosing MemberExpr will profile the actual member access.
1885 if (S->getOperator() == OO_Arrow)
1886 return Visit(S->getArg(0));
1887
1888 UnaryOperatorKind UnaryOp = UO_Extension;
1889 BinaryOperatorKind BinaryOp = BO_Comma;
1890 unsigned NumArgs = S->getNumArgs();
1891 Stmt::StmtClass SC = DecodeOperatorCall(S, UnaryOp, BinaryOp, NumArgs);
1892
1893 ID.AddInteger(SC);
1894 for (unsigned I = 0; I != NumArgs; ++I)
1895 Visit(S->getArg(I));
1896 if (SC == Stmt::UnaryOperatorClass)
1897 ID.AddInteger(UnaryOp);
1898 else if (SC == Stmt::BinaryOperatorClass ||
1899 SC == Stmt::CompoundAssignOperatorClass)
1900 ID.AddInteger(BinaryOp);
1901 else
1902 assert(SC == Stmt::ArraySubscriptExprClass || SC == Stmt::CallExprClass);
1903
1904 return;
1905 }
1906
1907 VisitCallExpr(S);
1908 ID.AddInteger(S->getOperator());
1909}
1910
1911void StmtProfiler::VisitCXXRewrittenBinaryOperator(
1912 const CXXRewrittenBinaryOperator *S) {
1913 // If a rewritten operator were ever to be type-dependent, we should profile
1914 // it following its syntactic operator.
1915 assert(!S->isTypeDependent() &&
1916 "resolved rewritten operator should never be type-dependent");
1917 ID.AddBoolean(S->isReversed());
1918 VisitExpr(S->getSemanticForm());
1919}
1920
1921#if defined(_MSC_VER) && !defined(__clang__)
1922#if _MSC_VER == 1911
1923#pragma optimize("", on)
1924#endif
1925#endif
1926
1927void StmtProfiler::VisitCXXMemberCallExpr(const CXXMemberCallExpr *S) {
1928 VisitCallExpr(S);
1929}
1930
1931void StmtProfiler::VisitCUDAKernelCallExpr(const CUDAKernelCallExpr *S) {
1932 VisitCallExpr(S);
1933}
1934
1935void StmtProfiler::VisitAsTypeExpr(const AsTypeExpr *S) {
1936 VisitExpr(S);
1937}
1938
1939void StmtProfiler::VisitCXXNamedCastExpr(const CXXNamedCastExpr *S) {
1940 VisitExplicitCastExpr(S);
1941}
1942
1943void StmtProfiler::VisitCXXStaticCastExpr(const CXXStaticCastExpr *S) {
1944 VisitCXXNamedCastExpr(S);
1945}
1946
1947void StmtProfiler::VisitCXXDynamicCastExpr(const CXXDynamicCastExpr *S) {
1948 VisitCXXNamedCastExpr(S);
1949}
1950
1951void
1952StmtProfiler::VisitCXXReinterpretCastExpr(const CXXReinterpretCastExpr *S) {
1953 VisitCXXNamedCastExpr(S);
1954}
1955
1956void StmtProfiler::VisitCXXConstCastExpr(const CXXConstCastExpr *S) {
1957 VisitCXXNamedCastExpr(S);
1958}
1959
1960void StmtProfiler::VisitBuiltinBitCastExpr(const BuiltinBitCastExpr *S) {
1961 VisitExpr(S);
1962 VisitType(S->getTypeInfoAsWritten()->getType());
1963}
1964
1965void StmtProfiler::VisitCXXAddrspaceCastExpr(const CXXAddrspaceCastExpr *S) {
1966 VisitCXXNamedCastExpr(S);
1967}
1968
1969void StmtProfiler::VisitUserDefinedLiteral(const UserDefinedLiteral *S) {
1970 VisitCallExpr(S);
1971}
1972
1973void StmtProfiler::VisitCXXBoolLiteralExpr(const CXXBoolLiteralExpr *S) {
1974 VisitExpr(S);
1975 ID.AddBoolean(S->getValue());
1976}
1977
1978void StmtProfiler::VisitCXXNullPtrLiteralExpr(const CXXNullPtrLiteralExpr *S) {
1979 VisitExpr(S);
1980}
1981
1982void StmtProfiler::VisitCXXStdInitializerListExpr(
1983 const CXXStdInitializerListExpr *S) {
1984 VisitExpr(S);
1985}
1986
1987void StmtProfiler::VisitCXXTypeidExpr(const CXXTypeidExpr *S) {
1988 VisitExpr(S);
1989 if (S->isTypeOperand())
1990 VisitType(S->getTypeOperandSourceInfo()->getType());
1991}
1992
1993void StmtProfiler::VisitCXXUuidofExpr(const CXXUuidofExpr *S) {
1994 VisitExpr(S);
1995 if (S->isTypeOperand())
1996 VisitType(S->getTypeOperandSourceInfo()->getType());
1997}
1998
1999void StmtProfiler::VisitMSPropertyRefExpr(const MSPropertyRefExpr *S) {
2000 VisitExpr(S);
2001 VisitDecl(S->getPropertyDecl());
2002}
2003
2004void StmtProfiler::VisitMSPropertySubscriptExpr(
2005 const MSPropertySubscriptExpr *S) {
2006 VisitExpr(S);
2007}
2008
2009void StmtProfiler::VisitCXXThisExpr(const CXXThisExpr *S) {
2010 VisitExpr(S);
2011 ID.AddBoolean(S->isImplicit());
2012}
2013
2014void StmtProfiler::VisitCXXThrowExpr(const CXXThrowExpr *S) {
2015 VisitExpr(S);
2016}
2017
2018void StmtProfiler::VisitCXXDefaultArgExpr(const CXXDefaultArgExpr *S) {
2019 VisitExpr(S);
2020 VisitDecl(S->getParam());
2021}
2022
2023void StmtProfiler::VisitCXXDefaultInitExpr(const CXXDefaultInitExpr *S) {
2024 VisitExpr(S);
2025 VisitDecl(S->getField());
2026}
2027
2028void StmtProfiler::VisitCXXBindTemporaryExpr(const CXXBindTemporaryExpr *S) {
2029 VisitExpr(S);
2030 VisitDecl(
2031 const_cast<CXXDestructorDecl *>(S->getTemporary()->getDestructor()));
2032}
2033
2034void StmtProfiler::VisitCXXConstructExpr(const CXXConstructExpr *S) {
2035 VisitExpr(S);
2036 VisitDecl(S->getConstructor());
2037 ID.AddBoolean(S->isElidable());
2038}
2039
2040void StmtProfiler::VisitCXXInheritedCtorInitExpr(
2041 const CXXInheritedCtorInitExpr *S) {
2042 VisitExpr(S);
2043 VisitDecl(S->getConstructor());
2044}
2045
2046void StmtProfiler::VisitCXXFunctionalCastExpr(const CXXFunctionalCastExpr *S) {
2047 VisitExplicitCastExpr(S);
2048}
2049
2050void
2051StmtProfiler::VisitCXXTemporaryObjectExpr(const CXXTemporaryObjectExpr *S) {
2052 VisitCXXConstructExpr(S);
2053}
2054
2055void
2056StmtProfiler::VisitLambdaExpr(const LambdaExpr *S) {
2057 if (!ProfileLambdaExpr) {
2058 // Do not recursively visit the children of this expression. Profiling the
2059 // body would result in unnecessary work, and is not safe to do during
2060 // deserialization.
2061 VisitStmtNoChildren(S);
2062
2063 // C++20 [temp.over.link]p5:
2064 // Two lambda-expressions are never considered equivalent.
2065 VisitDecl(S->getLambdaClass());
2066
2067 return;
2068 }
2069
2070 CXXRecordDecl *Lambda = S->getLambdaClass();
2071 ID.AddInteger(Lambda->getODRHash());
2072
2073 for (const auto &Capture : Lambda->captures()) {
2074 ID.AddInteger(Capture.getCaptureKind());
2075 if (Capture.capturesVariable())
2076 VisitDecl(Capture.getCapturedVar());
2077 }
2078}
2079
2080void
2081StmtProfiler::VisitCXXScalarValueInitExpr(const CXXScalarValueInitExpr *S) {
2082 VisitExpr(S);
2083}
2084
2085void StmtProfiler::VisitCXXDeleteExpr(const CXXDeleteExpr *S) {
2086 VisitExpr(S);
2087 ID.AddBoolean(S->isGlobalDelete());
2088 ID.AddBoolean(S->isArrayForm());
2089 VisitDecl(S->getOperatorDelete());
2090}
2091
2092void StmtProfiler::VisitCXXNewExpr(const CXXNewExpr *S) {
2093 VisitExpr(S);
2094 VisitType(S->getAllocatedType());
2095 VisitDecl(S->getOperatorNew());
2096 VisitDecl(S->getOperatorDelete());
2097 ID.AddBoolean(S->isArray());
2098 ID.AddInteger(S->getNumPlacementArgs());
2099 ID.AddBoolean(S->isGlobalNew());
2100 ID.AddBoolean(S->isParenTypeId());
2101 ID.AddInteger(llvm::to_underlying(S->getInitializationStyle()));
2102}
2103
2104void
2105StmtProfiler::VisitCXXPseudoDestructorExpr(const CXXPseudoDestructorExpr *S) {
2106 VisitExpr(S);
2107 ID.AddBoolean(S->isArrow());
2108 VisitNestedNameSpecifier(S->getQualifier());
2109 ID.AddBoolean(S->getScopeTypeInfo() != nullptr);
2110 if (S->getScopeTypeInfo())
2111 VisitType(S->getScopeTypeInfo()->getType());
2112 ID.AddBoolean(S->getDestroyedTypeInfo() != nullptr);
2113 if (S->getDestroyedTypeInfo())
2114 VisitType(S->getDestroyedType());
2115 else
2116 VisitIdentifierInfo(S->getDestroyedTypeIdentifier());
2117}
2118
2119void StmtProfiler::VisitOverloadExpr(const OverloadExpr *S) {
2120 VisitExpr(S);
2121 VisitNestedNameSpecifier(S->getQualifier());
2122 VisitName(S->getName(), /*TreatAsDecl*/ true);
2123 ID.AddBoolean(S->hasExplicitTemplateArgs());
2124 if (S->hasExplicitTemplateArgs())
2125 VisitTemplateArguments(S->getTemplateArgs(), S->getNumTemplateArgs());
2126}
2127
2128void
2129StmtProfiler::VisitUnresolvedLookupExpr(const UnresolvedLookupExpr *S) {
2130 VisitOverloadExpr(S);
2131}
2132
2133void StmtProfiler::VisitTypeTraitExpr(const TypeTraitExpr *S) {
2134 VisitExpr(S);
2135 ID.AddInteger(S->getTrait());
2136 ID.AddInteger(S->getNumArgs());
2137 for (unsigned I = 0, N = S->getNumArgs(); I != N; ++I)
2138 VisitType(S->getArg(I)->getType());
2139}
2140
2141void StmtProfiler::VisitArrayTypeTraitExpr(const ArrayTypeTraitExpr *S) {
2142 VisitExpr(S);
2143 ID.AddInteger(S->getTrait());
2144 VisitType(S->getQueriedType());
2145}
2146
2147void StmtProfiler::VisitExpressionTraitExpr(const ExpressionTraitExpr *S) {
2148 VisitExpr(S);
2149 ID.AddInteger(S->getTrait());
2150 VisitExpr(S->getQueriedExpression());
2151}
2152
2153void StmtProfiler::VisitDependentScopeDeclRefExpr(
2154 const DependentScopeDeclRefExpr *S) {
2155 VisitExpr(S);
2156 VisitName(S->getDeclName());
2157 VisitNestedNameSpecifier(S->getQualifier());
2158 ID.AddBoolean(S->hasExplicitTemplateArgs());
2159 if (S->hasExplicitTemplateArgs())
2160 VisitTemplateArguments(S->getTemplateArgs(), S->getNumTemplateArgs());
2161}
2162
2163void StmtProfiler::VisitExprWithCleanups(const ExprWithCleanups *S) {
2164 VisitExpr(S);
2165}
2166
2167void StmtProfiler::VisitCXXUnresolvedConstructExpr(
2168 const CXXUnresolvedConstructExpr *S) {
2169 VisitExpr(S);
2170 VisitType(S->getTypeAsWritten());
2171 ID.AddInteger(S->isListInitialization());
2172}
2173
2174void StmtProfiler::VisitCXXDependentScopeMemberExpr(
2175 const CXXDependentScopeMemberExpr *S) {
2176 ID.AddBoolean(S->isImplicitAccess());
2177 if (!S->isImplicitAccess()) {
2178 VisitExpr(S);
2179 ID.AddBoolean(S->isArrow());
2180 }
2181 VisitNestedNameSpecifier(S->getQualifier());
2182 VisitName(S->getMember());
2183 ID.AddBoolean(S->hasExplicitTemplateArgs());
2184 if (S->hasExplicitTemplateArgs())
2185 VisitTemplateArguments(S->getTemplateArgs(), S->getNumTemplateArgs());
2186}
2187
2188void StmtProfiler::VisitUnresolvedMemberExpr(const UnresolvedMemberExpr *S) {
2189 ID.AddBoolean(S->isImplicitAccess());
2190 if (!S->isImplicitAccess()) {
2191 VisitExpr(S);
2192 ID.AddBoolean(S->isArrow());
2193 }
2194 VisitNestedNameSpecifier(S->getQualifier());
2195 VisitName(S->getMemberName());
2196 ID.AddBoolean(S->hasExplicitTemplateArgs());
2197 if (S->hasExplicitTemplateArgs())
2198 VisitTemplateArguments(S->getTemplateArgs(), S->getNumTemplateArgs());
2199}
2200
2201void StmtProfiler::VisitCXXNoexceptExpr(const CXXNoexceptExpr *S) {
2202 VisitExpr(S);
2203}
2204
2205void StmtProfiler::VisitPackExpansionExpr(const PackExpansionExpr *S) {
2206 VisitExpr(S);
2207}
2208
2209void StmtProfiler::VisitSizeOfPackExpr(const SizeOfPackExpr *S) {
2210 VisitExpr(S);
2211 VisitDecl(S->getPack());
2212 if (S->isPartiallySubstituted()) {
2213 auto Args = S->getPartialArguments();
2214 ID.AddInteger(Args.size());
2215 for (const auto &TA : Args)
2216 VisitTemplateArgument(TA);
2217 } else {
2218 ID.AddInteger(0);
2219 }
2220}
2221
2222void StmtProfiler::VisitSubstNonTypeTemplateParmPackExpr(
2224 VisitExpr(S);
2225 VisitDecl(S->getParameterPack());
2226 VisitTemplateArgument(S->getArgumentPack());
2227}
2228
2229void StmtProfiler::VisitSubstNonTypeTemplateParmExpr(
2231 // Profile exactly as the replacement expression.
2232 Visit(E->getReplacement());
2233}
2234
2235void StmtProfiler::VisitFunctionParmPackExpr(const FunctionParmPackExpr *S) {
2236 VisitExpr(S);
2237 VisitDecl(S->getParameterPack());
2238 ID.AddInteger(S->getNumExpansions());
2239 for (FunctionParmPackExpr::iterator I = S->begin(), E = S->end(); I != E; ++I)
2240 VisitDecl(*I);
2241}
2242
2243void StmtProfiler::VisitMaterializeTemporaryExpr(
2244 const MaterializeTemporaryExpr *S) {
2245 VisitExpr(S);
2246}
2247
2248void StmtProfiler::VisitCXXFoldExpr(const CXXFoldExpr *S) {
2249 VisitExpr(S);
2250 ID.AddInteger(S->getOperator());
2251}
2252
2253void StmtProfiler::VisitCXXParenListInitExpr(const CXXParenListInitExpr *S) {
2254 VisitExpr(S);
2255}
2256
2257void StmtProfiler::VisitCoroutineBodyStmt(const CoroutineBodyStmt *S) {
2258 VisitStmt(S);
2259}
2260
2261void StmtProfiler::VisitCoreturnStmt(const CoreturnStmt *S) {
2262 VisitStmt(S);
2263}
2264
2265void StmtProfiler::VisitCoawaitExpr(const CoawaitExpr *S) {
2266 VisitExpr(S);
2267}
2268
2269void StmtProfiler::VisitDependentCoawaitExpr(const DependentCoawaitExpr *S) {
2270 VisitExpr(S);
2271}
2272
2273void StmtProfiler::VisitCoyieldExpr(const CoyieldExpr *S) {
2274 VisitExpr(S);
2275}
2276
2277void StmtProfiler::VisitOpaqueValueExpr(const OpaqueValueExpr *E) {
2278 VisitExpr(E);
2279}
2280
2281void StmtProfiler::VisitTypoExpr(const TypoExpr *E) {
2282 VisitExpr(E);
2283}
2284
2285void StmtProfiler::VisitSourceLocExpr(const SourceLocExpr *E) {
2286 VisitExpr(E);
2287}
2288
2289void StmtProfiler::VisitRecoveryExpr(const RecoveryExpr *E) { VisitExpr(E); }
2290
2291void StmtProfiler::VisitObjCStringLiteral(const ObjCStringLiteral *S) {
2292 VisitExpr(S);
2293}
2294
2295void StmtProfiler::VisitObjCBoxedExpr(const ObjCBoxedExpr *E) {
2296 VisitExpr(E);
2297}
2298
2299void StmtProfiler::VisitObjCArrayLiteral(const ObjCArrayLiteral *E) {
2300 VisitExpr(E);
2301}
2302
2303void StmtProfiler::VisitObjCDictionaryLiteral(const ObjCDictionaryLiteral *E) {
2304 VisitExpr(E);
2305}
2306
2307void StmtProfiler::VisitObjCEncodeExpr(const ObjCEncodeExpr *S) {
2308 VisitExpr(S);
2309 VisitType(S->getEncodedType());
2310}
2311
2312void StmtProfiler::VisitObjCSelectorExpr(const ObjCSelectorExpr *S) {
2313 VisitExpr(S);
2314 VisitName(S->getSelector());
2315}
2316
2317void StmtProfiler::VisitObjCProtocolExpr(const ObjCProtocolExpr *S) {
2318 VisitExpr(S);
2319 VisitDecl(S->getProtocol());
2320}
2321
2322void StmtProfiler::VisitObjCIvarRefExpr(const ObjCIvarRefExpr *S) {
2323 VisitExpr(S);
2324 VisitDecl(S->getDecl());
2325 ID.AddBoolean(S->isArrow());
2326 ID.AddBoolean(S->isFreeIvar());
2327}
2328
2329void StmtProfiler::VisitObjCPropertyRefExpr(const ObjCPropertyRefExpr *S) {
2330 VisitExpr(S);
2331 if (S->isImplicitProperty()) {
2332 VisitDecl(S->getImplicitPropertyGetter());
2333 VisitDecl(S->getImplicitPropertySetter());
2334 } else {
2335 VisitDecl(S->getExplicitProperty());
2336 }
2337 if (S->isSuperReceiver()) {
2338 ID.AddBoolean(S->isSuperReceiver());
2339 VisitType(S->getSuperReceiverType());
2340 }
2341}
2342
2343void StmtProfiler::VisitObjCSubscriptRefExpr(const ObjCSubscriptRefExpr *S) {
2344 VisitExpr(S);
2345 VisitDecl(S->getAtIndexMethodDecl());
2346 VisitDecl(S->setAtIndexMethodDecl());
2347}
2348
2349void StmtProfiler::VisitObjCMessageExpr(const ObjCMessageExpr *S) {
2350 VisitExpr(S);
2351 VisitName(S->getSelector());
2352 VisitDecl(S->getMethodDecl());
2353}
2354
2355void StmtProfiler::VisitObjCIsaExpr(const ObjCIsaExpr *S) {
2356 VisitExpr(S);
2357 ID.AddBoolean(S->isArrow());
2358}
2359
2360void StmtProfiler::VisitObjCBoolLiteralExpr(const ObjCBoolLiteralExpr *S) {
2361 VisitExpr(S);
2362 ID.AddBoolean(S->getValue());
2363}
2364
2365void StmtProfiler::VisitObjCIndirectCopyRestoreExpr(
2366 const ObjCIndirectCopyRestoreExpr *S) {
2367 VisitExpr(S);
2368 ID.AddBoolean(S->shouldCopy());
2369}
2370
2371void StmtProfiler::VisitObjCBridgedCastExpr(const ObjCBridgedCastExpr *S) {
2372 VisitExplicitCastExpr(S);
2373 ID.AddBoolean(S->getBridgeKind());
2374}
2375
2376void StmtProfiler::VisitObjCAvailabilityCheckExpr(
2377 const ObjCAvailabilityCheckExpr *S) {
2378 VisitExpr(S);
2379}
2380
2381void StmtProfiler::VisitTemplateArguments(const TemplateArgumentLoc *Args,
2382 unsigned NumArgs) {
2383 ID.AddInteger(NumArgs);
2384 for (unsigned I = 0; I != NumArgs; ++I)
2385 VisitTemplateArgument(Args[I].getArgument());
2386}
2387
2388void StmtProfiler::VisitTemplateArgument(const TemplateArgument &Arg) {
2389 // Mostly repetitive with TemplateArgument::Profile!
2390 ID.AddInteger(Arg.getKind());
2391 switch (Arg.getKind()) {
2393 break;
2394
2396 VisitType(Arg.getAsType());
2397 break;
2398
2401 VisitTemplateName(Arg.getAsTemplateOrTemplatePattern());
2402 break;
2403
2405 VisitType(Arg.getParamTypeForDecl());
2406 // FIXME: Do we need to recursively decompose template parameter objects?
2407 VisitDecl(Arg.getAsDecl());
2408 break;
2409
2411 VisitType(Arg.getNullPtrType());
2412 break;
2413
2415 VisitType(Arg.getIntegralType());
2416 Arg.getAsIntegral().Profile(ID);
2417 break;
2418
2420 Visit(Arg.getAsExpr());
2421 break;
2422
2424 for (const auto &P : Arg.pack_elements())
2425 VisitTemplateArgument(P);
2426 break;
2427 }
2428}
2429
2430void Stmt::Profile(llvm::FoldingSetNodeID &ID, const ASTContext &Context,
2431 bool Canonical, bool ProfileLambdaExpr) const {
2432 StmtProfilerWithPointers Profiler(ID, Context, Canonical, ProfileLambdaExpr);
2433 Profiler.Visit(this);
2434}
2435
2436void Stmt::ProcessODRHash(llvm::FoldingSetNodeID &ID,
2437 class ODRHash &Hash) const {
2438 StmtProfilerWithoutPointers Profiler(ID, Hash);
2439 Profiler.Visit(this);
2440}
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)
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:2535
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:4360
Represents the index of the current element of an array being initialized by an ArrayInitLoopExpr.
Definition: Expr.h:5575
Represents a loop initializing the elements of an array.
Definition: Expr.h:5522
ArraySubscriptExpr - [C99 6.5.2.1] Array Subscripting.
Definition: Expr.h:2691
An Embarcadero array type trait, as used in the implementation of __array_rank and __array_extent.
Definition: ExprCXX.h:2849
AsTypeExpr - Clang builtin function __builtin_astype [OpenCL 6.2.4.2] This AST node provides support ...
Definition: Expr.h:6245
AtomicExpr - Variadic atomic builtins: __atomic_exchange, __atomic_fetch_*, __atomic_load,...
Definition: Expr.h:6448
Represents an attribute applied to a statement.
Definition: Stmt.h:2074
BinaryConditionalOperator - The GNU extension to the conditional operator which allows the middle ope...
Definition: Expr.h:4263
A builtin binary operation expression such as "x + y" or "x <= y".
Definition: Expr.h:3862
A fixed int type of a specified bitwidth.
Definition: Type.h:6664
BlockExpr - Adaptor class for mixing a BlockDecl with expressions.
Definition: Expr.h:6184
BreakStmt - This represents a break.
Definition: Stmt.h:2974
Represents a C++2a __builtin_bit_cast(T, v) expression.
Definition: ExprCXX.h:5144
This class is used for builtin types like 'int'.
Definition: Type.h:2738
Kind getKind() const
Definition: Type.h:2780
CStyleCastExpr - An explicit cast in C (C99 6.5.4) or a C-style cast in C++ (C++ [expr....
Definition: Expr.h:3793
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:2494
Represents a C++ member access expression where the actual member referenced could not be resolved be...
Definition: ExprCXX.h:3658
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:4705
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:2227
Represents a C++11 noexcept expression (C++ [expr.unary.noexcept]).
Definition: ExprCXX.h:4101
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:4827
Represents a C++ pseudo-destructor (C++ [expr.pseudo]).
Definition: ExprCXX.h:2613
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:493
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:3532
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:2847
This captures a statement into a function.
Definition: Stmt.h:3751
CaseStmt - Represent a case statement.
Definition: Stmt.h:1795
CastExpr - Base class for type casts, including both implicit casts (ImplicitCastExpr) and explicit c...
Definition: Expr.h:3517
ChooseExpr - GNU builtin-in function __builtin_choose_expr.
Definition: Expr.h:4580
Represents a 'co_await' expression.
Definition: ExprCXX.h:5037
CompoundAssignOperator - For compound assignments (e.g.
Definition: Expr.h:4110
CompoundLiteralExpr - [C99 6.5.2.5].
Definition: Expr.h:3447
CompoundStmt - This represents a group of statements like { stmt stmt }.
Definition: Stmt.h:1602
Represents the specialization of a concept - evaluates to a prvalue of type bool.
Definition: ExprConcepts.h:42
ConditionalOperator - The ?: ternary operator.
Definition: Expr.h:4201
ConstStmtVisitor - This class implements a simple visitor for Stmt subclasses.
Definition: StmtVisitor.h:194
ConstantExpr - An expression that occurs in a constant context and optionally the result of evaluatin...
Definition: Expr.h:1059
ContinueStmt - This represents a continue.
Definition: Stmt.h:2944
ConvertVectorExpr - Clang builtin function __builtin_convertvector This AST node provides support for...
Definition: Expr.h:4521
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:5118
A reference to a declared variable, function, enum, etc.
Definition: Expr.h:1248
DeclStmt - Adaptor class for mixing declarations with statements and expressions.
Definition: Stmt.h:1493
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:967
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:5069
A qualified reference to a name whose declaration cannot yet be resolved.
Definition: ExprCXX.h:3298
Represents a single C99 designator.
Definition: Expr.h:5146
Represents a C99 designated initializer expression.
Definition: Expr.h:5103
DoStmt - This represents a 'do/while' stmt.
Definition: Stmt.h:2719
ExplicitCastExpr - An explicit cast written in the source code.
Definition: Expr.h:3752
Represents an expression – generally a full-expression – that introduces cleanups to be run at the en...
Definition: ExprCXX.h:3449
This represents one expression.
Definition: Expr.h:110
An expression trait intrinsic.
Definition: ExprCXX.h:2920
ExtVectorElementExpr - This represents access to specific elements of a vector, and may occur on the ...
Definition: Expr.h:6124
ForStmt - This represents a 'for (init;cond;inc)' stmt.
Definition: Stmt.h:2775
Represents a reference to a function parameter pack or init-capture pack that has been substituted bu...
Definition: ExprCXX.h:4513
VarDecl *const * iterator
Iterators over the parameters which the parameter pack expanded into.
Definition: ExprCXX.h:4547
This represents a GCC inline-assembly statement extension.
Definition: Stmt.h:3253
GNUNullExpr - Implements the GNU __null extension, which is a name for a null pointer constant that h...
Definition: Expr.h:4655
Represents a C11 generic selection.
Definition: Expr.h:5736
AssociationTy< true > ConstAssociation
Definition: Expr.h:5968
GotoStmt - This represents a direct goto.
Definition: Stmt.h:2856
One of these records is kept for each identifier that is lexed.
IfStmt - This represents an if/then/else.
Definition: Stmt.h:2132
ImaginaryLiteral - We support imaginary integer and floating point literals, like "1....
Definition: Expr.h:1751
ImplicitCastExpr - Allows us to explicitly represent implicit type conversions, which have no direct ...
Definition: Expr.h:3677
Represents an implicitly-generated value initialization of an object of a given type.
Definition: Expr.h:5611
IndirectGotoStmt - This represents an indirect goto.
Definition: Stmt.h:2895
Describes an C or C++ initializer list.
Definition: Expr.h:4858
LabelStmt - Represents a label, which has a substatement.
Definition: Stmt.h:2025
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:3476
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:4593
MatrixSubscriptExpr - Matrix subscript expression for the MatrixType extension.
Definition: Expr.h:2769
MemberExpr - [C99 6.5.2.3] Structure and Union Members.
Definition: Expr.h:3210
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:5431
NonTypeTemplateParmDecl - Declares a non-type template parameter, e.g., "Size" in.
NullStmt - This is the null statement ";": C99 6.8.3p3.
Definition: Stmt.h:1565
void AddDecl(const Decl *D)
Definition: ODRHash.cpp:789
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:1240
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:3668
This represents '#pragma omp cancellation point' directive.
Definition: StmtOpenMP.h:3610
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:5824
This represents 'dist_schedule' clause in the '#pragma omp ...' directive.
This represents '#pragma omp distribute' directive.
Definition: StmtOpenMP.h:4438
This represents '#pragma omp distribute parallel for' composite directive.
Definition: StmtOpenMP.h:4561
This represents '#pragma omp distribute parallel for simd' composite directive.
Definition: StmtOpenMP.h:4657
This represents '#pragma omp distribute simd' composite directive.
Definition: StmtOpenMP.h:4722
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:6299
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:5979
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:5771
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:5889
This represents '#pragma omp masked taskloop' directive.
Definition: StmtOpenMP.h:3943
This represents '#pragma omp masked taskloop simd' directive.
Definition: StmtOpenMP.h:4084
This represents '#pragma omp master' directive.
Definition: StmtOpenMP.h:2044
This represents '#pragma omp master taskloop' directive.
Definition: StmtOpenMP.h:3867
This represents '#pragma omp master taskloop simd' directive.
Definition: StmtOpenMP.h:4019
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:5940
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:6172
This represents '#pragma omp parallel masked' directive.
Definition: StmtOpenMP.h:2388
This represents '#pragma omp parallel masked taskloop' directive.
Definition: StmtOpenMP.h:4228
This represents '#pragma omp parallel masked taskloop simd' directive.
Definition: StmtOpenMP.h:4373
This represents '#pragma omp parallel master' directive.
Definition: StmtOpenMP.h:2325
This represents '#pragma omp parallel master taskloop' directive.
Definition: StmtOpenMP.h:4150
This represents '#pragma omp parallel master taskloop simd' directive.
Definition: StmtOpenMP.h:4306
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:5718
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:3219
This represents '#pragma omp target' directive.
Definition: StmtOpenMP.h:3165
This represents '#pragma omp target enter data' directive.
Definition: StmtOpenMP.h:3273
This represents '#pragma omp target exit data' directive.
Definition: StmtOpenMP.h:3328
This represents '#pragma omp target parallel' directive.
Definition: StmtOpenMP.h:3382
This represents '#pragma omp target parallel for' directive.
Definition: StmtOpenMP.h:3462
This represents '#pragma omp target parallel for simd' directive.
Definition: StmtOpenMP.h:4788
This represents '#pragma omp target parallel loop' directive.
Definition: StmtOpenMP.h:6237
This represents '#pragma omp target simd' directive.
Definition: StmtOpenMP.h:4855
This represents '#pragma omp target teams' directive.
Definition: StmtOpenMP.h:5213
This represents '#pragma omp target teams distribute' combined directive.
Definition: StmtOpenMP.h:5269
This represents '#pragma omp target teams distribute parallel for' combined directive.
Definition: StmtOpenMP.h:5336
This represents '#pragma omp target teams distribute parallel for simd' combined directive.
Definition: StmtOpenMP.h:5434
This represents '#pragma omp target teams distribute simd' combined directive.
Definition: StmtOpenMP.h:5504
This represents '#pragma omp target teams loop' directive.
Definition: StmtOpenMP.h:6106
This represents '#pragma omp target update' directive.
Definition: StmtOpenMP.h:4505
This represents '#pragma omp task' directive.
Definition: StmtOpenMP.h:2533
This represents '#pragma omp taskloop' directive.
Definition: StmtOpenMP.h:3728
This represents '#pragma omp taskloop simd' directive.
Definition: StmtOpenMP.h:3801
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:3557
This represents '#pragma omp teams distribute' directive.
Definition: StmtOpenMP.h:4920
This represents '#pragma omp teams distribute parallel for' composite directive.
Definition: StmtOpenMP.h:5120
This represents '#pragma omp teams distribute parallel for simd' composite directive.
Definition: StmtOpenMP.h:5054
This represents '#pragma omp teams distribute simd' combined directive.
Definition: StmtOpenMP.h:4986
This represents '#pragma omp teams loop' directive.
Definition: StmtOpenMP.h:6041
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:5562
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:5644
This represents 'untied' clause in the '#pragma omp ...' directive.
This represents 'update' clause in the '#pragma omp atomic' directive.
This represents the 'use' clause in '#pragma omp ...' directives.
This represents clause 'use_device_addr' in the '#pragma omp ...' directives.
This represents clause 'use_device_ptr' in the '#pragma omp ...' directives.
This represents clause 'uses_allocators' in the '#pragma omp target'-based directives.
This represents 'write' clause in the '#pragma omp atomic' directive.
This represents 'ompx_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:302
Represents Objective-C's @throw statement.
Definition: StmtObjC.h:357
Represents Objective-C's @try ... @catch ... @finally statement.
Definition: StmtObjC.h:167
Represents Objective-C's @autoreleasepool Statement.
Definition: StmtObjC.h:393
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:2492
Helper class for OffsetOfExpr.
Definition: Expr.h:2386
FieldDecl * getField() const
For a field offsetof node, returns the field.
Definition: Expr.h:2450
IdentifierInfo * getFieldName() const
For a field or identifier offsetof node, returns the name of the field.
Definition: Expr.cpp:1662
@ Array
An index into an array.
Definition: Expr.h:2391
@ Identifier
A field in a dependent type, known only by its name.
Definition: Expr.h:2395
@ Field
A field.
Definition: Expr.h:2393
@ Base
An implicit indirection through a C++ base class, when the field found is in a base class.
Definition: Expr.h:2398
Kind getKind() const
Determine what kind of offsetof node this is.
Definition: Expr.h:2440
OpaqueValueExpr - An expression referring to an opaque object of a fixed type and value class.
Definition: Expr.h:1156
A reference to an overloaded function set, either an UnresolvedLookupExpr or an UnresolvedMemberExpr.
Definition: ExprCXX.h:2979
Represents a C++11 pack expansion that produces a sequence of expressions.
Definition: ExprCXX.h:4155
ParenExpr - This represents a parethesized expression, e.g.
Definition: Expr.h:2157
Represents a parameter to a function.
Definition: Decl.h:1747
[C99 6.4.2.2] - A predefined identifier such as func.
Definition: Expr.h:2014
PseudoObjectExpr - An expression which accesses a pseudo-object l-value.
Definition: Expr.h:6316
const Expr *const * const_semantics_iterator
Definition: Expr.h:6381
A (possibly-)qualified type.
Definition: Type.h:736
bool isNull() const
Return true if this QualType doesn't point to a type yet.
Definition: Type.h:803
QualType getCanonicalType() const
Definition: Type.h:6833
void * getAsOpaquePtr() const
Definition: Type.h:783
Frontend produces RecoveryExprs on semantic errors that prevent creating other well-formed expression...
Definition: Expr.h:6646
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:3013
Represents a __leave statement.
Definition: Stmt.h:3712
ShuffleVectorExpr - clang-specific builtin-in function __builtin_shufflevector.
Definition: Expr.h:4453
Represents an expression that computes the length of a parameter pack.
Definition: ExprCXX.h:4233
Represents a function call to one of __builtin_LINE(), __builtin_COLUMN(), __builtin_FUNCTION(),...
Definition: Expr.h:4749
StmtExpr - This is the GNU Statement Expression extension: ({int X=4; X;}).
Definition: Expr.h:4405
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:1812
Represents a reference to a non-type template parameter that has been substituted with a template arg...
Definition: ExprCXX.h:4349
Represents a reference to a non-type template parameter pack that has been substituted with a non-tem...
Definition: ExprCXX.h:4434
SwitchStmt - This represents a 'switch' stmt.
Definition: Stmt.h:2382
Location wrapper for a TemplateArgument.
Definition: TemplateBase.h:495
Represents a template argument.
Definition: TemplateBase.h:60
QualType getParamTypeForDecl() const
Definition: TemplateBase.h:310
Expr * getAsExpr() const
Retrieve the template argument as an expression.
Definition: TemplateBase.h:379
QualType getAsType() const
Retrieve the type for a type template argument.
Definition: TemplateBase.h:298
llvm::APSInt getAsIntegral() const
Retrieve the template argument as an integral value.
Definition: TemplateBase.h:342
QualType getNullPtrType() const
Retrieve the type for null non-type template argument.
Definition: TemplateBase.h:316
QualType getIntegralType() const
Retrieve the type of the integral value.
Definition: TemplateBase.h:356
ValueDecl * getAsDecl() const
Retrieve the declaration for a declaration non-type template argument.
Definition: TemplateBase.h:305
ArrayRef< TemplateArgument > pack_elements() const
Iterator range referencing all of the elements of a template argument pack.
Definition: TemplateBase.h:403
@ Declaration
The template argument is a declaration that was provided for a pointer, reference,...
Definition: TemplateBase.h:73
@ Template
The template argument is a template name that was provided for a template template parameter.
Definition: TemplateBase.h:85
@ Pack
The template argument is actually a parameter pack.
Definition: TemplateBase.h:99
@ TemplateExpansion
The template argument is a pack expansion of a template name that was provided for a template templat...
Definition: TemplateBase.h:89
@ NullPtr
The template argument is a null pointer or null pointer to member that was provided for a non-type te...
Definition: TemplateBase.h:77
@ Type
The template argument is a type.
Definition: TemplateBase.h:69
@ Null
Represents an empty template argument, e.g., one that has not been deduced.
Definition: TemplateBase.h:66
@ Integral
The template argument is an integral value stored in an llvm::APSInt that was provided for an integra...
Definition: TemplateBase.h:81
@ Expression
The template argument is an expression, and we've not resolved it to one of the other forms yet,...
Definition: TemplateBase.h:95
ArgKind getKind() const
Return the kind of stored template argument.
Definition: TemplateBase.h:274
TemplateName getAsTemplateOrTemplatePattern() const
Retrieve the template argument as a template name; if the argument is a pack expansion,...
Definition: TemplateBase.h:329
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:2764
const T * castAs() const
Member-template castAs<specific type>.
Definition: Type.h:7625
TypeClass getTypeClass() const
Definition: Type.h:2070
const T * getAs() const
Member-template getAs<specific type>'.
Definition: Type.h:7558
TypoExpr - Internal placeholder for expressions where typo correction still needs to be performed and...
Definition: Expr.h:6591
UnaryExprOrTypeTraitExpr - expression with either a type or (unevaluated) expression operand.
Definition: Expr.h:2595
UnaryOperator - This represents the unary-expression's (except sizeof and alignof),...
Definition: Expr.h:2210
A reference to a name which we were able to look up during parsing but could not resolve to a specifi...
Definition: ExprCXX.h:3176
Represents a C++ member access expression for which lookup produced a set of overloaded functions.
Definition: ExprCXX.h:3918
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:4689
WhileStmt - This represents a 'while' stmt.
Definition: Stmt.h:2578
A static requirement that can be used in a requires-expression to check properties of types and expre...
Definition: ExprConcepts.h:168
@ 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.