clang  10.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/StmtVisitor.h"
23 #include "llvm/ADT/FoldingSet.h"
24 using namespace clang;
25 
26 namespace {
27  class StmtProfiler : public ConstStmtVisitor<StmtProfiler> {
28  protected:
29  llvm::FoldingSetNodeID &ID;
30  bool Canonical;
31 
32  public:
33  StmtProfiler(llvm::FoldingSetNodeID &ID, bool Canonical)
34  : ID(ID), Canonical(Canonical) {}
35 
36  virtual ~StmtProfiler() {}
37 
38  void VisitStmt(const Stmt *S);
39 
40  virtual void HandleStmtClass(Stmt::StmtClass SC) = 0;
41 
42 #define STMT(Node, Base) void Visit##Node(const Node *S);
43 #include "clang/AST/StmtNodes.inc"
44 
45  /// Visit a declaration that is referenced within an expression
46  /// or statement.
47  virtual void VisitDecl(const Decl *D) = 0;
48 
49  /// Visit a type that is referenced within an expression or
50  /// statement.
51  virtual void VisitType(QualType T) = 0;
52 
53  /// Visit a name that occurs within an expression or statement.
54  virtual void VisitName(DeclarationName Name, bool TreatAsDecl = false) = 0;
55 
56  /// Visit identifiers that are not in Decl's or Type's.
57  virtual void VisitIdentifierInfo(IdentifierInfo *II) = 0;
58 
59  /// Visit a nested-name-specifier that occurs within an expression
60  /// or statement.
61  virtual void VisitNestedNameSpecifier(NestedNameSpecifier *NNS) = 0;
62 
63  /// Visit a template name that occurs within an expression or
64  /// statement.
65  virtual void VisitTemplateName(TemplateName Name) = 0;
66 
67  /// Visit template arguments that occur within an expression or
68  /// statement.
69  void VisitTemplateArguments(const TemplateArgumentLoc *Args,
70  unsigned NumArgs);
71 
72  /// Visit a single template argument.
73  void VisitTemplateArgument(const TemplateArgument &Arg);
74  };
75 
76  class StmtProfilerWithPointers : public StmtProfiler {
77  const ASTContext &Context;
78 
79  public:
80  StmtProfilerWithPointers(llvm::FoldingSetNodeID &ID,
81  const ASTContext &Context, bool Canonical)
82  : StmtProfiler(ID, Canonical), Context(Context) {}
83  private:
84  void HandleStmtClass(Stmt::StmtClass SC) override {
85  ID.AddInteger(SC);
86  }
87 
88  void VisitDecl(const Decl *D) override {
89  ID.AddInteger(D ? D->getKind() : 0);
90 
91  if (Canonical && D) {
92  if (const NonTypeTemplateParmDecl *NTTP =
93  dyn_cast<NonTypeTemplateParmDecl>(D)) {
94  ID.AddInteger(NTTP->getDepth());
95  ID.AddInteger(NTTP->getIndex());
96  ID.AddBoolean(NTTP->isParameterPack());
97  VisitType(NTTP->getType());
98  return;
99  }
100 
101  if (const ParmVarDecl *Parm = dyn_cast<ParmVarDecl>(D)) {
102  // The Itanium C++ ABI uses the type, scope depth, and scope
103  // index of a parameter when mangling expressions that involve
104  // function parameters, so we will use the parameter's type for
105  // establishing function parameter identity. That way, our
106  // definition of "equivalent" (per C++ [temp.over.link]) is at
107  // least as strong as the definition of "equivalent" used for
108  // name mangling.
109  VisitType(Parm->getType());
110  ID.AddInteger(Parm->getFunctionScopeDepth());
111  ID.AddInteger(Parm->getFunctionScopeIndex());
112  return;
113  }
114 
115  if (const TemplateTypeParmDecl *TTP =
116  dyn_cast<TemplateTypeParmDecl>(D)) {
117  ID.AddInteger(TTP->getDepth());
118  ID.AddInteger(TTP->getIndex());
119  ID.AddBoolean(TTP->isParameterPack());
120  return;
121  }
122 
123  if (const TemplateTemplateParmDecl *TTP =
124  dyn_cast<TemplateTemplateParmDecl>(D)) {
125  ID.AddInteger(TTP->getDepth());
126  ID.AddInteger(TTP->getIndex());
127  ID.AddBoolean(TTP->isParameterPack());
128  return;
129  }
130  }
131 
132  ID.AddPointer(D ? D->getCanonicalDecl() : nullptr);
133  }
134 
135  void VisitType(QualType T) override {
136  if (Canonical && !T.isNull())
137  T = Context.getCanonicalType(T);
138 
139  ID.AddPointer(T.getAsOpaquePtr());
140  }
141 
142  void VisitName(DeclarationName Name, bool /*TreatAsDecl*/) override {
143  ID.AddPointer(Name.getAsOpaquePtr());
144  }
145 
146  void VisitIdentifierInfo(IdentifierInfo *II) override {
147  ID.AddPointer(II);
148  }
149 
150  void VisitNestedNameSpecifier(NestedNameSpecifier *NNS) override {
151  if (Canonical)
152  NNS = Context.getCanonicalNestedNameSpecifier(NNS);
153  ID.AddPointer(NNS);
154  }
155 
156  void VisitTemplateName(TemplateName Name) override {
157  if (Canonical)
158  Name = Context.getCanonicalTemplateName(Name);
159 
160  Name.Profile(ID);
161  }
162  };
163 
164  class StmtProfilerWithoutPointers : public StmtProfiler {
165  ODRHash &Hash;
166  public:
167  StmtProfilerWithoutPointers(llvm::FoldingSetNodeID &ID, ODRHash &Hash)
168  : StmtProfiler(ID, false), Hash(Hash) {}
169 
170  private:
171  void HandleStmtClass(Stmt::StmtClass SC) override {
172  if (SC == Stmt::UnresolvedLookupExprClass) {
173  // Pretend that the name looked up is a Decl due to how templates
174  // handle some Decl lookups.
175  ID.AddInteger(Stmt::DeclRefExprClass);
176  } else {
177  ID.AddInteger(SC);
178  }
179  }
180 
181  void VisitType(QualType T) override {
182  Hash.AddQualType(T);
183  }
184 
185  void VisitName(DeclarationName Name, bool TreatAsDecl) override {
186  if (TreatAsDecl) {
187  // A Decl can be null, so each Decl is preceded by a boolean to
188  // store its nullness. Add a boolean here to match.
189  ID.AddBoolean(true);
190  }
191  Hash.AddDeclarationName(Name, TreatAsDecl);
192  }
193  void VisitIdentifierInfo(IdentifierInfo *II) override {
194  ID.AddBoolean(II);
195  if (II) {
196  Hash.AddIdentifierInfo(II);
197  }
198  }
199  void VisitDecl(const Decl *D) override {
200  ID.AddBoolean(D);
201  if (D) {
202  Hash.AddDecl(D);
203  }
204  }
205  void VisitTemplateName(TemplateName Name) override {
206  Hash.AddTemplateName(Name);
207  }
208  void VisitNestedNameSpecifier(NestedNameSpecifier *NNS) override {
209  ID.AddBoolean(NNS);
210  if (NNS) {
211  Hash.AddNestedNameSpecifier(NNS);
212  }
213  }
214  };
215 }
216 
217 void StmtProfiler::VisitStmt(const Stmt *S) {
218  assert(S && "Requires non-null Stmt pointer");
219 
220  HandleStmtClass(S->getStmtClass());
221 
222  for (const Stmt *SubStmt : S->children()) {
223  if (SubStmt)
224  Visit(SubStmt);
225  else
226  ID.AddInteger(0);
227  }
228 }
229 
230 void StmtProfiler::VisitDeclStmt(const DeclStmt *S) {
231  VisitStmt(S);
232  for (const auto *D : S->decls())
233  VisitDecl(D);
234 }
235 
236 void StmtProfiler::VisitNullStmt(const NullStmt *S) {
237  VisitStmt(S);
238 }
239 
240 void StmtProfiler::VisitCompoundStmt(const CompoundStmt *S) {
241  VisitStmt(S);
242 }
243 
244 void StmtProfiler::VisitCaseStmt(const CaseStmt *S) {
245  VisitStmt(S);
246 }
247 
248 void StmtProfiler::VisitDefaultStmt(const DefaultStmt *S) {
249  VisitStmt(S);
250 }
251 
252 void StmtProfiler::VisitLabelStmt(const LabelStmt *S) {
253  VisitStmt(S);
254  VisitDecl(S->getDecl());
255 }
256 
257 void StmtProfiler::VisitAttributedStmt(const AttributedStmt *S) {
258  VisitStmt(S);
259  // TODO: maybe visit attributes?
260 }
261 
262 void StmtProfiler::VisitIfStmt(const IfStmt *S) {
263  VisitStmt(S);
264  VisitDecl(S->getConditionVariable());
265 }
266 
267 void StmtProfiler::VisitSwitchStmt(const SwitchStmt *S) {
268  VisitStmt(S);
269  VisitDecl(S->getConditionVariable());
270 }
271 
272 void StmtProfiler::VisitWhileStmt(const WhileStmt *S) {
273  VisitStmt(S);
274  VisitDecl(S->getConditionVariable());
275 }
276 
277 void StmtProfiler::VisitDoStmt(const DoStmt *S) {
278  VisitStmt(S);
279 }
280 
281 void StmtProfiler::VisitForStmt(const ForStmt *S) {
282  VisitStmt(S);
283 }
284 
285 void StmtProfiler::VisitGotoStmt(const GotoStmt *S) {
286  VisitStmt(S);
287  VisitDecl(S->getLabel());
288 }
289 
290 void StmtProfiler::VisitIndirectGotoStmt(const IndirectGotoStmt *S) {
291  VisitStmt(S);
292 }
293 
294 void StmtProfiler::VisitContinueStmt(const ContinueStmt *S) {
295  VisitStmt(S);
296 }
297 
298 void StmtProfiler::VisitBreakStmt(const BreakStmt *S) {
299  VisitStmt(S);
300 }
301 
302 void StmtProfiler::VisitReturnStmt(const ReturnStmt *S) {
303  VisitStmt(S);
304 }
305 
306 void StmtProfiler::VisitGCCAsmStmt(const GCCAsmStmt *S) {
307  VisitStmt(S);
308  ID.AddBoolean(S->isVolatile());
309  ID.AddBoolean(S->isSimple());
310  VisitStringLiteral(S->getAsmString());
311  ID.AddInteger(S->getNumOutputs());
312  for (unsigned I = 0, N = S->getNumOutputs(); I != N; ++I) {
313  ID.AddString(S->getOutputName(I));
314  VisitStringLiteral(S->getOutputConstraintLiteral(I));
315  }
316  ID.AddInteger(S->getNumInputs());
317  for (unsigned I = 0, N = S->getNumInputs(); I != N; ++I) {
318  ID.AddString(S->getInputName(I));
319  VisitStringLiteral(S->getInputConstraintLiteral(I));
320  }
321  ID.AddInteger(S->getNumClobbers());
322  for (unsigned I = 0, N = S->getNumClobbers(); I != N; ++I)
323  VisitStringLiteral(S->getClobberStringLiteral(I));
324  ID.AddInteger(S->getNumLabels());
325  for (auto *L : S->labels())
326  VisitDecl(L->getLabel());
327 }
328 
329 void StmtProfiler::VisitMSAsmStmt(const MSAsmStmt *S) {
330  // FIXME: Implement MS style inline asm statement profiler.
331  VisitStmt(S);
332 }
333 
334 void StmtProfiler::VisitCXXCatchStmt(const CXXCatchStmt *S) {
335  VisitStmt(S);
336  VisitType(S->getCaughtType());
337 }
338 
339 void StmtProfiler::VisitCXXTryStmt(const CXXTryStmt *S) {
340  VisitStmt(S);
341 }
342 
343 void StmtProfiler::VisitCXXForRangeStmt(const CXXForRangeStmt *S) {
344  VisitStmt(S);
345 }
346 
347 void StmtProfiler::VisitMSDependentExistsStmt(const MSDependentExistsStmt *S) {
348  VisitStmt(S);
349  ID.AddBoolean(S->isIfExists());
350  VisitNestedNameSpecifier(S->getQualifierLoc().getNestedNameSpecifier());
351  VisitName(S->getNameInfo().getName());
352 }
353 
354 void StmtProfiler::VisitSEHTryStmt(const SEHTryStmt *S) {
355  VisitStmt(S);
356 }
357 
358 void StmtProfiler::VisitSEHFinallyStmt(const SEHFinallyStmt *S) {
359  VisitStmt(S);
360 }
361 
362 void StmtProfiler::VisitSEHExceptStmt(const SEHExceptStmt *S) {
363  VisitStmt(S);
364 }
365 
366 void StmtProfiler::VisitSEHLeaveStmt(const SEHLeaveStmt *S) {
367  VisitStmt(S);
368 }
369 
370 void StmtProfiler::VisitCapturedStmt(const CapturedStmt *S) {
371  VisitStmt(S);
372 }
373 
374 void StmtProfiler::VisitObjCForCollectionStmt(const ObjCForCollectionStmt *S) {
375  VisitStmt(S);
376 }
377 
378 void StmtProfiler::VisitObjCAtCatchStmt(const ObjCAtCatchStmt *S) {
379  VisitStmt(S);
380  ID.AddBoolean(S->hasEllipsis());
381  if (S->getCatchParamDecl())
382  VisitType(S->getCatchParamDecl()->getType());
383 }
384 
385 void StmtProfiler::VisitObjCAtFinallyStmt(const ObjCAtFinallyStmt *S) {
386  VisitStmt(S);
387 }
388 
389 void StmtProfiler::VisitObjCAtTryStmt(const ObjCAtTryStmt *S) {
390  VisitStmt(S);
391 }
392 
393 void
394 StmtProfiler::VisitObjCAtSynchronizedStmt(const ObjCAtSynchronizedStmt *S) {
395  VisitStmt(S);
396 }
397 
398 void StmtProfiler::VisitObjCAtThrowStmt(const ObjCAtThrowStmt *S) {
399  VisitStmt(S);
400 }
401 
402 void
403 StmtProfiler::VisitObjCAutoreleasePoolStmt(const ObjCAutoreleasePoolStmt *S) {
404  VisitStmt(S);
405 }
406 
407 namespace {
408 class OMPClauseProfiler : public ConstOMPClauseVisitor<OMPClauseProfiler> {
409  StmtProfiler *Profiler;
410  /// Process clauses with list of variables.
411  template <typename T>
412  void VisitOMPClauseList(T *Node);
413 
414 public:
415  OMPClauseProfiler(StmtProfiler *P) : Profiler(P) { }
416 #define OPENMP_CLAUSE(Name, Class) \
417  void Visit##Class(const Class *C);
418 #include "clang/Basic/OpenMPKinds.def"
419  void VistOMPClauseWithPreInit(const OMPClauseWithPreInit *C);
420  void VistOMPClauseWithPostUpdate(const OMPClauseWithPostUpdate *C);
421 };
422 
423 void OMPClauseProfiler::VistOMPClauseWithPreInit(
424  const OMPClauseWithPreInit *C) {
425  if (auto *S = C->getPreInitStmt())
426  Profiler->VisitStmt(S);
427 }
428 
429 void OMPClauseProfiler::VistOMPClauseWithPostUpdate(
430  const OMPClauseWithPostUpdate *C) {
431  VistOMPClauseWithPreInit(C);
432  if (auto *E = C->getPostUpdateExpr())
433  Profiler->VisitStmt(E);
434 }
435 
436 void OMPClauseProfiler::VisitOMPIfClause(const OMPIfClause *C) {
437  VistOMPClauseWithPreInit(C);
438  if (C->getCondition())
439  Profiler->VisitStmt(C->getCondition());
440 }
441 
442 void OMPClauseProfiler::VisitOMPFinalClause(const OMPFinalClause *C) {
443  VistOMPClauseWithPreInit(C);
444  if (C->getCondition())
445  Profiler->VisitStmt(C->getCondition());
446 }
447 
448 void OMPClauseProfiler::VisitOMPNumThreadsClause(const OMPNumThreadsClause *C) {
449  VistOMPClauseWithPreInit(C);
450  if (C->getNumThreads())
451  Profiler->VisitStmt(C->getNumThreads());
452 }
453 
454 void OMPClauseProfiler::VisitOMPSafelenClause(const OMPSafelenClause *C) {
455  if (C->getSafelen())
456  Profiler->VisitStmt(C->getSafelen());
457 }
458 
459 void OMPClauseProfiler::VisitOMPSimdlenClause(const OMPSimdlenClause *C) {
460  if (C->getSimdlen())
461  Profiler->VisitStmt(C->getSimdlen());
462 }
463 
464 void OMPClauseProfiler::VisitOMPAllocatorClause(const OMPAllocatorClause *C) {
465  if (C->getAllocator())
466  Profiler->VisitStmt(C->getAllocator());
467 }
468 
469 void OMPClauseProfiler::VisitOMPCollapseClause(const OMPCollapseClause *C) {
470  if (C->getNumForLoops())
471  Profiler->VisitStmt(C->getNumForLoops());
472 }
473 
474 void OMPClauseProfiler::VisitOMPDefaultClause(const OMPDefaultClause *C) { }
475 
476 void OMPClauseProfiler::VisitOMPProcBindClause(const OMPProcBindClause *C) { }
477 
478 void OMPClauseProfiler::VisitOMPUnifiedAddressClause(
479  const OMPUnifiedAddressClause *C) {}
480 
481 void OMPClauseProfiler::VisitOMPUnifiedSharedMemoryClause(
482  const OMPUnifiedSharedMemoryClause *C) {}
483 
484 void OMPClauseProfiler::VisitOMPReverseOffloadClause(
485  const OMPReverseOffloadClause *C) {}
486 
487 void OMPClauseProfiler::VisitOMPDynamicAllocatorsClause(
488  const OMPDynamicAllocatorsClause *C) {}
489 
490 void OMPClauseProfiler::VisitOMPAtomicDefaultMemOrderClause(
491  const OMPAtomicDefaultMemOrderClause *C) {}
492 
493 void OMPClauseProfiler::VisitOMPScheduleClause(const OMPScheduleClause *C) {
494  VistOMPClauseWithPreInit(C);
495  if (auto *S = C->getChunkSize())
496  Profiler->VisitStmt(S);
497 }
498 
499 void OMPClauseProfiler::VisitOMPOrderedClause(const OMPOrderedClause *C) {
500  if (auto *Num = C->getNumForLoops())
501  Profiler->VisitStmt(Num);
502 }
503 
504 void OMPClauseProfiler::VisitOMPNowaitClause(const OMPNowaitClause *) {}
505 
506 void OMPClauseProfiler::VisitOMPUntiedClause(const OMPUntiedClause *) {}
507 
508 void OMPClauseProfiler::VisitOMPMergeableClause(const OMPMergeableClause *) {}
509 
510 void OMPClauseProfiler::VisitOMPReadClause(const OMPReadClause *) {}
511 
512 void OMPClauseProfiler::VisitOMPWriteClause(const OMPWriteClause *) {}
513 
514 void OMPClauseProfiler::VisitOMPUpdateClause(const OMPUpdateClause *) {}
515 
516 void OMPClauseProfiler::VisitOMPCaptureClause(const OMPCaptureClause *) {}
517 
518 void OMPClauseProfiler::VisitOMPSeqCstClause(const OMPSeqCstClause *) {}
519 
520 void OMPClauseProfiler::VisitOMPThreadsClause(const OMPThreadsClause *) {}
521 
522 void OMPClauseProfiler::VisitOMPSIMDClause(const OMPSIMDClause *) {}
523 
524 void OMPClauseProfiler::VisitOMPNogroupClause(const OMPNogroupClause *) {}
525 
526 template<typename T>
527 void OMPClauseProfiler::VisitOMPClauseList(T *Node) {
528  for (auto *E : Node->varlists()) {
529  if (E)
530  Profiler->VisitStmt(E);
531  }
532 }
533 
534 void OMPClauseProfiler::VisitOMPPrivateClause(const OMPPrivateClause *C) {
535  VisitOMPClauseList(C);
536  for (auto *E : C->private_copies()) {
537  if (E)
538  Profiler->VisitStmt(E);
539  }
540 }
541 void
542 OMPClauseProfiler::VisitOMPFirstprivateClause(const OMPFirstprivateClause *C) {
543  VisitOMPClauseList(C);
544  VistOMPClauseWithPreInit(C);
545  for (auto *E : C->private_copies()) {
546  if (E)
547  Profiler->VisitStmt(E);
548  }
549  for (auto *E : C->inits()) {
550  if (E)
551  Profiler->VisitStmt(E);
552  }
553 }
554 void
555 OMPClauseProfiler::VisitOMPLastprivateClause(const OMPLastprivateClause *C) {
556  VisitOMPClauseList(C);
557  VistOMPClauseWithPostUpdate(C);
558  for (auto *E : C->source_exprs()) {
559  if (E)
560  Profiler->VisitStmt(E);
561  }
562  for (auto *E : C->destination_exprs()) {
563  if (E)
564  Profiler->VisitStmt(E);
565  }
566  for (auto *E : C->assignment_ops()) {
567  if (E)
568  Profiler->VisitStmt(E);
569  }
570 }
571 void OMPClauseProfiler::VisitOMPSharedClause(const OMPSharedClause *C) {
572  VisitOMPClauseList(C);
573 }
574 void OMPClauseProfiler::VisitOMPReductionClause(
575  const OMPReductionClause *C) {
576  Profiler->VisitNestedNameSpecifier(
578  Profiler->VisitName(C->getNameInfo().getName());
579  VisitOMPClauseList(C);
580  VistOMPClauseWithPostUpdate(C);
581  for (auto *E : C->privates()) {
582  if (E)
583  Profiler->VisitStmt(E);
584  }
585  for (auto *E : C->lhs_exprs()) {
586  if (E)
587  Profiler->VisitStmt(E);
588  }
589  for (auto *E : C->rhs_exprs()) {
590  if (E)
591  Profiler->VisitStmt(E);
592  }
593  for (auto *E : C->reduction_ops()) {
594  if (E)
595  Profiler->VisitStmt(E);
596  }
597 }
598 void OMPClauseProfiler::VisitOMPTaskReductionClause(
599  const OMPTaskReductionClause *C) {
600  Profiler->VisitNestedNameSpecifier(
602  Profiler->VisitName(C->getNameInfo().getName());
603  VisitOMPClauseList(C);
604  VistOMPClauseWithPostUpdate(C);
605  for (auto *E : C->privates()) {
606  if (E)
607  Profiler->VisitStmt(E);
608  }
609  for (auto *E : C->lhs_exprs()) {
610  if (E)
611  Profiler->VisitStmt(E);
612  }
613  for (auto *E : C->rhs_exprs()) {
614  if (E)
615  Profiler->VisitStmt(E);
616  }
617  for (auto *E : C->reduction_ops()) {
618  if (E)
619  Profiler->VisitStmt(E);
620  }
621 }
622 void OMPClauseProfiler::VisitOMPInReductionClause(
623  const OMPInReductionClause *C) {
624  Profiler->VisitNestedNameSpecifier(
626  Profiler->VisitName(C->getNameInfo().getName());
627  VisitOMPClauseList(C);
628  VistOMPClauseWithPostUpdate(C);
629  for (auto *E : C->privates()) {
630  if (E)
631  Profiler->VisitStmt(E);
632  }
633  for (auto *E : C->lhs_exprs()) {
634  if (E)
635  Profiler->VisitStmt(E);
636  }
637  for (auto *E : C->rhs_exprs()) {
638  if (E)
639  Profiler->VisitStmt(E);
640  }
641  for (auto *E : C->reduction_ops()) {
642  if (E)
643  Profiler->VisitStmt(E);
644  }
645  for (auto *E : C->taskgroup_descriptors()) {
646  if (E)
647  Profiler->VisitStmt(E);
648  }
649 }
650 void OMPClauseProfiler::VisitOMPLinearClause(const OMPLinearClause *C) {
651  VisitOMPClauseList(C);
652  VistOMPClauseWithPostUpdate(C);
653  for (auto *E : C->privates()) {
654  if (E)
655  Profiler->VisitStmt(E);
656  }
657  for (auto *E : C->inits()) {
658  if (E)
659  Profiler->VisitStmt(E);
660  }
661  for (auto *E : C->updates()) {
662  if (E)
663  Profiler->VisitStmt(E);
664  }
665  for (auto *E : C->finals()) {
666  if (E)
667  Profiler->VisitStmt(E);
668  }
669  if (C->getStep())
670  Profiler->VisitStmt(C->getStep());
671  if (C->getCalcStep())
672  Profiler->VisitStmt(C->getCalcStep());
673 }
674 void OMPClauseProfiler::VisitOMPAlignedClause(const OMPAlignedClause *C) {
675  VisitOMPClauseList(C);
676  if (C->getAlignment())
677  Profiler->VisitStmt(C->getAlignment());
678 }
679 void OMPClauseProfiler::VisitOMPCopyinClause(const OMPCopyinClause *C) {
680  VisitOMPClauseList(C);
681  for (auto *E : C->source_exprs()) {
682  if (E)
683  Profiler->VisitStmt(E);
684  }
685  for (auto *E : C->destination_exprs()) {
686  if (E)
687  Profiler->VisitStmt(E);
688  }
689  for (auto *E : C->assignment_ops()) {
690  if (E)
691  Profiler->VisitStmt(E);
692  }
693 }
694 void
695 OMPClauseProfiler::VisitOMPCopyprivateClause(const OMPCopyprivateClause *C) {
696  VisitOMPClauseList(C);
697  for (auto *E : C->source_exprs()) {
698  if (E)
699  Profiler->VisitStmt(E);
700  }
701  for (auto *E : C->destination_exprs()) {
702  if (E)
703  Profiler->VisitStmt(E);
704  }
705  for (auto *E : C->assignment_ops()) {
706  if (E)
707  Profiler->VisitStmt(E);
708  }
709 }
710 void OMPClauseProfiler::VisitOMPFlushClause(const OMPFlushClause *C) {
711  VisitOMPClauseList(C);
712 }
713 void OMPClauseProfiler::VisitOMPDependClause(const OMPDependClause *C) {
714  VisitOMPClauseList(C);
715 }
716 void OMPClauseProfiler::VisitOMPDeviceClause(const OMPDeviceClause *C) {
717  if (C->getDevice())
718  Profiler->VisitStmt(C->getDevice());
719 }
720 void OMPClauseProfiler::VisitOMPMapClause(const OMPMapClause *C) {
721  VisitOMPClauseList(C);
722 }
723 void OMPClauseProfiler::VisitOMPAllocateClause(const OMPAllocateClause *C) {
724  if (Expr *Allocator = C->getAllocator())
725  Profiler->VisitStmt(Allocator);
726  VisitOMPClauseList(C);
727 }
728 void OMPClauseProfiler::VisitOMPNumTeamsClause(const OMPNumTeamsClause *C) {
729  VistOMPClauseWithPreInit(C);
730  if (C->getNumTeams())
731  Profiler->VisitStmt(C->getNumTeams());
732 }
733 void OMPClauseProfiler::VisitOMPThreadLimitClause(
734  const OMPThreadLimitClause *C) {
735  VistOMPClauseWithPreInit(C);
736  if (C->getThreadLimit())
737  Profiler->VisitStmt(C->getThreadLimit());
738 }
739 void OMPClauseProfiler::VisitOMPPriorityClause(const OMPPriorityClause *C) {
740  VistOMPClauseWithPreInit(C);
741  if (C->getPriority())
742  Profiler->VisitStmt(C->getPriority());
743 }
744 void OMPClauseProfiler::VisitOMPGrainsizeClause(const OMPGrainsizeClause *C) {
745  VistOMPClauseWithPreInit(C);
746  if (C->getGrainsize())
747  Profiler->VisitStmt(C->getGrainsize());
748 }
749 void OMPClauseProfiler::VisitOMPNumTasksClause(const OMPNumTasksClause *C) {
750  VistOMPClauseWithPreInit(C);
751  if (C->getNumTasks())
752  Profiler->VisitStmt(C->getNumTasks());
753 }
754 void OMPClauseProfiler::VisitOMPHintClause(const OMPHintClause *C) {
755  if (C->getHint())
756  Profiler->VisitStmt(C->getHint());
757 }
758 void OMPClauseProfiler::VisitOMPToClause(const OMPToClause *C) {
759  VisitOMPClauseList(C);
760 }
761 void OMPClauseProfiler::VisitOMPFromClause(const OMPFromClause *C) {
762  VisitOMPClauseList(C);
763 }
764 void OMPClauseProfiler::VisitOMPUseDevicePtrClause(
765  const OMPUseDevicePtrClause *C) {
766  VisitOMPClauseList(C);
767 }
768 void OMPClauseProfiler::VisitOMPIsDevicePtrClause(
769  const OMPIsDevicePtrClause *C) {
770  VisitOMPClauseList(C);
771 }
772 void OMPClauseProfiler::VisitOMPNontemporalClause(
773  const OMPNontemporalClause *C) {
774  VisitOMPClauseList(C);
775  for (auto *E : C->private_refs())
776  Profiler->VisitStmt(E);
777 }
778 } // namespace
779 
780 void
781 StmtProfiler::VisitOMPExecutableDirective(const OMPExecutableDirective *S) {
782  VisitStmt(S);
783  OMPClauseProfiler P(this);
784  ArrayRef<OMPClause *> Clauses = S->clauses();
785  for (ArrayRef<OMPClause *>::iterator I = Clauses.begin(), E = Clauses.end();
786  I != E; ++I)
787  if (*I)
788  P.Visit(*I);
789 }
790 
791 void StmtProfiler::VisitOMPLoopDirective(const OMPLoopDirective *S) {
792  VisitOMPExecutableDirective(S);
793 }
794 
795 void StmtProfiler::VisitOMPParallelDirective(const OMPParallelDirective *S) {
796  VisitOMPExecutableDirective(S);
797 }
798 
799 void StmtProfiler::VisitOMPSimdDirective(const OMPSimdDirective *S) {
800  VisitOMPLoopDirective(S);
801 }
802 
803 void StmtProfiler::VisitOMPForDirective(const OMPForDirective *S) {
804  VisitOMPLoopDirective(S);
805 }
806 
807 void StmtProfiler::VisitOMPForSimdDirective(const OMPForSimdDirective *S) {
808  VisitOMPLoopDirective(S);
809 }
810 
811 void StmtProfiler::VisitOMPSectionsDirective(const OMPSectionsDirective *S) {
812  VisitOMPExecutableDirective(S);
813 }
814 
815 void StmtProfiler::VisitOMPSectionDirective(const OMPSectionDirective *S) {
816  VisitOMPExecutableDirective(S);
817 }
818 
819 void StmtProfiler::VisitOMPSingleDirective(const OMPSingleDirective *S) {
820  VisitOMPExecutableDirective(S);
821 }
822 
823 void StmtProfiler::VisitOMPMasterDirective(const OMPMasterDirective *S) {
824  VisitOMPExecutableDirective(S);
825 }
826 
827 void StmtProfiler::VisitOMPCriticalDirective(const OMPCriticalDirective *S) {
828  VisitOMPExecutableDirective(S);
829  VisitName(S->getDirectiveName().getName());
830 }
831 
832 void
833 StmtProfiler::VisitOMPParallelForDirective(const OMPParallelForDirective *S) {
834  VisitOMPLoopDirective(S);
835 }
836 
837 void StmtProfiler::VisitOMPParallelForSimdDirective(
838  const OMPParallelForSimdDirective *S) {
839  VisitOMPLoopDirective(S);
840 }
841 
842 void StmtProfiler::VisitOMPParallelMasterDirective(
843  const OMPParallelMasterDirective *S) {
844  VisitOMPExecutableDirective(S);
845 }
846 
847 void StmtProfiler::VisitOMPParallelSectionsDirective(
848  const OMPParallelSectionsDirective *S) {
849  VisitOMPExecutableDirective(S);
850 }
851 
852 void StmtProfiler::VisitOMPTaskDirective(const OMPTaskDirective *S) {
853  VisitOMPExecutableDirective(S);
854 }
855 
856 void StmtProfiler::VisitOMPTaskyieldDirective(const OMPTaskyieldDirective *S) {
857  VisitOMPExecutableDirective(S);
858 }
859 
860 void StmtProfiler::VisitOMPBarrierDirective(const OMPBarrierDirective *S) {
861  VisitOMPExecutableDirective(S);
862 }
863 
864 void StmtProfiler::VisitOMPTaskwaitDirective(const OMPTaskwaitDirective *S) {
865  VisitOMPExecutableDirective(S);
866 }
867 
868 void StmtProfiler::VisitOMPTaskgroupDirective(const OMPTaskgroupDirective *S) {
869  VisitOMPExecutableDirective(S);
870  if (const Expr *E = S->getReductionRef())
871  VisitStmt(E);
872 }
873 
874 void StmtProfiler::VisitOMPFlushDirective(const OMPFlushDirective *S) {
875  VisitOMPExecutableDirective(S);
876 }
877 
878 void StmtProfiler::VisitOMPOrderedDirective(const OMPOrderedDirective *S) {
879  VisitOMPExecutableDirective(S);
880 }
881 
882 void StmtProfiler::VisitOMPAtomicDirective(const OMPAtomicDirective *S) {
883  VisitOMPExecutableDirective(S);
884 }
885 
886 void StmtProfiler::VisitOMPTargetDirective(const OMPTargetDirective *S) {
887  VisitOMPExecutableDirective(S);
888 }
889 
890 void StmtProfiler::VisitOMPTargetDataDirective(const OMPTargetDataDirective *S) {
891  VisitOMPExecutableDirective(S);
892 }
893 
894 void StmtProfiler::VisitOMPTargetEnterDataDirective(
895  const OMPTargetEnterDataDirective *S) {
896  VisitOMPExecutableDirective(S);
897 }
898 
899 void StmtProfiler::VisitOMPTargetExitDataDirective(
900  const OMPTargetExitDataDirective *S) {
901  VisitOMPExecutableDirective(S);
902 }
903 
904 void StmtProfiler::VisitOMPTargetParallelDirective(
905  const OMPTargetParallelDirective *S) {
906  VisitOMPExecutableDirective(S);
907 }
908 
909 void StmtProfiler::VisitOMPTargetParallelForDirective(
911  VisitOMPExecutableDirective(S);
912 }
913 
914 void StmtProfiler::VisitOMPTeamsDirective(const OMPTeamsDirective *S) {
915  VisitOMPExecutableDirective(S);
916 }
917 
918 void StmtProfiler::VisitOMPCancellationPointDirective(
920  VisitOMPExecutableDirective(S);
921 }
922 
923 void StmtProfiler::VisitOMPCancelDirective(const OMPCancelDirective *S) {
924  VisitOMPExecutableDirective(S);
925 }
926 
927 void StmtProfiler::VisitOMPTaskLoopDirective(const OMPTaskLoopDirective *S) {
928  VisitOMPLoopDirective(S);
929 }
930 
931 void StmtProfiler::VisitOMPTaskLoopSimdDirective(
932  const OMPTaskLoopSimdDirective *S) {
933  VisitOMPLoopDirective(S);
934 }
935 
936 void StmtProfiler::VisitOMPMasterTaskLoopDirective(
937  const OMPMasterTaskLoopDirective *S) {
938  VisitOMPLoopDirective(S);
939 }
940 
941 void StmtProfiler::VisitOMPMasterTaskLoopSimdDirective(
943  VisitOMPLoopDirective(S);
944 }
945 
946 void StmtProfiler::VisitOMPParallelMasterTaskLoopDirective(
948  VisitOMPLoopDirective(S);
949 }
950 
951 void StmtProfiler::VisitOMPParallelMasterTaskLoopSimdDirective(
953  VisitOMPLoopDirective(S);
954 }
955 
956 void StmtProfiler::VisitOMPDistributeDirective(
957  const OMPDistributeDirective *S) {
958  VisitOMPLoopDirective(S);
959 }
960 
961 void OMPClauseProfiler::VisitOMPDistScheduleClause(
962  const OMPDistScheduleClause *C) {
963  VistOMPClauseWithPreInit(C);
964  if (auto *S = C->getChunkSize())
965  Profiler->VisitStmt(S);
966 }
967 
968 void OMPClauseProfiler::VisitOMPDefaultmapClause(const OMPDefaultmapClause *) {}
969 
970 void StmtProfiler::VisitOMPTargetUpdateDirective(
971  const OMPTargetUpdateDirective *S) {
972  VisitOMPExecutableDirective(S);
973 }
974 
975 void StmtProfiler::VisitOMPDistributeParallelForDirective(
977  VisitOMPLoopDirective(S);
978 }
979 
980 void StmtProfiler::VisitOMPDistributeParallelForSimdDirective(
982  VisitOMPLoopDirective(S);
983 }
984 
985 void StmtProfiler::VisitOMPDistributeSimdDirective(
986  const OMPDistributeSimdDirective *S) {
987  VisitOMPLoopDirective(S);
988 }
989 
990 void StmtProfiler::VisitOMPTargetParallelForSimdDirective(
992  VisitOMPLoopDirective(S);
993 }
994 
995 void StmtProfiler::VisitOMPTargetSimdDirective(
996  const OMPTargetSimdDirective *S) {
997  VisitOMPLoopDirective(S);
998 }
999 
1000 void StmtProfiler::VisitOMPTeamsDistributeDirective(
1001  const OMPTeamsDistributeDirective *S) {
1002  VisitOMPLoopDirective(S);
1003 }
1004 
1005 void StmtProfiler::VisitOMPTeamsDistributeSimdDirective(
1007  VisitOMPLoopDirective(S);
1008 }
1009 
1010 void StmtProfiler::VisitOMPTeamsDistributeParallelForSimdDirective(
1012  VisitOMPLoopDirective(S);
1013 }
1014 
1015 void StmtProfiler::VisitOMPTeamsDistributeParallelForDirective(
1017  VisitOMPLoopDirective(S);
1018 }
1019 
1020 void StmtProfiler::VisitOMPTargetTeamsDirective(
1021  const OMPTargetTeamsDirective *S) {
1022  VisitOMPExecutableDirective(S);
1023 }
1024 
1025 void StmtProfiler::VisitOMPTargetTeamsDistributeDirective(
1027  VisitOMPLoopDirective(S);
1028 }
1029 
1030 void StmtProfiler::VisitOMPTargetTeamsDistributeParallelForDirective(
1032  VisitOMPLoopDirective(S);
1033 }
1034 
1035 void StmtProfiler::VisitOMPTargetTeamsDistributeParallelForSimdDirective(
1037  VisitOMPLoopDirective(S);
1038 }
1039 
1040 void StmtProfiler::VisitOMPTargetTeamsDistributeSimdDirective(
1042  VisitOMPLoopDirective(S);
1043 }
1044 
1045 void StmtProfiler::VisitExpr(const Expr *S) {
1046  VisitStmt(S);
1047 }
1048 
1049 void StmtProfiler::VisitConstantExpr(const ConstantExpr *S) {
1050  VisitExpr(S);
1051 }
1052 
1053 void StmtProfiler::VisitDeclRefExpr(const DeclRefExpr *S) {
1054  VisitExpr(S);
1055  if (!Canonical)
1056  VisitNestedNameSpecifier(S->getQualifier());
1057  VisitDecl(S->getDecl());
1058  if (!Canonical) {
1059  ID.AddBoolean(S->hasExplicitTemplateArgs());
1060  if (S->hasExplicitTemplateArgs())
1061  VisitTemplateArguments(S->getTemplateArgs(), S->getNumTemplateArgs());
1062  }
1063 }
1064 
1065 void StmtProfiler::VisitPredefinedExpr(const PredefinedExpr *S) {
1066  VisitExpr(S);
1067  ID.AddInteger(S->getIdentKind());
1068 }
1069 
1070 void StmtProfiler::VisitIntegerLiteral(const IntegerLiteral *S) {
1071  VisitExpr(S);
1072  S->getValue().Profile(ID);
1073  ID.AddInteger(S->getType()->castAs<BuiltinType>()->getKind());
1074 }
1075 
1076 void StmtProfiler::VisitFixedPointLiteral(const FixedPointLiteral *S) {
1077  VisitExpr(S);
1078  S->getValue().Profile(ID);
1079  ID.AddInteger(S->getType()->castAs<BuiltinType>()->getKind());
1080 }
1081 
1082 void StmtProfiler::VisitCharacterLiteral(const CharacterLiteral *S) {
1083  VisitExpr(S);
1084  ID.AddInteger(S->getKind());
1085  ID.AddInteger(S->getValue());
1086 }
1087 
1088 void StmtProfiler::VisitFloatingLiteral(const FloatingLiteral *S) {
1089  VisitExpr(S);
1090  S->getValue().Profile(ID);
1091  ID.AddBoolean(S->isExact());
1092  ID.AddInteger(S->getType()->castAs<BuiltinType>()->getKind());
1093 }
1094 
1095 void StmtProfiler::VisitImaginaryLiteral(const ImaginaryLiteral *S) {
1096  VisitExpr(S);
1097 }
1098 
1099 void StmtProfiler::VisitStringLiteral(const StringLiteral *S) {
1100  VisitExpr(S);
1101  ID.AddString(S->getBytes());
1102  ID.AddInteger(S->getKind());
1103 }
1104 
1105 void StmtProfiler::VisitParenExpr(const ParenExpr *S) {
1106  VisitExpr(S);
1107 }
1108 
1109 void StmtProfiler::VisitParenListExpr(const ParenListExpr *S) {
1110  VisitExpr(S);
1111 }
1112 
1113 void StmtProfiler::VisitUnaryOperator(const UnaryOperator *S) {
1114  VisitExpr(S);
1115  ID.AddInteger(S->getOpcode());
1116 }
1117 
1118 void StmtProfiler::VisitOffsetOfExpr(const OffsetOfExpr *S) {
1119  VisitType(S->getTypeSourceInfo()->getType());
1120  unsigned n = S->getNumComponents();
1121  for (unsigned i = 0; i < n; ++i) {
1122  const OffsetOfNode &ON = S->getComponent(i);
1123  ID.AddInteger(ON.getKind());
1124  switch (ON.getKind()) {
1125  case OffsetOfNode::Array:
1126  // Expressions handled below.
1127  break;
1128 
1129  case OffsetOfNode::Field:
1130  VisitDecl(ON.getField());
1131  break;
1132 
1134  VisitIdentifierInfo(ON.getFieldName());
1135  break;
1136 
1137  case OffsetOfNode::Base:
1138  // These nodes are implicit, and therefore don't need profiling.
1139  break;
1140  }
1141  }
1142 
1143  VisitExpr(S);
1144 }
1145 
1146 void
1147 StmtProfiler::VisitUnaryExprOrTypeTraitExpr(const UnaryExprOrTypeTraitExpr *S) {
1148  VisitExpr(S);
1149  ID.AddInteger(S->getKind());
1150  if (S->isArgumentType())
1151  VisitType(S->getArgumentType());
1152 }
1153 
1154 void StmtProfiler::VisitArraySubscriptExpr(const ArraySubscriptExpr *S) {
1155  VisitExpr(S);
1156 }
1157 
1158 void StmtProfiler::VisitOMPArraySectionExpr(const OMPArraySectionExpr *S) {
1159  VisitExpr(S);
1160 }
1161 
1162 void StmtProfiler::VisitCallExpr(const CallExpr *S) {
1163  VisitExpr(S);
1164 }
1165 
1166 void StmtProfiler::VisitMemberExpr(const MemberExpr *S) {
1167  VisitExpr(S);
1168  VisitDecl(S->getMemberDecl());
1169  if (!Canonical)
1170  VisitNestedNameSpecifier(S->getQualifier());
1171  ID.AddBoolean(S->isArrow());
1172 }
1173 
1174 void StmtProfiler::VisitCompoundLiteralExpr(const CompoundLiteralExpr *S) {
1175  VisitExpr(S);
1176  ID.AddBoolean(S->isFileScope());
1177 }
1178 
1179 void StmtProfiler::VisitCastExpr(const CastExpr *S) {
1180  VisitExpr(S);
1181 }
1182 
1183 void StmtProfiler::VisitImplicitCastExpr(const ImplicitCastExpr *S) {
1184  VisitCastExpr(S);
1185  ID.AddInteger(S->getValueKind());
1186 }
1187 
1188 void StmtProfiler::VisitExplicitCastExpr(const ExplicitCastExpr *S) {
1189  VisitCastExpr(S);
1190  VisitType(S->getTypeAsWritten());
1191 }
1192 
1193 void StmtProfiler::VisitCStyleCastExpr(const CStyleCastExpr *S) {
1194  VisitExplicitCastExpr(S);
1195 }
1196 
1197 void StmtProfiler::VisitBinaryOperator(const BinaryOperator *S) {
1198  VisitExpr(S);
1199  ID.AddInteger(S->getOpcode());
1200 }
1201 
1202 void
1203 StmtProfiler::VisitCompoundAssignOperator(const CompoundAssignOperator *S) {
1204  VisitBinaryOperator(S);
1205 }
1206 
1207 void StmtProfiler::VisitConditionalOperator(const ConditionalOperator *S) {
1208  VisitExpr(S);
1209 }
1210 
1211 void StmtProfiler::VisitBinaryConditionalOperator(
1212  const BinaryConditionalOperator *S) {
1213  VisitExpr(S);
1214 }
1215 
1216 void StmtProfiler::VisitAddrLabelExpr(const AddrLabelExpr *S) {
1217  VisitExpr(S);
1218  VisitDecl(S->getLabel());
1219 }
1220 
1221 void StmtProfiler::VisitStmtExpr(const StmtExpr *S) {
1222  VisitExpr(S);
1223 }
1224 
1225 void StmtProfiler::VisitShuffleVectorExpr(const ShuffleVectorExpr *S) {
1226  VisitExpr(S);
1227 }
1228 
1229 void StmtProfiler::VisitConvertVectorExpr(const ConvertVectorExpr *S) {
1230  VisitExpr(S);
1231 }
1232 
1233 void StmtProfiler::VisitChooseExpr(const ChooseExpr *S) {
1234  VisitExpr(S);
1235 }
1236 
1237 void StmtProfiler::VisitGNUNullExpr(const GNUNullExpr *S) {
1238  VisitExpr(S);
1239 }
1240 
1241 void StmtProfiler::VisitVAArgExpr(const VAArgExpr *S) {
1242  VisitExpr(S);
1243 }
1244 
1245 void StmtProfiler::VisitInitListExpr(const InitListExpr *S) {
1246  if (S->getSyntacticForm()) {
1247  VisitInitListExpr(S->getSyntacticForm());
1248  return;
1249  }
1250 
1251  VisitExpr(S);
1252 }
1253 
1254 void StmtProfiler::VisitDesignatedInitExpr(const DesignatedInitExpr *S) {
1255  VisitExpr(S);
1256  ID.AddBoolean(S->usesGNUSyntax());
1257  for (const DesignatedInitExpr::Designator &D : S->designators()) {
1258  if (D.isFieldDesignator()) {
1259  ID.AddInteger(0);
1260  VisitName(D.getFieldName());
1261  continue;
1262  }
1263 
1264  if (D.isArrayDesignator()) {
1265  ID.AddInteger(1);
1266  } else {
1267  assert(D.isArrayRangeDesignator());
1268  ID.AddInteger(2);
1269  }
1270  ID.AddInteger(D.getFirstExprIndex());
1271  }
1272 }
1273 
1274 // Seems that if VisitInitListExpr() only works on the syntactic form of an
1275 // InitListExpr, then a DesignatedInitUpdateExpr is not encountered.
1276 void StmtProfiler::VisitDesignatedInitUpdateExpr(
1277  const DesignatedInitUpdateExpr *S) {
1278  llvm_unreachable("Unexpected DesignatedInitUpdateExpr in syntactic form of "
1279  "initializer");
1280 }
1281 
1282 void StmtProfiler::VisitArrayInitLoopExpr(const ArrayInitLoopExpr *S) {
1283  VisitExpr(S);
1284 }
1285 
1286 void StmtProfiler::VisitArrayInitIndexExpr(const ArrayInitIndexExpr *S) {
1287  VisitExpr(S);
1288 }
1289 
1290 void StmtProfiler::VisitNoInitExpr(const NoInitExpr *S) {
1291  llvm_unreachable("Unexpected NoInitExpr in syntactic form of initializer");
1292 }
1293 
1294 void StmtProfiler::VisitImplicitValueInitExpr(const ImplicitValueInitExpr *S) {
1295  VisitExpr(S);
1296 }
1297 
1298 void StmtProfiler::VisitExtVectorElementExpr(const ExtVectorElementExpr *S) {
1299  VisitExpr(S);
1300  VisitName(&S->getAccessor());
1301 }
1302 
1303 void StmtProfiler::VisitBlockExpr(const BlockExpr *S) {
1304  VisitExpr(S);
1305  VisitDecl(S->getBlockDecl());
1306 }
1307 
1308 void StmtProfiler::VisitGenericSelectionExpr(const GenericSelectionExpr *S) {
1309  VisitExpr(S);
1310  for (const GenericSelectionExpr::ConstAssociation Assoc :
1311  S->associations()) {
1312  QualType T = Assoc.getType();
1313  if (T.isNull())
1314  ID.AddPointer(nullptr);
1315  else
1316  VisitType(T);
1317  VisitExpr(Assoc.getAssociationExpr());
1318  }
1319 }
1320 
1321 void StmtProfiler::VisitPseudoObjectExpr(const PseudoObjectExpr *S) {
1322  VisitExpr(S);
1324  i = S->semantics_begin(), e = S->semantics_end(); i != e; ++i)
1325  // Normally, we would not profile the source expressions of OVEs.
1326  if (const OpaqueValueExpr *OVE = dyn_cast<OpaqueValueExpr>(*i))
1327  Visit(OVE->getSourceExpr());
1328 }
1329 
1330 void StmtProfiler::VisitAtomicExpr(const AtomicExpr *S) {
1331  VisitExpr(S);
1332  ID.AddInteger(S->getOp());
1333 }
1334 
1335 void StmtProfiler::VisitConceptSpecializationExpr(
1336  const ConceptSpecializationExpr *S) {
1337  VisitExpr(S);
1338  VisitDecl(S->getNamedConcept());
1339  for (const TemplateArgument &Arg : S->getTemplateArguments())
1340  VisitTemplateArgument(Arg);
1341 }
1342 
1343 void StmtProfiler::VisitRequiresExpr(const RequiresExpr *S) {
1344  VisitExpr(S);
1345  ID.AddInteger(S->getLocalParameters().size());
1346  for (ParmVarDecl *LocalParam : S->getLocalParameters())
1347  VisitDecl(LocalParam);
1348  ID.AddInteger(S->getRequirements().size());
1349  for (concepts::Requirement *Req : S->getRequirements()) {
1350  if (auto *TypeReq = dyn_cast<concepts::TypeRequirement>(Req)) {
1351  ID.AddInteger(concepts::Requirement::RK_Type);
1352  ID.AddBoolean(TypeReq->isSubstitutionFailure());
1353  if (!TypeReq->isSubstitutionFailure())
1354  VisitType(TypeReq->getType()->getType());
1355  } else if (auto *ExprReq = dyn_cast<concepts::ExprRequirement>(Req)) {
1357  ID.AddBoolean(ExprReq->isExprSubstitutionFailure());
1358  if (!ExprReq->isExprSubstitutionFailure())
1359  Visit(ExprReq->getExpr());
1360  // C++2a [expr.prim.req.compound]p1 Example:
1361  // [...] The compound-requirement in C1 requires that x++ is a valid
1362  // expression. It is equivalent to the simple-requirement x++; [...]
1363  // We therefore do not profile isSimple() here.
1364  ID.AddBoolean(ExprReq->getNoexceptLoc().isValid());
1366  ExprReq->getReturnTypeRequirement();
1367  if (RetReq.isEmpty()) {
1368  ID.AddInteger(0);
1369  } else if (RetReq.isTypeConstraint()) {
1370  ID.AddInteger(1);
1372  } else {
1373  assert(RetReq.isSubstitutionFailure());
1374  ID.AddInteger(2);
1375  }
1376  } else {
1378  auto *NestedReq = cast<concepts::NestedRequirement>(Req);
1379  ID.AddBoolean(NestedReq->isSubstitutionFailure());
1380  if (!NestedReq->isSubstitutionFailure())
1381  Visit(NestedReq->getConstraintExpr());
1382  }
1383  }
1384 }
1385 
1387  UnaryOperatorKind &UnaryOp,
1388  BinaryOperatorKind &BinaryOp) {
1389  switch (S->getOperator()) {
1390  case OO_None:
1391  case OO_New:
1392  case OO_Delete:
1393  case OO_Array_New:
1394  case OO_Array_Delete:
1395  case OO_Arrow:
1396  case OO_Call:
1397  case OO_Conditional:
1399  llvm_unreachable("Invalid operator call kind");
1400 
1401  case OO_Plus:
1402  if (S->getNumArgs() == 1) {
1403  UnaryOp = UO_Plus;
1404  return Stmt::UnaryOperatorClass;
1405  }
1406 
1407  BinaryOp = BO_Add;
1408  return Stmt::BinaryOperatorClass;
1409 
1410  case OO_Minus:
1411  if (S->getNumArgs() == 1) {
1412  UnaryOp = UO_Minus;
1413  return Stmt::UnaryOperatorClass;
1414  }
1415 
1416  BinaryOp = BO_Sub;
1417  return Stmt::BinaryOperatorClass;
1418 
1419  case OO_Star:
1420  if (S->getNumArgs() == 1) {
1421  UnaryOp = UO_Deref;
1422  return Stmt::UnaryOperatorClass;
1423  }
1424 
1425  BinaryOp = BO_Mul;
1426  return Stmt::BinaryOperatorClass;
1427 
1428  case OO_Slash:
1429  BinaryOp = BO_Div;
1430  return Stmt::BinaryOperatorClass;
1431 
1432  case OO_Percent:
1433  BinaryOp = BO_Rem;
1434  return Stmt::BinaryOperatorClass;
1435 
1436  case OO_Caret:
1437  BinaryOp = BO_Xor;
1438  return Stmt::BinaryOperatorClass;
1439 
1440  case OO_Amp:
1441  if (S->getNumArgs() == 1) {
1442  UnaryOp = UO_AddrOf;
1443  return Stmt::UnaryOperatorClass;
1444  }
1445 
1446  BinaryOp = BO_And;
1447  return Stmt::BinaryOperatorClass;
1448 
1449  case OO_Pipe:
1450  BinaryOp = BO_Or;
1451  return Stmt::BinaryOperatorClass;
1452 
1453  case OO_Tilde:
1454  UnaryOp = UO_Not;
1455  return Stmt::UnaryOperatorClass;
1456 
1457  case OO_Exclaim:
1458  UnaryOp = UO_LNot;
1459  return Stmt::UnaryOperatorClass;
1460 
1461  case OO_Equal:
1462  BinaryOp = BO_Assign;
1463  return Stmt::BinaryOperatorClass;
1464 
1465  case OO_Less:
1466  BinaryOp = BO_LT;
1467  return Stmt::BinaryOperatorClass;
1468 
1469  case OO_Greater:
1470  BinaryOp = BO_GT;
1471  return Stmt::BinaryOperatorClass;
1472 
1473  case OO_PlusEqual:
1474  BinaryOp = BO_AddAssign;
1475  return Stmt::CompoundAssignOperatorClass;
1476 
1477  case OO_MinusEqual:
1478  BinaryOp = BO_SubAssign;
1479  return Stmt::CompoundAssignOperatorClass;
1480 
1481  case OO_StarEqual:
1482  BinaryOp = BO_MulAssign;
1483  return Stmt::CompoundAssignOperatorClass;
1484 
1485  case OO_SlashEqual:
1486  BinaryOp = BO_DivAssign;
1487  return Stmt::CompoundAssignOperatorClass;
1488 
1489  case OO_PercentEqual:
1490  BinaryOp = BO_RemAssign;
1491  return Stmt::CompoundAssignOperatorClass;
1492 
1493  case OO_CaretEqual:
1494  BinaryOp = BO_XorAssign;
1495  return Stmt::CompoundAssignOperatorClass;
1496 
1497  case OO_AmpEqual:
1498  BinaryOp = BO_AndAssign;
1499  return Stmt::CompoundAssignOperatorClass;
1500 
1501  case OO_PipeEqual:
1502  BinaryOp = BO_OrAssign;
1503  return Stmt::CompoundAssignOperatorClass;
1504 
1505  case OO_LessLess:
1506  BinaryOp = BO_Shl;
1507  return Stmt::BinaryOperatorClass;
1508 
1509  case OO_GreaterGreater:
1510  BinaryOp = BO_Shr;
1511  return Stmt::BinaryOperatorClass;
1512 
1513  case OO_LessLessEqual:
1514  BinaryOp = BO_ShlAssign;
1515  return Stmt::CompoundAssignOperatorClass;
1516 
1517  case OO_GreaterGreaterEqual:
1518  BinaryOp = BO_ShrAssign;
1519  return Stmt::CompoundAssignOperatorClass;
1520 
1521  case OO_EqualEqual:
1522  BinaryOp = BO_EQ;
1523  return Stmt::BinaryOperatorClass;
1524 
1525  case OO_ExclaimEqual:
1526  BinaryOp = BO_NE;
1527  return Stmt::BinaryOperatorClass;
1528 
1529  case OO_LessEqual:
1530  BinaryOp = BO_LE;
1531  return Stmt::BinaryOperatorClass;
1532 
1533  case OO_GreaterEqual:
1534  BinaryOp = BO_GE;
1535  return Stmt::BinaryOperatorClass;
1536 
1537  case OO_Spaceship:
1538  BinaryOp = BO_Cmp;
1539  return Stmt::BinaryOperatorClass;
1540 
1541  case OO_AmpAmp:
1542  BinaryOp = BO_LAnd;
1543  return Stmt::BinaryOperatorClass;
1544 
1545  case OO_PipePipe:
1546  BinaryOp = BO_LOr;
1547  return Stmt::BinaryOperatorClass;
1548 
1549  case OO_PlusPlus:
1550  UnaryOp = S->getNumArgs() == 1? UO_PreInc
1551  : UO_PostInc;
1552  return Stmt::UnaryOperatorClass;
1553 
1554  case OO_MinusMinus:
1555  UnaryOp = S->getNumArgs() == 1? UO_PreDec
1556  : UO_PostDec;
1557  return Stmt::UnaryOperatorClass;
1558 
1559  case OO_Comma:
1560  BinaryOp = BO_Comma;
1561  return Stmt::BinaryOperatorClass;
1562 
1563  case OO_ArrowStar:
1564  BinaryOp = BO_PtrMemI;
1565  return Stmt::BinaryOperatorClass;
1566 
1567  case OO_Subscript:
1568  return Stmt::ArraySubscriptExprClass;
1569 
1570  case OO_Coawait:
1571  UnaryOp = UO_Coawait;
1572  return Stmt::UnaryOperatorClass;
1573  }
1574 
1575  llvm_unreachable("Invalid overloaded operator expression");
1576 }
1577 
1578 #if defined(_MSC_VER) && !defined(__clang__)
1579 #if _MSC_VER == 1911
1580 // Work around https://developercommunity.visualstudio.com/content/problem/84002/clang-cl-when-built-with-vc-2017-crashes-cause-vc.html
1581 // MSVC 2017 update 3 miscompiles this function, and a clang built with it
1582 // will crash in stage 2 of a bootstrap build.
1583 #pragma optimize("", off)
1584 #endif
1585 #endif
1586 
1587 void StmtProfiler::VisitCXXOperatorCallExpr(const CXXOperatorCallExpr *S) {
1588  if (S->isTypeDependent()) {
1589  // Type-dependent operator calls are profiled like their underlying
1590  // syntactic operator.
1591  //
1592  // An operator call to operator-> is always implicit, so just skip it. The
1593  // enclosing MemberExpr will profile the actual member access.
1594  if (S->getOperator() == OO_Arrow)
1595  return Visit(S->getArg(0));
1596 
1597  UnaryOperatorKind UnaryOp = UO_Extension;
1598  BinaryOperatorKind BinaryOp = BO_Comma;
1599  Stmt::StmtClass SC = DecodeOperatorCall(S, UnaryOp, BinaryOp);
1600 
1601  ID.AddInteger(SC);
1602  for (unsigned I = 0, N = S->getNumArgs(); I != N; ++I)
1603  Visit(S->getArg(I));
1604  if (SC == Stmt::UnaryOperatorClass)
1605  ID.AddInteger(UnaryOp);
1606  else if (SC == Stmt::BinaryOperatorClass ||
1607  SC == Stmt::CompoundAssignOperatorClass)
1608  ID.AddInteger(BinaryOp);
1609  else
1610  assert(SC == Stmt::ArraySubscriptExprClass);
1611 
1612  return;
1613  }
1614 
1615  VisitCallExpr(S);
1616  ID.AddInteger(S->getOperator());
1617 }
1618 
1619 void StmtProfiler::VisitCXXRewrittenBinaryOperator(
1620  const CXXRewrittenBinaryOperator *S) {
1621  // If a rewritten operator were ever to be type-dependent, we should profile
1622  // it following its syntactic operator.
1623  assert(!S->isTypeDependent() &&
1624  "resolved rewritten operator should never be type-dependent");
1625  ID.AddBoolean(S->isReversed());
1626  VisitExpr(S->getSemanticForm());
1627 }
1628 
1629 #if defined(_MSC_VER) && !defined(__clang__)
1630 #if _MSC_VER == 1911
1631 #pragma optimize("", on)
1632 #endif
1633 #endif
1634 
1635 void StmtProfiler::VisitCXXMemberCallExpr(const CXXMemberCallExpr *S) {
1636  VisitCallExpr(S);
1637 }
1638 
1639 void StmtProfiler::VisitCUDAKernelCallExpr(const CUDAKernelCallExpr *S) {
1640  VisitCallExpr(S);
1641 }
1642 
1643 void StmtProfiler::VisitAsTypeExpr(const AsTypeExpr *S) {
1644  VisitExpr(S);
1645 }
1646 
1647 void StmtProfiler::VisitCXXNamedCastExpr(const CXXNamedCastExpr *S) {
1648  VisitExplicitCastExpr(S);
1649 }
1650 
1651 void StmtProfiler::VisitCXXStaticCastExpr(const CXXStaticCastExpr *S) {
1652  VisitCXXNamedCastExpr(S);
1653 }
1654 
1655 void StmtProfiler::VisitCXXDynamicCastExpr(const CXXDynamicCastExpr *S) {
1656  VisitCXXNamedCastExpr(S);
1657 }
1658 
1659 void
1660 StmtProfiler::VisitCXXReinterpretCastExpr(const CXXReinterpretCastExpr *S) {
1661  VisitCXXNamedCastExpr(S);
1662 }
1663 
1664 void StmtProfiler::VisitCXXConstCastExpr(const CXXConstCastExpr *S) {
1665  VisitCXXNamedCastExpr(S);
1666 }
1667 
1668 void StmtProfiler::VisitBuiltinBitCastExpr(const BuiltinBitCastExpr *S) {
1669  VisitExpr(S);
1670  VisitType(S->getTypeInfoAsWritten()->getType());
1671 }
1672 
1673 void StmtProfiler::VisitUserDefinedLiteral(const UserDefinedLiteral *S) {
1674  VisitCallExpr(S);
1675 }
1676 
1677 void StmtProfiler::VisitCXXBoolLiteralExpr(const CXXBoolLiteralExpr *S) {
1678  VisitExpr(S);
1679  ID.AddBoolean(S->getValue());
1680 }
1681 
1682 void StmtProfiler::VisitCXXNullPtrLiteralExpr(const CXXNullPtrLiteralExpr *S) {
1683  VisitExpr(S);
1684 }
1685 
1686 void StmtProfiler::VisitCXXStdInitializerListExpr(
1687  const CXXStdInitializerListExpr *S) {
1688  VisitExpr(S);
1689 }
1690 
1691 void StmtProfiler::VisitCXXTypeidExpr(const CXXTypeidExpr *S) {
1692  VisitExpr(S);
1693  if (S->isTypeOperand())
1694  VisitType(S->getTypeOperandSourceInfo()->getType());
1695 }
1696 
1697 void StmtProfiler::VisitCXXUuidofExpr(const CXXUuidofExpr *S) {
1698  VisitExpr(S);
1699  if (S->isTypeOperand())
1700  VisitType(S->getTypeOperandSourceInfo()->getType());
1701 }
1702 
1703 void StmtProfiler::VisitMSPropertyRefExpr(const MSPropertyRefExpr *S) {
1704  VisitExpr(S);
1705  VisitDecl(S->getPropertyDecl());
1706 }
1707 
1708 void StmtProfiler::VisitMSPropertySubscriptExpr(
1709  const MSPropertySubscriptExpr *S) {
1710  VisitExpr(S);
1711 }
1712 
1713 void StmtProfiler::VisitCXXThisExpr(const CXXThisExpr *S) {
1714  VisitExpr(S);
1715  ID.AddBoolean(S->isImplicit());
1716 }
1717 
1718 void StmtProfiler::VisitCXXThrowExpr(const CXXThrowExpr *S) {
1719  VisitExpr(S);
1720 }
1721 
1722 void StmtProfiler::VisitCXXDefaultArgExpr(const CXXDefaultArgExpr *S) {
1723  VisitExpr(S);
1724  VisitDecl(S->getParam());
1725 }
1726 
1727 void StmtProfiler::VisitCXXDefaultInitExpr(const CXXDefaultInitExpr *S) {
1728  VisitExpr(S);
1729  VisitDecl(S->getField());
1730 }
1731 
1732 void StmtProfiler::VisitCXXBindTemporaryExpr(const CXXBindTemporaryExpr *S) {
1733  VisitExpr(S);
1734  VisitDecl(
1735  const_cast<CXXDestructorDecl *>(S->getTemporary()->getDestructor()));
1736 }
1737 
1738 void StmtProfiler::VisitCXXConstructExpr(const CXXConstructExpr *S) {
1739  VisitExpr(S);
1740  VisitDecl(S->getConstructor());
1741  ID.AddBoolean(S->isElidable());
1742 }
1743 
1744 void StmtProfiler::VisitCXXInheritedCtorInitExpr(
1745  const CXXInheritedCtorInitExpr *S) {
1746  VisitExpr(S);
1747  VisitDecl(S->getConstructor());
1748 }
1749 
1750 void StmtProfiler::VisitCXXFunctionalCastExpr(const CXXFunctionalCastExpr *S) {
1751  VisitExplicitCastExpr(S);
1752 }
1753 
1754 void
1755 StmtProfiler::VisitCXXTemporaryObjectExpr(const CXXTemporaryObjectExpr *S) {
1756  VisitCXXConstructExpr(S);
1757 }
1758 
1759 void
1760 StmtProfiler::VisitLambdaExpr(const LambdaExpr *S) {
1761  VisitExpr(S);
1763  CEnd = S->explicit_capture_end();
1764  C != CEnd; ++C) {
1765  if (C->capturesVLAType())
1766  continue;
1767 
1768  ID.AddInteger(C->getCaptureKind());
1769  switch (C->getCaptureKind()) {
1770  case LCK_StarThis:
1771  case LCK_This:
1772  break;
1773  case LCK_ByRef:
1774  case LCK_ByCopy:
1775  VisitDecl(C->getCapturedVar());
1776  ID.AddBoolean(C->isPackExpansion());
1777  break;
1778  case LCK_VLAType:
1779  llvm_unreachable("VLA type in explicit captures.");
1780  }
1781  }
1782  // Note: If we actually needed to be able to match lambda
1783  // expressions, we would have to consider parameters and return type
1784  // here, among other things.
1785  VisitStmt(S->getBody());
1786 }
1787 
1788 void
1789 StmtProfiler::VisitCXXScalarValueInitExpr(const CXXScalarValueInitExpr *S) {
1790  VisitExpr(S);
1791 }
1792 
1793 void StmtProfiler::VisitCXXDeleteExpr(const CXXDeleteExpr *S) {
1794  VisitExpr(S);
1795  ID.AddBoolean(S->isGlobalDelete());
1796  ID.AddBoolean(S->isArrayForm());
1797  VisitDecl(S->getOperatorDelete());
1798 }
1799 
1800 void StmtProfiler::VisitCXXNewExpr(const CXXNewExpr *S) {
1801  VisitExpr(S);
1802  VisitType(S->getAllocatedType());
1803  VisitDecl(S->getOperatorNew());
1804  VisitDecl(S->getOperatorDelete());
1805  ID.AddBoolean(S->isArray());
1806  ID.AddInteger(S->getNumPlacementArgs());
1807  ID.AddBoolean(S->isGlobalNew());
1808  ID.AddBoolean(S->isParenTypeId());
1809  ID.AddInteger(S->getInitializationStyle());
1810 }
1811 
1812 void
1813 StmtProfiler::VisitCXXPseudoDestructorExpr(const CXXPseudoDestructorExpr *S) {
1814  VisitExpr(S);
1815  ID.AddBoolean(S->isArrow());
1816  VisitNestedNameSpecifier(S->getQualifier());
1817  ID.AddBoolean(S->getScopeTypeInfo() != nullptr);
1818  if (S->getScopeTypeInfo())
1819  VisitType(S->getScopeTypeInfo()->getType());
1820  ID.AddBoolean(S->getDestroyedTypeInfo() != nullptr);
1821  if (S->getDestroyedTypeInfo())
1822  VisitType(S->getDestroyedType());
1823  else
1824  VisitIdentifierInfo(S->getDestroyedTypeIdentifier());
1825 }
1826 
1827 void StmtProfiler::VisitOverloadExpr(const OverloadExpr *S) {
1828  VisitExpr(S);
1829  VisitNestedNameSpecifier(S->getQualifier());
1830  VisitName(S->getName(), /*TreatAsDecl*/ true);
1831  ID.AddBoolean(S->hasExplicitTemplateArgs());
1832  if (S->hasExplicitTemplateArgs())
1833  VisitTemplateArguments(S->getTemplateArgs(), S->getNumTemplateArgs());
1834 }
1835 
1836 void
1837 StmtProfiler::VisitUnresolvedLookupExpr(const UnresolvedLookupExpr *S) {
1838  VisitOverloadExpr(S);
1839 }
1840 
1841 void StmtProfiler::VisitTypeTraitExpr(const TypeTraitExpr *S) {
1842  VisitExpr(S);
1843  ID.AddInteger(S->getTrait());
1844  ID.AddInteger(S->getNumArgs());
1845  for (unsigned I = 0, N = S->getNumArgs(); I != N; ++I)
1846  VisitType(S->getArg(I)->getType());
1847 }
1848 
1849 void StmtProfiler::VisitArrayTypeTraitExpr(const ArrayTypeTraitExpr *S) {
1850  VisitExpr(S);
1851  ID.AddInteger(S->getTrait());
1852  VisitType(S->getQueriedType());
1853 }
1854 
1855 void StmtProfiler::VisitExpressionTraitExpr(const ExpressionTraitExpr *S) {
1856  VisitExpr(S);
1857  ID.AddInteger(S->getTrait());
1858  VisitExpr(S->getQueriedExpression());
1859 }
1860 
1861 void StmtProfiler::VisitDependentScopeDeclRefExpr(
1862  const DependentScopeDeclRefExpr *S) {
1863  VisitExpr(S);
1864  VisitName(S->getDeclName());
1865  VisitNestedNameSpecifier(S->getQualifier());
1866  ID.AddBoolean(S->hasExplicitTemplateArgs());
1867  if (S->hasExplicitTemplateArgs())
1868  VisitTemplateArguments(S->getTemplateArgs(), S->getNumTemplateArgs());
1869 }
1870 
1871 void StmtProfiler::VisitExprWithCleanups(const ExprWithCleanups *S) {
1872  VisitExpr(S);
1873 }
1874 
1875 void StmtProfiler::VisitCXXUnresolvedConstructExpr(
1876  const CXXUnresolvedConstructExpr *S) {
1877  VisitExpr(S);
1878  VisitType(S->getTypeAsWritten());
1879  ID.AddInteger(S->isListInitialization());
1880 }
1881 
1882 void StmtProfiler::VisitCXXDependentScopeMemberExpr(
1883  const CXXDependentScopeMemberExpr *S) {
1884  ID.AddBoolean(S->isImplicitAccess());
1885  if (!S->isImplicitAccess()) {
1886  VisitExpr(S);
1887  ID.AddBoolean(S->isArrow());
1888  }
1889  VisitNestedNameSpecifier(S->getQualifier());
1890  VisitName(S->getMember());
1891  ID.AddBoolean(S->hasExplicitTemplateArgs());
1892  if (S->hasExplicitTemplateArgs())
1893  VisitTemplateArguments(S->getTemplateArgs(), S->getNumTemplateArgs());
1894 }
1895 
1896 void StmtProfiler::VisitUnresolvedMemberExpr(const UnresolvedMemberExpr *S) {
1897  ID.AddBoolean(S->isImplicitAccess());
1898  if (!S->isImplicitAccess()) {
1899  VisitExpr(S);
1900  ID.AddBoolean(S->isArrow());
1901  }
1902  VisitNestedNameSpecifier(S->getQualifier());
1903  VisitName(S->getMemberName());
1904  ID.AddBoolean(S->hasExplicitTemplateArgs());
1905  if (S->hasExplicitTemplateArgs())
1906  VisitTemplateArguments(S->getTemplateArgs(), S->getNumTemplateArgs());
1907 }
1908 
1909 void StmtProfiler::VisitCXXNoexceptExpr(const CXXNoexceptExpr *S) {
1910  VisitExpr(S);
1911 }
1912 
1913 void StmtProfiler::VisitPackExpansionExpr(const PackExpansionExpr *S) {
1914  VisitExpr(S);
1915 }
1916 
1917 void StmtProfiler::VisitSizeOfPackExpr(const SizeOfPackExpr *S) {
1918  VisitExpr(S);
1919  VisitDecl(S->getPack());
1920  if (S->isPartiallySubstituted()) {
1921  auto Args = S->getPartialArguments();
1922  ID.AddInteger(Args.size());
1923  for (const auto &TA : Args)
1924  VisitTemplateArgument(TA);
1925  } else {
1926  ID.AddInteger(0);
1927  }
1928 }
1929 
1930 void StmtProfiler::VisitSubstNonTypeTemplateParmPackExpr(
1932  VisitExpr(S);
1933  VisitDecl(S->getParameterPack());
1934  VisitTemplateArgument(S->getArgumentPack());
1935 }
1936 
1937 void StmtProfiler::VisitSubstNonTypeTemplateParmExpr(
1938  const SubstNonTypeTemplateParmExpr *E) {
1939  // Profile exactly as the replacement expression.
1940  Visit(E->getReplacement());
1941 }
1942 
1943 void StmtProfiler::VisitFunctionParmPackExpr(const FunctionParmPackExpr *S) {
1944  VisitExpr(S);
1945  VisitDecl(S->getParameterPack());
1946  ID.AddInteger(S->getNumExpansions());
1947  for (FunctionParmPackExpr::iterator I = S->begin(), E = S->end(); I != E; ++I)
1948  VisitDecl(*I);
1949 }
1950 
1951 void StmtProfiler::VisitMaterializeTemporaryExpr(
1952  const MaterializeTemporaryExpr *S) {
1953  VisitExpr(S);
1954 }
1955 
1956 void StmtProfiler::VisitCXXFoldExpr(const CXXFoldExpr *S) {
1957  VisitExpr(S);
1958  ID.AddInteger(S->getOperator());
1959 }
1960 
1961 void StmtProfiler::VisitCoroutineBodyStmt(const CoroutineBodyStmt *S) {
1962  VisitStmt(S);
1963 }
1964 
1965 void StmtProfiler::VisitCoreturnStmt(const CoreturnStmt *S) {
1966  VisitStmt(S);
1967 }
1968 
1969 void StmtProfiler::VisitCoawaitExpr(const CoawaitExpr *S) {
1970  VisitExpr(S);
1971 }
1972 
1973 void StmtProfiler::VisitDependentCoawaitExpr(const DependentCoawaitExpr *S) {
1974  VisitExpr(S);
1975 }
1976 
1977 void StmtProfiler::VisitCoyieldExpr(const CoyieldExpr *S) {
1978  VisitExpr(S);
1979 }
1980 
1981 void StmtProfiler::VisitOpaqueValueExpr(const OpaqueValueExpr *E) {
1982  VisitExpr(E);
1983 }
1984 
1985 void StmtProfiler::VisitTypoExpr(const TypoExpr *E) {
1986  VisitExpr(E);
1987 }
1988 
1989 void StmtProfiler::VisitSourceLocExpr(const SourceLocExpr *E) {
1990  VisitExpr(E);
1991 }
1992 
1993 void StmtProfiler::VisitObjCStringLiteral(const ObjCStringLiteral *S) {
1994  VisitExpr(S);
1995 }
1996 
1997 void StmtProfiler::VisitObjCBoxedExpr(const ObjCBoxedExpr *E) {
1998  VisitExpr(E);
1999 }
2000 
2001 void StmtProfiler::VisitObjCArrayLiteral(const ObjCArrayLiteral *E) {
2002  VisitExpr(E);
2003 }
2004 
2005 void StmtProfiler::VisitObjCDictionaryLiteral(const ObjCDictionaryLiteral *E) {
2006  VisitExpr(E);
2007 }
2008 
2009 void StmtProfiler::VisitObjCEncodeExpr(const ObjCEncodeExpr *S) {
2010  VisitExpr(S);
2011  VisitType(S->getEncodedType());
2012 }
2013 
2014 void StmtProfiler::VisitObjCSelectorExpr(const ObjCSelectorExpr *S) {
2015  VisitExpr(S);
2016  VisitName(S->getSelector());
2017 }
2018 
2019 void StmtProfiler::VisitObjCProtocolExpr(const ObjCProtocolExpr *S) {
2020  VisitExpr(S);
2021  VisitDecl(S->getProtocol());
2022 }
2023 
2024 void StmtProfiler::VisitObjCIvarRefExpr(const ObjCIvarRefExpr *S) {
2025  VisitExpr(S);
2026  VisitDecl(S->getDecl());
2027  ID.AddBoolean(S->isArrow());
2028  ID.AddBoolean(S->isFreeIvar());
2029 }
2030 
2031 void StmtProfiler::VisitObjCPropertyRefExpr(const ObjCPropertyRefExpr *S) {
2032  VisitExpr(S);
2033  if (S->isImplicitProperty()) {
2034  VisitDecl(S->getImplicitPropertyGetter());
2035  VisitDecl(S->getImplicitPropertySetter());
2036  } else {
2037  VisitDecl(S->getExplicitProperty());
2038  }
2039  if (S->isSuperReceiver()) {
2040  ID.AddBoolean(S->isSuperReceiver());
2041  VisitType(S->getSuperReceiverType());
2042  }
2043 }
2044 
2045 void StmtProfiler::VisitObjCSubscriptRefExpr(const ObjCSubscriptRefExpr *S) {
2046  VisitExpr(S);
2047  VisitDecl(S->getAtIndexMethodDecl());
2048  VisitDecl(S->setAtIndexMethodDecl());
2049 }
2050 
2051 void StmtProfiler::VisitObjCMessageExpr(const ObjCMessageExpr *S) {
2052  VisitExpr(S);
2053  VisitName(S->getSelector());
2054  VisitDecl(S->getMethodDecl());
2055 }
2056 
2057 void StmtProfiler::VisitObjCIsaExpr(const ObjCIsaExpr *S) {
2058  VisitExpr(S);
2059  ID.AddBoolean(S->isArrow());
2060 }
2061 
2062 void StmtProfiler::VisitObjCBoolLiteralExpr(const ObjCBoolLiteralExpr *S) {
2063  VisitExpr(S);
2064  ID.AddBoolean(S->getValue());
2065 }
2066 
2067 void StmtProfiler::VisitObjCIndirectCopyRestoreExpr(
2068  const ObjCIndirectCopyRestoreExpr *S) {
2069  VisitExpr(S);
2070  ID.AddBoolean(S->shouldCopy());
2071 }
2072 
2073 void StmtProfiler::VisitObjCBridgedCastExpr(const ObjCBridgedCastExpr *S) {
2074  VisitExplicitCastExpr(S);
2075  ID.AddBoolean(S->getBridgeKind());
2076 }
2077 
2078 void StmtProfiler::VisitObjCAvailabilityCheckExpr(
2079  const ObjCAvailabilityCheckExpr *S) {
2080  VisitExpr(S);
2081 }
2082 
2083 void StmtProfiler::VisitTemplateArguments(const TemplateArgumentLoc *Args,
2084  unsigned NumArgs) {
2085  ID.AddInteger(NumArgs);
2086  for (unsigned I = 0; I != NumArgs; ++I)
2087  VisitTemplateArgument(Args[I].getArgument());
2088 }
2089 
2090 void StmtProfiler::VisitTemplateArgument(const TemplateArgument &Arg) {
2091  // Mostly repetitive with TemplateArgument::Profile!
2092  ID.AddInteger(Arg.getKind());
2093  switch (Arg.getKind()) {
2095  break;
2096 
2098  VisitType(Arg.getAsType());
2099  break;
2100 
2103  VisitTemplateName(Arg.getAsTemplateOrTemplatePattern());
2104  break;
2105 
2107  VisitDecl(Arg.getAsDecl());
2108  break;
2109 
2111  VisitType(Arg.getNullPtrType());
2112  break;
2113 
2115  Arg.getAsIntegral().Profile(ID);
2116  VisitType(Arg.getIntegralType());
2117  break;
2118 
2120  Visit(Arg.getAsExpr());
2121  break;
2122 
2124  for (const auto &P : Arg.pack_elements())
2125  VisitTemplateArgument(P);
2126  break;
2127  }
2128 }
2129 
2130 void Stmt::Profile(llvm::FoldingSetNodeID &ID, const ASTContext &Context,
2131  bool Canonical) const {
2132  StmtProfilerWithPointers Profiler(ID, Context, Canonical);
2133  Profiler.Visit(this);
2134 }
2135 
2136 void Stmt::ProcessODRHash(llvm::FoldingSetNodeID &ID,
2137  class ODRHash &Hash) const {
2138  StmtProfilerWithoutPointers Profiler(ID, Hash);
2139  Profiler.Visit(this);
2140 }
ObjCPropertyRefExpr - A dot-syntax expression to access an ObjC property.
Definition: ExprObjC.h:614
ObjCIndirectCopyRestoreExpr - Represents the passing of a function argument by indirect copy-restore ...
Definition: ExprObjC.h:1577
A call to an overloaded operator written using operator syntax.
Definition: ExprCXX.h:78
Represents a single C99 designator.
Definition: Expr.h:4714
unsigned getNumTemplateArgs() const
Retrieve the number of template arguments provided as part of this template-id.
Definition: Expr.h:1348
Expr * getImmediatelyDeclaredConstraint() const
Get the immediately-declared constraint expression introduced by this type-constraint, that is - the constraint expression that is added to the associated constraints of the enclosing declaration in practice.
Definition: ASTConcept.h:187
Defines the clang::ASTContext interface.
const BlockDecl * getBlockDecl() const
Definition: Expr.h:5593
This represents &#39;#pragma omp distribute simd&#39; composite directive.
Definition: StmtOpenMP.h:3757
This represents &#39;#pragma omp master&#39; directive.
Definition: StmtOpenMP.h:1591
TypeSourceInfo * getTypeOperandSourceInfo() const
Retrieve source information for the type operand.
Definition: ExprCXX.h:1036
The null pointer literal (C++11 [lex.nullptr])
Definition: ExprCXX.h:683
const CXXDestructorDecl * getDestructor() const
Definition: ExprCXX.h:1352
capture_iterator explicit_capture_end() const
Retrieve an iterator pointing past the end of the sequence of explicit lambda captures.
Definition: ExprCXX.cpp:1261
This represents &#39;#pragma omp task&#39; directive.
Definition: StmtOpenMP.h:1986
This represents a GCC inline-assembly statement extension.
Definition: Stmt.h:2878
Represents a &#39;co_await&#39; expression while the type of the promise is dependent.
Definition: ExprCXX.h:4735
bool getValue() const
Definition: ExprObjC.h:97
helper_expr_const_range reduction_ops() const
This represents &#39;thread_limit&#39; clause in the &#39;#pragma omp ...&#39; directive.
bool hasExplicitTemplateArgs() const
Determines whether this expression had explicit template arguments.
Definition: ExprCXX.h:2995
unsigned getNumInputs() const
Definition: Stmt.h:2790
const TemplateArgumentLoc * getTemplateArgs() const
Retrieve the template arguments provided as part of this template-id.
Definition: Expr.h:1340
helper_expr_const_range lhs_exprs() const
This represents clause &#39;copyin&#39; in the &#39;#pragma omp ...&#39; directives.
A (possibly-)qualified type.
Definition: Type.h:654
StringKind getKind() const
Definition: Expr.h:1826
ValueDecl * getMemberDecl() const
Retrieve the member declaration to which this expression refers.
Definition: Expr.h:2919
ArrayRef< OMPClause * > clauses()
Definition: StmtOpenMP.h:325
Expr * getArg(unsigned Arg)
getArg - Return the specified argument.
Definition: Expr.h:2702
ObjCMethodDecl * getAtIndexMethodDecl() const
Definition: ExprObjC.h:896
static const TemplateArgument & getArgument(const TemplateArgument &A)
Selector getSelector() const
Definition: ExprObjC.cpp:337
void AddDeclarationName(DeclarationName Name, bool TreatAsDecl=false)
Definition: ODRHash.cpp:34
ConstStmtVisitor - This class implements a simple visitor for Stmt subclasses.
Definition: StmtVisitor.h:193
This file contains the declaration of the ODRHash class, which calculates a hash based on AST nodes...
bool isSuperReceiver() const
Definition: ExprObjC.h:776
A type trait used in the implementation of various C++11 and Library TR1 trait templates.
Definition: ExprCXX.h:2627
ArrayRef< ParmVarDecl * > getLocalParameters() const
Definition: ExprConcepts.h:507
VarDecl * getParameterPack() const
Get the parameter pack which this expression refers to.
Definition: ExprCXX.h:4366
This represents &#39;atomic_default_mem_order&#39; clause in the &#39;#pragma omp requires&#39; directive.
bool isListInitialization() const
Determine whether this expression models list-initialization.
Definition: ExprCXX.h:3444
helper_expr_const_range rhs_exprs() const
private_copies_range private_copies()
ObjCProtocolDecl * getProtocol() const
Definition: ExprObjC.h:519
Represents a &#39;co_return&#39; statement in the C++ Coroutines TS.
Definition: StmtCXX.h:456
Stmt - This represents one statement.
Definition: Stmt.h:66
unsigned getNumArgs() const
getNumArgs - Return the number of actual arguments to this call.
Definition: Expr.h:2689
This represents clause &#39;in_reduction&#39; in the &#39;#pragma omp task&#39; directives.
void AddQualType(QualType T)
Definition: ODRHash.cpp:1124
IfStmt - This represents an if/then/else.
Definition: Stmt.h:1834
TemplateArgumentLoc const * getTemplateArgs() const
Definition: ExprCXX.h:3253
Class that handles pre-initialization statement for some clauses, like &#39;shedule&#39;, &#39;firstprivate&#39; etc...
Definition: OpenMPClause.h:108
ObjCMethodDecl * setAtIndexMethodDecl() const
Definition: ExprObjC.h:900
unsigned getNumOutputs() const
Definition: Stmt.h:2768
This represents &#39;#pragma omp for simd&#39; directive.
Definition: StmtOpenMP.h:1337
The template argument is an expression, and we&#39;ve not resolved it to one of the other forms yet...
Definition: TemplateBase.h:86
Expr * getAllocator() const
Returns allocator.
Definition: OpenMPClause.h:301
const StringLiteral * getAsmString() const
Definition: Stmt.h:2906
helper_expr_const_range rhs_exprs() const
Decl - This represents one declaration (or definition), e.g.
Definition: DeclBase.h:88
This represents &#39;grainsize&#39; clause in the &#39;#pragma omp ...&#39; directive.
This represents &#39;#pragma omp teams distribute parallel for&#39; composite directive.
Definition: StmtOpenMP.h:4171
llvm::APFloat getValue() const
Definition: Expr.h:1597
ObjCMethodDecl * getImplicitPropertySetter() const
Definition: ExprObjC.h:717
Represents the index of the current element of an array being initialized by an ArrayInitLoopExpr.
Definition: Expr.h:5082
FunctionDecl * getOperatorNew() const
Definition: ExprCXX.h:2218
A reference to a name which we were able to look up during parsing but could not resolve to a specifi...
Definition: ExprCXX.h:3037
This represents &#39;if&#39; clause in the &#39;#pragma omp ...&#39; directive.
Definition: OpenMPClause.h:425
DeclarationNameInfo getNameInfo() const
Retrieve the name of the entity we&#39;re testing for, along with location information.
Definition: StmtCXX.h:288
Defines the C++ template declaration subclasses.
Opcode getOpcode() const
Definition: Expr.h:3469
StringRef P
This represents &#39;#pragma omp parallel master&#39; directive.
Definition: StmtOpenMP.h:1863
Represents an attribute applied to a statement.
Definition: Stmt.h:1776
ParenExpr - This represents a parethesized expression, e.g.
Definition: Expr.h:1994
helper_expr_const_range assignment_ops() const
NestedNameSpecifierLoc getQualifierLoc() const
Retrieve the nested-name-specifier that qualifies this name, if any.
Definition: StmtCXX.h:284
This represents &#39;priority&#39; clause in the &#39;#pragma omp ...&#39; directive.
This represents &#39;#pragma omp target teams distribute&#39; combined directive.
Definition: StmtOpenMP.h:4310
helper_expr_const_range lhs_exprs() const
NestedNameSpecifier * getQualifier() const
Retrieve the nested-name-specifier that qualifies this declaration.
Definition: ExprCXX.h:3211
Represents Objective-C&#39;s @throw statement.
Definition: StmtObjC.h:332
bool hasExplicitTemplateArgs() const
Determines whether this declaration reference was followed by an explicit template argument list...
Definition: Expr.h:1328
The template argument is a declaration that was provided for a pointer, reference, or pointer to member non-type template parameter.
Definition: TemplateBase.h:63
Represents a call to a C++ constructor.
Definition: ExprCXX.h:1422
ObjCSubscriptRefExpr - used for array and dictionary subscripting.
Definition: ExprObjC.h:845
TypeSourceInfo * getTypeInfoAsWritten() const
getTypeInfoAsWritten - Returns the type source info for the type that this expression is casting to...
Definition: Expr.h:3355
An Embarcadero array type trait, as used in the implementation of __array_rank and __array_extent...
Definition: ExprCXX.h:2715
Expr * getCondition() const
Returns condition.
Definition: OpenMPClause.h:567
This represents &#39;update&#39; clause in the &#39;#pragma omp atomic&#39; directive.
NestedNameSpecifier * getQualifier() const
If the member name was qualified, retrieves the nested-name-specifier that precedes the member name...
Definition: ExprCXX.h:2536
Expr * getCondition() const
Returns condition.
Definition: OpenMPClause.h:493
This represents &#39;#pragma omp parallel for&#39; directive.
Definition: StmtOpenMP.h:1715
MS property subscript expression.
Definition: ExprCXX.h:937
IdentKind getIdentKind() const
Definition: Expr.h:1951
This represents &#39;#pragma omp target teams distribute parallel for&#39; combined directive.
Definition: StmtOpenMP.h:4379
Describes the capture of a variable or of this, or of a C++1y init-capture.
Definition: LambdaCapture.h:25
Represents a prvalue temporary that is written into memory so that a reference can bind to it...
Definition: ExprCXX.h:4419
Expr * getAlignment()
Returns alignment.
Expr * getNumForLoops() const
Return the number of associated for-loops.
This represents &#39;#pragma omp target exit data&#39; directive.
Definition: StmtOpenMP.h:2690
This represents &#39;read&#39; clause in the &#39;#pragma omp atomic&#39; directive.
helper_expr_const_range assignment_ops() const
This represents clause &#39;private&#39; in the &#39;#pragma omp ...&#39; directives.
ObjCIsaExpr - Represent X->isa and X.isa when X is an ObjC &#39;id&#39; type.
Definition: ExprObjC.h:1492
CompoundLiteralExpr - [C99 6.5.2.5].
Definition: Expr.h:3077
This represents &#39;num_threads&#39; clause in the &#39;#pragma omp ...&#39; directive.
Definition: OpenMPClause.h:594
unsigned getNumArgs() const
Determine the number of arguments to this type trait.
Definition: ExprCXX.h:2676
Represents an empty template argument, e.g., one that has not been deduced.
Definition: TemplateBase.h:56
This represents &#39;defaultmap&#39; clause in the &#39;#pragma omp ...&#39; directive.
void Profile(llvm::FoldingSetNodeID &ID, const ASTContext &Context, bool Canonical) const
Produce a unique representation of the given statement.
bool isArrow() const
Definition: ExprObjC.h:1520
void * getAsOpaquePtr() const
Get the representation of this declaration name as an opaque pointer.
DeclarationName getName() const
Gets the name looked up.
Definition: ExprCXX.h:2953
Implicit construction of a std::initializer_list<T> object from an array temporary within list-initia...
Definition: ExprCXX.h:715
unsigned getNumPlacementArgs() const
Definition: ExprCXX.h:2236
This represents implicit clause &#39;flush&#39; for the &#39;#pragma omp flush&#39; directive.
const DeclarationNameInfo & getNameInfo() const
Gets the name info for specified reduction identifier.
CXXConstructorDecl * getConstructor() const
Get the constructor that this expression will call.
Definition: ExprCXX.h:1648
A C++ throw-expression (C++ [except.throw]).
Definition: ExprCXX.h:1140
Represents an expression – generally a full-expression – that introduces cleanups to be run at the ...
Definition: ExprCXX.h:3306
This represents &#39;reverse_offload&#39; clause in the &#39;#pragma omp requires&#39; directive. ...
TypeSourceInfo * getArg(unsigned I) const
Retrieve the Ith argument.
Definition: ExprCXX.h:2679
Represents a parameter to a function.
Definition: Decl.h:1595
Defines the clang::Expr interface and subclasses for C++ expressions.
QualType getIntegralType() const
Retrieve the type of the integral value.
Definition: TemplateBase.h:314
StringRef getInputName(unsigned i) const
Definition: Stmt.h:2998
iterator begin() const
Definition: ExprCXX.h:4374
Expr * getGrainsize() const
Return safe iteration space distance.
This represents &#39;nogroup&#39; clause in the &#39;#pragma omp ...&#39; directive.
This represents &#39;allocator&#39; clause in the &#39;#pragma omp ...&#39; directive.
Definition: OpenMPClause.h:266
This represents &#39;safelen&#39; clause in the &#39;#pragma omp ...&#39; directive.
Definition: OpenMPClause.h:670
ObjCPropertyDecl * getExplicitProperty() const
Definition: ExprObjC.h:707
A C++ static_cast expression (C++ [expr.static.cast]).
Definition: ExprCXX.h:409
LabelStmt - Represents a label, which has a substatement.
Definition: Stmt.h:1732
Represents a C99 designated initializer expression.
Definition: Expr.h:4639
Expr * getSemanticForm()
Get an equivalent semantic form for this expression.
Definition: ExprCXX.h:293
TypeSourceInfo * getScopeTypeInfo() const
Retrieve the scope type in a qualified pseudo-destructor expression.
Definition: ExprCXX.h:2556
One of these records is kept for each identifier that is lexed.
FieldDecl * getField() const
For a field offsetof node, returns the field.
Definition: Expr.h:2227
Represents a function call to one of __builtin_LINE(), __builtin_COLUMN(), __builtin_FUNCTION(), or __builtin_FILE().
Definition: Expr.h:4295
C++2a [expr.prim.req]: A requires-expression provides a concise way to express requirements on templa...
Definition: ExprConcepts.h:470
This represents &#39;#pragma omp parallel&#39; directive.
Definition: StmtOpenMP.h:357
ShuffleVectorExpr - clang-specific builtin-in function __builtin_shufflevector.
Definition: Expr.h:3999
Expr * getAsExpr() const
Retrieve the template argument as an expression.
Definition: TemplateBase.h:329
Holds long-lived AST nodes (such as types and decls) that can be referred to throughout the semantic ...
Definition: ASTContext.h:168
QualType getCaughtType() const
Definition: StmtCXX.cpp:19
This represents &#39;simd&#39; clause in the &#39;#pragma omp ...&#39; directive.
The template argument is an integral value stored in an llvm::APSInt that was provided for an integra...
Definition: TemplateBase.h:71
bool isFileScope() const
Definition: Expr.h:3107
This represents clause &#39;lastprivate&#39; in the &#39;#pragma omp ...&#39; directives.
This represents clause &#39;allocate&#39; in the &#39;#pragma omp ...&#39; directives.
Definition: OpenMPClause.h:328
Represents a place-holder for an object not to be initialized by anything.
Definition: Expr.h:4937
CompoundStmt * getBody() const
Retrieve the body of the lambda.
Definition: ExprCXX.cpp:1307
Expr * getChunkSize()
Get chunk size.
GNUNullExpr - Implements the GNU __null extension, which is a name for a null pointer constant that h...
Definition: Expr.h:4210
This represents clause &#39;map&#39; in the &#39;#pragma omp ...&#39; directives.
QualType getDestroyedType() const
Retrieve the type being destroyed.
Definition: ExprCXX.cpp:369
This represents clause &#39;to&#39; in the &#39;#pragma omp ...&#39; directives.
This represents &#39;#pragma omp target simd&#39; directive.
Definition: StmtOpenMP.h:3895
Represents a C++ member access expression for which lookup produced a set of overloaded functions...
Definition: ExprCXX.h:3771
ExtVectorElementExpr - This represents access to specific elements of a vector, and may occur on the ...
Definition: Expr.h:5518
Expr * getSafelen() const
Return safe iteration space distance.
Definition: OpenMPClause.h:704
This represents &#39;#pragma omp barrier&#39; directive.
Definition: StmtOpenMP.h:2101
ObjCArrayLiteral - used for objective-c array containers; as in: @["Hello", NSApp, [NSNumber numberWithInt:42]];.
Definition: ExprObjC.h:188
This is a common base class for loop directives (&#39;omp simd&#39;, &#39;omp for&#39;, &#39;omp for simd&#39; etc...
Definition: StmtOpenMP.h:420
Expr * getNumTeams()
Return NumTeams number.
Represents a reference to a non-type template parameter pack that has been substituted with a non-tem...
Definition: ExprCXX.h:4269
This represents &#39;#pragma omp critical&#39; directive.
Definition: StmtOpenMP.h:1640
bool hasExplicitTemplateArgs() const
Determines whether this lookup had explicit template arguments.
Definition: ExprCXX.h:3243
Selector getSelector() const
Definition: ExprObjC.h:467
const Expr *const * const_semantics_iterator
Definition: Expr.h:5782
Represents Objective-C&#39;s @catch statement.
Definition: StmtObjC.h:77
This represents clause &#39;copyprivate&#39; in the &#39;#pragma omp ...&#39; directives.
IndirectGotoStmt - This represents an indirect goto.
Definition: Stmt.h:2520
Describes an C or C++ initializer list.
Definition: Expr.h:4403
A C++ typeid expression (C++ [expr.typeid]), which gets the type_info that corresponds to the supplie...
Definition: ExprCXX.h:764
This represents &#39;#pragma omp distribute parallel for&#39; composite directive.
Definition: StmtOpenMP.h:3606
bool isArrow() const
Definition: ExprObjC.h:584
This represents &#39;#pragma omp teams distribute parallel for simd&#39; composite directive.
Definition: StmtOpenMP.h:4100
BinaryOperatorKind
AssociationTy< true > ConstAssociation
Definition: Expr.h:5394
unsigned getNumExpansions() const
Get the number of parameters in this parameter pack.
Definition: ExprCXX.h:4378
ForStmt - This represents a &#39;for (init;cond;inc)&#39; stmt.
Definition: Stmt.h:2410
NestedNameSpecifierLoc getQualifierLoc() const
Gets the nested name specifier.
FunctionDecl * getOperatorDelete() const
Definition: ExprCXX.h:2399
TemplateArgument getArgumentPack() const
Retrieve the template argument pack containing the substituted template arguments.
Definition: ExprCXX.cpp:1626
bool isElidable() const
Whether this construction is elidable.
Definition: ExprCXX.h:1500
void AddDecl(const Decl *D)
Definition: ODRHash.cpp:630
< Capturing the *this object by copy
Definition: Lambda.h:36
bool isGlobalNew() const
Definition: ExprCXX.h:2259
LabelDecl * getDecl() const
Definition: Stmt.h:1749
QualType getNullPtrType() const
Retrieve the type for null non-type template argument.
Definition: TemplateBase.h:274
ExprValueKind getValueKind() const
getValueKind - The value kind that this expression produces.
Definition: Expr.h:414
const Stmt * getPreInitStmt() const
Get pre-initialization statement for the clause.
Definition: OpenMPClause.h:132
child_range children()
Definition: Stmt.cpp:224
semantics_iterator semantics_end()
Definition: Expr.h:5789
unsigned getNumTemplateArgs() const
Retrieve the number of template arguments provided as part of this template-id.
Definition: ExprCXX.h:3713
static Stmt::StmtClass DecodeOperatorCall(const CXXOperatorCallExpr *S, UnaryOperatorKind &UnaryOp, BinaryOperatorKind &BinaryOp)
A builtin binary operation expression such as "x + y" or "x <= y".
Definition: Expr.h:3434
const StringLiteral * getInputConstraintLiteral(unsigned i) const
Definition: Stmt.h:3007
CXXForRangeStmt - This represents C++0x [stmt.ranged]&#39;s ranged for statement, represented as &#39;for (ra...
Definition: StmtCXX.h:134
bool isArrow() const
Definition: Expr.h:3020
ConceptDecl * getNamedConcept() const
Definition: ASTConcept.h:154
Class that handles post-update expression for some clauses, like &#39;lastprivate&#39;, &#39;reduction&#39; etc...
Definition: OpenMPClause.h:146
labels_range labels()
Definition: Stmt.h:3050
This represents &#39;#pragma omp cancellation point&#39; directive.
Definition: StmtOpenMP.h:2946
This represents &#39;default&#39; clause in the &#39;#pragma omp ...&#39; directive.
Definition: OpenMPClause.h:862
ObjCStringLiteral, used for Objective-C string literals i.e.
Definition: ExprObjC.h:50
CaseStmt - Represent a case statement.
Definition: Stmt.h:1500
TypoExpr - Internal placeholder for expressions where typo correction still needs to be performed and...
Definition: Expr.h:5978
This represents &#39;final&#39; clause in the &#39;#pragma omp ...&#39; directive.
Definition: OpenMPClause.h:525
This represents &#39;mergeable&#39; clause in the &#39;#pragma omp ...&#39; directive.
This represents &#39;#pragma omp teams&#39; directive.
Definition: StmtOpenMP.h:2888
NestedNameSpecifier * getQualifier() const
Fetches the nested-name qualifier, if one was given.
Definition: ExprCXX.h:2959
CastExpr - Base class for type casts, including both implicit casts (ImplicitCastExpr) and explicit c...
Definition: Expr.h:3150
This represents clause &#39;reduction&#39; in the &#39;#pragma omp ...&#39; directives.
FieldDecl * getField()
Get the field whose initializer will be used.
Definition: ExprCXX.h:1303
Helper class for OffsetOfExpr.
Definition: Expr.h:2163
This represents &#39;#pragma omp teams distribute simd&#39; combined directive.
Definition: StmtOpenMP.h:4029
Represents binding an expression to a temporary.
Definition: ExprCXX.h:1373
StringLiteral * getClobberStringLiteral(unsigned i)
Definition: Stmt.h:3087
StringRef getOutputName(unsigned i) const
Definition: Stmt.h:2970
CXXTemporary * getTemporary()
Definition: ExprCXX.h:1392
A C++ lambda expression, which produces a function object (of unspecified type) that can be invoked l...
Definition: ExprCXX.h:1818
bool isTypeDependent() const
isTypeDependent - Determines whether this expression is type-dependent (C++ [temp.dep.expr]), which means that its type could change from one template instantiation to the next.
Definition: Expr.h:176
helper_expr_const_range source_exprs() const
void * getAsOpaquePtr() const
Definition: Type.h:699
DeclarationName getDeclName() const
Retrieve the name that this expression refers to.
Definition: ExprCXX.h:3198
Represents a C++ member access expression where the actual member referenced could not be resolved be...
Definition: ExprCXX.h:3511
This represents clause &#39;is_device_ptr&#39; in the &#39;#pragma omp ...&#39; directives.
StmtClass
Definition: Stmt.h:68
helper_expr_const_range source_exprs() const
A default argument (C++ [dcl.fct.default]).
Definition: ExprCXX.h:1202
bool isExact() const
Definition: Expr.h:1630
virtual Decl * getCanonicalDecl()
Retrieves the "canonical" declaration of the given declaration.
Definition: DeclBase.h:877
bool isTypeOperand() const
Definition: ExprCXX.h:1029
helper_expr_const_range privates() const
This represents clause &#39;from&#39; in the &#39;#pragma omp ...&#39; directives.
Represents the this expression in C++.
Definition: ExprCXX.h:1097
DeclarationName getMemberName() const
Retrieve the name of the member that this expression refers to.
Definition: ExprCXX.h:3883
ObjCIvarDecl * getDecl()
Definition: ExprObjC.h:576
void AddTemplateName(TemplateName Name)
Definition: ODRHash.cpp:138
bool isArrayForm() const
Definition: ExprCXX.h:2386
helper_expr_const_range reduction_ops() const
This represents &#39;#pragma omp target parallel for simd&#39; directive.
Definition: StmtOpenMP.h:3825
QualType getTypeAsWritten() const
getTypeAsWritten - Returns the type that this expression is casting to, as written in the source code...
Definition: Expr.h:3360
OpenMP 4.0 [2.4, Array Sections].
Definition: ExprOpenMP.h:44
This represents &#39;dynamic_allocators&#39; clause in the &#39;#pragma omp requires&#39; directive.
ConditionalOperator - The ?: ternary operator.
Definition: Expr.h:3732
Represents a C++ pseudo-destructor (C++ [expr.pseudo]).
Definition: ExprCXX.h:2479
CompoundStmt - This represents a group of statements like { stmt stmt }.
Definition: Stmt.h:1332
QualType getQueriedType() const
Definition: ExprCXX.h:2756
This represents &#39;threads&#39; clause in the &#39;#pragma omp ...&#39; directive.
This represents &#39;#pragma omp taskgroup&#39; directive.
Definition: StmtOpenMP.h:2193
helper_expr_const_range destination_exprs() const
Expr * getSimdlen() const
Return safe iteration space distance.
Definition: OpenMPClause.h:769
CXXConstructorDecl * getConstructor() const
Get the constructor that this expression will (ultimately) call.
Definition: ExprCXX.h:1494
helper_expr_const_range source_exprs() const
NestedNameSpecifier * getQualifier() const
If the member name was qualified, retrieves the nested-name-specifier that precedes the member name...
Definition: Expr.h:2947
This represents clause &#39;aligned&#39; in the &#39;#pragma omp ...&#39; directives.
const TemplateArgumentLoc * getTemplateArgs() const
Retrieve the template arguments provided as part of this template-id.
Definition: ExprCXX.h:3704
UnaryExprOrTypeTraitExpr - expression with either a type or (unevaluated) expression operand...
Definition: Expr.h:2372
This represents clause &#39;task_reduction&#39; in the &#39;#pragma omp taskgroup&#39; directives.
ConstantExpr - An expression that occurs in a constant context and optionally the result of evaluatin...
Definition: Expr.h:978
Represents a call to the builtin function __builtin_va_arg.
Definition: Expr.h:4244
ValueDecl * getAsDecl() const
Retrieve the declaration for a declaration non-type template argument.
Definition: TemplateBase.h:263
helper_expr_const_range destination_exprs() const
bool isImplicitAccess() const
True if this is an implicit access, i.e.
Definition: ExprCXX.h:3601
unsigned getValue() const
Definition: Expr.h:1564
This represents &#39;#pragma omp distribute&#39; directive.
Definition: StmtOpenMP.h:3480
This represents implicit clause &#39;depend&#39; for the &#39;#pragma omp task&#39; directive.
An expression "T()" which creates a value-initialized rvalue of type T, which is a non-class type...
Definition: ExprCXX.h:2053
llvm::MutableArrayRef< Designator > designators()
Definition: Expr.h:4842
This represents &#39;proc_bind&#39; clause in the &#39;#pragma omp ...&#39; directive.
Definition: OpenMPClause.h:942
This represents &#39;capture&#39; clause in the &#39;#pragma omp atomic&#39; directive.
This represents one expression.
Definition: Expr.h:108
TemplateArgumentLoc const * getTemplateArgs() const
Definition: ExprCXX.h:2997
IdentifierInfo * getFieldName() const
For a field or identifier offsetof node, returns the name of the field.
Definition: Expr.cpp:1596
bool isArrow() const
Determine whether this member expression used the &#39;->&#39; operator; otherwise, it used the &#39;...
Definition: ExprCXX.h:3867
This represents &#39;simdlen&#39; clause in the &#39;#pragma omp ...&#39; directive.
Definition: OpenMPClause.h:735
Declaration of a template type parameter.
Expr * getNumTasks() const
Return safe iteration space distance.
bool isImplicitAccess() const
True if this is an implicit access, i.e., one in which the member being accessed was not written in t...
Definition: ExprCXX.cpp:1531
This represents &#39;#pragma omp master taskloop&#39; directive.
Definition: StmtOpenMP.h:3204
const T * castAs() const
Member-template castAs<specific type>.
Definition: Type.h:7067
Represents a C++ functional cast expression that builds a temporary object.
Definition: ExprCXX.h:1750
The template argument is a null pointer or null pointer to member that was provided for a non-type te...
Definition: TemplateBase.h:67
A C++ const_cast expression (C++ [expr.const.cast]).
Definition: ExprCXX.h:527
BlockExpr - Adaptor class for mixing a BlockDecl with expressions.
Definition: Expr.h:5579
IdentifierInfo * getDestroyedTypeIdentifier() const
In a dependent pseudo-destructor expression for which we do not have full type information on the des...
Definition: ExprCXX.h:2579
This represents &#39;#pragma omp target teams distribute parallel for simd&#39; combined directive.
Definition: StmtOpenMP.h:4463
QualType getArgumentType() const
Definition: Expr.h:2409
bool isArrow() const
Determine whether this pseudo-destructor expression was written using an &#39;->&#39; (otherwise, it used a &#39;.
Definition: ExprCXX.h:2542
Expr * getAllocator() const
Returns the allocator expression or nullptr, if no allocator is specified.
Definition: OpenMPClause.h:385
unsigned getNumTemplateArgs() const
Definition: ExprCXX.h:3003
ObjCDictionaryLiteral - AST node to represent objective-c dictionary literals; as in:"name" : NSUserN...
Definition: ExprObjC.h:304
Represents Objective-C&#39;s @synchronized statement.
Definition: StmtObjC.h:277
ObjCSelectorExpr used for @selector in Objective-C.
Definition: ExprObjC.h:454
TypeSourceInfo * getTypeSourceInfo() const
Definition: Expr.h:2309
Represents an expression that computes the length of a parameter pack.
Definition: ExprCXX.h:4091
CXXTryStmt - A C++ try block, including all handlers.
Definition: StmtCXX.h:68
AsTypeExpr - Clang builtin function __builtin_astype [OpenCL 6.2.4.2] This AST node provides support ...
Definition: Expr.h:5642
void ProcessODRHash(llvm::FoldingSetNodeID &ID, ODRHash &Hash) const
Calculate a unique representation for a statement that is stable across compiler invocations.
NonTypeTemplateParmDecl - Declares a non-type template parameter, e.g., "Size" in.
IdentifierInfo & getAccessor() const
Definition: Expr.h:5540
Represents a C++ template name within the type system.
Definition: TemplateName.h:191
This represents &#39;#pragma omp target teams distribute simd&#39; combined directive.
Definition: StmtOpenMP.h:4536
ArrayTypeTrait getTrait() const
Definition: ExprCXX.h:2754
helper_expr_const_range rhs_exprs() const
This represents &#39;ordered&#39; clause in the &#39;#pragma omp ...&#39; directive.
Kind getKind() const
Determine what kind of offsetof node this is.
Definition: Expr.h:2217
QualType getType() const
Definition: Expr.h:137
This represents &#39;#pragma omp for&#39; directive.
Definition: StmtOpenMP.h:1259
LabelDecl * getLabel() const
Definition: Stmt.h:2494
Represents a folding of a pack over an operator.
Definition: ExprCXX.h:4529
QualType getEncodedType() const
Definition: ExprObjC.h:428
ReturnStmt - This represents a return, optionally of an expression: return; return 4;...
Definition: Stmt.h:2636
This represents &#39;#pragma omp target teams&#39; directive.
Definition: StmtOpenMP.h:4251
An expression that sends a message to the given Objective-C object or class.
Definition: ExprObjC.h:950
This represents a Microsoft inline-assembly statement extension.
Definition: Stmt.h:3101
ObjCMethodDecl * getImplicitPropertyGetter() const
Definition: ExprObjC.h:712
UnaryOperator - This represents the unary-expression&#39;s (except sizeof and alignof), the postinc/postdec operators from postfix-expression, and various extensions.
Definition: Expr.h:2046
bool usesGNUSyntax() const
Determines whether this designated initializer used the deprecated GNU syntax for designated initiali...
Definition: Expr.h:4873
AtomicOp getOp() const
Definition: Expr.h:5913
A member reference to an MSPropertyDecl.
Definition: ExprCXX.h:863
TemplateTemplateParmDecl - Declares a template template parameter, e.g., "T" in.
Represents a reference to a non-type template parameter that has been substituted with a template arg...
Definition: ExprCXX.h:4209
const OffsetOfNode & getComponent(unsigned Idx) const
Definition: Expr.h:2316
Expr * getDevice()
Return device number.
This represents &#39;#pragma omp cancel&#39; directive.
Definition: StmtOpenMP.h:3005
This represents &#39;collapse&#39; clause in the &#39;#pragma omp ...&#39; directive.
Definition: OpenMPClause.h:800
This represents clause &#39;firstprivate&#39; in the &#39;#pragma omp ...&#39; directives.
ValueDecl * getDecl()
Definition: Expr.h:1247
ObjCBridgeCastKind getBridgeKind() const
Determine which kind of bridge is being performed via this cast.
Definition: ExprObjC.h:1665
CStyleCastExpr - An explicit cast in C (C99 6.5.4) or a C-style cast in C++ (C++ [expr.cast]), which uses the syntax (Type)expr.
Definition: Expr.h:3371
bool isNull() const
Return true if this QualType doesn&#39;t point to a type yet.
Definition: Type.h:719
bool getValue() const
Definition: ExprCXX.h:657
ImaginaryLiteral - We support imaginary integer and floating point literals, like "1...
Definition: Expr.h:1662
This represents &#39;#pragma omp flush&#39; directive.
Definition: StmtOpenMP.h:2267
ArrayRef< concepts::Requirement * > getRequirements() const
Definition: ExprConcepts.h:513
This represents &#39;#pragma omp parallel for simd&#39; directive.
Definition: StmtOpenMP.h:1796
DoStmt - This represents a &#39;do/while&#39; stmt.
Definition: Stmt.h:2354
This represents &#39;seq_cst&#39; clause in the &#39;#pragma omp atomic&#39; directive.
helper_expr_const_range assignment_ops() const
This represents &#39;untied&#39; clause in the &#39;#pragma omp ...&#39; directive.
NestedNameSpecifier * getQualifier() const
Retrieve the nested-name-specifier that qualifies the member name.
Definition: ExprCXX.h:3626
This represents &#39;#pragma omp parallel master taskloop&#39; directive.
Definition: StmtOpenMP.h:3340
This represents &#39;unified_address&#39; clause in the &#39;#pragma omp requires&#39; directive. ...
This represents &#39;#pragma omp target enter data&#39; directive.
Definition: StmtOpenMP.h:2631
This represents &#39;#pragma omp master taskloop simd&#39; directive.
Definition: StmtOpenMP.h:3272
This represents &#39;num_teams&#39; clause in the &#39;#pragma omp ...&#39; directive.
A C++ dynamic_cast expression (C++ [expr.dynamic.cast]).
Definition: ExprCXX.h:445
OpaqueValueExpr - An expression referring to an opaque object of a fixed type and value class...
Definition: Expr.h:1075
ConvertVectorExpr - Clang builtin function __builtin_convertvector This AST node provides support for...
Definition: Expr.h:4067
#define false
Definition: stdbool.h:17
A reference to an overloaded function set, either an UnresolvedLookupExpr or an UnresolvedMemberExpr...
Definition: ExprCXX.h:2844
A field in a dependent type, known only by its name.
Definition: Expr.h:2172
This captures a statement into a function.
Definition: Stmt.h:3376
Represents a call to an inherited base class constructor from an inheriting constructor.
Definition: ExprCXX.h:1613
ExpressionTrait getTrait() const
Definition: ExprCXX.h:2822
PseudoObjectExpr - An expression which accesses a pseudo-object l-value.
Definition: Expr.h:5715
bool isImplicitProperty() const
Definition: ExprObjC.h:704
helper_expr_const_range taskgroup_descriptors() const
This represents &#39;#pragma omp single&#39; directive.
Definition: StmtOpenMP.h:1535
capture_iterator explicit_capture_begin() const
Retrieve an iterator pointing to the first explicit lambda capture.
Definition: ExprCXX.cpp:1257
This represents &#39;hint&#39; clause in the &#39;#pragma omp ...&#39; directive.
bool hasExplicitTemplateArgs() const
Determines whether this member expression actually had a C++ template argument list explicitly specif...
Definition: ExprCXX.h:3692
This is a basic class for representing single OpenMP executable directive.
Definition: StmtOpenMP.h:33
private_copies_range private_copies()
Represents a new-expression for memory allocation and constructor calls, e.g: "new CXXNewExpr(foo)"...
Definition: ExprCXX.h:2100
A call to a literal operator (C++11 [over.literal]) written as a user-defined literal (C++11 [lit...
Definition: ExprCXX.h:564
DeclarationName getName() const
getName - Returns the embedded declaration name.
Represents a C++2a __builtin_bit_cast(T, v) expression.
Definition: ExprCXX.h:4812
This represents &#39;schedule&#39; clause in the &#39;#pragma omp ...&#39; directive.
Represents a call to a member function that may be written either with member call syntax (e...
Definition: ExprCXX.h:171
void AddIdentifierInfo(const IdentifierInfo *II)
Definition: ODRHash.cpp:29
DeclStmt - Adaptor class for mixing declarations with statements and expressions. ...
Definition: Stmt.h:1225
This represents clause &#39;shared&#39; in the &#39;#pragma omp ...&#39; directives.
DeclarationNameInfo getDirectiveName() const
Return name of the directive.
Definition: StmtOpenMP.h:1699
Expr * getPriority()
Return Priority number.
Represents a C++ nested name specifier, such as "\::std::vector<int>::".
This represents &#39;#pragma omp taskwait&#39; directive.
Definition: StmtOpenMP.h:2147
QualType getAllocatedType() const
Definition: ExprCXX.h:2193
AtomicExpr - Variadic atomic builtins: __atomic_exchange, __atomic_fetch_*, __atomic_load, __atomic_store, and __atomic_compare_exchange_*, for the similarly-named C++11 instructions, and __c11 variants for <stdatomic.h>, and corresponding __opencl_atomic_* for OpenCL 2.0.
Definition: Expr.h:5849
UnaryExprOrTypeTrait getKind() const
Definition: Expr.h:2403
bool isArray() const
Definition: ExprCXX.h:2223
void Profile(llvm::FoldingSetNodeID &ID)
Definition: TemplateName.h:327
ObjCProtocolExpr used for protocol expression in Objective-C.
Definition: ExprObjC.h:503
const StringLiteral * getOutputConstraintLiteral(unsigned i) const
Definition: Stmt.h:2979
ImplicitCastExpr - Allows us to explicitly represent implicit type conversions, which have no direct ...
Definition: Expr.h:3274
CharacterKind getKind() const
Definition: Expr.h:1557
This represents &#39;#pragma omp target&#39; directive.
Definition: StmtOpenMP.h:2514
Expr * getNumForLoops() const
Return the number of associated for-loops.
Definition: OpenMPClause.h:835
bool isParenTypeId() const
Definition: ExprCXX.h:2253
void AddNestedNameSpecifier(const NestedNameSpecifier *NNS)
Definition: ODRHash.cpp:109
llvm::APSInt getAsIntegral() const
Retrieve the template argument as an integral value.
Definition: TemplateBase.h:300
An expression trait intrinsic.
Definition: ExprCXX.h:2785
const ObjCMethodDecl * getMethodDecl() const
Definition: ExprObjC.h:1356
A static requirement that can be used in a requires-expression to check properties of types and expre...
Definition: ExprConcepts.h:145
VarDecl * getConditionVariable()
Retrieve the variable declared in this "switch" statement, if any.
Definition: Stmt.cpp:994
This represents &#39;#pragma omp ordered&#39; directive.
Definition: StmtOpenMP.h:2323
StmtExpr - This is the GNU Statement Expression extension: ({int X=4; X;}).
Definition: Expr.h:3954
This represents &#39;#pragma omp target update&#39; directive.
Definition: StmtOpenMP.h:3547
ObjCBoxedExpr - used for generalized expression boxing.
Definition: ExprObjC.h:124
bool isArgumentType() const
Definition: Expr.h:2408
helper_expr_const_range lhs_exprs() const
FunctionDecl * getOperatorDelete() const
Definition: ExprCXX.h:2220
This represents &#39;#pragma omp parallel master taskloop simd&#39; directive.
Definition: StmtOpenMP.h:3411
Representation of a Microsoft __if_exists or __if_not_exists statement with a dependent name...
Definition: StmtCXX.h:252
A qualified reference to a name whose declaration cannot yet be resolved.
Definition: ExprCXX.h:3155
InitializationStyle getInitializationStyle() const
The kind of initializer this new-expression has.
Definition: ExprCXX.h:2267
ArrayRef< TemplateArgument > pack_elements() const
Iterator range referencing all of the elements of a template argument pack.
Definition: TemplateBase.h:353
CompoundAssignOperator - For compound assignments (e.g.
Definition: Expr.h:3654
Represents a C11 generic selection.
Definition: Expr.h:5234
ArrayRef< TemplateArgument > getPartialArguments() const
Get.
Definition: ExprCXX.h:4184
bool isReversed() const
Determine whether this expression was rewritten in reverse form.
Definition: ExprCXX.h:311
AddrLabelExpr - The GNU address of label extension, representing &&label.
Definition: Expr.h:3910
An Objective-C "bridged" cast expression, which casts between Objective-C pointers and C pointers...
Definition: ExprObjC.h:1638
ast_type_traits::DynTypedNode Node
Represents a reference to a function parameter pack or init-capture pack that has been substituted bu...
Definition: ExprCXX.h:4337
Represents a template argument.
Definition: TemplateBase.h:50
TypeSourceInfo * getDestroyedTypeInfo() const
Retrieve the source location information for the type being destroyed.
Definition: ExprCXX.h:2572
NullStmt - This is the null statement ";": C99 6.8.3p3.
Definition: Stmt.h:1297
bool isTypeOperand() const
Definition: ExprCXX.h:804
Dataflow Directional Tag Classes.
This represents &#39;device&#39; clause in the &#39;#pragma omp ...&#39; directive.
NestedNameSpecifier * getNestedNameSpecifier() const
Retrieve the nested-name-specifier to which this instance refers.
bool isVolatile() const
Definition: Stmt.h:2755
VarDecl * getConditionVariable()
Retrieve the variable declared in this "while" statement, if any.
Definition: Stmt.cpp:1050
[C99 6.4.2.2] - A predefined identifier such as func.
Definition: Expr.h:1903
UnaryOperatorKind
Represents a delete expression for memory deallocation and destructor calls, e.g. ...
Definition: ExprCXX.h:2359
bool isSimple() const
Definition: Stmt.h:2752
OverloadedOperatorKind getOperator() const
Returns the kind of overloaded operator that this expression refers to.
Definition: ExprCXX.h:107
helper_expr_const_range privates() const
NonTypeTemplateParmDecl * getParameterPack() const
Retrieve the non-type template parameter pack being substituted.
Definition: ExprCXX.h:4297
MSPropertyDecl * getPropertyDecl() const
Definition: ExprCXX.h:920
The template argument is a pack expansion of a template name that was provided for a template templat...
Definition: TemplateBase.h:79
bool isImplicit() const
Definition: ExprCXX.h:1118
This represents &#39;#pragma omp section&#39; directive.
Definition: StmtOpenMP.h:1472
This represents &#39;#pragma omp teams distribute&#39; directive.
Definition: StmtOpenMP.h:3961
A runtime availability query.
Definition: ExprObjC.h:1699
VarDecl *const * iterator
Iterators over the parameters which the parameter pack expanded into.
Definition: ExprCXX.h:4373
A C++ reinterpret_cast expression (C++ [expr.reinterpret.cast]).
Definition: ExprCXX.h:487
This represents &#39;#pragma omp simd&#39; directive.
Definition: StmtOpenMP.h:1194
Represents a &#39;co_yield&#39; expression.
Definition: ExprCXX.h:4786
DeclarationName getMember() const
Retrieve the name of the member that this expression refers to.
Definition: ExprCXX.h:3657
The name of a declaration.
StmtClass getStmtClass() const
Definition: Stmt.h:1109
Kind getKind() const
Definition: DeclBase.h:432
const Expr * getReductionRef() const
Returns reference to the task_reduction return variable.
Definition: StmtOpenMP.h:2245
Represents a C++11 pack expansion that produces a sequence of expressions.
Definition: ExprCXX.h:4015
This represents &#39;unified_shared_memory&#39; clause in the &#39;#pragma omp requires&#39; directive.
This represents clause &#39;linear&#39; in the &#39;#pragma omp ...&#39; directives.
semantics_iterator semantics_begin()
Definition: Expr.h:5783
bool isIfExists() const
Determine whether this is an __if_exists statement.
Definition: StmtCXX.h:277
ExplicitCastExpr - An explicit cast written in the source code.
Definition: Expr.h:3337
This represents &#39;#pragma omp atomic&#39; directive.
Definition: StmtOpenMP.h:2379
TypeSourceInfo * getTypeOperandSourceInfo() const
Retrieve source information for the type operand.
Definition: ExprCXX.h:811
llvm::APInt getValue() const
Definition: Expr.h:1430
Represents a __leave statement.
Definition: Stmt.h:3337
LabelDecl * getLabel() const
Definition: Expr.h:3932
helper_expr_const_range privates() const
iterator end() const
Definition: ExprCXX.h:4375
Represents a C++11 noexcept expression (C++ [expr.unary.noexcept]).
Definition: ExprCXX.h:3958
SwitchStmt - This represents a &#39;switch&#39; stmt.
Definition: Stmt.h:2043
Capturing variable-length array type.
Definition: Lambda.h:38
Not an overloaded operator.
Definition: OperatorKinds.h:22
Represents the body of a coroutine.
Definition: StmtCXX.h:317
Location wrapper for a TemplateArgument.
Definition: TemplateBase.h:449
ArraySubscriptExpr - [C99 6.5.2.1] Array Subscripting.
Definition: Expr.h:2462
Represents Objective-C&#39;s collection statement.
Definition: StmtObjC.h:23
ObjCEncodeExpr, used for @encode in Objective-C.
Definition: ExprObjC.h:407
bool hasEllipsis() const
Definition: StmtObjC.h:113
helper_expr_const_range destination_exprs() const
An implicit indirection through a C++ base class, when the field found is in a base class...
Definition: Expr.h:2175
Represents a call to a CUDA kernel function.
Definition: ExprCXX.h:224
Represents a &#39;co_await&#39; expression.
Definition: ExprCXX.h:4699
Opcode getOpcode() const
Definition: Expr.h:2071
decl_range decls()
Definition: Stmt.h:1273
StringRef getBytes() const
Allow access to clients that need the byte representation, such as ASTWriterStmt::VisitStringLiteral(...
Definition: Expr.h:1802
Represents Objective-C&#39;s @finally statement.
Definition: StmtObjC.h:127
The template argument is a type.
Definition: TemplateBase.h:59
child_range private_refs()
The template argument is actually a parameter pack.
Definition: TemplateBase.h:90
bool isArrow() const
Determine whether this member expression used the &#39;->&#39; operator; otherwise, it used the &#39;...
Definition: ExprCXX.h:3618
const DeclarationNameInfo & getNameInfo() const
Gets the name info for specified reduction identifier.
Capturing the *this object by reference.
Definition: Lambda.h:34
This represents &#39;write&#39; clause in the &#39;#pragma omp atomic&#39; directive.
unsigned getNumClobbers() const
Definition: Stmt.h:2800
ObjCIvarRefExpr - A reference to an ObjC instance variable.
Definition: ExprObjC.h:546
bool isPartiallySubstituted() const
Determine whether this represents a partially-substituted sizeof...
Definition: ExprCXX.h:4179
Describes an explicit type conversion that uses functional notion but could not be resolved because o...
Definition: ExprCXX.h:3390
CanQualType getCanonicalType(QualType T) const
Return the canonical (structural) type corresponding to the specified potentially non-canonical type ...
Definition: ASTContext.h:2305
GotoStmt - This represents a direct goto.
Definition: Stmt.h:2481
A use of a default initializer in a constructor or in aggregate initialization.
Definition: ExprCXX.h:1279
ArgKind getKind() const
Return the kind of stored template argument.
Definition: TemplateBase.h:234
bool isFreeIvar() const
Definition: ExprObjC.h:585
QualType getSuperReceiverType() const
Definition: ExprObjC.h:767
Defines the C++ Decl subclasses, other than those for templates (found in DeclTemplate.h) and friends (in DeclFriend.h).
const DeclarationNameInfo & getNameInfo() const
Gets the name info for specified reduction identifier.
VarDecl * getConditionVariable()
Retrieve the variable declared in this "if" statement, if any.
Definition: Stmt.cpp:887
MemberExpr - [C99 6.5.2.3] Structure and Union Members.
Definition: Expr.h:2836
This represents &#39;#pragma omp target parallel&#39; directive.
Definition: StmtOpenMP.h:2748
This represents &#39;nowait&#39; clause in the &#39;#pragma omp ...&#39; directive.
ArrayRef< TemplateArgument > getTemplateArguments() const
Definition: ExprConcepts.h:94
ContinueStmt - This represents a continue.
Definition: Stmt.h:2569
Represents a loop initializing the elements of an array.
Definition: Expr.h:5027
This represents &#39;num_tasks&#39; clause in the &#39;#pragma omp ...&#39; directive.
The template argument is a template name that was provided for a template template parameter...
Definition: TemplateBase.h:75
ChooseExpr - GNU builtin-in function __builtin_choose_expr.
Definition: Expr.h:4130
TemplateName getCanonicalTemplateName(TemplateName Name) const
Retrieves the "canonical" template name that refers to a given template.
BinaryConditionalOperator - The GNU extension to the conditional operator which allows the middle ope...
Definition: Expr.h:3808
CXXCatchStmt - This represents a C++ catch block.
Definition: StmtCXX.h:28
An index into an array.
Definition: Expr.h:2168
Represents an explicit C++ type conversion that uses "functional" notation (C++ [expr.type.conv]).
Definition: ExprCXX.h:1688
WhileStmt - This represents a &#39;while&#39; stmt.
Definition: Stmt.h:2226
Capturing by reference.
Definition: Lambda.h:37
Represents the specialization of a concept - evaluates to a prvalue of type bool. ...
Definition: ExprConcepts.h:40
helper_expr_const_range reduction_ops() const
Expr * getThreadLimit()
Return ThreadLimit number.
This class is used for builtin types like &#39;int&#39;.
Definition: Type.h:2465
bool shouldCopy() const
shouldCopy - True if we should do the &#39;copy&#39; part of the copy-restore.
Definition: ExprObjC.h:1607
Represents Objective-C&#39;s @try ... @catch ... @finally statement.
Definition: StmtObjC.h:165
bool isGlobalDelete() const
Definition: ExprCXX.h:2385
This represents &#39;#pragma omp taskloop simd&#39; directive.
Definition: StmtOpenMP.h:3137
StringLiteral - This represents a string literal expression, e.g.
Definition: Expr.h:1711
CallExpr - Represents a function call (C99 6.5.2.2, C++ [expr.call]).
Definition: Expr.h:2546
This represents &#39;dist_schedule&#39; clause in the &#39;#pragma omp ...&#39; directive.
static Decl::Kind getKind(const Decl *D)
Definition: DeclBase.cpp:947
Abstract class common to all of the C++ "named"/"keyword" casts.
Definition: ExprCXX.h:353
This represents &#39;#pragma omp sections&#39; directive.
Definition: StmtOpenMP.h:1403
Expr * getHint() const
Returns number of threads.
NestedNameSpecifierLoc getQualifierLoc() const
Gets the nested name specifier.
ObjCBoolLiteralExpr - Objective-C Boolean Literal.
Definition: ExprObjC.h:85
unsigned getNumComponents() const
Definition: Expr.h:2326
This represents &#39;#pragma omp target data&#39; directive.
Definition: StmtOpenMP.h:2573
const ParmVarDecl * getParam() const
Definition: ExprCXX.h:1237
QualType getAsType() const
Retrieve the type for a type template argument.
Definition: TemplateBase.h:256
A rewritten comparison expression that was originally written using operator syntax.
Definition: ExprCXX.h:273
A reference to a declared variable, function, enum, etc.
Definition: Expr.h:1171
NestedNameSpecifierLoc getQualifierLoc() const
Gets the nested name specifier.
BreakStmt - This represents a break.
Definition: Stmt.h:2599
Expr * getChunkSize()
Get chunk size.
const VarDecl * getCatchParamDecl() const
Definition: StmtObjC.h:97
unsigned getNumLabels() const
Definition: Stmt.h:3027
Expr * getNumThreads() const
Returns number of threads.
Definition: OpenMPClause.h:638
QualType getTypeAsWritten() const
Retrieve the type that is being constructed, as specified in the source code.
Definition: ExprCXX.h:3425
QualType getType() const
Definition: Decl.h:630
This represents &#39;#pragma omp taskyield&#39; directive.
Definition: StmtOpenMP.h:2055
This represents &#39;#pragma omp distribute parallel for simd&#39; composite directive.
Definition: StmtOpenMP.h:3688
A boolean literal, per ([C++ lex.bool] Boolean literals).
Definition: ExprCXX.h:645
NestedNameSpecifier * getQualifier() const
If the name was qualified, retrieves the nested-name-specifier that precedes the name.
Definition: Expr.h:1274
OffsetOfExpr - [C99 7.17] - This represents an expression of the form offsetof(record-type, member-designator).
Definition: Expr.h:2267
Expr * getQueriedExpression() const
Definition: ExprCXX.h:2824
This represents &#39;#pragma omp parallel sections&#39; directive.
Definition: StmtOpenMP.h:1914
A Microsoft C++ __uuidof expression, which gets the _GUID that corresponds to the supplied type or ex...
Definition: ExprCXX.h:1000
unsigned getNumTemplateArgs() const
Definition: ExprCXX.h:3260
const Expr * getPostUpdateExpr() const
Get post-update expression for the clause.
Definition: OpenMPClause.h:162
NestedNameSpecifier * getCanonicalNestedNameSpecifier(NestedNameSpecifier *NNS) const
Retrieves the "canonical" nested name specifier for a given nested name specifier.
TemplateName getAsTemplateOrTemplatePattern() const
Retrieve the template argument as a template name; if the argument is a pack expansion, return the pattern as a template name.
Definition: TemplateBase.h:287
BinaryOperatorKind getOperator() const
Definition: ExprCXX.h:4575
This represents clause &#39;nontemporal&#39; in the &#39;#pragma omp ...&#39; directives.
NamedDecl * getPack() const
Retrieve the parameter pack.
Definition: ExprCXX.h:4162
Represents Objective-C&#39;s @autoreleasepool Statement.
Definition: StmtObjC.h:368
InitListExpr * getSyntacticForm() const
Definition: Expr.h:4562
Represents an implicitly-generated value initialization of an object of a given type.
Definition: Expr.h:5117
This represents &#39;#pragma omp target parallel for&#39; directive.
Definition: StmtOpenMP.h:2808
This represents clause &#39;use_device_ptr&#39; in the &#39;#pragma omp ...&#39; directives.
QualType getType() const
Return the type wrapped by this type source info.
Definition: Type.h:6238
TypeTrait getTrait() const
Determine which type trait this expression uses.
Definition: ExprCXX.h:2666
association_range associations()
Definition: Expr.h:5463
This represents &#39;#pragma omp taskloop&#39; directive.
Definition: StmtOpenMP.h:3071