clang  14.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 //===----------------------------------------------------------------------===//
13 #include "clang/AST/ASTContext.h"
14 #include "clang/AST/DeclCXX.h"
15 #include "clang/AST/DeclObjC.h"
16 #include "clang/AST/DeclTemplate.h"
17 #include "clang/AST/Expr.h"
18 #include "clang/AST/ExprCXX.h"
19 #include "clang/AST/ExprObjC.h"
20 #include "clang/AST/ExprOpenMP.h"
21 #include "clang/AST/ODRHash.h"
22 #include "clang/AST/OpenMPClause.h"
23 #include "clang/AST/StmtVisitor.h"
24 #include "llvm/ADT/FoldingSet.h"
25 using namespace clang;
26 
27 namespace {
28  class StmtProfiler : public ConstStmtVisitor<StmtProfiler> {
29  protected:
30  llvm::FoldingSetNodeID &ID;
31  bool Canonical;
32 
33  public:
34  StmtProfiler(llvm::FoldingSetNodeID &ID, bool Canonical)
35  : ID(ID), Canonical(Canonical) {}
36 
37  virtual ~StmtProfiler() {}
38 
39  void VisitStmt(const Stmt *S);
40 
41  virtual void HandleStmtClass(Stmt::StmtClass SC) = 0;
42 
43 #define STMT(Node, Base) void Visit##Node(const Node *S);
44 #include "clang/AST/StmtNodes.inc"
45 
46  /// Visit a declaration that is referenced within an expression
47  /// or statement.
48  virtual void VisitDecl(const Decl *D) = 0;
49 
50  /// Visit a type that is referenced within an expression or
51  /// statement.
52  virtual void VisitType(QualType T) = 0;
53 
54  /// Visit a name that occurs within an expression or statement.
55  virtual void VisitName(DeclarationName Name, bool TreatAsDecl = false) = 0;
56 
57  /// Visit identifiers that are not in Decl's or Type's.
58  virtual void VisitIdentifierInfo(IdentifierInfo *II) = 0;
59 
60  /// Visit a nested-name-specifier that occurs within an expression
61  /// or statement.
62  virtual void VisitNestedNameSpecifier(NestedNameSpecifier *NNS) = 0;
63 
64  /// Visit a template name that occurs within an expression or
65  /// statement.
66  virtual void VisitTemplateName(TemplateName Name) = 0;
67 
68  /// Visit template arguments that occur within an expression or
69  /// statement.
70  void VisitTemplateArguments(const TemplateArgumentLoc *Args,
71  unsigned NumArgs);
72 
73  /// Visit a single template argument.
74  void VisitTemplateArgument(const TemplateArgument &Arg);
75  };
76 
77  class StmtProfilerWithPointers : public StmtProfiler {
78  const ASTContext &Context;
79 
80  public:
81  StmtProfilerWithPointers(llvm::FoldingSetNodeID &ID,
82  const ASTContext &Context, bool Canonical)
83  : StmtProfiler(ID, Canonical), Context(Context) {}
84  private:
85  void HandleStmtClass(Stmt::StmtClass SC) override {
86  ID.AddInteger(SC);
87  }
88 
89  void VisitDecl(const Decl *D) override {
90  ID.AddInteger(D ? D->getKind() : 0);
91 
92  if (Canonical && D) {
93  if (const NonTypeTemplateParmDecl *NTTP =
94  dyn_cast<NonTypeTemplateParmDecl>(D)) {
95  ID.AddInteger(NTTP->getDepth());
96  ID.AddInteger(NTTP->getIndex());
97  ID.AddBoolean(NTTP->isParameterPack());
98  VisitType(NTTP->getType());
99  return;
100  }
101 
102  if (const ParmVarDecl *Parm = dyn_cast<ParmVarDecl>(D)) {
103  // The Itanium C++ ABI uses the type, scope depth, and scope
104  // index of a parameter when mangling expressions that involve
105  // function parameters, so we will use the parameter's type for
106  // establishing function parameter identity. That way, our
107  // definition of "equivalent" (per C++ [temp.over.link]) is at
108  // least as strong as the definition of "equivalent" used for
109  // name mangling.
110  VisitType(Parm->getType());
111  ID.AddInteger(Parm->getFunctionScopeDepth());
112  ID.AddInteger(Parm->getFunctionScopeIndex());
113  return;
114  }
115 
116  if (const TemplateTypeParmDecl *TTP =
117  dyn_cast<TemplateTypeParmDecl>(D)) {
118  ID.AddInteger(TTP->getDepth());
119  ID.AddInteger(TTP->getIndex());
120  ID.AddBoolean(TTP->isParameterPack());
121  return;
122  }
123 
124  if (const TemplateTemplateParmDecl *TTP =
125  dyn_cast<TemplateTemplateParmDecl>(D)) {
126  ID.AddInteger(TTP->getDepth());
127  ID.AddInteger(TTP->getIndex());
128  ID.AddBoolean(TTP->isParameterPack());
129  return;
130  }
131  }
132 
133  ID.AddPointer(D ? D->getCanonicalDecl() : nullptr);
134  }
135 
136  void VisitType(QualType T) override {
137  if (Canonical && !T.isNull())
138  T = Context.getCanonicalType(T);
139 
140  ID.AddPointer(T.getAsOpaquePtr());
141  }
142 
143  void VisitName(DeclarationName Name, bool /*TreatAsDecl*/) override {
144  ID.AddPointer(Name.getAsOpaquePtr());
145  }
146 
147  void VisitIdentifierInfo(IdentifierInfo *II) override {
148  ID.AddPointer(II);
149  }
150 
151  void VisitNestedNameSpecifier(NestedNameSpecifier *NNS) override {
152  if (Canonical)
153  NNS = Context.getCanonicalNestedNameSpecifier(NNS);
154  ID.AddPointer(NNS);
155  }
156 
157  void VisitTemplateName(TemplateName Name) override {
158  if (Canonical)
159  Name = Context.getCanonicalTemplateName(Name);
160 
161  Name.Profile(ID);
162  }
163  };
164 
165  class StmtProfilerWithoutPointers : public StmtProfiler {
166  ODRHash &Hash;
167  public:
168  StmtProfilerWithoutPointers(llvm::FoldingSetNodeID &ID, ODRHash &Hash)
169  : StmtProfiler(ID, false), Hash(Hash) {}
170 
171  private:
172  void HandleStmtClass(Stmt::StmtClass SC) override {
173  if (SC == Stmt::UnresolvedLookupExprClass) {
174  // Pretend that the name looked up is a Decl due to how templates
175  // handle some Decl lookups.
176  ID.AddInteger(Stmt::DeclRefExprClass);
177  } else {
178  ID.AddInteger(SC);
179  }
180  }
181 
182  void VisitType(QualType T) override {
183  Hash.AddQualType(T);
184  }
185 
186  void VisitName(DeclarationName Name, bool TreatAsDecl) override {
187  if (TreatAsDecl) {
188  // A Decl can be null, so each Decl is preceded by a boolean to
189  // store its nullness. Add a boolean here to match.
190  ID.AddBoolean(true);
191  }
192  Hash.AddDeclarationName(Name, TreatAsDecl);
193  }
194  void VisitIdentifierInfo(IdentifierInfo *II) override {
195  ID.AddBoolean(II);
196  if (II) {
197  Hash.AddIdentifierInfo(II);
198  }
199  }
200  void VisitDecl(const Decl *D) override {
201  ID.AddBoolean(D);
202  if (D) {
203  Hash.AddDecl(D);
204  }
205  }
206  void VisitTemplateName(TemplateName Name) override {
207  Hash.AddTemplateName(Name);
208  }
209  void VisitNestedNameSpecifier(NestedNameSpecifier *NNS) override {
210  ID.AddBoolean(NNS);
211  if (NNS) {
212  Hash.AddNestedNameSpecifier(NNS);
213  }
214  }
215  };
216 }
217 
218 void StmtProfiler::VisitStmt(const Stmt *S) {
219  assert(S && "Requires non-null Stmt pointer");
220 
221  HandleStmtClass(S->getStmtClass());
222 
223  for (const Stmt *SubStmt : S->children()) {
224  if (SubStmt)
225  Visit(SubStmt);
226  else
227  ID.AddInteger(0);
228  }
229 }
230 
231 void StmtProfiler::VisitDeclStmt(const DeclStmt *S) {
232  VisitStmt(S);
233  for (const auto *D : S->decls())
234  VisitDecl(D);
235 }
236 
237 void StmtProfiler::VisitNullStmt(const NullStmt *S) {
238  VisitStmt(S);
239 }
240 
241 void StmtProfiler::VisitCompoundStmt(const CompoundStmt *S) {
242  VisitStmt(S);
243 }
244 
245 void StmtProfiler::VisitCaseStmt(const CaseStmt *S) {
246  VisitStmt(S);
247 }
248 
249 void StmtProfiler::VisitDefaultStmt(const DefaultStmt *S) {
250  VisitStmt(S);
251 }
252 
253 void StmtProfiler::VisitLabelStmt(const LabelStmt *S) {
254  VisitStmt(S);
255  VisitDecl(S->getDecl());
256 }
257 
258 void StmtProfiler::VisitAttributedStmt(const AttributedStmt *S) {
259  VisitStmt(S);
260  // TODO: maybe visit attributes?
261 }
262 
263 void StmtProfiler::VisitIfStmt(const IfStmt *S) {
264  VisitStmt(S);
265  VisitDecl(S->getConditionVariable());
266 }
267 
268 void StmtProfiler::VisitSwitchStmt(const SwitchStmt *S) {
269  VisitStmt(S);
270  VisitDecl(S->getConditionVariable());
271 }
272 
273 void StmtProfiler::VisitWhileStmt(const WhileStmt *S) {
274  VisitStmt(S);
275  VisitDecl(S->getConditionVariable());
276 }
277 
278 void StmtProfiler::VisitDoStmt(const DoStmt *S) {
279  VisitStmt(S);
280 }
281 
282 void StmtProfiler::VisitForStmt(const ForStmt *S) {
283  VisitStmt(S);
284 }
285 
286 void StmtProfiler::VisitGotoStmt(const GotoStmt *S) {
287  VisitStmt(S);
288  VisitDecl(S->getLabel());
289 }
290 
291 void StmtProfiler::VisitIndirectGotoStmt(const IndirectGotoStmt *S) {
292  VisitStmt(S);
293 }
294 
295 void StmtProfiler::VisitContinueStmt(const ContinueStmt *S) {
296  VisitStmt(S);
297 }
298 
299 void StmtProfiler::VisitBreakStmt(const BreakStmt *S) {
300  VisitStmt(S);
301 }
302 
303 void StmtProfiler::VisitReturnStmt(const ReturnStmt *S) {
304  VisitStmt(S);
305 }
306 
307 void StmtProfiler::VisitGCCAsmStmt(const GCCAsmStmt *S) {
308  VisitStmt(S);
309  ID.AddBoolean(S->isVolatile());
310  ID.AddBoolean(S->isSimple());
311  VisitStringLiteral(S->getAsmString());
312  ID.AddInteger(S->getNumOutputs());
313  for (unsigned I = 0, N = S->getNumOutputs(); I != N; ++I) {
314  ID.AddString(S->getOutputName(I));
315  VisitStringLiteral(S->getOutputConstraintLiteral(I));
316  }
317  ID.AddInteger(S->getNumInputs());
318  for (unsigned I = 0, N = S->getNumInputs(); I != N; ++I) {
319  ID.AddString(S->getInputName(I));
320  VisitStringLiteral(S->getInputConstraintLiteral(I));
321  }
322  ID.AddInteger(S->getNumClobbers());
323  for (unsigned I = 0, N = S->getNumClobbers(); I != N; ++I)
324  VisitStringLiteral(S->getClobberStringLiteral(I));
325  ID.AddInteger(S->getNumLabels());
326  for (auto *L : S->labels())
327  VisitDecl(L->getLabel());
328 }
329 
330 void StmtProfiler::VisitMSAsmStmt(const MSAsmStmt *S) {
331  // FIXME: Implement MS style inline asm statement profiler.
332  VisitStmt(S);
333 }
334 
335 void StmtProfiler::VisitCXXCatchStmt(const CXXCatchStmt *S) {
336  VisitStmt(S);
337  VisitType(S->getCaughtType());
338 }
339 
340 void StmtProfiler::VisitCXXTryStmt(const CXXTryStmt *S) {
341  VisitStmt(S);
342 }
343 
344 void StmtProfiler::VisitCXXForRangeStmt(const CXXForRangeStmt *S) {
345  VisitStmt(S);
346 }
347 
348 void StmtProfiler::VisitMSDependentExistsStmt(const MSDependentExistsStmt *S) {
349  VisitStmt(S);
350  ID.AddBoolean(S->isIfExists());
351  VisitNestedNameSpecifier(S->getQualifierLoc().getNestedNameSpecifier());
352  VisitName(S->getNameInfo().getName());
353 }
354 
355 void StmtProfiler::VisitSEHTryStmt(const SEHTryStmt *S) {
356  VisitStmt(S);
357 }
358 
359 void StmtProfiler::VisitSEHFinallyStmt(const SEHFinallyStmt *S) {
360  VisitStmt(S);
361 }
362 
363 void StmtProfiler::VisitSEHExceptStmt(const SEHExceptStmt *S) {
364  VisitStmt(S);
365 }
366 
367 void StmtProfiler::VisitSEHLeaveStmt(const SEHLeaveStmt *S) {
368  VisitStmt(S);
369 }
370 
371 void StmtProfiler::VisitCapturedStmt(const CapturedStmt *S) {
372  VisitStmt(S);
373 }
374 
375 void StmtProfiler::VisitObjCForCollectionStmt(const ObjCForCollectionStmt *S) {
376  VisitStmt(S);
377 }
378 
379 void StmtProfiler::VisitObjCAtCatchStmt(const ObjCAtCatchStmt *S) {
380  VisitStmt(S);
381  ID.AddBoolean(S->hasEllipsis());
382  if (S->getCatchParamDecl())
383  VisitType(S->getCatchParamDecl()->getType());
384 }
385 
386 void StmtProfiler::VisitObjCAtFinallyStmt(const ObjCAtFinallyStmt *S) {
387  VisitStmt(S);
388 }
389 
390 void StmtProfiler::VisitObjCAtTryStmt(const ObjCAtTryStmt *S) {
391  VisitStmt(S);
392 }
393 
394 void
395 StmtProfiler::VisitObjCAtSynchronizedStmt(const ObjCAtSynchronizedStmt *S) {
396  VisitStmt(S);
397 }
398 
399 void StmtProfiler::VisitObjCAtThrowStmt(const ObjCAtThrowStmt *S) {
400  VisitStmt(S);
401 }
402 
403 void
404 StmtProfiler::VisitObjCAutoreleasePoolStmt(const ObjCAutoreleasePoolStmt *S) {
405  VisitStmt(S);
406 }
407 
408 namespace {
409 class OMPClauseProfiler : public ConstOMPClauseVisitor<OMPClauseProfiler> {
410  StmtProfiler *Profiler;
411  /// Process clauses with list of variables.
412  template <typename T>
413  void VisitOMPClauseList(T *Node);
414 
415 public:
416  OMPClauseProfiler(StmtProfiler *P) : Profiler(P) { }
417 #define GEN_CLANG_CLAUSE_CLASS
418 #define CLAUSE_CLASS(Enum, Str, Class) void Visit##Class(const Class *C);
419 #include "llvm/Frontend/OpenMP/OMP.inc"
420  void VistOMPClauseWithPreInit(const OMPClauseWithPreInit *C);
421  void VistOMPClauseWithPostUpdate(const OMPClauseWithPostUpdate *C);
422 };
423 
424 void OMPClauseProfiler::VistOMPClauseWithPreInit(
425  const OMPClauseWithPreInit *C) {
426  if (auto *S = C->getPreInitStmt())
427  Profiler->VisitStmt(S);
428 }
429 
430 void OMPClauseProfiler::VistOMPClauseWithPostUpdate(
431  const OMPClauseWithPostUpdate *C) {
432  VistOMPClauseWithPreInit(C);
433  if (auto *E = C->getPostUpdateExpr())
434  Profiler->VisitStmt(E);
435 }
436 
437 void OMPClauseProfiler::VisitOMPIfClause(const OMPIfClause *C) {
438  VistOMPClauseWithPreInit(C);
439  if (C->getCondition())
440  Profiler->VisitStmt(C->getCondition());
441 }
442 
443 void OMPClauseProfiler::VisitOMPFinalClause(const OMPFinalClause *C) {
444  VistOMPClauseWithPreInit(C);
445  if (C->getCondition())
446  Profiler->VisitStmt(C->getCondition());
447 }
448 
449 void OMPClauseProfiler::VisitOMPNumThreadsClause(const OMPNumThreadsClause *C) {
450  VistOMPClauseWithPreInit(C);
451  if (C->getNumThreads())
452  Profiler->VisitStmt(C->getNumThreads());
453 }
454 
455 void OMPClauseProfiler::VisitOMPSafelenClause(const OMPSafelenClause *C) {
456  if (C->getSafelen())
457  Profiler->VisitStmt(C->getSafelen());
458 }
459 
460 void OMPClauseProfiler::VisitOMPSimdlenClause(const OMPSimdlenClause *C) {
461  if (C->getSimdlen())
462  Profiler->VisitStmt(C->getSimdlen());
463 }
464 
465 void OMPClauseProfiler::VisitOMPSizesClause(const OMPSizesClause *C) {
466  for (auto E : C->getSizesRefs())
467  if (E)
468  Profiler->VisitExpr(E);
469 }
470 
471 void OMPClauseProfiler::VisitOMPFullClause(const OMPFullClause *C) {}
472 
473 void OMPClauseProfiler::VisitOMPPartialClause(const OMPPartialClause *C) {
474  if (const Expr *Factor = C->getFactor())
475  Profiler->VisitExpr(Factor);
476 }
477 
478 void OMPClauseProfiler::VisitOMPAllocatorClause(const OMPAllocatorClause *C) {
479  if (C->getAllocator())
480  Profiler->VisitStmt(C->getAllocator());
481 }
482 
483 void OMPClauseProfiler::VisitOMPCollapseClause(const OMPCollapseClause *C) {
484  if (C->getNumForLoops())
485  Profiler->VisitStmt(C->getNumForLoops());
486 }
487 
488 void OMPClauseProfiler::VisitOMPDetachClause(const OMPDetachClause *C) {
489  if (Expr *Evt = C->getEventHandler())
490  Profiler->VisitStmt(Evt);
491 }
492 
493 void OMPClauseProfiler::VisitOMPNovariantsClause(const OMPNovariantsClause *C) {
494  VistOMPClauseWithPreInit(C);
495  if (C->getCondition())
496  Profiler->VisitStmt(C->getCondition());
497 }
498 
499 void OMPClauseProfiler::VisitOMPNocontextClause(const OMPNocontextClause *C) {
500  VistOMPClauseWithPreInit(C);
501  if (C->getCondition())
502  Profiler->VisitStmt(C->getCondition());
503 }
504 
505 void OMPClauseProfiler::VisitOMPDefaultClause(const OMPDefaultClause *C) { }
506 
507 void OMPClauseProfiler::VisitOMPProcBindClause(const OMPProcBindClause *C) { }
508 
509 void OMPClauseProfiler::VisitOMPUnifiedAddressClause(
510  const OMPUnifiedAddressClause *C) {}
511 
512 void OMPClauseProfiler::VisitOMPUnifiedSharedMemoryClause(
513  const OMPUnifiedSharedMemoryClause *C) {}
514 
515 void OMPClauseProfiler::VisitOMPReverseOffloadClause(
516  const OMPReverseOffloadClause *C) {}
517 
518 void OMPClauseProfiler::VisitOMPDynamicAllocatorsClause(
519  const OMPDynamicAllocatorsClause *C) {}
520 
521 void OMPClauseProfiler::VisitOMPAtomicDefaultMemOrderClause(
522  const OMPAtomicDefaultMemOrderClause *C) {}
523 
524 void OMPClauseProfiler::VisitOMPScheduleClause(const OMPScheduleClause *C) {
525  VistOMPClauseWithPreInit(C);
526  if (auto *S = C->getChunkSize())
527  Profiler->VisitStmt(S);
528 }
529 
530 void OMPClauseProfiler::VisitOMPOrderedClause(const OMPOrderedClause *C) {
531  if (auto *Num = C->getNumForLoops())
532  Profiler->VisitStmt(Num);
533 }
534 
535 void OMPClauseProfiler::VisitOMPNowaitClause(const OMPNowaitClause *) {}
536 
537 void OMPClauseProfiler::VisitOMPUntiedClause(const OMPUntiedClause *) {}
538 
539 void OMPClauseProfiler::VisitOMPMergeableClause(const OMPMergeableClause *) {}
540 
541 void OMPClauseProfiler::VisitOMPReadClause(const OMPReadClause *) {}
542 
543 void OMPClauseProfiler::VisitOMPWriteClause(const OMPWriteClause *) {}
544 
545 void OMPClauseProfiler::VisitOMPUpdateClause(const OMPUpdateClause *) {}
546 
547 void OMPClauseProfiler::VisitOMPCaptureClause(const OMPCaptureClause *) {}
548 
549 void OMPClauseProfiler::VisitOMPSeqCstClause(const OMPSeqCstClause *) {}
550 
551 void OMPClauseProfiler::VisitOMPAcqRelClause(const OMPAcqRelClause *) {}
552 
553 void OMPClauseProfiler::VisitOMPAcquireClause(const OMPAcquireClause *) {}
554 
555 void OMPClauseProfiler::VisitOMPReleaseClause(const OMPReleaseClause *) {}
556 
557 void OMPClauseProfiler::VisitOMPRelaxedClause(const OMPRelaxedClause *) {}
558 
559 void OMPClauseProfiler::VisitOMPThreadsClause(const OMPThreadsClause *) {}
560 
561 void OMPClauseProfiler::VisitOMPSIMDClause(const OMPSIMDClause *) {}
562 
563 void OMPClauseProfiler::VisitOMPNogroupClause(const OMPNogroupClause *) {}
564 
565 void OMPClauseProfiler::VisitOMPInitClause(const OMPInitClause *C) {
566  VisitOMPClauseList(C);
567 }
568 
569 void OMPClauseProfiler::VisitOMPUseClause(const OMPUseClause *C) {
570  if (C->getInteropVar())
571  Profiler->VisitStmt(C->getInteropVar());
572 }
573 
574 void OMPClauseProfiler::VisitOMPDestroyClause(const OMPDestroyClause *C) {
575  if (C->getInteropVar())
576  Profiler->VisitStmt(C->getInteropVar());
577 }
578 
579 void OMPClauseProfiler::VisitOMPFilterClause(const OMPFilterClause *C) {
580  VistOMPClauseWithPreInit(C);
581  if (C->getThreadID())
582  Profiler->VisitStmt(C->getThreadID());
583 }
584 
585 template<typename T>
586 void OMPClauseProfiler::VisitOMPClauseList(T *Node) {
587  for (auto *E : Node->varlists()) {
588  if (E)
589  Profiler->VisitStmt(E);
590  }
591 }
592 
593 void OMPClauseProfiler::VisitOMPPrivateClause(const OMPPrivateClause *C) {
594  VisitOMPClauseList(C);
595  for (auto *E : C->private_copies()) {
596  if (E)
597  Profiler->VisitStmt(E);
598  }
599 }
600 void
601 OMPClauseProfiler::VisitOMPFirstprivateClause(const OMPFirstprivateClause *C) {
602  VisitOMPClauseList(C);
603  VistOMPClauseWithPreInit(C);
604  for (auto *E : C->private_copies()) {
605  if (E)
606  Profiler->VisitStmt(E);
607  }
608  for (auto *E : C->inits()) {
609  if (E)
610  Profiler->VisitStmt(E);
611  }
612 }
613 void
614 OMPClauseProfiler::VisitOMPLastprivateClause(const OMPLastprivateClause *C) {
615  VisitOMPClauseList(C);
616  VistOMPClauseWithPostUpdate(C);
617  for (auto *E : C->source_exprs()) {
618  if (E)
619  Profiler->VisitStmt(E);
620  }
621  for (auto *E : C->destination_exprs()) {
622  if (E)
623  Profiler->VisitStmt(E);
624  }
625  for (auto *E : C->assignment_ops()) {
626  if (E)
627  Profiler->VisitStmt(E);
628  }
629 }
630 void OMPClauseProfiler::VisitOMPSharedClause(const OMPSharedClause *C) {
631  VisitOMPClauseList(C);
632 }
633 void OMPClauseProfiler::VisitOMPReductionClause(
634  const OMPReductionClause *C) {
635  Profiler->VisitNestedNameSpecifier(
636  C->getQualifierLoc().getNestedNameSpecifier());
637  Profiler->VisitName(C->getNameInfo().getName());
638  VisitOMPClauseList(C);
639  VistOMPClauseWithPostUpdate(C);
640  for (auto *E : C->privates()) {
641  if (E)
642  Profiler->VisitStmt(E);
643  }
644  for (auto *E : C->lhs_exprs()) {
645  if (E)
646  Profiler->VisitStmt(E);
647  }
648  for (auto *E : C->rhs_exprs()) {
649  if (E)
650  Profiler->VisitStmt(E);
651  }
652  for (auto *E : C->reduction_ops()) {
653  if (E)
654  Profiler->VisitStmt(E);
655  }
656  if (C->getModifier() == clang::OMPC_REDUCTION_inscan) {
657  for (auto *E : C->copy_ops()) {
658  if (E)
659  Profiler->VisitStmt(E);
660  }
661  for (auto *E : C->copy_array_temps()) {
662  if (E)
663  Profiler->VisitStmt(E);
664  }
665  for (auto *E : C->copy_array_elems()) {
666  if (E)
667  Profiler->VisitStmt(E);
668  }
669  }
670 }
671 void OMPClauseProfiler::VisitOMPTaskReductionClause(
672  const OMPTaskReductionClause *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 }
695 void OMPClauseProfiler::VisitOMPInReductionClause(
696  const OMPInReductionClause *C) {
697  Profiler->VisitNestedNameSpecifier(
698  C->getQualifierLoc().getNestedNameSpecifier());
699  Profiler->VisitName(C->getNameInfo().getName());
700  VisitOMPClauseList(C);
701  VistOMPClauseWithPostUpdate(C);
702  for (auto *E : C->privates()) {
703  if (E)
704  Profiler->VisitStmt(E);
705  }
706  for (auto *E : C->lhs_exprs()) {
707  if (E)
708  Profiler->VisitStmt(E);
709  }
710  for (auto *E : C->rhs_exprs()) {
711  if (E)
712  Profiler->VisitStmt(E);
713  }
714  for (auto *E : C->reduction_ops()) {
715  if (E)
716  Profiler->VisitStmt(E);
717  }
718  for (auto *E : C->taskgroup_descriptors()) {
719  if (E)
720  Profiler->VisitStmt(E);
721  }
722 }
723 void OMPClauseProfiler::VisitOMPLinearClause(const OMPLinearClause *C) {
724  VisitOMPClauseList(C);
725  VistOMPClauseWithPostUpdate(C);
726  for (auto *E : C->privates()) {
727  if (E)
728  Profiler->VisitStmt(E);
729  }
730  for (auto *E : C->inits()) {
731  if (E)
732  Profiler->VisitStmt(E);
733  }
734  for (auto *E : C->updates()) {
735  if (E)
736  Profiler->VisitStmt(E);
737  }
738  for (auto *E : C->finals()) {
739  if (E)
740  Profiler->VisitStmt(E);
741  }
742  if (C->getStep())
743  Profiler->VisitStmt(C->getStep());
744  if (C->getCalcStep())
745  Profiler->VisitStmt(C->getCalcStep());
746 }
747 void OMPClauseProfiler::VisitOMPAlignedClause(const OMPAlignedClause *C) {
748  VisitOMPClauseList(C);
749  if (C->getAlignment())
750  Profiler->VisitStmt(C->getAlignment());
751 }
752 void OMPClauseProfiler::VisitOMPCopyinClause(const OMPCopyinClause *C) {
753  VisitOMPClauseList(C);
754  for (auto *E : C->source_exprs()) {
755  if (E)
756  Profiler->VisitStmt(E);
757  }
758  for (auto *E : C->destination_exprs()) {
759  if (E)
760  Profiler->VisitStmt(E);
761  }
762  for (auto *E : C->assignment_ops()) {
763  if (E)
764  Profiler->VisitStmt(E);
765  }
766 }
767 void
768 OMPClauseProfiler::VisitOMPCopyprivateClause(const OMPCopyprivateClause *C) {
769  VisitOMPClauseList(C);
770  for (auto *E : C->source_exprs()) {
771  if (E)
772  Profiler->VisitStmt(E);
773  }
774  for (auto *E : C->destination_exprs()) {
775  if (E)
776  Profiler->VisitStmt(E);
777  }
778  for (auto *E : C->assignment_ops()) {
779  if (E)
780  Profiler->VisitStmt(E);
781  }
782 }
783 void OMPClauseProfiler::VisitOMPFlushClause(const OMPFlushClause *C) {
784  VisitOMPClauseList(C);
785 }
786 void OMPClauseProfiler::VisitOMPDepobjClause(const OMPDepobjClause *C) {
787  if (const Expr *Depobj = C->getDepobj())
788  Profiler->VisitStmt(Depobj);
789 }
790 void OMPClauseProfiler::VisitOMPDependClause(const OMPDependClause *C) {
791  VisitOMPClauseList(C);
792 }
793 void OMPClauseProfiler::VisitOMPDeviceClause(const OMPDeviceClause *C) {
794  if (C->getDevice())
795  Profiler->VisitStmt(C->getDevice());
796 }
797 void OMPClauseProfiler::VisitOMPMapClause(const OMPMapClause *C) {
798  VisitOMPClauseList(C);
799 }
800 void OMPClauseProfiler::VisitOMPAllocateClause(const OMPAllocateClause *C) {
801  if (Expr *Allocator = C->getAllocator())
802  Profiler->VisitStmt(Allocator);
803  VisitOMPClauseList(C);
804 }
805 void OMPClauseProfiler::VisitOMPNumTeamsClause(const OMPNumTeamsClause *C) {
806  VistOMPClauseWithPreInit(C);
807  if (C->getNumTeams())
808  Profiler->VisitStmt(C->getNumTeams());
809 }
810 void OMPClauseProfiler::VisitOMPThreadLimitClause(
811  const OMPThreadLimitClause *C) {
812  VistOMPClauseWithPreInit(C);
813  if (C->getThreadLimit())
814  Profiler->VisitStmt(C->getThreadLimit());
815 }
816 void OMPClauseProfiler::VisitOMPPriorityClause(const OMPPriorityClause *C) {
817  VistOMPClauseWithPreInit(C);
818  if (C->getPriority())
819  Profiler->VisitStmt(C->getPriority());
820 }
821 void OMPClauseProfiler::VisitOMPGrainsizeClause(const OMPGrainsizeClause *C) {
822  VistOMPClauseWithPreInit(C);
823  if (C->getGrainsize())
824  Profiler->VisitStmt(C->getGrainsize());
825 }
826 void OMPClauseProfiler::VisitOMPNumTasksClause(const OMPNumTasksClause *C) {
827  VistOMPClauseWithPreInit(C);
828  if (C->getNumTasks())
829  Profiler->VisitStmt(C->getNumTasks());
830 }
831 void OMPClauseProfiler::VisitOMPHintClause(const OMPHintClause *C) {
832  if (C->getHint())
833  Profiler->VisitStmt(C->getHint());
834 }
835 void OMPClauseProfiler::VisitOMPToClause(const OMPToClause *C) {
836  VisitOMPClauseList(C);
837 }
838 void OMPClauseProfiler::VisitOMPFromClause(const OMPFromClause *C) {
839  VisitOMPClauseList(C);
840 }
841 void OMPClauseProfiler::VisitOMPUseDevicePtrClause(
842  const OMPUseDevicePtrClause *C) {
843  VisitOMPClauseList(C);
844 }
845 void OMPClauseProfiler::VisitOMPUseDeviceAddrClause(
846  const OMPUseDeviceAddrClause *C) {
847  VisitOMPClauseList(C);
848 }
849 void OMPClauseProfiler::VisitOMPIsDevicePtrClause(
850  const OMPIsDevicePtrClause *C) {
851  VisitOMPClauseList(C);
852 }
853 void OMPClauseProfiler::VisitOMPNontemporalClause(
854  const OMPNontemporalClause *C) {
855  VisitOMPClauseList(C);
856  for (auto *E : C->private_refs())
857  Profiler->VisitStmt(E);
858 }
859 void OMPClauseProfiler::VisitOMPInclusiveClause(const OMPInclusiveClause *C) {
860  VisitOMPClauseList(C);
861 }
862 void OMPClauseProfiler::VisitOMPExclusiveClause(const OMPExclusiveClause *C) {
863  VisitOMPClauseList(C);
864 }
865 void OMPClauseProfiler::VisitOMPUsesAllocatorsClause(
866  const OMPUsesAllocatorsClause *C) {
867  for (unsigned I = 0, E = C->getNumberOfAllocators(); I < E; ++I) {
868  OMPUsesAllocatorsClause::Data D = C->getAllocatorData(I);
869  Profiler->VisitStmt(D.Allocator);
870  if (D.AllocatorTraits)
871  Profiler->VisitStmt(D.AllocatorTraits);
872  }
873 }
874 void OMPClauseProfiler::VisitOMPAffinityClause(const OMPAffinityClause *C) {
875  if (const Expr *Modifier = C->getModifier())
876  Profiler->VisitStmt(Modifier);
877  for (const Expr *E : C->varlists())
878  Profiler->VisitStmt(E);
879 }
880 void OMPClauseProfiler::VisitOMPOrderClause(const OMPOrderClause *C) {}
881 } // namespace
882 
883 void
884 StmtProfiler::VisitOMPExecutableDirective(const OMPExecutableDirective *S) {
885  VisitStmt(S);
886  OMPClauseProfiler P(this);
887  ArrayRef<OMPClause *> Clauses = S->clauses();
888  for (ArrayRef<OMPClause *>::iterator I = Clauses.begin(), E = Clauses.end();
889  I != E; ++I)
890  if (*I)
891  P.Visit(*I);
892 }
893 
894 void StmtProfiler::VisitOMPCanonicalLoop(const OMPCanonicalLoop *L) {
895  VisitStmt(L);
896 }
897 
898 void StmtProfiler::VisitOMPLoopBasedDirective(const OMPLoopBasedDirective *S) {
899  VisitOMPExecutableDirective(S);
900 }
901 
902 void StmtProfiler::VisitOMPLoopDirective(const OMPLoopDirective *S) {
903  VisitOMPLoopBasedDirective(S);
904 }
905 
906 void StmtProfiler::VisitOMPMetaDirective(const OMPMetaDirective *S) {
907  VisitOMPExecutableDirective(S);
908 }
909 
910 void StmtProfiler::VisitOMPParallelDirective(const OMPParallelDirective *S) {
911  VisitOMPExecutableDirective(S);
912 }
913 
914 void StmtProfiler::VisitOMPSimdDirective(const OMPSimdDirective *S) {
915  VisitOMPLoopDirective(S);
916 }
917 
918 void StmtProfiler::VisitOMPLoopTransformationDirective(
920  VisitOMPLoopBasedDirective(S);
921 }
922 
923 void StmtProfiler::VisitOMPTileDirective(const OMPTileDirective *S) {
924  VisitOMPLoopTransformationDirective(S);
925 }
926 
927 void StmtProfiler::VisitOMPUnrollDirective(const OMPUnrollDirective *S) {
928  VisitOMPLoopTransformationDirective(S);
929 }
930 
931 void StmtProfiler::VisitOMPForDirective(const OMPForDirective *S) {
932  VisitOMPLoopDirective(S);
933 }
934 
935 void StmtProfiler::VisitOMPForSimdDirective(const OMPForSimdDirective *S) {
936  VisitOMPLoopDirective(S);
937 }
938 
939 void StmtProfiler::VisitOMPSectionsDirective(const OMPSectionsDirective *S) {
940  VisitOMPExecutableDirective(S);
941 }
942 
943 void StmtProfiler::VisitOMPSectionDirective(const OMPSectionDirective *S) {
944  VisitOMPExecutableDirective(S);
945 }
946 
947 void StmtProfiler::VisitOMPSingleDirective(const OMPSingleDirective *S) {
948  VisitOMPExecutableDirective(S);
949 }
950 
951 void StmtProfiler::VisitOMPMasterDirective(const OMPMasterDirective *S) {
952  VisitOMPExecutableDirective(S);
953 }
954 
955 void StmtProfiler::VisitOMPCriticalDirective(const OMPCriticalDirective *S) {
956  VisitOMPExecutableDirective(S);
957  VisitName(S->getDirectiveName().getName());
958 }
959 
960 void
961 StmtProfiler::VisitOMPParallelForDirective(const OMPParallelForDirective *S) {
962  VisitOMPLoopDirective(S);
963 }
964 
965 void StmtProfiler::VisitOMPParallelForSimdDirective(
966  const OMPParallelForSimdDirective *S) {
967  VisitOMPLoopDirective(S);
968 }
969 
970 void StmtProfiler::VisitOMPParallelMasterDirective(
971  const OMPParallelMasterDirective *S) {
972  VisitOMPExecutableDirective(S);
973 }
974 
975 void StmtProfiler::VisitOMPParallelSectionsDirective(
976  const OMPParallelSectionsDirective *S) {
977  VisitOMPExecutableDirective(S);
978 }
979 
980 void StmtProfiler::VisitOMPTaskDirective(const OMPTaskDirective *S) {
981  VisitOMPExecutableDirective(S);
982 }
983 
984 void StmtProfiler::VisitOMPTaskyieldDirective(const OMPTaskyieldDirective *S) {
985  VisitOMPExecutableDirective(S);
986 }
987 
988 void StmtProfiler::VisitOMPBarrierDirective(const OMPBarrierDirective *S) {
989  VisitOMPExecutableDirective(S);
990 }
991 
992 void StmtProfiler::VisitOMPTaskwaitDirective(const OMPTaskwaitDirective *S) {
993  VisitOMPExecutableDirective(S);
994 }
995 
996 void StmtProfiler::VisitOMPTaskgroupDirective(const OMPTaskgroupDirective *S) {
997  VisitOMPExecutableDirective(S);
998  if (const Expr *E = S->getReductionRef())
999  VisitStmt(E);
1000 }
1001 
1002 void StmtProfiler::VisitOMPFlushDirective(const OMPFlushDirective *S) {
1003  VisitOMPExecutableDirective(S);
1004 }
1005 
1006 void StmtProfiler::VisitOMPDepobjDirective(const OMPDepobjDirective *S) {
1007  VisitOMPExecutableDirective(S);
1008 }
1009 
1010 void StmtProfiler::VisitOMPScanDirective(const OMPScanDirective *S) {
1011  VisitOMPExecutableDirective(S);
1012 }
1013 
1014 void StmtProfiler::VisitOMPOrderedDirective(const OMPOrderedDirective *S) {
1015  VisitOMPExecutableDirective(S);
1016 }
1017 
1018 void StmtProfiler::VisitOMPAtomicDirective(const OMPAtomicDirective *S) {
1019  VisitOMPExecutableDirective(S);
1020 }
1021 
1022 void StmtProfiler::VisitOMPTargetDirective(const OMPTargetDirective *S) {
1023  VisitOMPExecutableDirective(S);
1024 }
1025 
1026 void StmtProfiler::VisitOMPTargetDataDirective(const OMPTargetDataDirective *S) {
1027  VisitOMPExecutableDirective(S);
1028 }
1029 
1030 void StmtProfiler::VisitOMPTargetEnterDataDirective(
1031  const OMPTargetEnterDataDirective *S) {
1032  VisitOMPExecutableDirective(S);
1033 }
1034 
1035 void StmtProfiler::VisitOMPTargetExitDataDirective(
1036  const OMPTargetExitDataDirective *S) {
1037  VisitOMPExecutableDirective(S);
1038 }
1039 
1040 void StmtProfiler::VisitOMPTargetParallelDirective(
1041  const OMPTargetParallelDirective *S) {
1042  VisitOMPExecutableDirective(S);
1043 }
1044 
1045 void StmtProfiler::VisitOMPTargetParallelForDirective(
1046  const OMPTargetParallelForDirective *S) {
1047  VisitOMPExecutableDirective(S);
1048 }
1049 
1050 void StmtProfiler::VisitOMPTeamsDirective(const OMPTeamsDirective *S) {
1051  VisitOMPExecutableDirective(S);
1052 }
1053 
1054 void StmtProfiler::VisitOMPCancellationPointDirective(
1055  const OMPCancellationPointDirective *S) {
1056  VisitOMPExecutableDirective(S);
1057 }
1058 
1059 void StmtProfiler::VisitOMPCancelDirective(const OMPCancelDirective *S) {
1060  VisitOMPExecutableDirective(S);
1061 }
1062 
1063 void StmtProfiler::VisitOMPTaskLoopDirective(const OMPTaskLoopDirective *S) {
1064  VisitOMPLoopDirective(S);
1065 }
1066 
1067 void StmtProfiler::VisitOMPTaskLoopSimdDirective(
1068  const OMPTaskLoopSimdDirective *S) {
1069  VisitOMPLoopDirective(S);
1070 }
1071 
1072 void StmtProfiler::VisitOMPMasterTaskLoopDirective(
1073  const OMPMasterTaskLoopDirective *S) {
1074  VisitOMPLoopDirective(S);
1075 }
1076 
1077 void StmtProfiler::VisitOMPMasterTaskLoopSimdDirective(
1078  const OMPMasterTaskLoopSimdDirective *S) {
1079  VisitOMPLoopDirective(S);
1080 }
1081 
1082 void StmtProfiler::VisitOMPParallelMasterTaskLoopDirective(
1084  VisitOMPLoopDirective(S);
1085 }
1086 
1087 void StmtProfiler::VisitOMPParallelMasterTaskLoopSimdDirective(
1089  VisitOMPLoopDirective(S);
1090 }
1091 
1092 void StmtProfiler::VisitOMPDistributeDirective(
1093  const OMPDistributeDirective *S) {
1094  VisitOMPLoopDirective(S);
1095 }
1096 
1097 void OMPClauseProfiler::VisitOMPDistScheduleClause(
1098  const OMPDistScheduleClause *C) {
1099  VistOMPClauseWithPreInit(C);
1100  if (auto *S = C->getChunkSize())
1101  Profiler->VisitStmt(S);
1102 }
1103 
1104 void OMPClauseProfiler::VisitOMPDefaultmapClause(const OMPDefaultmapClause *) {}
1105 
1106 void StmtProfiler::VisitOMPTargetUpdateDirective(
1107  const OMPTargetUpdateDirective *S) {
1108  VisitOMPExecutableDirective(S);
1109 }
1110 
1111 void StmtProfiler::VisitOMPDistributeParallelForDirective(
1113  VisitOMPLoopDirective(S);
1114 }
1115 
1116 void StmtProfiler::VisitOMPDistributeParallelForSimdDirective(
1118  VisitOMPLoopDirective(S);
1119 }
1120 
1121 void StmtProfiler::VisitOMPDistributeSimdDirective(
1122  const OMPDistributeSimdDirective *S) {
1123  VisitOMPLoopDirective(S);
1124 }
1125 
1126 void StmtProfiler::VisitOMPTargetParallelForSimdDirective(
1128  VisitOMPLoopDirective(S);
1129 }
1130 
1131 void StmtProfiler::VisitOMPTargetSimdDirective(
1132  const OMPTargetSimdDirective *S) {
1133  VisitOMPLoopDirective(S);
1134 }
1135 
1136 void StmtProfiler::VisitOMPTeamsDistributeDirective(
1137  const OMPTeamsDistributeDirective *S) {
1138  VisitOMPLoopDirective(S);
1139 }
1140 
1141 void StmtProfiler::VisitOMPTeamsDistributeSimdDirective(
1143  VisitOMPLoopDirective(S);
1144 }
1145 
1146 void StmtProfiler::VisitOMPTeamsDistributeParallelForSimdDirective(
1148  VisitOMPLoopDirective(S);
1149 }
1150 
1151 void StmtProfiler::VisitOMPTeamsDistributeParallelForDirective(
1153  VisitOMPLoopDirective(S);
1154 }
1155 
1156 void StmtProfiler::VisitOMPTargetTeamsDirective(
1157  const OMPTargetTeamsDirective *S) {
1158  VisitOMPExecutableDirective(S);
1159 }
1160 
1161 void StmtProfiler::VisitOMPTargetTeamsDistributeDirective(
1163  VisitOMPLoopDirective(S);
1164 }
1165 
1166 void StmtProfiler::VisitOMPTargetTeamsDistributeParallelForDirective(
1168  VisitOMPLoopDirective(S);
1169 }
1170 
1171 void StmtProfiler::VisitOMPTargetTeamsDistributeParallelForSimdDirective(
1173  VisitOMPLoopDirective(S);
1174 }
1175 
1176 void StmtProfiler::VisitOMPTargetTeamsDistributeSimdDirective(
1178  VisitOMPLoopDirective(S);
1179 }
1180 
1181 void StmtProfiler::VisitOMPInteropDirective(const OMPInteropDirective *S) {
1182  VisitOMPExecutableDirective(S);
1183 }
1184 
1185 void StmtProfiler::VisitOMPDispatchDirective(const OMPDispatchDirective *S) {
1186  VisitOMPExecutableDirective(S);
1187 }
1188 
1189 void StmtProfiler::VisitOMPMaskedDirective(const OMPMaskedDirective *S) {
1190  VisitOMPExecutableDirective(S);
1191 }
1192 
1193 void StmtProfiler::VisitExpr(const Expr *S) {
1194  VisitStmt(S);
1195 }
1196 
1197 void StmtProfiler::VisitConstantExpr(const ConstantExpr *S) {
1198  VisitExpr(S);
1199 }
1200 
1201 void StmtProfiler::VisitDeclRefExpr(const DeclRefExpr *S) {
1202  VisitExpr(S);
1203  if (!Canonical)
1204  VisitNestedNameSpecifier(S->getQualifier());
1205  VisitDecl(S->getDecl());
1206  if (!Canonical) {
1207  ID.AddBoolean(S->hasExplicitTemplateArgs());
1208  if (S->hasExplicitTemplateArgs())
1209  VisitTemplateArguments(S->getTemplateArgs(), S->getNumTemplateArgs());
1210  }
1211 }
1212 
1213 void StmtProfiler::VisitSYCLUniqueStableNameExpr(
1214  const SYCLUniqueStableNameExpr *S) {
1215  VisitExpr(S);
1216  VisitType(S->getTypeSourceInfo()->getType());
1217 }
1218 
1219 void StmtProfiler::VisitPredefinedExpr(const PredefinedExpr *S) {
1220  VisitExpr(S);
1221  ID.AddInteger(S->getIdentKind());
1222 }
1223 
1224 void StmtProfiler::VisitIntegerLiteral(const IntegerLiteral *S) {
1225  VisitExpr(S);
1226  S->getValue().Profile(ID);
1227  ID.AddInteger(S->getType()->castAs<BuiltinType>()->getKind());
1228 }
1229 
1230 void StmtProfiler::VisitFixedPointLiteral(const FixedPointLiteral *S) {
1231  VisitExpr(S);
1232  S->getValue().Profile(ID);
1233  ID.AddInteger(S->getType()->castAs<BuiltinType>()->getKind());
1234 }
1235 
1236 void StmtProfiler::VisitCharacterLiteral(const CharacterLiteral *S) {
1237  VisitExpr(S);
1238  ID.AddInteger(S->getKind());
1239  ID.AddInteger(S->getValue());
1240 }
1241 
1242 void StmtProfiler::VisitFloatingLiteral(const FloatingLiteral *S) {
1243  VisitExpr(S);
1244  S->getValue().Profile(ID);
1245  ID.AddBoolean(S->isExact());
1246  ID.AddInteger(S->getType()->castAs<BuiltinType>()->getKind());
1247 }
1248 
1249 void StmtProfiler::VisitImaginaryLiteral(const ImaginaryLiteral *S) {
1250  VisitExpr(S);
1251 }
1252 
1253 void StmtProfiler::VisitStringLiteral(const StringLiteral *S) {
1254  VisitExpr(S);
1255  ID.AddString(S->getBytes());
1256  ID.AddInteger(S->getKind());
1257 }
1258 
1259 void StmtProfiler::VisitParenExpr(const ParenExpr *S) {
1260  VisitExpr(S);
1261 }
1262 
1263 void StmtProfiler::VisitParenListExpr(const ParenListExpr *S) {
1264  VisitExpr(S);
1265 }
1266 
1267 void StmtProfiler::VisitUnaryOperator(const UnaryOperator *S) {
1268  VisitExpr(S);
1269  ID.AddInteger(S->getOpcode());
1270 }
1271 
1272 void StmtProfiler::VisitOffsetOfExpr(const OffsetOfExpr *S) {
1273  VisitType(S->getTypeSourceInfo()->getType());
1274  unsigned n = S->getNumComponents();
1275  for (unsigned i = 0; i < n; ++i) {
1276  const OffsetOfNode &ON = S->getComponent(i);
1277  ID.AddInteger(ON.getKind());
1278  switch (ON.getKind()) {
1279  case OffsetOfNode::Array:
1280  // Expressions handled below.
1281  break;
1282 
1283  case OffsetOfNode::Field:
1284  VisitDecl(ON.getField());
1285  break;
1286 
1288  VisitIdentifierInfo(ON.getFieldName());
1289  break;
1290 
1291  case OffsetOfNode::Base:
1292  // These nodes are implicit, and therefore don't need profiling.
1293  break;
1294  }
1295  }
1296 
1297  VisitExpr(S);
1298 }
1299 
1300 void
1301 StmtProfiler::VisitUnaryExprOrTypeTraitExpr(const UnaryExprOrTypeTraitExpr *S) {
1302  VisitExpr(S);
1303  ID.AddInteger(S->getKind());
1304  if (S->isArgumentType())
1305  VisitType(S->getArgumentType());
1306 }
1307 
1308 void StmtProfiler::VisitArraySubscriptExpr(const ArraySubscriptExpr *S) {
1309  VisitExpr(S);
1310 }
1311 
1312 void StmtProfiler::VisitMatrixSubscriptExpr(const MatrixSubscriptExpr *S) {
1313  VisitExpr(S);
1314 }
1315 
1316 void StmtProfiler::VisitOMPArraySectionExpr(const OMPArraySectionExpr *S) {
1317  VisitExpr(S);
1318 }
1319 
1320 void StmtProfiler::VisitOMPArrayShapingExpr(const OMPArrayShapingExpr *S) {
1321  VisitExpr(S);
1322 }
1323 
1324 void StmtProfiler::VisitOMPIteratorExpr(const OMPIteratorExpr *S) {
1325  VisitExpr(S);
1326  for (unsigned I = 0, E = S->numOfIterators(); I < E; ++I)
1327  VisitDecl(S->getIteratorDecl(I));
1328 }
1329 
1330 void StmtProfiler::VisitCallExpr(const CallExpr *S) {
1331  VisitExpr(S);
1332 }
1333 
1334 void StmtProfiler::VisitMemberExpr(const MemberExpr *S) {
1335  VisitExpr(S);
1336  VisitDecl(S->getMemberDecl());
1337  if (!Canonical)
1338  VisitNestedNameSpecifier(S->getQualifier());
1339  ID.AddBoolean(S->isArrow());
1340 }
1341 
1342 void StmtProfiler::VisitCompoundLiteralExpr(const CompoundLiteralExpr *S) {
1343  VisitExpr(S);
1344  ID.AddBoolean(S->isFileScope());
1345 }
1346 
1347 void StmtProfiler::VisitCastExpr(const CastExpr *S) {
1348  VisitExpr(S);
1349 }
1350 
1351 void StmtProfiler::VisitImplicitCastExpr(const ImplicitCastExpr *S) {
1352  VisitCastExpr(S);
1353  ID.AddInteger(S->getValueKind());
1354 }
1355 
1356 void StmtProfiler::VisitExplicitCastExpr(const ExplicitCastExpr *S) {
1357  VisitCastExpr(S);
1358  VisitType(S->getTypeAsWritten());
1359 }
1360 
1361 void StmtProfiler::VisitCStyleCastExpr(const CStyleCastExpr *S) {
1362  VisitExplicitCastExpr(S);
1363 }
1364 
1365 void StmtProfiler::VisitBinaryOperator(const BinaryOperator *S) {
1366  VisitExpr(S);
1367  ID.AddInteger(S->getOpcode());
1368 }
1369 
1370 void
1371 StmtProfiler::VisitCompoundAssignOperator(const CompoundAssignOperator *S) {
1372  VisitBinaryOperator(S);
1373 }
1374 
1375 void StmtProfiler::VisitConditionalOperator(const ConditionalOperator *S) {
1376  VisitExpr(S);
1377 }
1378 
1379 void StmtProfiler::VisitBinaryConditionalOperator(
1380  const BinaryConditionalOperator *S) {
1381  VisitExpr(S);
1382 }
1383 
1384 void StmtProfiler::VisitAddrLabelExpr(const AddrLabelExpr *S) {
1385  VisitExpr(S);
1386  VisitDecl(S->getLabel());
1387 }
1388 
1389 void StmtProfiler::VisitStmtExpr(const StmtExpr *S) {
1390  VisitExpr(S);
1391 }
1392 
1393 void StmtProfiler::VisitShuffleVectorExpr(const ShuffleVectorExpr *S) {
1394  VisitExpr(S);
1395 }
1396 
1397 void StmtProfiler::VisitConvertVectorExpr(const ConvertVectorExpr *S) {
1398  VisitExpr(S);
1399 }
1400 
1401 void StmtProfiler::VisitChooseExpr(const ChooseExpr *S) {
1402  VisitExpr(S);
1403 }
1404 
1405 void StmtProfiler::VisitGNUNullExpr(const GNUNullExpr *S) {
1406  VisitExpr(S);
1407 }
1408 
1409 void StmtProfiler::VisitVAArgExpr(const VAArgExpr *S) {
1410  VisitExpr(S);
1411 }
1412 
1413 void StmtProfiler::VisitInitListExpr(const InitListExpr *S) {
1414  if (S->getSyntacticForm()) {
1415  VisitInitListExpr(S->getSyntacticForm());
1416  return;
1417  }
1418 
1419  VisitExpr(S);
1420 }
1421 
1422 void StmtProfiler::VisitDesignatedInitExpr(const DesignatedInitExpr *S) {
1423  VisitExpr(S);
1424  ID.AddBoolean(S->usesGNUSyntax());
1425  for (const DesignatedInitExpr::Designator &D : S->designators()) {
1426  if (D.isFieldDesignator()) {
1427  ID.AddInteger(0);
1428  VisitName(D.getFieldName());
1429  continue;
1430  }
1431 
1432  if (D.isArrayDesignator()) {
1433  ID.AddInteger(1);
1434  } else {
1435  assert(D.isArrayRangeDesignator());
1436  ID.AddInteger(2);
1437  }
1438  ID.AddInteger(D.getFirstExprIndex());
1439  }
1440 }
1441 
1442 // Seems that if VisitInitListExpr() only works on the syntactic form of an
1443 // InitListExpr, then a DesignatedInitUpdateExpr is not encountered.
1444 void StmtProfiler::VisitDesignatedInitUpdateExpr(
1445  const DesignatedInitUpdateExpr *S) {
1446  llvm_unreachable("Unexpected DesignatedInitUpdateExpr in syntactic form of "
1447  "initializer");
1448 }
1449 
1450 void StmtProfiler::VisitArrayInitLoopExpr(const ArrayInitLoopExpr *S) {
1451  VisitExpr(S);
1452 }
1453 
1454 void StmtProfiler::VisitArrayInitIndexExpr(const ArrayInitIndexExpr *S) {
1455  VisitExpr(S);
1456 }
1457 
1458 void StmtProfiler::VisitNoInitExpr(const NoInitExpr *S) {
1459  llvm_unreachable("Unexpected NoInitExpr in syntactic form of initializer");
1460 }
1461 
1462 void StmtProfiler::VisitImplicitValueInitExpr(const ImplicitValueInitExpr *S) {
1463  VisitExpr(S);
1464 }
1465 
1466 void StmtProfiler::VisitExtVectorElementExpr(const ExtVectorElementExpr *S) {
1467  VisitExpr(S);
1468  VisitName(&S->getAccessor());
1469 }
1470 
1471 void StmtProfiler::VisitBlockExpr(const BlockExpr *S) {
1472  VisitExpr(S);
1473  VisitDecl(S->getBlockDecl());
1474 }
1475 
1476 void StmtProfiler::VisitGenericSelectionExpr(const GenericSelectionExpr *S) {
1477  VisitExpr(S);
1478  for (const GenericSelectionExpr::ConstAssociation Assoc :
1479  S->associations()) {
1480  QualType T = Assoc.getType();
1481  if (T.isNull())
1482  ID.AddPointer(nullptr);
1483  else
1484  VisitType(T);
1485  VisitExpr(Assoc.getAssociationExpr());
1486  }
1487 }
1488 
1489 void StmtProfiler::VisitPseudoObjectExpr(const PseudoObjectExpr *S) {
1490  VisitExpr(S);
1492  i = S->semantics_begin(), e = S->semantics_end(); i != e; ++i)
1493  // Normally, we would not profile the source expressions of OVEs.
1494  if (const OpaqueValueExpr *OVE = dyn_cast<OpaqueValueExpr>(*i))
1495  Visit(OVE->getSourceExpr());
1496 }
1497 
1498 void StmtProfiler::VisitAtomicExpr(const AtomicExpr *S) {
1499  VisitExpr(S);
1500  ID.AddInteger(S->getOp());
1501 }
1502 
1503 void StmtProfiler::VisitConceptSpecializationExpr(
1504  const ConceptSpecializationExpr *S) {
1505  VisitExpr(S);
1506  VisitDecl(S->getNamedConcept());
1507  for (const TemplateArgument &Arg : S->getTemplateArguments())
1508  VisitTemplateArgument(Arg);
1509 }
1510 
1511 void StmtProfiler::VisitRequiresExpr(const RequiresExpr *S) {
1512  VisitExpr(S);
1513  ID.AddInteger(S->getLocalParameters().size());
1514  for (ParmVarDecl *LocalParam : S->getLocalParameters())
1515  VisitDecl(LocalParam);
1516  ID.AddInteger(S->getRequirements().size());
1517  for (concepts::Requirement *Req : S->getRequirements()) {
1518  if (auto *TypeReq = dyn_cast<concepts::TypeRequirement>(Req)) {
1519  ID.AddInteger(concepts::Requirement::RK_Type);
1520  ID.AddBoolean(TypeReq->isSubstitutionFailure());
1521  if (!TypeReq->isSubstitutionFailure())
1522  VisitType(TypeReq->getType()->getType());
1523  } else if (auto *ExprReq = dyn_cast<concepts::ExprRequirement>(Req)) {
1525  ID.AddBoolean(ExprReq->isExprSubstitutionFailure());
1526  if (!ExprReq->isExprSubstitutionFailure())
1527  Visit(ExprReq->getExpr());
1528  // C++2a [expr.prim.req.compound]p1 Example:
1529  // [...] The compound-requirement in C1 requires that x++ is a valid
1530  // expression. It is equivalent to the simple-requirement x++; [...]
1531  // We therefore do not profile isSimple() here.
1532  ID.AddBoolean(ExprReq->getNoexceptLoc().isValid());
1534  ExprReq->getReturnTypeRequirement();
1535  if (RetReq.isEmpty()) {
1536  ID.AddInteger(0);
1537  } else if (RetReq.isTypeConstraint()) {
1538  ID.AddInteger(1);
1540  } else {
1541  assert(RetReq.isSubstitutionFailure());
1542  ID.AddInteger(2);
1543  }
1544  } else {
1546  auto *NestedReq = cast<concepts::NestedRequirement>(Req);
1547  ID.AddBoolean(NestedReq->isSubstitutionFailure());
1548  if (!NestedReq->isSubstitutionFailure())
1549  Visit(NestedReq->getConstraintExpr());
1550  }
1551  }
1552 }
1553 
1555  UnaryOperatorKind &UnaryOp,
1556  BinaryOperatorKind &BinaryOp) {
1557  switch (S->getOperator()) {
1558  case OO_None:
1559  case OO_New:
1560  case OO_Delete:
1561  case OO_Array_New:
1562  case OO_Array_Delete:
1563  case OO_Arrow:
1564  case OO_Conditional:
1566  llvm_unreachable("Invalid operator call kind");
1567 
1568  case OO_Plus:
1569  if (S->getNumArgs() == 1) {
1570  UnaryOp = UO_Plus;
1571  return Stmt::UnaryOperatorClass;
1572  }
1573 
1574  BinaryOp = BO_Add;
1575  return Stmt::BinaryOperatorClass;
1576 
1577  case OO_Minus:
1578  if (S->getNumArgs() == 1) {
1579  UnaryOp = UO_Minus;
1580  return Stmt::UnaryOperatorClass;
1581  }
1582 
1583  BinaryOp = BO_Sub;
1584  return Stmt::BinaryOperatorClass;
1585 
1586  case OO_Star:
1587  if (S->getNumArgs() == 1) {
1588  UnaryOp = UO_Deref;
1589  return Stmt::UnaryOperatorClass;
1590  }
1591 
1592  BinaryOp = BO_Mul;
1593  return Stmt::BinaryOperatorClass;
1594 
1595  case OO_Slash:
1596  BinaryOp = BO_Div;
1597  return Stmt::BinaryOperatorClass;
1598 
1599  case OO_Percent:
1600  BinaryOp = BO_Rem;
1601  return Stmt::BinaryOperatorClass;
1602 
1603  case OO_Caret:
1604  BinaryOp = BO_Xor;
1605  return Stmt::BinaryOperatorClass;
1606 
1607  case OO_Amp:
1608  if (S->getNumArgs() == 1) {
1609  UnaryOp = UO_AddrOf;
1610  return Stmt::UnaryOperatorClass;
1611  }
1612 
1613  BinaryOp = BO_And;
1614  return Stmt::BinaryOperatorClass;
1615 
1616  case OO_Pipe:
1617  BinaryOp = BO_Or;
1618  return Stmt::BinaryOperatorClass;
1619 
1620  case OO_Tilde:
1621  UnaryOp = UO_Not;
1622  return Stmt::UnaryOperatorClass;
1623 
1624  case OO_Exclaim:
1625  UnaryOp = UO_LNot;
1626  return Stmt::UnaryOperatorClass;
1627 
1628  case OO_Equal:
1629  BinaryOp = BO_Assign;
1630  return Stmt::BinaryOperatorClass;
1631 
1632  case OO_Less:
1633  BinaryOp = BO_LT;
1634  return Stmt::BinaryOperatorClass;
1635 
1636  case OO_Greater:
1637  BinaryOp = BO_GT;
1638  return Stmt::BinaryOperatorClass;
1639 
1640  case OO_PlusEqual:
1641  BinaryOp = BO_AddAssign;
1642  return Stmt::CompoundAssignOperatorClass;
1643 
1644  case OO_MinusEqual:
1645  BinaryOp = BO_SubAssign;
1646  return Stmt::CompoundAssignOperatorClass;
1647 
1648  case OO_StarEqual:
1649  BinaryOp = BO_MulAssign;
1650  return Stmt::CompoundAssignOperatorClass;
1651 
1652  case OO_SlashEqual:
1653  BinaryOp = BO_DivAssign;
1654  return Stmt::CompoundAssignOperatorClass;
1655 
1656  case OO_PercentEqual:
1657  BinaryOp = BO_RemAssign;
1658  return Stmt::CompoundAssignOperatorClass;
1659 
1660  case OO_CaretEqual:
1661  BinaryOp = BO_XorAssign;
1662  return Stmt::CompoundAssignOperatorClass;
1663 
1664  case OO_AmpEqual:
1665  BinaryOp = BO_AndAssign;
1666  return Stmt::CompoundAssignOperatorClass;
1667 
1668  case OO_PipeEqual:
1669  BinaryOp = BO_OrAssign;
1670  return Stmt::CompoundAssignOperatorClass;
1671 
1672  case OO_LessLess:
1673  BinaryOp = BO_Shl;
1674  return Stmt::BinaryOperatorClass;
1675 
1676  case OO_GreaterGreater:
1677  BinaryOp = BO_Shr;
1678  return Stmt::BinaryOperatorClass;
1679 
1680  case OO_LessLessEqual:
1681  BinaryOp = BO_ShlAssign;
1682  return Stmt::CompoundAssignOperatorClass;
1683 
1684  case OO_GreaterGreaterEqual:
1685  BinaryOp = BO_ShrAssign;
1686  return Stmt::CompoundAssignOperatorClass;
1687 
1688  case OO_EqualEqual:
1689  BinaryOp = BO_EQ;
1690  return Stmt::BinaryOperatorClass;
1691 
1692  case OO_ExclaimEqual:
1693  BinaryOp = BO_NE;
1694  return Stmt::BinaryOperatorClass;
1695 
1696  case OO_LessEqual:
1697  BinaryOp = BO_LE;
1698  return Stmt::BinaryOperatorClass;
1699 
1700  case OO_GreaterEqual:
1701  BinaryOp = BO_GE;
1702  return Stmt::BinaryOperatorClass;
1703 
1704  case OO_Spaceship:
1705  BinaryOp = BO_Cmp;
1706  return Stmt::BinaryOperatorClass;
1707 
1708  case OO_AmpAmp:
1709  BinaryOp = BO_LAnd;
1710  return Stmt::BinaryOperatorClass;
1711 
1712  case OO_PipePipe:
1713  BinaryOp = BO_LOr;
1714  return Stmt::BinaryOperatorClass;
1715 
1716  case OO_PlusPlus:
1717  UnaryOp = S->getNumArgs() == 1? UO_PreInc
1718  : UO_PostInc;
1719  return Stmt::UnaryOperatorClass;
1720 
1721  case OO_MinusMinus:
1722  UnaryOp = S->getNumArgs() == 1? UO_PreDec
1723  : UO_PostDec;
1724  return Stmt::UnaryOperatorClass;
1725 
1726  case OO_Comma:
1727  BinaryOp = BO_Comma;
1728  return Stmt::BinaryOperatorClass;
1729 
1730  case OO_ArrowStar:
1731  BinaryOp = BO_PtrMemI;
1732  return Stmt::BinaryOperatorClass;
1733 
1734  case OO_Subscript:
1735  return Stmt::ArraySubscriptExprClass;
1736 
1737  case OO_Call:
1738  return Stmt::CallExprClass;
1739 
1740  case OO_Coawait:
1741  UnaryOp = UO_Coawait;
1742  return Stmt::UnaryOperatorClass;
1743  }
1744 
1745  llvm_unreachable("Invalid overloaded operator expression");
1746 }
1747 
1748 #if defined(_MSC_VER) && !defined(__clang__)
1749 #if _MSC_VER == 1911
1750 // Work around https://developercommunity.visualstudio.com/content/problem/84002/clang-cl-when-built-with-vc-2017-crashes-cause-vc.html
1751 // MSVC 2017 update 3 miscompiles this function, and a clang built with it
1752 // will crash in stage 2 of a bootstrap build.
1753 #pragma optimize("", off)
1754 #endif
1755 #endif
1756 
1757 void StmtProfiler::VisitCXXOperatorCallExpr(const CXXOperatorCallExpr *S) {
1758  if (S->isTypeDependent()) {
1759  // Type-dependent operator calls are profiled like their underlying
1760  // syntactic operator.
1761  //
1762  // An operator call to operator-> is always implicit, so just skip it. The
1763  // enclosing MemberExpr will profile the actual member access.
1764  if (S->getOperator() == OO_Arrow)
1765  return Visit(S->getArg(0));
1766 
1767  UnaryOperatorKind UnaryOp = UO_Extension;
1768  BinaryOperatorKind BinaryOp = BO_Comma;
1769  Stmt::StmtClass SC = DecodeOperatorCall(S, UnaryOp, BinaryOp);
1770 
1771  ID.AddInteger(SC);
1772  for (unsigned I = 0, N = S->getNumArgs(); I != N; ++I)
1773  Visit(S->getArg(I));
1774  if (SC == Stmt::UnaryOperatorClass)
1775  ID.AddInteger(UnaryOp);
1776  else if (SC == Stmt::BinaryOperatorClass ||
1777  SC == Stmt::CompoundAssignOperatorClass)
1778  ID.AddInteger(BinaryOp);
1779  else
1780  assert(SC == Stmt::ArraySubscriptExprClass || SC == Stmt::CallExprClass);
1781 
1782  return;
1783  }
1784 
1785  VisitCallExpr(S);
1786  ID.AddInteger(S->getOperator());
1787 }
1788 
1789 void StmtProfiler::VisitCXXRewrittenBinaryOperator(
1790  const CXXRewrittenBinaryOperator *S) {
1791  // If a rewritten operator were ever to be type-dependent, we should profile
1792  // it following its syntactic operator.
1793  assert(!S->isTypeDependent() &&
1794  "resolved rewritten operator should never be type-dependent");
1795  ID.AddBoolean(S->isReversed());
1796  VisitExpr(S->getSemanticForm());
1797 }
1798 
1799 #if defined(_MSC_VER) && !defined(__clang__)
1800 #if _MSC_VER == 1911
1801 #pragma optimize("", on)
1802 #endif
1803 #endif
1804 
1805 void StmtProfiler::VisitCXXMemberCallExpr(const CXXMemberCallExpr *S) {
1806  VisitCallExpr(S);
1807 }
1808 
1809 void StmtProfiler::VisitCUDAKernelCallExpr(const CUDAKernelCallExpr *S) {
1810  VisitCallExpr(S);
1811 }
1812 
1813 void StmtProfiler::VisitAsTypeExpr(const AsTypeExpr *S) {
1814  VisitExpr(S);
1815 }
1816 
1817 void StmtProfiler::VisitCXXNamedCastExpr(const CXXNamedCastExpr *S) {
1818  VisitExplicitCastExpr(S);
1819 }
1820 
1821 void StmtProfiler::VisitCXXStaticCastExpr(const CXXStaticCastExpr *S) {
1822  VisitCXXNamedCastExpr(S);
1823 }
1824 
1825 void StmtProfiler::VisitCXXDynamicCastExpr(const CXXDynamicCastExpr *S) {
1826  VisitCXXNamedCastExpr(S);
1827 }
1828 
1829 void
1830 StmtProfiler::VisitCXXReinterpretCastExpr(const CXXReinterpretCastExpr *S) {
1831  VisitCXXNamedCastExpr(S);
1832 }
1833 
1834 void StmtProfiler::VisitCXXConstCastExpr(const CXXConstCastExpr *S) {
1835  VisitCXXNamedCastExpr(S);
1836 }
1837 
1838 void StmtProfiler::VisitBuiltinBitCastExpr(const BuiltinBitCastExpr *S) {
1839  VisitExpr(S);
1840  VisitType(S->getTypeInfoAsWritten()->getType());
1841 }
1842 
1843 void StmtProfiler::VisitCXXAddrspaceCastExpr(const CXXAddrspaceCastExpr *S) {
1844  VisitCXXNamedCastExpr(S);
1845 }
1846 
1847 void StmtProfiler::VisitUserDefinedLiteral(const UserDefinedLiteral *S) {
1848  VisitCallExpr(S);
1849 }
1850 
1851 void StmtProfiler::VisitCXXBoolLiteralExpr(const CXXBoolLiteralExpr *S) {
1852  VisitExpr(S);
1853  ID.AddBoolean(S->getValue());
1854 }
1855 
1856 void StmtProfiler::VisitCXXNullPtrLiteralExpr(const CXXNullPtrLiteralExpr *S) {
1857  VisitExpr(S);
1858 }
1859 
1860 void StmtProfiler::VisitCXXStdInitializerListExpr(
1861  const CXXStdInitializerListExpr *S) {
1862  VisitExpr(S);
1863 }
1864 
1865 void StmtProfiler::VisitCXXTypeidExpr(const CXXTypeidExpr *S) {
1866  VisitExpr(S);
1867  if (S->isTypeOperand())
1868  VisitType(S->getTypeOperandSourceInfo()->getType());
1869 }
1870 
1871 void StmtProfiler::VisitCXXUuidofExpr(const CXXUuidofExpr *S) {
1872  VisitExpr(S);
1873  if (S->isTypeOperand())
1874  VisitType(S->getTypeOperandSourceInfo()->getType());
1875 }
1876 
1877 void StmtProfiler::VisitMSPropertyRefExpr(const MSPropertyRefExpr *S) {
1878  VisitExpr(S);
1879  VisitDecl(S->getPropertyDecl());
1880 }
1881 
1882 void StmtProfiler::VisitMSPropertySubscriptExpr(
1883  const MSPropertySubscriptExpr *S) {
1884  VisitExpr(S);
1885 }
1886 
1887 void StmtProfiler::VisitCXXThisExpr(const CXXThisExpr *S) {
1888  VisitExpr(S);
1889  ID.AddBoolean(S->isImplicit());
1890 }
1891 
1892 void StmtProfiler::VisitCXXThrowExpr(const CXXThrowExpr *S) {
1893  VisitExpr(S);
1894 }
1895 
1896 void StmtProfiler::VisitCXXDefaultArgExpr(const CXXDefaultArgExpr *S) {
1897  VisitExpr(S);
1898  VisitDecl(S->getParam());
1899 }
1900 
1901 void StmtProfiler::VisitCXXDefaultInitExpr(const CXXDefaultInitExpr *S) {
1902  VisitExpr(S);
1903  VisitDecl(S->getField());
1904 }
1905 
1906 void StmtProfiler::VisitCXXBindTemporaryExpr(const CXXBindTemporaryExpr *S) {
1907  VisitExpr(S);
1908  VisitDecl(
1909  const_cast<CXXDestructorDecl *>(S->getTemporary()->getDestructor()));
1910 }
1911 
1912 void StmtProfiler::VisitCXXConstructExpr(const CXXConstructExpr *S) {
1913  VisitExpr(S);
1914  VisitDecl(S->getConstructor());
1915  ID.AddBoolean(S->isElidable());
1916 }
1917 
1918 void StmtProfiler::VisitCXXInheritedCtorInitExpr(
1919  const CXXInheritedCtorInitExpr *S) {
1920  VisitExpr(S);
1921  VisitDecl(S->getConstructor());
1922 }
1923 
1924 void StmtProfiler::VisitCXXFunctionalCastExpr(const CXXFunctionalCastExpr *S) {
1925  VisitExplicitCastExpr(S);
1926 }
1927 
1928 void
1929 StmtProfiler::VisitCXXTemporaryObjectExpr(const CXXTemporaryObjectExpr *S) {
1930  VisitCXXConstructExpr(S);
1931 }
1932 
1933 void
1934 StmtProfiler::VisitLambdaExpr(const LambdaExpr *S) {
1935  VisitExpr(S);
1936  // C++20 [temp.over.link]p5:
1937  // Two lambda-expressions are never considered equivalent.
1938  VisitDecl(S->getLambdaClass());
1939 }
1940 
1941 void
1942 StmtProfiler::VisitCXXScalarValueInitExpr(const CXXScalarValueInitExpr *S) {
1943  VisitExpr(S);
1944 }
1945 
1946 void StmtProfiler::VisitCXXDeleteExpr(const CXXDeleteExpr *S) {
1947  VisitExpr(S);
1948  ID.AddBoolean(S->isGlobalDelete());
1949  ID.AddBoolean(S->isArrayForm());
1950  VisitDecl(S->getOperatorDelete());
1951 }
1952 
1953 void StmtProfiler::VisitCXXNewExpr(const CXXNewExpr *S) {
1954  VisitExpr(S);
1955  VisitType(S->getAllocatedType());
1956  VisitDecl(S->getOperatorNew());
1957  VisitDecl(S->getOperatorDelete());
1958  ID.AddBoolean(S->isArray());
1959  ID.AddInteger(S->getNumPlacementArgs());
1960  ID.AddBoolean(S->isGlobalNew());
1961  ID.AddBoolean(S->isParenTypeId());
1962  ID.AddInteger(S->getInitializationStyle());
1963 }
1964 
1965 void
1966 StmtProfiler::VisitCXXPseudoDestructorExpr(const CXXPseudoDestructorExpr *S) {
1967  VisitExpr(S);
1968  ID.AddBoolean(S->isArrow());
1969  VisitNestedNameSpecifier(S->getQualifier());
1970  ID.AddBoolean(S->getScopeTypeInfo() != nullptr);
1971  if (S->getScopeTypeInfo())
1972  VisitType(S->getScopeTypeInfo()->getType());
1973  ID.AddBoolean(S->getDestroyedTypeInfo() != nullptr);
1974  if (S->getDestroyedTypeInfo())
1975  VisitType(S->getDestroyedType());
1976  else
1977  VisitIdentifierInfo(S->getDestroyedTypeIdentifier());
1978 }
1979 
1980 void StmtProfiler::VisitOverloadExpr(const OverloadExpr *S) {
1981  VisitExpr(S);
1982  VisitNestedNameSpecifier(S->getQualifier());
1983  VisitName(S->getName(), /*TreatAsDecl*/ true);
1984  ID.AddBoolean(S->hasExplicitTemplateArgs());
1985  if (S->hasExplicitTemplateArgs())
1986  VisitTemplateArguments(S->getTemplateArgs(), S->getNumTemplateArgs());
1987 }
1988 
1989 void
1990 StmtProfiler::VisitUnresolvedLookupExpr(const UnresolvedLookupExpr *S) {
1991  VisitOverloadExpr(S);
1992 }
1993 
1994 void StmtProfiler::VisitTypeTraitExpr(const TypeTraitExpr *S) {
1995  VisitExpr(S);
1996  ID.AddInteger(S->getTrait());
1997  ID.AddInteger(S->getNumArgs());
1998  for (unsigned I = 0, N = S->getNumArgs(); I != N; ++I)
1999  VisitType(S->getArg(I)->getType());
2000 }
2001 
2002 void StmtProfiler::VisitArrayTypeTraitExpr(const ArrayTypeTraitExpr *S) {
2003  VisitExpr(S);
2004  ID.AddInteger(S->getTrait());
2005  VisitType(S->getQueriedType());
2006 }
2007 
2008 void StmtProfiler::VisitExpressionTraitExpr(const ExpressionTraitExpr *S) {
2009  VisitExpr(S);
2010  ID.AddInteger(S->getTrait());
2011  VisitExpr(S->getQueriedExpression());
2012 }
2013 
2014 void StmtProfiler::VisitDependentScopeDeclRefExpr(
2015  const DependentScopeDeclRefExpr *S) {
2016  VisitExpr(S);
2017  VisitName(S->getDeclName());
2018  VisitNestedNameSpecifier(S->getQualifier());
2019  ID.AddBoolean(S->hasExplicitTemplateArgs());
2020  if (S->hasExplicitTemplateArgs())
2021  VisitTemplateArguments(S->getTemplateArgs(), S->getNumTemplateArgs());
2022 }
2023 
2024 void StmtProfiler::VisitExprWithCleanups(const ExprWithCleanups *S) {
2025  VisitExpr(S);
2026 }
2027 
2028 void StmtProfiler::VisitCXXUnresolvedConstructExpr(
2029  const CXXUnresolvedConstructExpr *S) {
2030  VisitExpr(S);
2031  VisitType(S->getTypeAsWritten());
2032  ID.AddInteger(S->isListInitialization());
2033 }
2034 
2035 void StmtProfiler::VisitCXXDependentScopeMemberExpr(
2036  const CXXDependentScopeMemberExpr *S) {
2037  ID.AddBoolean(S->isImplicitAccess());
2038  if (!S->isImplicitAccess()) {
2039  VisitExpr(S);
2040  ID.AddBoolean(S->isArrow());
2041  }
2042  VisitNestedNameSpecifier(S->getQualifier());
2043  VisitName(S->getMember());
2044  ID.AddBoolean(S->hasExplicitTemplateArgs());
2045  if (S->hasExplicitTemplateArgs())
2046  VisitTemplateArguments(S->getTemplateArgs(), S->getNumTemplateArgs());
2047 }
2048 
2049 void StmtProfiler::VisitUnresolvedMemberExpr(const UnresolvedMemberExpr *S) {
2050  ID.AddBoolean(S->isImplicitAccess());
2051  if (!S->isImplicitAccess()) {
2052  VisitExpr(S);
2053  ID.AddBoolean(S->isArrow());
2054  }
2055  VisitNestedNameSpecifier(S->getQualifier());
2056  VisitName(S->getMemberName());
2057  ID.AddBoolean(S->hasExplicitTemplateArgs());
2058  if (S->hasExplicitTemplateArgs())
2059  VisitTemplateArguments(S->getTemplateArgs(), S->getNumTemplateArgs());
2060 }
2061 
2062 void StmtProfiler::VisitCXXNoexceptExpr(const CXXNoexceptExpr *S) {
2063  VisitExpr(S);
2064 }
2065 
2066 void StmtProfiler::VisitPackExpansionExpr(const PackExpansionExpr *S) {
2067  VisitExpr(S);
2068 }
2069 
2070 void StmtProfiler::VisitSizeOfPackExpr(const SizeOfPackExpr *S) {
2071  VisitExpr(S);
2072  VisitDecl(S->getPack());
2073  if (S->isPartiallySubstituted()) {
2074  auto Args = S->getPartialArguments();
2075  ID.AddInteger(Args.size());
2076  for (const auto &TA : Args)
2077  VisitTemplateArgument(TA);
2078  } else {
2079  ID.AddInteger(0);
2080  }
2081 }
2082 
2083 void StmtProfiler::VisitSubstNonTypeTemplateParmPackExpr(
2085  VisitExpr(S);
2086  VisitDecl(S->getParameterPack());
2087  VisitTemplateArgument(S->getArgumentPack());
2088 }
2089 
2090 void StmtProfiler::VisitSubstNonTypeTemplateParmExpr(
2091  const SubstNonTypeTemplateParmExpr *E) {
2092  // Profile exactly as the replacement expression.
2093  Visit(E->getReplacement());
2094 }
2095 
2096 void StmtProfiler::VisitFunctionParmPackExpr(const FunctionParmPackExpr *S) {
2097  VisitExpr(S);
2098  VisitDecl(S->getParameterPack());
2099  ID.AddInteger(S->getNumExpansions());
2100  for (FunctionParmPackExpr::iterator I = S->begin(), E = S->end(); I != E; ++I)
2101  VisitDecl(*I);
2102 }
2103 
2104 void StmtProfiler::VisitMaterializeTemporaryExpr(
2105  const MaterializeTemporaryExpr *S) {
2106  VisitExpr(S);
2107 }
2108 
2109 void StmtProfiler::VisitCXXFoldExpr(const CXXFoldExpr *S) {
2110  VisitExpr(S);
2111  ID.AddInteger(S->getOperator());
2112 }
2113 
2114 void StmtProfiler::VisitCoroutineBodyStmt(const CoroutineBodyStmt *S) {
2115  VisitStmt(S);
2116 }
2117 
2118 void StmtProfiler::VisitCoreturnStmt(const CoreturnStmt *S) {
2119  VisitStmt(S);
2120 }
2121 
2122 void StmtProfiler::VisitCoawaitExpr(const CoawaitExpr *S) {
2123  VisitExpr(S);
2124 }
2125 
2126 void StmtProfiler::VisitDependentCoawaitExpr(const DependentCoawaitExpr *S) {
2127  VisitExpr(S);
2128 }
2129 
2130 void StmtProfiler::VisitCoyieldExpr(const CoyieldExpr *S) {
2131  VisitExpr(S);
2132 }
2133 
2134 void StmtProfiler::VisitOpaqueValueExpr(const OpaqueValueExpr *E) {
2135  VisitExpr(E);
2136 }
2137 
2138 void StmtProfiler::VisitTypoExpr(const TypoExpr *E) {
2139  VisitExpr(E);
2140 }
2141 
2142 void StmtProfiler::VisitSourceLocExpr(const SourceLocExpr *E) {
2143  VisitExpr(E);
2144 }
2145 
2146 void StmtProfiler::VisitRecoveryExpr(const RecoveryExpr *E) { VisitExpr(E); }
2147 
2148 void StmtProfiler::VisitObjCStringLiteral(const ObjCStringLiteral *S) {
2149  VisitExpr(S);
2150 }
2151 
2152 void StmtProfiler::VisitObjCBoxedExpr(const ObjCBoxedExpr *E) {
2153  VisitExpr(E);
2154 }
2155 
2156 void StmtProfiler::VisitObjCArrayLiteral(const ObjCArrayLiteral *E) {
2157  VisitExpr(E);
2158 }
2159 
2160 void StmtProfiler::VisitObjCDictionaryLiteral(const ObjCDictionaryLiteral *E) {
2161  VisitExpr(E);
2162 }
2163 
2164 void StmtProfiler::VisitObjCEncodeExpr(const ObjCEncodeExpr *S) {
2165  VisitExpr(S);
2166  VisitType(S->getEncodedType());
2167 }
2168 
2169 void StmtProfiler::VisitObjCSelectorExpr(const ObjCSelectorExpr *S) {
2170  VisitExpr(S);
2171  VisitName(S->getSelector());
2172 }
2173 
2174 void StmtProfiler::VisitObjCProtocolExpr(const ObjCProtocolExpr *S) {
2175  VisitExpr(S);
2176  VisitDecl(S->getProtocol());
2177 }
2178 
2179 void StmtProfiler::VisitObjCIvarRefExpr(const ObjCIvarRefExpr *S) {
2180  VisitExpr(S);
2181  VisitDecl(S->getDecl());
2182  ID.AddBoolean(S->isArrow());
2183  ID.AddBoolean(S->isFreeIvar());
2184 }
2185 
2186 void StmtProfiler::VisitObjCPropertyRefExpr(const ObjCPropertyRefExpr *S) {
2187  VisitExpr(S);
2188  if (S->isImplicitProperty()) {
2189  VisitDecl(S->getImplicitPropertyGetter());
2190  VisitDecl(S->getImplicitPropertySetter());
2191  } else {
2192  VisitDecl(S->getExplicitProperty());
2193  }
2194  if (S->isSuperReceiver()) {
2195  ID.AddBoolean(S->isSuperReceiver());
2196  VisitType(S->getSuperReceiverType());
2197  }
2198 }
2199 
2200 void StmtProfiler::VisitObjCSubscriptRefExpr(const ObjCSubscriptRefExpr *S) {
2201  VisitExpr(S);
2202  VisitDecl(S->getAtIndexMethodDecl());
2203  VisitDecl(S->setAtIndexMethodDecl());
2204 }
2205 
2206 void StmtProfiler::VisitObjCMessageExpr(const ObjCMessageExpr *S) {
2207  VisitExpr(S);
2208  VisitName(S->getSelector());
2209  VisitDecl(S->getMethodDecl());
2210 }
2211 
2212 void StmtProfiler::VisitObjCIsaExpr(const ObjCIsaExpr *S) {
2213  VisitExpr(S);
2214  ID.AddBoolean(S->isArrow());
2215 }
2216 
2217 void StmtProfiler::VisitObjCBoolLiteralExpr(const ObjCBoolLiteralExpr *S) {
2218  VisitExpr(S);
2219  ID.AddBoolean(S->getValue());
2220 }
2221 
2222 void StmtProfiler::VisitObjCIndirectCopyRestoreExpr(
2223  const ObjCIndirectCopyRestoreExpr *S) {
2224  VisitExpr(S);
2225  ID.AddBoolean(S->shouldCopy());
2226 }
2227 
2228 void StmtProfiler::VisitObjCBridgedCastExpr(const ObjCBridgedCastExpr *S) {
2229  VisitExplicitCastExpr(S);
2230  ID.AddBoolean(S->getBridgeKind());
2231 }
2232 
2233 void StmtProfiler::VisitObjCAvailabilityCheckExpr(
2234  const ObjCAvailabilityCheckExpr *S) {
2235  VisitExpr(S);
2236 }
2237 
2238 void StmtProfiler::VisitTemplateArguments(const TemplateArgumentLoc *Args,
2239  unsigned NumArgs) {
2240  ID.AddInteger(NumArgs);
2241  for (unsigned I = 0; I != NumArgs; ++I)
2242  VisitTemplateArgument(Args[I].getArgument());
2243 }
2244 
2245 void StmtProfiler::VisitTemplateArgument(const TemplateArgument &Arg) {
2246  // Mostly repetitive with TemplateArgument::Profile!
2247  ID.AddInteger(Arg.getKind());
2248  switch (Arg.getKind()) {
2250  break;
2251 
2253  VisitType(Arg.getAsType());
2254  break;
2255 
2258  VisitTemplateName(Arg.getAsTemplateOrTemplatePattern());
2259  break;
2260 
2262  VisitType(Arg.getParamTypeForDecl());
2263  // FIXME: Do we need to recursively decompose template parameter objects?
2264  VisitDecl(Arg.getAsDecl());
2265  break;
2266 
2268  VisitType(Arg.getNullPtrType());
2269  break;
2270 
2272  VisitType(Arg.getIntegralType());
2273  Arg.getAsIntegral().Profile(ID);
2274  break;
2275 
2277  Visit(Arg.getAsExpr());
2278  break;
2279 
2281  for (const auto &P : Arg.pack_elements())
2282  VisitTemplateArgument(P);
2283  break;
2284  }
2285 }
2286 
2287 void Stmt::Profile(llvm::FoldingSetNodeID &ID, const ASTContext &Context,
2288  bool Canonical) const {
2289  StmtProfilerWithPointers Profiler(ID, Context, Canonical);
2290  Profiler.Visit(this);
2291 }
2292 
2293 void Stmt::ProcessODRHash(llvm::FoldingSetNodeID &ID,
2294  class ODRHash &Hash) const {
2295  StmtProfilerWithoutPointers Profiler(ID, Hash);
2296  Profiler.Visit(this);
2297 }
clang::ArrayInitIndexExpr
Represents the index of the current element of an array being initialized by an ArrayInitLoopExpr.
Definition: Expr.h:5469
clang::BuiltinType
This class is used for builtin types like 'int'.
Definition: Type.h:2493
clang::IndirectGotoStmt
IndirectGotoStmt - This represents an indirect goto.
Definition: Stmt.h:2644
clang::LabelStmt
LabelStmt - Represents a label, which has a substatement.
Definition: Stmt.h:1799
clang::ExpressionTraitExpr
An expression trait intrinsic.
Definition: ExprCXX.h:2823
clang::OMPForDirective
This represents '#pragma omp for' directive.
Definition: StmtOpenMP.h:1607
clang::OMPPartialClause
Representation of the 'partial' clause of the '#pragma omp unroll' directive.
Definition: OpenMPClause.h:941
clang::OMPIteratorExpr
OpenMP 5.0 [2.1.6 Iterators] Iterators are identifiers that expand to multiple values in the clause o...
Definition: ExprOpenMP.h:272
clang::MatrixSubscriptExpr
MatrixSubscriptExpr - Matrix subscript expression for the MatrixType extension.
Definition: Expr.h:2717
clang::SubstNonTypeTemplateParmExpr
Represents a reference to a non-type template parameter that has been substituted with a template arg...
Definition: ExprCXX.h:4245
clang::AtomicExpr
AtomicExpr - Variadic atomic builtins: __atomic_exchange, __atomic_fetch_*, __atomic_load,...
Definition: Expr.h:6229
clang::OMPMasterTaskLoopSimdDirective
This represents '#pragma omp master taskloop simd' directive.
Definition: StmtOpenMP.h:3724
clang::CaseStmt
CaseStmt - Represent a case statement.
Definition: Stmt.h:1567
clang::OMPTaskyieldDirective
This represents '#pragma omp taskyield' directive.
Definition: StmtOpenMP.h:2438
clang::ImaginaryLiteral
ImaginaryLiteral - We support imaginary integer and floating point literals, like "1....
Definition: Expr.h:1712
clang::OMPDestroyClause
This represents 'destroy' clause in the '#pragma omp depobj' directive or the '#pragma omp interop' d...
Definition: OpenMPClause.h:7681
clang::OMPLastprivateClause
This represents clause 'lastprivate' in the '#pragma omp ...' directives.
Definition: OpenMPClause.h:2611
clang::ArrayTypeTraitExpr
An Embarcadero array type trait, as used in the implementation of __array_rank and __array_extent.
Definition: ExprCXX.h:2753
clang::ObjCBoxedExpr
ObjCBoxedExpr - used for generalized expression boxing.
Definition: ExprObjC.h:128
clang::CXXBoolLiteralExpr
A boolean literal, per ([C++ lex.bool] Boolean literals).
Definition: ExprCXX.h:721
clang::AsTypeExpr
AsTypeExpr - Clang builtin function __builtin_astype [OpenCL 6.2.4.2] This AST node provides support ...
Definition: Expr.h:6026
clang::ODRHash::AddDecl
void AddDecl(const Decl *D)
Definition: ODRHash.cpp:630
clang::OffsetOfExpr
OffsetOfExpr - [C99 7.17] - This represents an expression of the form offsetof(record-type,...
Definition: Expr.h:2438
clang::OMPUsesAllocatorsClause::Data::Allocator
Expr * Allocator
Allocator.
Definition: OpenMPClause.h:8127
clang::concepts::ExprRequirement::ReturnTypeRequirement::getTypeConstraint
const TypeConstraint * getTypeConstraint() const
Definition: ExprConcepts.cpp:136
clang::CXXPseudoDestructorExpr
Represents a C++ pseudo-destructor (C++ [expr.pseudo]).
Definition: ExprCXX.h:2517
clang::ConstOMPClauseVisitor
Definition: OpenMPClause.h:8447
clang::OMPPriorityClause
This represents 'priority' clause in the '#pragma omp ...' directive.
Definition: OpenMPClause.h:5989
clang::OMPTileDirective
This represents the '#pragma omp tile' loop transformation directive.
Definition: StmtOpenMP.h:5056
clang::SwitchStmt
SwitchStmt - This represents a 'switch' stmt.
Definition: Stmt.h:2150
clang::GenericSelectionExpr::ConstAssociation
AssociationTy< true > ConstAssociation
Definition: Expr.h:5781
clang::OMPMaskedDirective
This represents '#pragma omp masked' directive.
Definition: StmtOpenMP.h:5383
clang::WhileStmt
WhileStmt - This represents a 'while' stmt.
Definition: Stmt.h:2341
clang::NullStmt
NullStmt - This is the null statement ";": C99 6.8.3p3.
Definition: Stmt.h:1364
clang::OMPInitClause
This represents the 'init' clause in '#pragma omp ...' directives.
Definition: OpenMPClause.h:7483
clang::TemplateArgument::getAsTemplateOrTemplatePattern
TemplateName getAsTemplateOrTemplatePattern() const
Retrieve the template argument as a template name; if the argument is a pack expansion,...
Definition: TemplateBase.h:300
clang::CXXReinterpretCastExpr
A C++ reinterpret_cast expression (C++ [expr.reinterpret.cast]).
Definition: ExprCXX.h:521
clang::TemplateArgument::pack_elements
ArrayRef< TemplateArgument > pack_elements() const
Iterator range referencing all of the elements of a template argument pack.
Definition: TemplateBase.h:366
clang::TemplateArgument::Null
@ Null
Represents an empty template argument, e.g., one that has not been deduced.
Definition: TemplateBase.h:68
clang::OMPParallelMasterTaskLoopDirective
This represents '#pragma omp parallel master taskloop' directive.
Definition: StmtOpenMP.h:3790
clang::OMPDepobjClause
This represents implicit clause 'depobj' for the '#pragma omp depobj' directive.
Definition: OpenMPClause.h:4542
clang::DesignatedInitExpr
Represents a C99 designated initializer expression.
Definition: Expr.h:5024
clang::OMPTargetTeamsDistributeDirective
This represents '#pragma omp target teams distribute' combined directive.
Definition: StmtOpenMP.h:4763
clang::SubstNonTypeTemplateParmPackExpr
Represents a reference to a non-type template parameter pack that has been substituted with a non-tem...
Definition: ExprCXX.h:4312
clang::OMPTargetTeamsDistributeSimdDirective
This represents '#pragma omp target teams distribute simd' combined directive.
Definition: StmtOpenMP.h:4998
clang::OMPDefaultmapClause
This represents 'defaultmap' clause in the '#pragma omp ...' directive.
Definition: OpenMPClause.h:6422
clang::OMPCanonicalLoop
Representation of an OpenMP canonical loop.
Definition: StmtOpenMP.h:142
clang::MSPropertyRefExpr
A member reference to an MSPropertyDecl.
Definition: ExprCXX.h:923
clang::ODRHash::AddDeclarationName
void AddDeclarationName(DeclarationName Name, bool TreatAsDecl=false)
Definition: ODRHash.cpp:34
clang::ParenListExpr
Definition: Expr.h:5532
clang::OffsetOfNode::getKind
Kind getKind() const
Determine what kind of offsetof node this is.
Definition: Expr.h:2388
clang::TemplateArgument::getIntegralType
QualType getIntegralType() const
Retrieve the type of the integral value.
Definition: TemplateBase.h:327
clang::OMPThreadsClause
This represents 'threads' clause in the '#pragma omp ...' directive.
Definition: OpenMPClause.h:4860
clang::OMPMasterDirective
This represents '#pragma omp master' directive.
Definition: StmtOpenMP.h:1950
clang::OMPAllocatorClause
This represents 'allocator' clause in the '#pragma omp ...' directive.
Definition: OpenMPClause.h:269
clang::Stmt::StmtClass
StmtClass
Definition: Stmt.h:71
clang::OMPIfClause
This represents 'if' clause in the '#pragma omp ...' directive.
Definition: OpenMPClause.h:429
clang::NoInitExpr
Represents a place-holder for an object not to be initialized by anything.
Definition: Expr.h:5325
clang::OMPLinearClause
This represents clause 'linear' in the '#pragma omp ...' directives.
Definition: OpenMPClause.h:3745
clang::OMPCopyinClause
This represents clause 'copyin' in the '#pragma omp ...' directives.
Definition: OpenMPClause.h:4120
clang::OMPPrivateClause
This represents clause 'private' in the '#pragma omp ...' directives.
Definition: OpenMPClause.h:2364
clang::OffsetOfNode::Array
@ Array
An index into an array.
Definition: Expr.h:2339
clang::OMPTaskwaitDirective
This represents '#pragma omp taskwait' directive.
Definition: StmtOpenMP.h:2530
clang::TemplateArgument::getParamTypeForDecl
QualType getParamTypeForDecl() const
Definition: TemplateBase.h:281
clang::UnresolvedMemberExpr
Represents a C++ member access expression for which lookup produced a set of overloaded functions.
Definition: ExprCXX.h:3810
clang::QualType
A (possibly-)qualified type.
Definition: Type.h:673
clang::concepts::ExprRequirement::ReturnTypeRequirement::isEmpty
bool isEmpty() const
Definition: ExprConcepts.h:304
clang::NonTypeTemplateParmDecl
NonTypeTemplateParmDecl - Declares a non-type template parameter, e.g., "Size" in.
Definition: DeclTemplate.h:1384
clang::ObjCBridgedCastExpr
An Objective-C "bridged" cast expression, which casts between Objective-C pointers and C pointers,...
Definition: ExprObjC.h:1625
AttributeLangSupport::C
@ C
Definition: SemaDeclAttr.cpp:54
clang::TypeConstraint::getImmediatelyDeclaredConstraint
Expr * getImmediatelyDeclaredConstraint() const
Get the immediately-declared constraint expression introduced by this type-constraint,...
Definition: ASTConcept.h:187
clang::NestedNameSpecifier
Represents a C++ nested name specifier, such as "\::std::vector<int>::".
Definition: NestedNameSpecifier.h:50
clang::OMPSectionDirective
This represents '#pragma omp section' directive.
Definition: StmtOpenMP.h:1837
clang::TypeTraitExpr
A type trait used in the implementation of various C++11 and Library TR1 trait templates.
Definition: ExprCXX.h:2665
clang::CXXTypeidExpr
A C++ typeid expression (C++ [expr.typeid]), which gets the type_info that corresponds to the supplie...
Definition: ExprCXX.h:839
clang::RequiresExpr
C++2a [expr.prim.req]: A requires-expression provides a concise way to express requirements on templa...
Definition: ExprConcepts.h:475
clang::ParmVarDecl
Represents a parameter to a function.
Definition: Decl.h:1665
DeclCXX.h
clang::OMPTeamsDistributeSimdDirective
This represents '#pragma omp teams distribute simd' combined directive.
Definition: StmtOpenMP.h:4480
clang::OMPAtomicDefaultMemOrderClause
This represents 'atomic_default_mem_order' clause in the '#pragma omp requires' directive.
Definition: OpenMPClause.h:1408
clang::TemplateArgument::Declaration
@ Declaration
The template argument is a declaration that was provided for a pointer, reference,...
Definition: TemplateBase.h:75
clang::CXXNewExpr
Represents a new-expression for memory allocation and constructor calls, e.g: "new CXXNewExpr(foo)".
Definition: ExprCXX.h:2139
clang::OMPDistScheduleClause
This represents 'dist_schedule' clause in the '#pragma omp ...' directive.
Definition: OpenMPClause.h:6303
clang::OMPClauseWithPostUpdate
Class that handles post-update expression for some clauses, like 'lastprivate', 'reduction' etc.
Definition: OpenMPClause.h:149
clang::IfStmt
IfStmt - This represents an if/then/else.
Definition: Stmt.h:1904
clang::ObjCAtTryStmt
Represents Objective-C's @try ... @catch ... @finally statement.
Definition: StmtObjC.h:165
clang::RecoveryExpr
Frontend produces RecoveryExprs on semantic errors that prevent creating other well-formed expression...
Definition: Expr.h:6412
clang::OMPSeqCstClause
This represents 'seq_cst' clause in the '#pragma omp atomic' directive.
Definition: OpenMPClause.h:2159
clang::GotoStmt
GotoStmt - This represents a direct goto.
Definition: Stmt.h:2605
clang::OMPMapClause
This represents clause 'map' in the '#pragma omp ...' directives.
Definition: OpenMPClause.h:5582
clang::InitListExpr
Describes an C or C++ initializer list.
Definition: Expr.h:4786
clang::OffsetOfNode::getFieldName
IdentifierInfo * getFieldName() const
For a field or identifier offsetof node, returns the name of the field.
Definition: Expr.cpp:1606
clang::OMPLoopTransformationDirective
The base class for all loop transformation directives.
Definition: StmtOpenMP.h:959
clang::OMPInReductionClause
This represents clause 'in_reduction' in the '#pragma omp task' directives.
Definition: OpenMPClause.h:3489
getArgument
static const TemplateArgument & getArgument(const TemplateArgument &A)
Definition: TypePrinter.cpp:1849
clang::UnaryOperator
UnaryOperator - This represents the unary-expression's (except sizeof and alignof),...
Definition: Expr.h:2157
clang::OMPReductionClause
This represents clause 'reduction' in the '#pragma omp ...' directives.
Definition: OpenMPClause.h:2922
clang::Stmt::ProcessODRHash
void ProcessODRHash(llvm::FoldingSetNodeID &ID, ODRHash &Hash) const
Calculate a unique representation for a statement that is stable across compiler invocations.
Definition: StmtProfile.cpp:2293
clang::OMPUnifiedAddressClause
This represents 'unified_address' clause in the '#pragma omp requires' directive.
Definition: OpenMPClause.h:1236
clang::concepts::ExprRequirement::ReturnTypeRequirement::isTypeConstraint
bool isTypeConstraint() const
Definition: ExprConcepts.h:313
clang::CoreturnStmt
Represents a 'co_return' statement in the C++ Coroutines TS.
Definition: StmtCXX.h:456
clang::OMPUsesAllocatorsClause::Data::AllocatorTraits
Expr * AllocatorTraits
Allocator traits.
Definition: OpenMPClause.h:8129
ExprOpenMP.h
clang::CXXStaticCastExpr
A C++ static_cast expression (C++ [expr.static.cast]).
Definition: ExprCXX.h:431
clang::ObjCForCollectionStmt
Represents Objective-C's collection statement.
Definition: StmtObjC.h:23
clang::ArrayInitLoopExpr
Represents a loop initializing the elements of an array.
Definition: Expr.h:5416
clang::OMPInclusiveClause
This represents clause 'inclusive' in the '#pragma omp scan' directive.
Definition: OpenMPClause.h:7970
clang::TemplateArgument::getAsExpr
Expr * getAsExpr() const
Retrieve the template argument as an expression.
Definition: TemplateBase.h:342
clang::OMPUseDeviceAddrClause
This represents clause 'use_device_addr' in the '#pragma omp ...' directives.
Definition: OpenMPClause.h:7103
clang::OMPReleaseClause
This represents 'release' clause in the '#pragma omp atomic|flush' directives.
Definition: OpenMPClause.h:2282
clang::DeclarationName
The name of a declaration.
Definition: DeclarationName.h:145
clang::OMPSharedClause
This represents clause 'shared' in the '#pragma omp ...' directives.
Definition: OpenMPClause.h:2849
clang::TemplateArgument::Expression
@ Expression
The template argument is an expression, and we've not resolved it to one of the other forms yet,...
Definition: TemplateBase.h:97
clang::TemplateArgument::getAsIntegral
llvm::APSInt getAsIntegral() const
Retrieve the template argument as an integral value.
Definition: TemplateBase.h:313
clang::OMPTargetTeamsDistributeParallelForDirective
This represents '#pragma omp target teams distribute parallel for' combined directive.
Definition: StmtOpenMP.h:4829
clang::OpaqueValueExpr
OpaqueValueExpr - An expression referring to an opaque object of a fixed type and value class.
Definition: Expr.h:1129
clang::OMPScheduleClause
This represents 'schedule' clause in the '#pragma omp ...' directive.
Definition: OpenMPClause.h:1497
clang::SEHTryStmt
Definition: Stmt.h:3408
clang::OMPCollapseClause
This represents 'collapse' clause in the '#pragma omp ...' directive.
Definition: OpenMPClause.h:1010
clang::CXXFoldExpr
Represents a folding of a pack over an operator.
Definition: ExprCXX.h:4574
clang::ObjCSubscriptRefExpr
ObjCSubscriptRefExpr - used for array and dictionary subscripting.
Definition: ExprObjC.h:841
clang::ObjCBoolLiteralExpr
ObjCBoolLiteralExpr - Objective-C Boolean Literal.
Definition: ExprObjC.h:88
clang::OMPAllocateClause
This represents clause 'allocate' in the '#pragma omp ...' directives.
Definition: OpenMPClause.h:332
DecodeOperatorCall
static Stmt::StmtClass DecodeOperatorCall(const CXXOperatorCallExpr *S, UnaryOperatorKind &UnaryOp, BinaryOperatorKind &BinaryOp)
Definition: StmtProfile.cpp:1554
clang::OMPTaskgroupDirective
This represents '#pragma omp taskgroup' directive.
Definition: StmtOpenMP.h:2576
clang::ObjCIndirectCopyRestoreExpr
ObjCIndirectCopyRestoreExpr - Represents the passing of a function argument by indirect copy-restore ...
Definition: ExprObjC.h:1566
clang::ConditionalOperator
ConditionalOperator - The ?: ternary operator.
Definition: Expr.h:4141
clang::CXXThrowExpr
A C++ throw-expression (C++ [except.throw]).
Definition: ExprCXX.h:1181
clang::OMPUseDevicePtrClause
This represents clause 'use_device_ptr' in the '#pragma omp ...' directives.
Definition: OpenMPClause.h:6939
clang::ObjCArrayLiteral
ObjCArrayLiteral - used for objective-c array containers; as in: @["Hello", NSApp,...
Definition: ExprObjC.h:190
DeclObjC.h
clang::TemplateArgument::Integral
@ Integral
The template argument is an integral value stored in an llvm::APSInt that was provided for an integra...
Definition: TemplateBase.h:83
clang::ObjCPropertyRefExpr
ObjCPropertyRefExpr - A dot-syntax expression to access an ObjC property.
Definition: ExprObjC.h:614
clang::OMPAlignedClause
This represents clause 'aligned' in the '#pragma omp ...' directives.
Definition: OpenMPClause.h:4022
clang::CXXTemporaryObjectExpr
Represents a C++ functional cast expression that builds a temporary object.
Definition: ExprCXX.h:1797
clang::OMPNocontextClause
This represents 'nocontext' clause in the '#pragma omp ...' directive.
Definition: OpenMPClause.h:7839
clang::FunctionParmPackExpr
Represents a reference to a function parameter pack or init-capture pack that has been substituted bu...
Definition: ExprCXX.h:4380
clang::OMPOrderedClause
This represents 'ordered' clause in the '#pragma omp ...' directive.
Definition: OpenMPClause.h:1690
clang::FixedPointLiteral
Definition: Expr.h:1531
clang::OMPTargetExitDataDirective
This represents '#pragma omp target exit data' directive.
Definition: StmtOpenMP.h:3109
clang::TemplateArgument::NullPtr
@ NullPtr
The template argument is a null pointer or null pointer to member that was provided for a non-type te...
Definition: TemplateBase.h:79
clang::OMPForSimdDirective
This represents '#pragma omp for simd' directive.
Definition: StmtOpenMP.h:1697
clang::concepts::ExprRequirement::ReturnTypeRequirement::isSubstitutionFailure
bool isSubstitutionFailure() const
Definition: ExprConcepts.h:308
clang::AttributedStmt
Represents an attribute applied to a statement.
Definition: Stmt.h:1846
clang::IntegerLiteral
Definition: Expr.h:1488
clang::OMPProcBindClause
This represents 'proc_bind' clause in the '#pragma omp ...' directive.
Definition: OpenMPClause.h:1154
clang::ObjCAtCatchStmt
Represents Objective-C's @catch statement.
Definition: StmtObjC.h:77
clang::UnaryExprOrTypeTraitExpr
UnaryExprOrTypeTraitExpr - expression with either a type or (unevaluated) expression operand.
Definition: Expr.h:2543
clang::OMPNovariantsClause
This represents 'novariants' clause in the '#pragma omp ...' directive.
Definition: OpenMPClause.h:7768
clang::FloatingLiteral
Definition: Expr.h:1633
clang::TemplateArgument::getKind
ArgKind getKind() const
Return the kind of stored template argument.
Definition: TemplateBase.h:245
clang::CompoundStmt
CompoundStmt - This represents a group of statements like { stmt stmt }.
Definition: Stmt.h:1399
clang::ConvertVectorExpr
ConvertVectorExpr - Clang builtin function __builtin_convertvector This AST node provides support for...
Definition: Expr.h:4461
clang::OMPNumTeamsClause
This represents 'num_teams' clause in the '#pragma omp ...' directive.
Definition: OpenMPClause.h:5836
clang::ObjCSelectorExpr
ObjCSelectorExpr used for @selector in Objective-C.
Definition: ExprObjC.h:454
DeclTemplate.h
clang::MSPropertySubscriptExpr
MS property subscript expression.
Definition: ExprCXX.h:994
clang::CXXAddrspaceCastExpr
A C++ addrspace_cast expression (currently only enabled for OpenCL).
Definition: ExprCXX.h:600
clang::OMPSIMDClause
This represents 'simd' clause in the '#pragma omp ...' directive.
Definition: OpenMPClause.h:4900
clang::OMPParallelMasterDirective
This represents '#pragma omp parallel master' directive.
Definition: StmtOpenMP.h:2231
clang::ODRHash::AddQualType
void AddQualType(QualType T)
Definition: ODRHash.cpp:1124
clang::UnresolvedLookupExpr
A reference to a name which we were able to look up during parsing but could not resolve to a specifi...
Definition: ExprCXX.h:3073
clang::CXXRewrittenBinaryOperator
A rewritten comparison expression that was originally written using operator syntax.
Definition: ExprCXX.h:284
clang::OMPReverseOffloadClause
This represents 'reverse_offload' clause in the '#pragma omp requires' directive.
Definition: OpenMPClause.h:1322
clang::DependentCoawaitExpr
Represents a 'co_await' expression while the type of the promise is dependent.
Definition: ExprCXX.h:4800
clang::SizeOfPackExpr
Represents an expression that computes the length of a parameter pack.
Definition: ExprCXX.h:4127
clang::OMPTaskReductionClause
This represents clause 'task_reduction' in the '#pragma omp taskgroup' directives.
Definition: OpenMPClause.h:3258
Node
DynTypedNode Node
Definition: ASTMatchFinder.cpp:67
clang::CXXBindTemporaryExpr
Represents binding an expression to a temporary.
Definition: ExprCXX.h:1412
clang::Decl::getKind
Kind getKind() const
Definition: DeclBase.h:433
clang::BinaryOperator
A builtin binary operation expression such as "x + y" or "x <= y".
Definition: Expr.h:3803
clang::OMPTeamsDirective
This represents '#pragma omp teams' directive.
Definition: StmtOpenMP.h:3338
clang::LambdaExpr
A C++ lambda expression, which produces a function object (of unspecified type) that can be invoked l...
Definition: ExprCXX.h:1865
clang::OMPLoopDirective
This is a common base class for loop directives ('omp simd', 'omp for', 'omp for simd' etc....
Definition: StmtOpenMP.h:1002
clang::ObjCAtThrowStmt
Represents Objective-C's @throw statement.
Definition: StmtObjC.h:332
clang::SubstNonTypeTemplateParmExpr::getReplacement
Expr * getReplacement() const
Definition: ExprCXX.h:4277
clang::ObjCStringLiteral
ObjCStringLiteral, used for Objective-C string literals i.e.
Definition: ExprObjC.h:52
clang::OMPFullClause
Representation of the 'full' clause of the '#pragma omp unroll' directive.
Definition: OpenMPClause.h:897
clang::ConceptSpecializationExpr
Represents the specialization of a concept - evaluates to a prvalue of type bool.
Definition: ExprConcepts.h:40
clang::OMPScanDirective
This represents '#pragma omp scan' directive.
Definition: StmtOpenMP.h:5212
clang::MaterializeTemporaryExpr
Represents a prvalue temporary that is written into memory so that a reference can bind to it.
Definition: ExprCXX.h:4462
clang::ASTContext
Holds long-lived AST nodes (such as types and decls) that can be referred to throughout the semantic ...
Definition: ASTContext.h:212
clang::ObjCDictionaryLiteral
ObjCDictionaryLiteral - AST node to represent objective-c dictionary literals; as in:"name" : NSUserN...
Definition: ExprObjC.h:306
clang::OMPMetaDirective
This represents '#pragma omp metadirective' directive.
Definition: StmtOpenMP.h:5434
clang::OMPDetachClause
This represents 'detach' clause in the '#pragma omp task' directive.
Definition: OpenMPClause.h:7908
clang::PseudoObjectExpr::const_semantics_iterator
const typedef Expr *const * const_semantics_iterator
Definition: Expr.h:6162
clang::BuiltinBitCastExpr
Represents a C++2a __builtin_bit_cast(T, v) expression.
Definition: ExprCXX.h:4875
clang::OMPDeviceClause
This represents 'device' clause in the '#pragma omp ...' directive.
Definition: OpenMPClause.h:4766
clang::TemplateArgument
Represents a template argument.
Definition: TemplateBase.h:62
clang::concepts::Requirement
A static requirement that can be used in a requires-expression to check properties of types and expre...
Definition: ExprConcepts.h:149
clang::OMPDistributeParallelForSimdDirective
This represents '#pragma omp distribute parallel for simd' composite directive.
Definition: StmtOpenMP.h:4151
clang::ForStmt
ForStmt - This represents a 'for (init;cond;inc)' stmt.
Definition: Stmt.h:2534
clang::ObjCAvailabilityCheckExpr
A runtime availability query.
Definition: ExprObjC.h:1686
clang::OMPDepobjDirective
This represents '#pragma omp depobj' directive.
Definition: StmtOpenMP.h:2695
clang::ODRHash::AddTemplateName
void AddTemplateName(TemplateName Name)
Definition: ODRHash.cpp:138
clang::PseudoObjectExpr
PseudoObjectExpr - An expression which accesses a pseudo-object l-value.
Definition: Expr.h:6095
clang::ObjCAtSynchronizedStmt
Represents Objective-C's @synchronized statement.
Definition: StmtObjC.h:277
clang::Decl::getCanonicalDecl
virtual Decl * getCanonicalDecl()
Retrieves the "canonical" declaration of the given declaration.
Definition: DeclBase.h:901
clang::OffsetOfNode::getField
FieldDecl * getField() const
For a field offsetof node, returns the field.
Definition: Expr.h:2398
clang::OMPNowaitClause
This represents 'nowait' clause in the '#pragma omp ...' directive.
Definition: OpenMPClause.h:1785
clang::BinaryConditionalOperator
BinaryConditionalOperator - The GNU extension to the conditional operator which allows the middle ope...
Definition: Expr.h:4203
clang::OMPUsesAllocatorsClause
This represents clause 'uses_allocators' in the '#pragma omp target'-based directives.
Definition: OpenMPClause.h:8119
clang::CXXDestructorDecl
Represents a C++ destructor within a class.
Definition: DeclCXX.h:2668
clang::TemplateArgumentLoc
Location wrapper for a TemplateArgument.
Definition: TemplateBase.h:458
clang::OMPDynamicAllocatorsClause
This represents 'dynamic_allocators' clause in the '#pragma omp requires' directive.
Definition: OpenMPClause.h:1365
clang::OMPLoopBasedDirective
The base class for all loop-based directives, including loop transformation directives.
Definition: StmtOpenMP.h:682
Expr.h
clang::OMPToClause
This represents clause 'to' in the '#pragma omp ...' directives.
Definition: OpenMPClause.h:6537
clang::ODRHash::AddIdentifierInfo
void AddIdentifierInfo(const IdentifierInfo *II)
Definition: ODRHash.cpp:29
clang::ImplicitValueInitExpr
Represents an implicitly-generated value initialization of an object of a given type.
Definition: Expr.h:5505
clang::TemplateTemplateParmDecl
TemplateTemplateParmDecl - Declares a template template parameter, e.g., "T" in.
Definition: DeclTemplate.h:1601
clang::OMPParallelDirective
This represents '#pragma omp parallel' directive.
Definition: StmtOpenMP.h:611
ASTContext.h
clang::CXXDynamicCastExpr
A C++ dynamic_cast expression (C++ [expr.dynamic.cast]).
Definition: ExprCXX.h:477
clang::OMPParallelForSimdDirective
This represents '#pragma omp parallel for simd' directive.
Definition: StmtOpenMP.h:2166
clang::OMPTaskDirective
This represents '#pragma omp task' directive.
Definition: StmtOpenMP.h:2376
clang::StringLiteral
StringLiteral - This represents a string literal expression, e.g.
Definition: Expr.h:1761
clang::OMPTargetParallelDirective
This represents '#pragma omp target parallel' directive.
Definition: StmtOpenMP.h:3163
clang::ExprWithCleanups
Represents an expression – generally a full-expression – that introduces cleanups to be run at the en...
Definition: ExprCXX.h:3342
clang::NUM_OVERLOADED_OPERATORS
@ NUM_OVERLOADED_OPERATORS
Definition: OperatorKinds.h:26
clang::CapturedStmt
This captures a statement into a function.
Definition: Stmt.h:3500
clang::ASTContext::getCanonicalType
CanQualType getCanonicalType(QualType T) const
Return the canonical (structural) type corresponding to the specified potentially non-canonical type ...
Definition: ASTContext.h:2468
clang::ObjCAtFinallyStmt
Represents Objective-C's @finally statement.
Definition: StmtObjC.h:127
clang::OMPParallelForDirective
This represents '#pragma omp parallel for' directive.
Definition: StmtOpenMP.h:2069
clang::OMPGrainsizeClause
This represents 'grainsize' clause in the '#pragma omp ...' directive.
Definition: OpenMPClause.h:6063
clang::CXXTryStmt
CXXTryStmt - A C++ try block, including all handlers.
Definition: StmtCXX.h:68
ExprObjC.h
clang::Stmt::Profile
void Profile(llvm::FoldingSetNodeID &ID, const ASTContext &Context, bool Canonical) const
Produce a unique representation of the given statement.
Definition: StmtProfile.cpp:2287
ExprCXX.h
clang::OMPDefaultClause
This represents 'default' clause in the '#pragma omp ...' directive.
Definition: OpenMPClause.h:1073
clang::ObjCEncodeExpr
ObjCEncodeExpr, used for @encode in Objective-C.
Definition: ExprObjC.h:409
clang::CXXInheritedCtorInitExpr
Represents a call to an inherited base class constructor from an inheriting constructor.
Definition: ExprCXX.h:1651
clang::CXXDefaultArgExpr
A default argument (C++ [dcl.fct.default]).
Definition: ExprCXX.h:1241
clang::PackExpansionExpr
Represents a C++11 pack expansion that produces a sequence of expressions.
Definition: ExprCXX.h:4051
clang::OMPHintClause
This represents 'hint' clause in the '#pragma omp ...' directive.
Definition: OpenMPClause.h:6240
clang::OMPCriticalDirective
This represents '#pragma omp critical' directive.
Definition: StmtOpenMP.h:1998
clang::OMPTargetParallelForSimdDirective
This represents '#pragma omp target parallel for simd' directive.
Definition: StmtOpenMP.h:4282
clang::OMPCaptureClause
This represents 'capture' clause in the '#pragma omp atomic' directive.
Definition: OpenMPClause.h:2118
clang::OMPFirstprivateClause
This represents clause 'firstprivate' in the '#pragma omp ...' directives.
Definition: OpenMPClause.h:2470
clang::OMPMasterTaskLoopDirective
This represents '#pragma omp master taskloop' directive.
Definition: StmtOpenMP.h:3648
clang::OMPNumTasksClause
This represents 'num_tasks' clause in the '#pragma omp ...' directive.
Definition: OpenMPClause.h:6172
clang::concepts::Requirement::RK_Compound
@ RK_Compound
Definition: ExprConcepts.h:153
clang::ConstantExpr
ConstantExpr - An expression that occurs in a constant context and optionally the result of evaluatin...
Definition: Expr.h:1026
clang::TemplateTypeParmDecl
Declaration of a template type parameter.
Definition: DeclTemplate.h:1178
clang::ObjCMessageExpr
An expression that sends a message to the given Objective-C object or class.
Definition: ExprObjC.h:940
clang::OMPTeamsDistributeDirective
This represents '#pragma omp teams distribute' directive.
Definition: StmtOpenMP.h:4414
clang::OffsetOfNode
Helper class for OffsetOfExpr.
Definition: Expr.h:2334
clang::OMPUnifiedSharedMemoryClause
This represents 'unified_shared_memory' clause in the '#pragma omp requires' directive.
Definition: OpenMPClause.h:1279
clang::ChooseExpr
ChooseExpr - GNU builtin-in function __builtin_choose_expr.
Definition: Expr.h:4520
clang::ODRHash
Definition: ODRHash.h:41
clang::SEHExceptStmt
Definition: Stmt.h:3329
clang::OMPArrayShapingExpr
An explicit cast in C or a C-style cast in C++, which uses the syntax ([s1][s2]......
Definition: ExprOpenMP.h:146
clang::OMPMergeableClause
This represents 'mergeable' clause in the '#pragma omp ...' directive.
Definition: OpenMPClause.h:1864
clang::CharacterLiteral
Definition: Expr.h:1578
clang::UserDefinedLiteral
A call to a literal operator (C++11 [over.literal]) written as a user-defined literal (C++11 [lit....
Definition: ExprCXX.h:638
clang::TemplateArgument::TemplateExpansion
@ TemplateExpansion
The template argument is a pack expansion of a template name that was provided for a template templat...
Definition: TemplateBase.h:91
clang::OMPOrderClause
This represents 'order' clause in the '#pragma omp ...' directive.
Definition: OpenMPClause.h:7406
clang::OMPCancelDirective
This represents '#pragma omp cancel' directive.
Definition: StmtOpenMP.h:3449
clang::CompoundLiteralExpr
CompoundLiteralExpr - [C99 6.5.2.5].
Definition: Expr.h:3403
clang::OMPSafelenClause
This represents 'safelen' clause in the '#pragma omp ...' directive.
Definition: OpenMPClause.h:676
clang::OMPSectionsDirective
This represents '#pragma omp sections' directive.
Definition: StmtOpenMP.h:1760
clang::OMPTargetTeamsDistributeParallelForSimdDirective
This represents '#pragma omp target teams distribute parallel for simd' combined directive.
Definition: StmtOpenMP.h:4927
clang::CStyleCastExpr
CStyleCastExpr - An explicit cast in C (C99 6.5.4) or a C-style cast in C++ (C++ [expr....
Definition: Expr.h:3731
clang::GCCAsmStmt
This represents a GCC inline-assembly statement extension.
Definition: Stmt.h:3002
clang::OMPUntiedClause
This represents 'untied' clause in the '#pragma omp ...' directive.
Definition: OpenMPClause.h:1824
clang::OMPRelaxedClause
This represents 'relaxed' clause in the '#pragma omp atomic' directives.
Definition: OpenMPClause.h:2323
clang::OMPClauseWithPreInit
Class that handles pre-initialization statement for some clauses, like 'shedule', 'firstprivate' etc.
Definition: OpenMPClause.h:111
clang::OO_None
@ OO_None
Not an overloaded operator.
Definition: OperatorKinds.h:22
clang::OMPDependClause
This represents implicit clause 'depend' for the '#pragma omp task' directive.
Definition: OpenMPClause.h:4625
clang::OMPFlushDirective
This represents '#pragma omp flush' directive.
Definition: StmtOpenMP.h:2643
P
StringRef P
Definition: ASTMatchersInternal.cpp:563
clang::OMPTargetEnterDataDirective
This represents '#pragma omp target enter data' directive.
Definition: StmtOpenMP.h:3054
clang::DesignatedInitUpdateExpr
Definition: Expr.h:5362
clang::OMPSizesClause
This represents the 'sizes' clause in the '#pragma omp tile' directive.
Definition: OpenMPClause.h:804
clang::OMPInteropDirective
This represents '#pragma omp interop' directive.
Definition: StmtOpenMP.h:5265
false
#define false
Definition: stdbool.h:17
clang::OMPDistributeDirective
This represents '#pragma omp distribute' directive.
Definition: StmtOpenMP.h:3933
clang::OMPSingleDirective
This represents '#pragma omp single' directive.
Definition: StmtOpenMP.h:1899
clang::TemplateName
Represents a C++ template name within the type system.
Definition: TemplateName.h:192
clang::ParenExpr
ParenExpr - This represents a parethesized expression, e.g.
Definition: Expr.h:2106
clang::CoyieldExpr
Represents a 'co_yield' expression.
Definition: ExprCXX.h:4849
clang::ObjCProtocolExpr
ObjCProtocolExpr used for protocol expression in Objective-C.
Definition: ExprObjC.h:504
clang::CXXDeleteExpr
Represents a delete expression for memory deallocation and destructor calls, e.g.
Definition: ExprCXX.h:2398
clang::QualType::isNull
bool isNull() const
Return true if this QualType doesn't point to a type yet.
Definition: Type.h:738
clang::BlockExpr
BlockExpr - Adaptor class for mixing a BlockDecl with expressions.
Definition: Expr.h:5965
clang::StmtExpr
StmtExpr - This is the GNU Statement Expression extension: ({int X=4; X;}).
Definition: Expr.h:4345
llvm::ArrayRef
Definition: LLVM.h:34
clang::OMPTaskLoopDirective
This represents '#pragma omp taskloop' directive.
Definition: StmtOpenMP.h:3509
clang::FunctionParmPackExpr::iterator
VarDecl *const * iterator
Iterators over the parameters which the parameter pack expanded into.
Definition: ExprCXX.h:4416
clang::OMPFilterClause
This represents 'filter' clause in the '#pragma omp ...' directive.
Definition: OpenMPClause.h:8344
clang::ODRHash::AddNestedNameSpecifier
void AddNestedNameSpecifier(const NestedNameSpecifier *NNS)
Definition: ODRHash.cpp:109
clang::Decl
Decl - This represents one declaration (or definition), e.g.
Definition: DeclBase.h:89
clang::OMPUsesAllocatorsClause::Data
Data for list of allocators.
Definition: OpenMPClause.h:8125
clang::OffsetOfNode::Base
@ Base
An implicit indirection through a C++ base class, when the field found is in a base class.
Definition: Expr.h:2346
OpenMPClause.h
clang::AddrLabelExpr
AddrLabelExpr - The GNU address of label extension, representing &&label.
Definition: Expr.h:4300
clang::CXXFunctionalCastExpr
Represents an explicit C++ type conversion that uses "functional" notation (C++ [expr....
Definition: ExprCXX.h:1726
clang::DesignatedInitExpr::Designator
Represents a single C99 designator.
Definition: Expr.h:5099
clang::OMPIsDevicePtrClause
This represents clause 'is_device_ptr' in the '#pragma omp ...' directives.
Definition: OpenMPClause.h:7207
clang::OMPNogroupClause
This represents 'nogroup' clause in the '#pragma omp ...' directive.
Definition: OpenMPClause.h:6130
clang::ArraySubscriptExpr
ArraySubscriptExpr - [C99 6.5.2.1] Array Subscripting.
Definition: Expr.h:2639
clang::CXXUuidofExpr
A Microsoft C++ __uuidof expression, which gets the _GUID that corresponds to the supplied type or ex...
Definition: ExprCXX.h:1056
clang::DependentScopeDeclRefExpr
A qualified reference to a name whose declaration cannot yet be resolved.
Definition: ExprCXX.h:3191
clang::DoStmt
DoStmt - This represents a 'do/while' stmt.
Definition: Stmt.h:2478
StmtVisitor.h
clang::CXXNullPtrLiteralExpr
The null pointer literal (C++11 [lex.nullptr])
Definition: ExprCXX.h:759
clang::CoroutineBodyStmt
Represents the body of a coroutine.
Definition: StmtCXX.h:317
clang::OffsetOfNode::Field
@ Field
A field.
Definition: Expr.h:2341
clang::CoawaitExpr
Represents a 'co_await' expression.
Definition: ExprCXX.h:4764
clang::UnaryOperatorKind
UnaryOperatorKind
Definition: OperationKinds.h:30
clang::BreakStmt
BreakStmt - This represents a break.
Definition: Stmt.h:2723
clang::OMPAffinityClause
This represents clause 'affinity' in the '#pragma omp task'-based directives.
Definition: OpenMPClause.h:8245
clang::OverloadExpr
A reference to an overloaded function set, either an UnresolvedLookupExpr or an UnresolvedMemberExpr.
Definition: ExprCXX.h:2880
clang::ASTContext::getCanonicalTemplateName
TemplateName getCanonicalTemplateName(TemplateName Name) const
Retrieves the "canonical" template name that refers to a given template.
Definition: ASTContext.cpp:6027
clang::OMPCancellationPointDirective
This represents '#pragma omp cancellation point' directive.
Definition: StmtOpenMP.h:3391
clang::OMPSimdlenClause
This represents 'simdlen' clause in the '#pragma omp ...' directive.
Definition: OpenMPClause.h:742
clang::OMPDispatchDirective
This represents '#pragma omp dispatch' directive.
Definition: StmtOpenMP.h:5318
clang::CXXDependentScopeMemberExpr
Represents a C++ member access expression where the actual member referenced could not be resolved be...
Definition: ExprCXX.h:3550
clang::CompoundAssignOperator
CompoundAssignOperator - For compound assignments (e.g.
Definition: Expr.h:4050
clang::BinaryOperatorKind
BinaryOperatorKind
Definition: OperationKinds.h:25
clang::CXXNoexceptExpr
Represents a C++11 noexcept expression (C++ [expr.unary.noexcept]).
Definition: ExprCXX.h:3997
clang::CXXUnresolvedConstructExpr
Describes an explicit type conversion that uses functional notion but could not be resolved because o...
Definition: ExprCXX.h:3428
clang::ConstStmtVisitor
ConstStmtVisitor - This class implements a simple visitor for Stmt subclasses.
Definition: StmtVisitor.h:193
clang::IdentifierInfo
One of these records is kept for each identifier that is lexed.
Definition: IdentifierTable.h:84
clang::OMPExecutableDirective
This is a basic class for representing single OpenMP executable directive.
Definition: StmtOpenMP.h:266
ODRHash.h
clang::OMPWriteClause
This represents 'write' clause in the '#pragma omp atomic' directive.
Definition: OpenMPClause.h:1943
clang::CXXForRangeStmt
CXXForRangeStmt - This represents C++0x [stmt.ranged]'s ranged for statement, represented as 'for (ra...
Definition: StmtCXX.h:134
clang::DeclStmt
DeclStmt - Adaptor class for mixing declarations with statements and expressions.
Definition: Stmt.h:1292
clang::ContinueStmt
ContinueStmt - This represents a continue.
Definition: Stmt.h:2693
clang::BuiltinType::getKind
Kind getKind() const
Definition: Type.h:2528
clang::OffsetOfNode::Identifier
@ Identifier
A field in a dependent type, known only by its name.
Definition: Expr.h:2343
clang::OMPFlushClause
This represents implicit clause 'flush' for the '#pragma omp flush' directive.
Definition: OpenMPClause.h:4465
clang::CXXConstCastExpr
A C++ const_cast expression (C++ [expr.const.cast]).
Definition: ExprCXX.h:562
clang::CXXThisExpr
Represents the this expression in C++.
Definition: ExprCXX.h:1142
clang::TemplateArgument::getAsDecl
ValueDecl * getAsDecl() const
Retrieve the declaration for a declaration non-type template argument.
Definition: TemplateBase.h:276
clang::ExtVectorElementExpr
ExtVectorElementExpr - This represents access to specific elements of a vector, and may occur on the ...
Definition: Expr.h:5905
clang::OMPTeamsDistributeParallelForDirective
This represents '#pragma omp teams distribute parallel for' composite directive.
Definition: StmtOpenMP.h:4614
clang::OMPExclusiveClause
This represents clause 'exclusive' in the '#pragma omp scan' directive.
Definition: OpenMPClause.h:8044
clang::TypoExpr
TypoExpr - Internal placeholder for expressions where typo correction still needs to be performed and...
Definition: Expr.h:6358
clang::PredefinedExpr
[C99 6.4.2.2] - A predefined identifier such as func.
Definition: Expr.h:1953
clang::MSDependentExistsStmt
Representation of a Microsoft __if_exists or __if_not_exists statement with a dependent name.
Definition: StmtCXX.h:252
clang::SEHFinallyStmt
Definition: Stmt.h:3373
clang::CUDAKernelCallExpr
Represents a call to a CUDA kernel function.
Definition: ExprCXX.h:232
clang::concepts::ExprRequirement::ReturnTypeRequirement
Definition: ExprConcepts.h:268
clang::OMPSimdDirective
This represents '#pragma omp simd' directive.
Definition: StmtOpenMP.h:1544
clang::Builtin::ID
ID
Definition: Builtins.h:48
clang::TemplateArgument::Type
@ Type
The template argument is a type.
Definition: TemplateBase.h:71
clang::OMPUseClause
This represents the 'use' clause in '#pragma omp ...' directives.
Definition: OpenMPClause.h:7606
clang::OMPArraySectionExpr
OpenMP 5.0 [2.1.5, Array Sections].
Definition: ExprOpenMP.h:56
clang
Definition: CalledOnceCheck.h:17
clang::OMPAcquireClause
This represents 'acquire' clause in the '#pragma omp atomic|flush' directives.
Definition: OpenMPClause.h:2241
clang::OMPTargetTeamsDirective
This represents '#pragma omp target teams' directive.
Definition: StmtOpenMP.h:4707
clang::TemplateArgument::getNullPtrType
QualType getNullPtrType() const
Retrieve the type for null non-type template argument.
Definition: TemplateBase.h:287
clang::TemplateArgument::Template
@ Template
The template argument is a template name that was provided for a template template parameter.
Definition: TemplateBase.h:87
clang::Stmt
Stmt - This represents one statement.
Definition: Stmt.h:69
clang::OMPDistributeParallelForDirective
This represents '#pragma omp distribute parallel for' composite directive.
Definition: StmtOpenMP.h:4055
clang::DefaultStmt
Definition: Stmt.h:1723
clang::ObjCAutoreleasePoolStmt
Represents Objective-C's @autoreleasepool Statement.
Definition: StmtObjC.h:368
clang::CXXCatchStmt
CXXCatchStmt - This represents a C++ catch block.
Definition: StmtCXX.h:28
clang::OMPAcqRelClause
This represents 'acq_rel' clause in the '#pragma omp atomic|flush' directives.
Definition: OpenMPClause.h:2200
clang::GenericSelectionExpr
Represents a C11 generic selection.
Definition: Expr.h:5623
clang::CXXScalarValueInitExpr
An expression "T()" which creates a value-initialized rvalue of type T, which is a non-class type.
Definition: ExprCXX.h:2093
clang::ObjCIsaExpr
ObjCIsaExpr - Represent X->isa and X.isa when X is an ObjC 'id' type.
Definition: ExprObjC.h:1482
clang::OMPUnrollDirective
This represents the '#pragma omp unroll' loop transformation directive.
Definition: StmtOpenMP.h:5138
clang::CXXNamedCastExpr
Abstract class common to all of the C++ "named"/"keyword" casts.
Definition: ExprCXX.h:373
clang::OMPTargetDirective
This represents '#pragma omp target' directive.
Definition: StmtOpenMP.h:2946
clang::OMPTargetUpdateDirective
This represents '#pragma omp target update' directive.
Definition: StmtOpenMP.h:3999
clang::ImplicitCastExpr
ImplicitCastExpr - Allows us to explicitly represent implicit type conversions, which have no direct ...
Definition: Expr.h:3618
clang::VAArgExpr
Represents a call to the builtin function __builtin_va_arg.
Definition: Expr.h:4629
clang::OMPOrderedDirective
This represents '#pragma omp ordered' directive.
Definition: StmtOpenMP.h:2747
clang::SourceLocExpr
Represents a function call to one of __builtin_LINE(), __builtin_COLUMN(), __builtin_FUNCTION(),...
Definition: Expr.h:4678
clang::MemberExpr
MemberExpr - [C99 6.5.2.3] Structure and Union Members.
Definition: Expr.h:3162
clang::OMPThreadLimitClause
This represents 'thread_limit' clause in the '#pragma omp ...' directive.
Definition: OpenMPClause.h:5912
clang::OMPReadClause
This represents 'read' clause in the '#pragma omp atomic' directive.
Definition: OpenMPClause.h:1904
clang::QualType::getAsOpaquePtr
void * getAsOpaquePtr() const
Definition: Type.h:718
clang::OMPUpdateClause
This represents 'update' clause in the '#pragma omp atomic' directive.
Definition: OpenMPClause.h:1991
clang::OMPNontemporalClause
This represents clause 'nontemporal' in the '#pragma omp ...' directives.
Definition: OpenMPClause.h:7309
clang::OMPDistributeSimdDirective
This represents '#pragma omp distribute simd' composite directive.
Definition: StmtOpenMP.h:4216
clang::OMPParallelMasterTaskLoopSimdDirective
This represents '#pragma omp parallel master taskloop simd' directive.
Definition: StmtOpenMP.h:3868
clang::GNUNullExpr
GNUNullExpr - Implements the GNU __null extension, which is a name for a null pointer constant that h...
Definition: Expr.h:4595
clang::CXXStdInitializerListExpr
Implicit construction of a std::initializer_list<T> object from an array temporary within list-initia...
Definition: ExprCXX.h:791
clang::concepts::Requirement::RK_Nested
@ RK_Nested
Definition: ExprConcepts.h:153
clang::OMPNumThreadsClause
This represents 'num_threads' clause in the '#pragma omp ...' directive.
Definition: OpenMPClause.h:599
clang::Expr
This represents one expression.
Definition: Expr.h:109
clang::OMPTargetDataDirective
This represents '#pragma omp target data' directive.
Definition: StmtOpenMP.h:3000
clang::CXXDefaultInitExpr
A use of a default initializer in a constructor or in aggregate initialization.
Definition: ExprCXX.h:1318
clang::OMPCopyprivateClause
This represents clause 'copyprivate' in the '#pragma omp ...' directives.
Definition: OpenMPClause.h:4297
clang::OMPTargetSimdDirective
This represents '#pragma omp target simd' directive.
Definition: StmtOpenMP.h:4349
clang::concepts::Requirement::RK_Type
@ RK_Type
Definition: ExprConcepts.h:153
clang::CastExpr
CastExpr - Base class for type casts, including both implicit casts (ImplicitCastExpr) and explicit c...
Definition: Expr.h:3473
clang::MSAsmStmt
This represents a Microsoft inline-assembly statement extension.
Definition: Stmt.h:3225
clang::DeclRefExpr
A reference to a declared variable, function, enum, etc.
Definition: Expr.h:1217
clang::OMPFinalClause
This represents 'final' clause in the '#pragma omp ...' directive.
Definition: OpenMPClause.h:530
clang::OMPTaskLoopSimdDirective
This represents '#pragma omp taskloop simd' directive.
Definition: StmtOpenMP.h:3582
clang::OMPTargetParallelForDirective
This represents '#pragma omp target parallel for' directive.
Definition: StmtOpenMP.h:3243
clang::CallExpr
CallExpr - Represents a function call (C99 6.5.2.2, C++ [expr.call]).
Definition: Expr.h:2795
clang::OMPParallelSectionsDirective
This represents '#pragma omp parallel sections' directive.
Definition: StmtOpenMP.h:2295
clang::CXXOperatorCallExpr
A call to an overloaded operator written using operator syntax.
Definition: ExprCXX.h:82
clang::ShuffleVectorExpr
ShuffleVectorExpr - clang-specific builtin-in function __builtin_shufflevector.
Definition: Expr.h:4393
clang::CXXConstructExpr
Represents a call to a C++ constructor.
Definition: ExprCXX.h:1460
clang::ObjCIvarRefExpr
ObjCIvarRefExpr - A reference to an ObjC instance variable.
Definition: ExprObjC.h:548
clang::OMPAtomicDirective
This represents '#pragma omp atomic' directive.
Definition: StmtOpenMP.h:2801
clang::CXXMemberCallExpr
Represents a call to a member function that may be written either with member call syntax (e....
Definition: ExprCXX.h:177
clang::ExplicitCastExpr
ExplicitCastExpr - An explicit cast written in the source code.
Definition: Expr.h:3695
clang::ASTContext::getCanonicalNestedNameSpecifier
NestedNameSpecifier * getCanonicalNestedNameSpecifier(NestedNameSpecifier *NNS) const
Retrieves the "canonical" nested name specifier for a given nested name specifier.
Definition: ASTContext.cpp:6127
clang::ReturnStmt
ReturnStmt - This represents a return, optionally of an expression: return; return 4;.
Definition: Stmt.h:2760
clang::TemplateArgument::getAsType
QualType getAsType() const
Retrieve the type for a type template argument.
Definition: TemplateBase.h:269
clang::SEHLeaveStmt
Represents a __leave statement.
Definition: Stmt.h:3461
clang::TemplateArgument::Pack
@ Pack
The template argument is actually a parameter pack.
Definition: TemplateBase.h:101
clang::OMPTeamsDistributeParallelForSimdDirective
This represents '#pragma omp teams distribute parallel for simd' composite directive.
Definition: StmtOpenMP.h:4547
clang::OMPBarrierDirective
This represents '#pragma omp barrier' directive.
Definition: StmtOpenMP.h:2484
clang::SYCLUniqueStableNameExpr
Definition: Expr.h:2050
clang::OMPFromClause
This represents clause 'from' in the '#pragma omp ...' directives.
Definition: OpenMPClause.h:6738