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