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