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