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