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