clang  10.0.0svn
RecursiveASTVisitor.h
Go to the documentation of this file.
1 //===--- RecursiveASTVisitor.h - Recursive AST Visitor ----------*- C++ -*-===//
2 //
3 // Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.
4 // See https://llvm.org/LICENSE.txt for license information.
5 // SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception
6 //
7 //===----------------------------------------------------------------------===//
8 //
9 // This file defines the RecursiveASTVisitor interface, which recursively
10 // traverses the entire AST.
11 //
12 //===----------------------------------------------------------------------===//
13 #ifndef LLVM_CLANG_AST_RECURSIVEASTVISITOR_H
14 #define LLVM_CLANG_AST_RECURSIVEASTVISITOR_H
15 
16 #include "clang/AST/Attr.h"
17 #include "clang/AST/Decl.h"
19 #include "clang/AST/DeclBase.h"
20 #include "clang/AST/DeclCXX.h"
21 #include "clang/AST/DeclFriend.h"
22 #include "clang/AST/DeclObjC.h"
23 #include "clang/AST/DeclOpenMP.h"
24 #include "clang/AST/DeclTemplate.h"
25 #include "clang/AST/Expr.h"
26 #include "clang/AST/ExprCXX.h"
27 #include "clang/AST/ExprObjC.h"
28 #include "clang/AST/ExprOpenMP.h"
31 #include "clang/AST/OpenMPClause.h"
32 #include "clang/AST/Stmt.h"
33 #include "clang/AST/StmtCXX.h"
34 #include "clang/AST/StmtObjC.h"
35 #include "clang/AST/StmtOpenMP.h"
36 #include "clang/AST/TemplateBase.h"
37 #include "clang/AST/TemplateName.h"
38 #include "clang/AST/Type.h"
39 #include "clang/AST/TypeLoc.h"
40 #include "clang/Basic/LLVM.h"
42 #include "clang/Basic/Specifiers.h"
43 #include "llvm/ADT/PointerIntPair.h"
44 #include "llvm/ADT/SmallVector.h"
45 #include "llvm/Support/Casting.h"
46 #include <algorithm>
47 #include <cstddef>
48 #include <type_traits>
49 
50 // The following three macros are used for meta programming. The code
51 // using them is responsible for defining macro OPERATOR().
52 
53 // All unary operators.
54 #define UNARYOP_LIST() \
55  OPERATOR(PostInc) OPERATOR(PostDec) OPERATOR(PreInc) OPERATOR(PreDec) \
56  OPERATOR(AddrOf) OPERATOR(Deref) OPERATOR(Plus) OPERATOR(Minus) \
57  OPERATOR(Not) OPERATOR(LNot) OPERATOR(Real) OPERATOR(Imag) \
58  OPERATOR(Extension) OPERATOR(Coawait)
59 
60 // All binary operators (excluding compound assign operators).
61 #define BINOP_LIST() \
62  OPERATOR(PtrMemD) OPERATOR(PtrMemI) OPERATOR(Mul) OPERATOR(Div) \
63  OPERATOR(Rem) OPERATOR(Add) OPERATOR(Sub) OPERATOR(Shl) OPERATOR(Shr) \
64  OPERATOR(LT) OPERATOR(GT) OPERATOR(LE) OPERATOR(GE) OPERATOR(EQ) \
65  OPERATOR(NE) OPERATOR(Cmp) OPERATOR(And) OPERATOR(Xor) OPERATOR(Or) \
66  OPERATOR(LAnd) OPERATOR(LOr) OPERATOR(Assign) OPERATOR(Comma)
67 
68 // All compound assign operators.
69 #define CAO_LIST() \
70  OPERATOR(Mul) OPERATOR(Div) OPERATOR(Rem) OPERATOR(Add) OPERATOR(Sub) \
71  OPERATOR(Shl) OPERATOR(Shr) OPERATOR(And) OPERATOR(Or) OPERATOR(Xor)
72 
73 namespace clang {
74 
75 // A helper macro to implement short-circuiting when recursing. It
76 // invokes CALL_EXPR, which must be a method call, on the derived
77 // object (s.t. a user of RecursiveASTVisitor can override the method
78 // in CALL_EXPR).
79 #define TRY_TO(CALL_EXPR) \
80  do { \
81  if (!getDerived().CALL_EXPR) \
82  return false; \
83  } while (false)
84 
85 /// A class that does preorder or postorder
86 /// depth-first traversal on the entire Clang AST and visits each node.
87 ///
88 /// This class performs three distinct tasks:
89 /// 1. traverse the AST (i.e. go to each node);
90 /// 2. at a given node, walk up the class hierarchy, starting from
91 /// the node's dynamic type, until the top-most class (e.g. Stmt,
92 /// Decl, or Type) is reached.
93 /// 3. given a (node, class) combination, where 'class' is some base
94 /// class of the dynamic type of 'node', call a user-overridable
95 /// function to actually visit the node.
96 ///
97 /// These tasks are done by three groups of methods, respectively:
98 /// 1. TraverseDecl(Decl *x) does task #1. It is the entry point
99 /// for traversing an AST rooted at x. This method simply
100 /// dispatches (i.e. forwards) to TraverseFoo(Foo *x) where Foo
101 /// is the dynamic type of *x, which calls WalkUpFromFoo(x) and
102 /// then recursively visits the child nodes of x.
103 /// TraverseStmt(Stmt *x) and TraverseType(QualType x) work
104 /// similarly.
105 /// 2. WalkUpFromFoo(Foo *x) does task #2. It does not try to visit
106 /// any child node of x. Instead, it first calls WalkUpFromBar(x)
107 /// where Bar is the direct parent class of Foo (unless Foo has
108 /// no parent), and then calls VisitFoo(x) (see the next list item).
109 /// 3. VisitFoo(Foo *x) does task #3.
110 ///
111 /// These three method groups are tiered (Traverse* > WalkUpFrom* >
112 /// Visit*). A method (e.g. Traverse*) may call methods from the same
113 /// tier (e.g. other Traverse*) or one tier lower (e.g. WalkUpFrom*).
114 /// It may not call methods from a higher tier.
115 ///
116 /// Note that since WalkUpFromFoo() calls WalkUpFromBar() (where Bar
117 /// is Foo's super class) before calling VisitFoo(), the result is
118 /// that the Visit*() methods for a given node are called in the
119 /// top-down order (e.g. for a node of type NamespaceDecl, the order will
120 /// be VisitDecl(), VisitNamedDecl(), and then VisitNamespaceDecl()).
121 ///
122 /// This scheme guarantees that all Visit*() calls for the same AST
123 /// node are grouped together. In other words, Visit*() methods for
124 /// different nodes are never interleaved.
125 ///
126 /// Clients of this visitor should subclass the visitor (providing
127 /// themselves as the template argument, using the curiously recurring
128 /// template pattern) and override any of the Traverse*, WalkUpFrom*,
129 /// and Visit* methods for declarations, types, statements,
130 /// expressions, or other AST nodes where the visitor should customize
131 /// behavior. Most users only need to override Visit*. Advanced
132 /// users may override Traverse* and WalkUpFrom* to implement custom
133 /// traversal strategies. Returning false from one of these overridden
134 /// functions will abort the entire traversal.
135 ///
136 /// By default, this visitor tries to visit every part of the explicit
137 /// source code exactly once. The default policy towards templates
138 /// is to descend into the 'pattern' class or function body, not any
139 /// explicit or implicit instantiations. Explicit specializations
140 /// are still visited, and the patterns of partial specializations
141 /// are visited separately. This behavior can be changed by
142 /// overriding shouldVisitTemplateInstantiations() in the derived class
143 /// to return true, in which case all known implicit and explicit
144 /// instantiations will be visited at the same time as the pattern
145 /// from which they were produced.
146 ///
147 /// By default, this visitor preorder traverses the AST. If postorder traversal
148 /// is needed, the \c shouldTraversePostOrder method needs to be overridden
149 /// to return \c true.
150 template <typename Derived> class RecursiveASTVisitor {
151 public:
152  /// A queue used for performing data recursion over statements.
153  /// Parameters involving this type are used to implement data
154  /// recursion over Stmts and Exprs within this class, and should
155  /// typically not be explicitly specified by derived classes.
156  /// The bool bit indicates whether the statement has been traversed or not.
159 
160  /// Return a reference to the derived class.
161  Derived &getDerived() { return *static_cast<Derived *>(this); }
162 
163  /// Return whether this visitor should recurse into
164  /// template instantiations.
165  bool shouldVisitTemplateInstantiations() const { return false; }
166 
167  /// Return whether this visitor should recurse into the types of
168  /// TypeLocs.
169  bool shouldWalkTypesOfTypeLocs() const { return true; }
170 
171  /// Return whether this visitor should recurse into implicit
172  /// code, e.g., implicit constructors and destructors.
173  bool shouldVisitImplicitCode() const { return false; }
174 
175  /// Return whether this visitor should traverse post-order.
176  bool shouldTraversePostOrder() const { return false; }
177 
178  /// Recursively visits an entire AST, starting from the top-level Decls
179  /// in the AST traversal scope (by default, the TranslationUnitDecl).
180  /// \returns false if visitation was terminated early.
181  bool TraverseAST(ASTContext &AST) {
182  for (Decl *D : AST.getTraversalScope())
183  if (!getDerived().TraverseDecl(D))
184  return false;
185  return true;
186  }
187 
188  /// Recursively visit a statement or expression, by
189  /// dispatching to Traverse*() based on the argument's dynamic type.
190  ///
191  /// \returns false if the visitation was terminated early, true
192  /// otherwise (including when the argument is nullptr).
193  bool TraverseStmt(Stmt *S, DataRecursionQueue *Queue = nullptr);
194 
195  /// Invoked before visiting a statement or expression via data recursion.
196  ///
197  /// \returns false to skip visiting the node, true otherwise.
198  bool dataTraverseStmtPre(Stmt *S) { return true; }
199 
200  /// Invoked after visiting a statement or expression via data recursion.
201  /// This is not invoked if the previously invoked \c dataTraverseStmtPre
202  /// returned false.
203  ///
204  /// \returns false if the visitation was terminated early, true otherwise.
205  bool dataTraverseStmtPost(Stmt *S) { return true; }
206 
207  /// Recursively visit a type, by dispatching to
208  /// Traverse*Type() based on the argument's getTypeClass() property.
209  ///
210  /// \returns false if the visitation was terminated early, true
211  /// otherwise (including when the argument is a Null type).
212  bool TraverseType(QualType T);
213 
214  /// Recursively visit a type with location, by dispatching to
215  /// Traverse*TypeLoc() based on the argument type's getTypeClass() property.
216  ///
217  /// \returns false if the visitation was terminated early, true
218  /// otherwise (including when the argument is a Null type location).
219  bool TraverseTypeLoc(TypeLoc TL);
220 
221  /// Recursively visit an attribute, by dispatching to
222  /// Traverse*Attr() based on the argument's dynamic type.
223  ///
224  /// \returns false if the visitation was terminated early, true
225  /// otherwise (including when the argument is a Null type location).
226  bool TraverseAttr(Attr *At);
227 
228  /// Recursively visit a declaration, by dispatching to
229  /// Traverse*Decl() based on the argument's dynamic type.
230  ///
231  /// \returns false if the visitation was terminated early, true
232  /// otherwise (including when the argument is NULL).
233  bool TraverseDecl(Decl *D);
234 
235  /// Recursively visit a C++ nested-name-specifier.
236  ///
237  /// \returns false if the visitation was terminated early, true otherwise.
239 
240  /// Recursively visit a C++ nested-name-specifier with location
241  /// information.
242  ///
243  /// \returns false if the visitation was terminated early, true otherwise.
245 
246  /// Recursively visit a name with its location information.
247  ///
248  /// \returns false if the visitation was terminated early, true otherwise.
250 
251  /// Recursively visit a template name and dispatch to the
252  /// appropriate method.
253  ///
254  /// \returns false if the visitation was terminated early, true otherwise.
255  bool TraverseTemplateName(TemplateName Template);
256 
257  /// Recursively visit a template argument and dispatch to the
258  /// appropriate method for the argument type.
259  ///
260  /// \returns false if the visitation was terminated early, true otherwise.
261  // FIXME: migrate callers to TemplateArgumentLoc instead.
263 
264  /// Recursively visit a template argument location and dispatch to the
265  /// appropriate method for the argument type.
266  ///
267  /// \returns false if the visitation was terminated early, true otherwise.
269 
270  /// Recursively visit a set of template arguments.
271  /// This can be overridden by a subclass, but it's not expected that
272  /// will be needed -- this visitor always dispatches to another.
273  ///
274  /// \returns false if the visitation was terminated early, true otherwise.
275  // FIXME: take a TemplateArgumentLoc* (or TemplateArgumentListInfo) instead.
277  unsigned NumArgs);
278 
279  /// Recursively visit a base specifier. This can be overridden by a
280  /// subclass.
281  ///
282  /// \returns false if the visitation was terminated early, true otherwise.
284 
285  /// Recursively visit a constructor initializer. This
286  /// automatically dispatches to another visitor for the initializer
287  /// expression, but not for the name of the initializer, so may
288  /// be overridden for clients that need access to the name.
289  ///
290  /// \returns false if the visitation was terminated early, true otherwise.
292 
293  /// Recursively visit a lambda capture. \c Init is the expression that
294  /// will be used to initialize the capture.
295  ///
296  /// \returns false if the visitation was terminated early, true otherwise.
298  Expr *Init);
299 
300  /// Recursively visit the syntactic or semantic form of an
301  /// initialization list.
302  ///
303  /// \returns false if the visitation was terminated early, true otherwise.
305  DataRecursionQueue *Queue = nullptr);
306 
307  // ---- Methods on Attrs ----
308 
309  // Visit an attribute.
310  bool VisitAttr(Attr *A) { return true; }
311 
312 // Declare Traverse* and empty Visit* for all Attr classes.
313 #define ATTR_VISITOR_DECLS_ONLY
314 #include "clang/AST/AttrVisitor.inc"
315 #undef ATTR_VISITOR_DECLS_ONLY
316 
317 // ---- Methods on Stmts ----
318 
320 
321 private:
322  template<typename T, typename U>
323  struct has_same_member_pointer_type : std::false_type {};
324  template<typename T, typename U, typename R, typename... P>
325  struct has_same_member_pointer_type<R (T::*)(P...), R (U::*)(P...)>
326  : std::true_type {};
327 
328  // Traverse the given statement. If the most-derived traverse function takes a
329  // data recursion queue, pass it on; otherwise, discard it. Note that the
330  // first branch of this conditional must compile whether or not the derived
331  // class can take a queue, so if we're taking the second arm, make the first
332  // arm call our function rather than the derived class version.
333 #define TRAVERSE_STMT_BASE(NAME, CLASS, VAR, QUEUE) \
334  (has_same_member_pointer_type<decltype( \
335  &RecursiveASTVisitor::Traverse##NAME), \
336  decltype(&Derived::Traverse##NAME)>::value \
337  ? static_cast<typename std::conditional< \
338  has_same_member_pointer_type< \
339  decltype(&RecursiveASTVisitor::Traverse##NAME), \
340  decltype(&Derived::Traverse##NAME)>::value, \
341  Derived &, RecursiveASTVisitor &>::type>(*this) \
342  .Traverse##NAME(static_cast<CLASS *>(VAR), QUEUE) \
343  : getDerived().Traverse##NAME(static_cast<CLASS *>(VAR)))
344 
345 // Try to traverse the given statement, or enqueue it if we're performing data
346 // recursion in the middle of traversing another statement. Can only be called
347 // from within a DEF_TRAVERSE_STMT body or similar context.
348 #define TRY_TO_TRAVERSE_OR_ENQUEUE_STMT(S) \
349  do { \
350  if (!TRAVERSE_STMT_BASE(Stmt, Stmt, S, Queue)) \
351  return false; \
352  } while (false)
353 
354 public:
355 // Declare Traverse*() for all concrete Stmt classes.
356 #define ABSTRACT_STMT(STMT)
357 #define STMT(CLASS, PARENT) \
358  bool Traverse##CLASS(CLASS *S, DataRecursionQueue *Queue = nullptr);
359 #include "clang/AST/StmtNodes.inc"
360  // The above header #undefs ABSTRACT_STMT and STMT upon exit.
361 
362  // Define WalkUpFrom*() and empty Visit*() for all Stmt classes.
363  bool WalkUpFromStmt(Stmt *S) { return getDerived().VisitStmt(S); }
364  bool VisitStmt(Stmt *S) { return true; }
365 #define STMT(CLASS, PARENT) \
366  bool WalkUpFrom##CLASS(CLASS *S) { \
367  TRY_TO(WalkUpFrom##PARENT(S)); \
368  TRY_TO(Visit##CLASS(S)); \
369  return true; \
370  } \
371  bool Visit##CLASS(CLASS *S) { return true; }
372 #include "clang/AST/StmtNodes.inc"
373 
374 // Define Traverse*(), WalkUpFrom*(), and Visit*() for unary
375 // operator methods. Unary operators are not classes in themselves
376 // (they're all opcodes in UnaryOperator) but do have visitors.
377 #define OPERATOR(NAME) \
378  bool TraverseUnary##NAME(UnaryOperator *S, \
379  DataRecursionQueue *Queue = nullptr) { \
380  if (!getDerived().shouldTraversePostOrder()) \
381  TRY_TO(WalkUpFromUnary##NAME(S)); \
382  TRY_TO_TRAVERSE_OR_ENQUEUE_STMT(S->getSubExpr()); \
383  return true; \
384  } \
385  bool WalkUpFromUnary##NAME(UnaryOperator *S) { \
386  TRY_TO(WalkUpFromUnaryOperator(S)); \
387  TRY_TO(VisitUnary##NAME(S)); \
388  return true; \
389  } \
390  bool VisitUnary##NAME(UnaryOperator *S) { return true; }
391 
392  UNARYOP_LIST()
393 #undef OPERATOR
394 
395 // Define Traverse*(), WalkUpFrom*(), and Visit*() for binary
396 // operator methods. Binary operators are not classes in themselves
397 // (they're all opcodes in BinaryOperator) but do have visitors.
398 #define GENERAL_BINOP_FALLBACK(NAME, BINOP_TYPE) \
399  bool TraverseBin##NAME(BINOP_TYPE *S, DataRecursionQueue *Queue = nullptr) { \
400  if (!getDerived().shouldTraversePostOrder()) \
401  TRY_TO(WalkUpFromBin##NAME(S)); \
402  TRY_TO_TRAVERSE_OR_ENQUEUE_STMT(S->getLHS()); \
403  TRY_TO_TRAVERSE_OR_ENQUEUE_STMT(S->getRHS()); \
404  return true; \
405  } \
406  bool WalkUpFromBin##NAME(BINOP_TYPE *S) { \
407  TRY_TO(WalkUpFrom##BINOP_TYPE(S)); \
408  TRY_TO(VisitBin##NAME(S)); \
409  return true; \
410  } \
411  bool VisitBin##NAME(BINOP_TYPE *S) { return true; }
412 
413 #define OPERATOR(NAME) GENERAL_BINOP_FALLBACK(NAME, BinaryOperator)
414  BINOP_LIST()
415 #undef OPERATOR
416 
417 // Define Traverse*(), WalkUpFrom*(), and Visit*() for compound
418 // assignment methods. Compound assignment operators are not
419 // classes in themselves (they're all opcodes in
420 // CompoundAssignOperator) but do have visitors.
421 #define OPERATOR(NAME) \
422  GENERAL_BINOP_FALLBACK(NAME##Assign, CompoundAssignOperator)
423 
424  CAO_LIST()
425 #undef OPERATOR
426 #undef GENERAL_BINOP_FALLBACK
427 
428 // ---- Methods on Types ----
429 // FIXME: revamp to take TypeLoc's rather than Types.
430 
431 // Declare Traverse*() for all concrete Type classes.
432 #define ABSTRACT_TYPE(CLASS, BASE)
433 #define TYPE(CLASS, BASE) bool Traverse##CLASS##Type(CLASS##Type *T);
434 #include "clang/AST/TypeNodes.inc"
435  // The above header #undefs ABSTRACT_TYPE and TYPE upon exit.
436 
437  // Define WalkUpFrom*() and empty Visit*() for all Type classes.
438  bool WalkUpFromType(Type *T) { return getDerived().VisitType(T); }
439  bool VisitType(Type *T) { return true; }
440 #define TYPE(CLASS, BASE) \
441  bool WalkUpFrom##CLASS##Type(CLASS##Type *T) { \
442  TRY_TO(WalkUpFrom##BASE(T)); \
443  TRY_TO(Visit##CLASS##Type(T)); \
444  return true; \
445  } \
446  bool Visit##CLASS##Type(CLASS##Type *T) { return true; }
447 #include "clang/AST/TypeNodes.inc"
448 
449 // ---- Methods on TypeLocs ----
450 // FIXME: this currently just calls the matching Type methods
451 
452 // Declare Traverse*() for all concrete TypeLoc classes.
453 #define ABSTRACT_TYPELOC(CLASS, BASE)
454 #define TYPELOC(CLASS, BASE) bool Traverse##CLASS##TypeLoc(CLASS##TypeLoc TL);
455 #include "clang/AST/TypeLocNodes.def"
456  // The above header #undefs ABSTRACT_TYPELOC and TYPELOC upon exit.
457 
458  // Define WalkUpFrom*() and empty Visit*() for all TypeLoc classes.
459  bool WalkUpFromTypeLoc(TypeLoc TL) { return getDerived().VisitTypeLoc(TL); }
460  bool VisitTypeLoc(TypeLoc TL) { return true; }
461 
462  // QualifiedTypeLoc and UnqualTypeLoc are not declared in
463  // TypeNodes.inc and thus need to be handled specially.
465  return getDerived().VisitUnqualTypeLoc(TL.getUnqualifiedLoc());
466  }
467  bool VisitQualifiedTypeLoc(QualifiedTypeLoc TL) { return true; }
469  return getDerived().VisitUnqualTypeLoc(TL.getUnqualifiedLoc());
470  }
471  bool VisitUnqualTypeLoc(UnqualTypeLoc TL) { return true; }
472 
473 // Note that BASE includes trailing 'Type' which CLASS doesn't.
474 #define TYPE(CLASS, BASE) \
475  bool WalkUpFrom##CLASS##TypeLoc(CLASS##TypeLoc TL) { \
476  TRY_TO(WalkUpFrom##BASE##Loc(TL)); \
477  TRY_TO(Visit##CLASS##TypeLoc(TL)); \
478  return true; \
479  } \
480  bool Visit##CLASS##TypeLoc(CLASS##TypeLoc TL) { return true; }
481 #include "clang/AST/TypeNodes.inc"
482 
483 // ---- Methods on Decls ----
484 
485 // Declare Traverse*() for all concrete Decl classes.
486 #define ABSTRACT_DECL(DECL)
487 #define DECL(CLASS, BASE) bool Traverse##CLASS##Decl(CLASS##Decl *D);
488 #include "clang/AST/DeclNodes.inc"
489  // The above header #undefs ABSTRACT_DECL and DECL upon exit.
490 
491  // Define WalkUpFrom*() and empty Visit*() for all Decl classes.
492  bool WalkUpFromDecl(Decl *D) { return getDerived().VisitDecl(D); }
493  bool VisitDecl(Decl *D) { return true; }
494 #define DECL(CLASS, BASE) \
495  bool WalkUpFrom##CLASS##Decl(CLASS##Decl *D) { \
496  TRY_TO(WalkUpFrom##BASE(D)); \
497  TRY_TO(Visit##CLASS##Decl(D)); \
498  return true; \
499  } \
500  bool Visit##CLASS##Decl(CLASS##Decl *D) { return true; }
501 #include "clang/AST/DeclNodes.inc"
502 
503  bool canIgnoreChildDeclWhileTraversingDeclContext(const Decl *Child);
504 
505 private:
506  // These are helper methods used by more than one Traverse* method.
507  bool TraverseTemplateParameterListHelper(TemplateParameterList *TPL);
508 
509  // Traverses template parameter lists of either a DeclaratorDecl or TagDecl.
510  template <typename T>
511  bool TraverseDeclTemplateParameterLists(T *D);
512 
513 #define DEF_TRAVERSE_TMPL_INST(TMPLDECLKIND) \
514  bool TraverseTemplateInstantiations(TMPLDECLKIND##TemplateDecl *D);
517  DEF_TRAVERSE_TMPL_INST(Function)
518 #undef DEF_TRAVERSE_TMPL_INST
519  bool TraverseTemplateArgumentLocsHelper(const TemplateArgumentLoc *TAL,
520  unsigned Count);
521  bool TraverseArrayTypeLocHelper(ArrayTypeLoc TL);
522  bool TraverseRecordHelper(RecordDecl *D);
523  bool TraverseCXXRecordHelper(CXXRecordDecl *D);
524  bool TraverseDeclaratorHelper(DeclaratorDecl *D);
525  bool TraverseDeclContextHelper(DeclContext *DC);
526  bool TraverseFunctionHelper(FunctionDecl *D);
527  bool TraverseVarHelper(VarDecl *D);
528  bool TraverseOMPExecutableDirective(OMPExecutableDirective *S);
529  bool TraverseOMPLoopDirective(OMPLoopDirective *S);
530  bool TraverseOMPClause(OMPClause *C);
531 #define OPENMP_CLAUSE(Name, Class) bool Visit##Class(Class *C);
532 #include "clang/Basic/OpenMPKinds.def"
533  /// Process clauses with list of variables.
534  template <typename T> bool VisitOMPClauseList(T *Node);
535  /// Process clauses with pre-initis.
536  bool VisitOMPClauseWithPreInit(OMPClauseWithPreInit *Node);
537  bool VisitOMPClauseWithPostUpdate(OMPClauseWithPostUpdate *Node);
538 
539  bool dataTraverseNode(Stmt *S, DataRecursionQueue *Queue);
540  bool PostVisitStmt(Stmt *S);
541 };
542 
543 template <typename Derived>
544 bool RecursiveASTVisitor<Derived>::dataTraverseNode(Stmt *S,
545  DataRecursionQueue *Queue) {
546 #define DISPATCH_STMT(NAME, CLASS, VAR) \
547  return TRAVERSE_STMT_BASE(NAME, CLASS, VAR, Queue);
548 
549  // If we have a binary expr, dispatch to the subcode of the binop. A smart
550  // optimizer (e.g. LLVM) will fold this comparison into the switch stmt
551  // below.
552  if (BinaryOperator *BinOp = dyn_cast<BinaryOperator>(S)) {
553  switch (BinOp->getOpcode()) {
554 #define OPERATOR(NAME) \
555  case BO_##NAME: \
556  DISPATCH_STMT(Bin##NAME, BinaryOperator, S);
557 
558  BINOP_LIST()
559 #undef OPERATOR
560 #undef BINOP_LIST
561 
562 #define OPERATOR(NAME) \
563  case BO_##NAME##Assign: \
564  DISPATCH_STMT(Bin##NAME##Assign, CompoundAssignOperator, S);
565 
566  CAO_LIST()
567 #undef OPERATOR
568 #undef CAO_LIST
569  }
570  } else if (UnaryOperator *UnOp = dyn_cast<UnaryOperator>(S)) {
571  switch (UnOp->getOpcode()) {
572 #define OPERATOR(NAME) \
573  case UO_##NAME: \
574  DISPATCH_STMT(Unary##NAME, UnaryOperator, S);
575 
576  UNARYOP_LIST()
577 #undef OPERATOR
578 #undef UNARYOP_LIST
579  }
580  }
581 
582  // Top switch stmt: dispatch to TraverseFooStmt for each concrete FooStmt.
583  switch (S->getStmtClass()) {
584  case Stmt::NoStmtClass:
585  break;
586 #define ABSTRACT_STMT(STMT)
587 #define STMT(CLASS, PARENT) \
588  case Stmt::CLASS##Class: \
589  DISPATCH_STMT(CLASS, CLASS, S);
590 #include "clang/AST/StmtNodes.inc"
591  }
592 
593  return true;
594 }
595 
596 #undef DISPATCH_STMT
597 
598 template <typename Derived>
599 bool RecursiveASTVisitor<Derived>::PostVisitStmt(Stmt *S) {
600  switch (S->getStmtClass()) {
601  case Stmt::NoStmtClass:
602  break;
603 #define ABSTRACT_STMT(STMT)
604 #define STMT(CLASS, PARENT) \
605  case Stmt::CLASS##Class: \
606  TRY_TO(WalkUpFrom##CLASS(static_cast<CLASS *>(S))); break;
607 #define INITLISTEXPR(CLASS, PARENT) \
608  case Stmt::CLASS##Class: \
609  { \
610  auto ILE = static_cast<CLASS *>(S); \
611  if (auto Syn = ILE->isSemanticForm() ? ILE->getSyntacticForm() : ILE) \
612  TRY_TO(WalkUpFrom##CLASS(Syn)); \
613  if (auto Sem = ILE->isSemanticForm() ? ILE : ILE->getSemanticForm()) \
614  TRY_TO(WalkUpFrom##CLASS(Sem)); \
615  break; \
616  }
617 #include "clang/AST/StmtNodes.inc"
618  }
619 
620  return true;
621 }
622 
623 #undef DISPATCH_STMT
624 
625 template <typename Derived>
627  DataRecursionQueue *Queue) {
628  if (!S)
629  return true;
630 
631  if (Queue) {
632  Queue->push_back({S, false});
633  return true;
634  }
635 
637  LocalQueue.push_back({S, false});
638 
639  while (!LocalQueue.empty()) {
640  auto &CurrSAndVisited = LocalQueue.back();
641  Stmt *CurrS = CurrSAndVisited.getPointer();
642  bool Visited = CurrSAndVisited.getInt();
643  if (Visited) {
644  LocalQueue.pop_back();
647  TRY_TO(PostVisitStmt(CurrS));
648  }
649  continue;
650  }
651 
652  if (getDerived().dataTraverseStmtPre(CurrS)) {
653  CurrSAndVisited.setInt(true);
654  size_t N = LocalQueue.size();
655  TRY_TO(dataTraverseNode(CurrS, &LocalQueue));
656  // Process new children in the order they were added.
657  std::reverse(LocalQueue.begin() + N, LocalQueue.end());
658  } else {
659  LocalQueue.pop_back();
660  }
661  }
662 
663  return true;
664 }
665 
666 #define DISPATCH(NAME, CLASS, VAR) \
667  return getDerived().Traverse##NAME(static_cast<CLASS *>(VAR))
668 
669 template <typename Derived>
671  if (T.isNull())
672  return true;
673 
674  switch (T->getTypeClass()) {
675 #define ABSTRACT_TYPE(CLASS, BASE)
676 #define TYPE(CLASS, BASE) \
677  case Type::CLASS: \
678  DISPATCH(CLASS##Type, CLASS##Type, const_cast<Type *>(T.getTypePtr()));
679 #include "clang/AST/TypeNodes.inc"
680  }
681 
682  return true;
683 }
684 
685 template <typename Derived>
687  if (TL.isNull())
688  return true;
689 
690  switch (TL.getTypeLocClass()) {
691 #define ABSTRACT_TYPELOC(CLASS, BASE)
692 #define TYPELOC(CLASS, BASE) \
693  case TypeLoc::CLASS: \
694  return getDerived().Traverse##CLASS##TypeLoc(TL.castAs<CLASS##TypeLoc>());
695 #include "clang/AST/TypeLocNodes.def"
696  }
697 
698  return true;
699 }
700 
701 // Define the Traverse*Attr(Attr* A) methods
702 #define VISITORCLASS RecursiveASTVisitor
703 #include "clang/AST/AttrVisitor.inc"
704 #undef VISITORCLASS
705 
706 template <typename Derived>
708  if (!D)
709  return true;
710 
711  // As a syntax visitor, by default we want to ignore declarations for
712  // implicit declarations (ones not typed explicitly by the user).
714  return true;
715 
716  switch (D->getKind()) {
717 #define ABSTRACT_DECL(DECL)
718 #define DECL(CLASS, BASE) \
719  case Decl::CLASS: \
720  if (!getDerived().Traverse##CLASS##Decl(static_cast<CLASS##Decl *>(D))) \
721  return false; \
722  break;
723 #include "clang/AST/DeclNodes.inc"
724  }
725  return true;
726 }
727 
728 #undef DISPATCH
729 
730 template <typename Derived>
732  NestedNameSpecifier *NNS) {
733  if (!NNS)
734  return true;
735 
736  if (NNS->getPrefix())
738 
739  switch (NNS->getKind()) {
745  return true;
746 
749  TRY_TO(TraverseType(QualType(NNS->getAsType(), 0)));
750  }
751 
752  return true;
753 }
754 
755 template <typename Derived>
758  if (!NNS)
759  return true;
760 
761  if (NestedNameSpecifierLoc Prefix = NNS.getPrefix())
763 
764  switch (NNS.getNestedNameSpecifier()->getKind()) {
770  return true;
771 
775  break;
776  }
777 
778  return true;
779 }
780 
781 template <typename Derived>
783  DeclarationNameInfo NameInfo) {
784  switch (NameInfo.getName().getNameKind()) {
788  if (TypeSourceInfo *TSInfo = NameInfo.getNamedTypeInfo())
789  TRY_TO(TraverseTypeLoc(TSInfo->getTypeLoc()));
790  break;
791 
795  break;
796 
804  break;
805  }
806 
807  return true;
808 }
809 
810 template <typename Derived>
813  TRY_TO(TraverseNestedNameSpecifier(DTN->getQualifier()));
814  else if (QualifiedTemplateName *QTN = Template.getAsQualifiedTemplateName())
815  TRY_TO(TraverseNestedNameSpecifier(QTN->getQualifier()));
816 
817  return true;
818 }
819 
820 template <typename Derived>
822  const TemplateArgument &Arg) {
823  switch (Arg.getKind()) {
828  return true;
829 
831  return getDerived().TraverseType(Arg.getAsType());
832 
835  return getDerived().TraverseTemplateName(
837 
839  return getDerived().TraverseStmt(Arg.getAsExpr());
840 
842  return getDerived().TraverseTemplateArguments(Arg.pack_begin(),
843  Arg.pack_size());
844  }
845 
846  return true;
847 }
848 
849 // FIXME: no template name location?
850 // FIXME: no source locations for a template argument pack?
851 template <typename Derived>
853  const TemplateArgumentLoc &ArgLoc) {
854  const TemplateArgument &Arg = ArgLoc.getArgument();
855 
856  switch (Arg.getKind()) {
861  return true;
862 
863  case TemplateArgument::Type: {
864  // FIXME: how can TSI ever be NULL?
865  if (TypeSourceInfo *TSI = ArgLoc.getTypeSourceInfo())
866  return getDerived().TraverseTypeLoc(TSI->getTypeLoc());
867  else
868  return getDerived().TraverseType(Arg.getAsType());
869  }
870 
873  if (ArgLoc.getTemplateQualifierLoc())
874  TRY_TO(getDerived().TraverseNestedNameSpecifierLoc(
875  ArgLoc.getTemplateQualifierLoc()));
876  return getDerived().TraverseTemplateName(
878 
880  return getDerived().TraverseStmt(ArgLoc.getSourceExpression());
881 
883  return getDerived().TraverseTemplateArguments(Arg.pack_begin(),
884  Arg.pack_size());
885  }
886 
887  return true;
888 }
889 
890 template <typename Derived>
892  const TemplateArgument *Args, unsigned NumArgs) {
893  for (unsigned I = 0; I != NumArgs; ++I) {
895  }
896 
897  return true;
898 }
899 
900 template <typename Derived>
902  CXXCtorInitializer *Init) {
903  if (TypeSourceInfo *TInfo = Init->getTypeSourceInfo())
904  TRY_TO(TraverseTypeLoc(TInfo->getTypeLoc()));
905 
906  if (Init->isWritten() || getDerived().shouldVisitImplicitCode())
907  TRY_TO(TraverseStmt(Init->getInit()));
908 
909  return true;
910 }
911 
912 template <typename Derived>
913 bool
915  const LambdaCapture *C,
916  Expr *Init) {
917  if (LE->isInitCapture(C))
919  else
920  TRY_TO(TraverseStmt(Init));
921  return true;
922 }
923 
924 // ----------------- Type traversal -----------------
925 
926 // This macro makes available a variable T, the passed-in type.
927 #define DEF_TRAVERSE_TYPE(TYPE, CODE) \
928  template <typename Derived> \
929  bool RecursiveASTVisitor<Derived>::Traverse##TYPE(TYPE *T) { \
930  if (!getDerived().shouldTraversePostOrder()) \
931  TRY_TO(WalkUpFrom##TYPE(T)); \
932  { CODE; } \
933  if (getDerived().shouldTraversePostOrder()) \
934  TRY_TO(WalkUpFrom##TYPE(T)); \
935  return true; \
936  }
937 
938 DEF_TRAVERSE_TYPE(BuiltinType, {})
939 
940 DEF_TRAVERSE_TYPE(ComplexType, { TRY_TO(TraverseType(T->getElementType())); })
941 
942 DEF_TRAVERSE_TYPE(PointerType, { TRY_TO(TraverseType(T->getPointeeType())); })
943 
944 DEF_TRAVERSE_TYPE(BlockPointerType,
945  { TRY_TO(TraverseType(T->getPointeeType())); })
946 
947 DEF_TRAVERSE_TYPE(LValueReferenceType,
948  { TRY_TO(TraverseType(T->getPointeeType())); })
949 
950 DEF_TRAVERSE_TYPE(RValueReferenceType,
951  { TRY_TO(TraverseType(T->getPointeeType())); })
952 
953 DEF_TRAVERSE_TYPE(MemberPointerType, {
954  TRY_TO(TraverseType(QualType(T->getClass(), 0)));
955  TRY_TO(TraverseType(T->getPointeeType()));
956 })
957 
958 DEF_TRAVERSE_TYPE(AdjustedType, { TRY_TO(TraverseType(T->getOriginalType())); })
959 
960 DEF_TRAVERSE_TYPE(DecayedType, { TRY_TO(TraverseType(T->getOriginalType())); })
961 
962 DEF_TRAVERSE_TYPE(ConstantArrayType, {
963  TRY_TO(TraverseType(T->getElementType()));
964  if (T->getSizeExpr())
965  TRY_TO(TraverseStmt(const_cast<Expr*>(T->getSizeExpr())));
966 })
967 
968 DEF_TRAVERSE_TYPE(IncompleteArrayType,
969  { TRY_TO(TraverseType(T->getElementType())); })
970 
971 DEF_TRAVERSE_TYPE(VariableArrayType, {
972  TRY_TO(TraverseType(T->getElementType()));
973  TRY_TO(TraverseStmt(T->getSizeExpr()));
974 })
975 
976 DEF_TRAVERSE_TYPE(DependentSizedArrayType, {
977  TRY_TO(TraverseType(T->getElementType()));
978  if (T->getSizeExpr())
979  TRY_TO(TraverseStmt(T->getSizeExpr()));
980 })
981 
982 DEF_TRAVERSE_TYPE(DependentAddressSpaceType, {
983  TRY_TO(TraverseStmt(T->getAddrSpaceExpr()));
984  TRY_TO(TraverseType(T->getPointeeType()));
985 })
986 
987 DEF_TRAVERSE_TYPE(DependentVectorType, {
988  if (T->getSizeExpr())
989  TRY_TO(TraverseStmt(T->getSizeExpr()));
990  TRY_TO(TraverseType(T->getElementType()));
991 })
992 
993 DEF_TRAVERSE_TYPE(DependentSizedExtVectorType, {
994  if (T->getSizeExpr())
995  TRY_TO(TraverseStmt(T->getSizeExpr()));
996  TRY_TO(TraverseType(T->getElementType()));
997 })
998 
999 DEF_TRAVERSE_TYPE(VectorType, { TRY_TO(TraverseType(T->getElementType())); })
1000 
1001 DEF_TRAVERSE_TYPE(ExtVectorType, { TRY_TO(TraverseType(T->getElementType())); })
1002 
1003 DEF_TRAVERSE_TYPE(FunctionNoProtoType,
1004  { TRY_TO(TraverseType(T->getReturnType())); })
1005 
1006 DEF_TRAVERSE_TYPE(FunctionProtoType, {
1007  TRY_TO(TraverseType(T->getReturnType()));
1008 
1009  for (const auto &A : T->param_types()) {
1010  TRY_TO(TraverseType(A));
1011  }
1012 
1013  for (const auto &E : T->exceptions()) {
1014  TRY_TO(TraverseType(E));
1015  }
1016 
1017  if (Expr *NE = T->getNoexceptExpr())
1019 })
1020 
1021 DEF_TRAVERSE_TYPE(UnresolvedUsingType, {})
1022 DEF_TRAVERSE_TYPE(TypedefType, {})
1023 
1024 DEF_TRAVERSE_TYPE(TypeOfExprType,
1025  { TRY_TO(TraverseStmt(T->getUnderlyingExpr())); })
1026 
1027 DEF_TRAVERSE_TYPE(TypeOfType, { TRY_TO(TraverseType(T->getUnderlyingType())); })
1028 
1029 DEF_TRAVERSE_TYPE(DecltypeType,
1030  { TRY_TO(TraverseStmt(T->getUnderlyingExpr())); })
1031 
1032 DEF_TRAVERSE_TYPE(UnaryTransformType, {
1033  TRY_TO(TraverseType(T->getBaseType()));
1034  TRY_TO(TraverseType(T->getUnderlyingType()));
1035 })
1036 
1037 DEF_TRAVERSE_TYPE(AutoType, { TRY_TO(TraverseType(T->getDeducedType())); })
1038 DEF_TRAVERSE_TYPE(DeducedTemplateSpecializationType, {
1039  TRY_TO(TraverseTemplateName(T->getTemplateName()));
1040  TRY_TO(TraverseType(T->getDeducedType()));
1041 })
1042 
1043 DEF_TRAVERSE_TYPE(RecordType, {})
1044 DEF_TRAVERSE_TYPE(EnumType, {})
1045 DEF_TRAVERSE_TYPE(TemplateTypeParmType, {})
1046 DEF_TRAVERSE_TYPE(SubstTemplateTypeParmType, {
1047  TRY_TO(TraverseType(T->getReplacementType()));
1048 })
1049 DEF_TRAVERSE_TYPE(SubstTemplateTypeParmPackType, {
1050  TRY_TO(TraverseTemplateArgument(T->getArgumentPack()));
1051 })
1052 
1053 DEF_TRAVERSE_TYPE(TemplateSpecializationType, {
1054  TRY_TO(TraverseTemplateName(T->getTemplateName()));
1055  TRY_TO(TraverseTemplateArguments(T->getArgs(), T->getNumArgs()));
1056 })
1057 
1058 DEF_TRAVERSE_TYPE(InjectedClassNameType, {})
1059 
1060 DEF_TRAVERSE_TYPE(AttributedType,
1061  { TRY_TO(TraverseType(T->getModifiedType())); })
1062 
1063 DEF_TRAVERSE_TYPE(ParenType, { TRY_TO(TraverseType(T->getInnerType())); })
1064 
1065 DEF_TRAVERSE_TYPE(MacroQualifiedType,
1066  { TRY_TO(TraverseType(T->getUnderlyingType())); })
1067 
1068 DEF_TRAVERSE_TYPE(ElaboratedType, {
1069  if (T->getQualifier()) {
1070  TRY_TO(TraverseNestedNameSpecifier(T->getQualifier()));
1071  }
1072  TRY_TO(TraverseType(T->getNamedType()));
1073 })
1074 
1075 DEF_TRAVERSE_TYPE(DependentNameType,
1076  { TRY_TO(TraverseNestedNameSpecifier(T->getQualifier())); })
1077 
1078 DEF_TRAVERSE_TYPE(DependentTemplateSpecializationType, {
1079  TRY_TO(TraverseNestedNameSpecifier(T->getQualifier()));
1080  TRY_TO(TraverseTemplateArguments(T->getArgs(), T->getNumArgs()));
1081 })
1082 
1083 DEF_TRAVERSE_TYPE(PackExpansionType, { TRY_TO(TraverseType(T->getPattern())); })
1084 
1085 DEF_TRAVERSE_TYPE(ObjCTypeParamType, {})
1086 
1087 DEF_TRAVERSE_TYPE(ObjCInterfaceType, {})
1088 
1089 DEF_TRAVERSE_TYPE(ObjCObjectType, {
1090  // We have to watch out here because an ObjCInterfaceType's base
1091  // type is itself.
1092  if (T->getBaseType().getTypePtr() != T)
1093  TRY_TO(TraverseType(T->getBaseType()));
1094  for (auto typeArg : T->getTypeArgsAsWritten()) {
1095  TRY_TO(TraverseType(typeArg));
1096  }
1097 })
1098 
1100  { TRY_TO(TraverseType(T->getPointeeType())); })
1101 
1102 DEF_TRAVERSE_TYPE(AtomicType, { TRY_TO(TraverseType(T->getValueType())); })
1103 
1104 DEF_TRAVERSE_TYPE(PipeType, { TRY_TO(TraverseType(T->getElementType())); })
1105 
1106 #undef DEF_TRAVERSE_TYPE
1107 
1108 // ----------------- TypeLoc traversal -----------------
1109 
1110 // This macro makes available a variable TL, the passed-in TypeLoc.
1111 // If requested, it calls WalkUpFrom* for the Type in the given TypeLoc,
1112 // in addition to WalkUpFrom* for the TypeLoc itself, such that existing
1113 // clients that override the WalkUpFrom*Type() and/or Visit*Type() methods
1114 // continue to work.
1115 #define DEF_TRAVERSE_TYPELOC(TYPE, CODE) \
1116  template <typename Derived> \
1117  bool RecursiveASTVisitor<Derived>::Traverse##TYPE##Loc(TYPE##Loc TL) { \
1119  TRY_TO(WalkUpFrom##TYPE(const_cast<TYPE *>(TL.getTypePtr()))); \
1120  TRY_TO(WalkUpFrom##TYPE##Loc(TL)); \
1121  { CODE; } \
1122  return true; \
1123  }
1124 
1125 template <typename Derived>
1126 bool
1128  // Move this over to the 'main' typeloc tree. Note that this is a
1129  // move -- we pretend that we were really looking at the unqualified
1130  // typeloc all along -- rather than a recursion, so we don't follow
1131  // the normal CRTP plan of going through
1132  // getDerived().TraverseTypeLoc. If we did, we'd be traversing
1133  // twice for the same type (once as a QualifiedTypeLoc version of
1134  // the type, once as an UnqualifiedTypeLoc version of the type),
1135  // which in effect means we'd call VisitTypeLoc twice with the
1136  // 'same' type. This solves that problem, at the cost of never
1137  // seeing the qualified version of the type (unless the client
1138  // subclasses TraverseQualifiedTypeLoc themselves). It's not a
1139  // perfect solution. A perfect solution probably requires making
1140  // QualifiedTypeLoc a wrapper around TypeLoc -- like QualType is a
1141  // wrapper around Type* -- rather than being its own class in the
1142  // type hierarchy.
1143  return TraverseTypeLoc(TL.getUnqualifiedLoc());
1144 }
1145 
1147 
1148 // FIXME: ComplexTypeLoc is unfinished
1150  TRY_TO(TraverseType(TL.getTypePtr()->getElementType()));
1151 })
1152 
1154  { TRY_TO(TraverseTypeLoc(TL.getPointeeLoc())); })
1155 
1157  { TRY_TO(TraverseTypeLoc(TL.getPointeeLoc())); })
1158 
1160  { TRY_TO(TraverseTypeLoc(TL.getPointeeLoc())); })
1161 
1163  { TRY_TO(TraverseTypeLoc(TL.getPointeeLoc())); })
1164 
1165 // FIXME: location of base class?
1166 // We traverse this in the type case as well, but how is it not reached through
1167 // the pointee type?
1169  TRY_TO(TraverseType(QualType(TL.getTypePtr()->getClass(), 0)));
1170  TRY_TO(TraverseTypeLoc(TL.getPointeeLoc()));
1171 })
1172 
1174  { TRY_TO(TraverseTypeLoc(TL.getOriginalLoc())); })
1175 
1177  { TRY_TO(TraverseTypeLoc(TL.getOriginalLoc())); })
1178 
1179 template <typename Derived>
1181  // This isn't available for ArrayType, but is for the ArrayTypeLoc.
1183  return true;
1184 }
1185 
1188  return TraverseArrayTypeLocHelper(TL);
1189 })
1190 
1193  return TraverseArrayTypeLocHelper(TL);
1194 })
1195 
1198  return TraverseArrayTypeLocHelper(TL);
1199 })
1200 
1203  return TraverseArrayTypeLocHelper(TL);
1204 })
1205 
1207  TRY_TO(TraverseStmt(TL.getTypePtr()->getAddrSpaceExpr()));
1209 })
1210 
1211 // FIXME: order? why not size expr first?
1212 // FIXME: base VectorTypeLoc is unfinished
1214  if (TL.getTypePtr()->getSizeExpr())
1215  TRY_TO(TraverseStmt(TL.getTypePtr()->getSizeExpr()));
1217 })
1218 
1219 // FIXME: VectorTypeLoc is unfinished
1222 })
1223 
1225  if (TL.getTypePtr()->getSizeExpr())
1226  TRY_TO(TraverseStmt(TL.getTypePtr()->getSizeExpr()));
1228 })
1229 
1230 // FIXME: size and attributes
1231 // FIXME: base VectorTypeLoc is unfinished
1234 })
1235 
1237  { TRY_TO(TraverseTypeLoc(TL.getReturnLoc())); })
1238 
1239 // FIXME: location of exception specifications (attributes?)
1241  TRY_TO(TraverseTypeLoc(TL.getReturnLoc()));
1242 
1243  const FunctionProtoType *T = TL.getTypePtr();
1244 
1245  for (unsigned I = 0, E = TL.getNumParams(); I != E; ++I) {
1246  if (TL.getParam(I)) {
1247  TRY_TO(TraverseDecl(TL.getParam(I)));
1248  } else if (I < T->getNumParams()) {
1250  }
1251  }
1252 
1253  for (const auto &E : T->exceptions()) {
1254  TRY_TO(TraverseType(E));
1255  }
1256 
1257  if (Expr *NE = T->getNoexceptExpr())
1259 })
1260 
1263 
1265  { TRY_TO(TraverseStmt(TL.getUnderlyingExpr())); })
1266 
1268  TRY_TO(TraverseTypeLoc(TL.getUnderlyingTInfo()->getTypeLoc()));
1269 })
1270 
1271 // FIXME: location of underlying expr
1273  TRY_TO(TraverseStmt(TL.getTypePtr()->getUnderlyingExpr()));
1274 })
1275 
1277  TRY_TO(TraverseTypeLoc(TL.getUnderlyingTInfo()->getTypeLoc()));
1278 })
1279 
1281  TRY_TO(TraverseType(TL.getTypePtr()->getDeducedType()));
1282 })
1283 
1285  TRY_TO(TraverseTemplateName(TL.getTypePtr()->getTemplateName()));
1286  TRY_TO(TraverseType(TL.getTypePtr()->getDeducedType()));
1287 })
1288 
1293  TRY_TO(TraverseType(TL.getTypePtr()->getReplacementType()));
1294 })
1296  TRY_TO(TraverseTemplateArgument(TL.getTypePtr()->getArgumentPack()));
1297 })
1298 
1299 // FIXME: use the loc for the template name?
1301  TRY_TO(TraverseTemplateName(TL.getTypePtr()->getTemplateName()));
1302  for (unsigned I = 0, E = TL.getNumArgs(); I != E; ++I) {
1303  TRY_TO(TraverseTemplateArgumentLoc(TL.getArgLoc(I)));
1304  }
1305 })
1306 
1308 
1309 DEF_TRAVERSE_TYPELOC(ParenType, { TRY_TO(TraverseTypeLoc(TL.getInnerLoc())); })
1310 
1312  { TRY_TO(TraverseTypeLoc(TL.getInnerLoc())); })
1313 
1315  { TRY_TO(TraverseTypeLoc(TL.getModifiedLoc())); })
1316 
1318  if (TL.getQualifierLoc()) {
1319  TRY_TO(TraverseNestedNameSpecifierLoc(TL.getQualifierLoc()));
1320  }
1321  TRY_TO(TraverseTypeLoc(TL.getNamedTypeLoc()));
1322 })
1323 
1325  TRY_TO(TraverseNestedNameSpecifierLoc(TL.getQualifierLoc()));
1326 })
1327 
1329  if (TL.getQualifierLoc()) {
1330  TRY_TO(TraverseNestedNameSpecifierLoc(TL.getQualifierLoc()));
1331  }
1332 
1333  for (unsigned I = 0, E = TL.getNumArgs(); I != E; ++I) {
1334  TRY_TO(TraverseTemplateArgumentLoc(TL.getArgLoc(I)));
1335  }
1336 })
1337 
1339  { TRY_TO(TraverseTypeLoc(TL.getPatternLoc())); })
1340 
1342 
1344 
1346  // We have to watch out here because an ObjCInterfaceType's base
1347  // type is itself.
1348  if (TL.getTypePtr()->getBaseType().getTypePtr() != TL.getTypePtr())
1349  TRY_TO(TraverseTypeLoc(TL.getBaseLoc()));
1350  for (unsigned i = 0, n = TL.getNumTypeArgs(); i != n; ++i)
1351  TRY_TO(TraverseTypeLoc(TL.getTypeArgTInfo(i)->getTypeLoc()));
1352 })
1353 
1355  { TRY_TO(TraverseTypeLoc(TL.getPointeeLoc())); })
1356 
1357 DEF_TRAVERSE_TYPELOC(AtomicType, { TRY_TO(TraverseTypeLoc(TL.getValueLoc())); })
1358 
1359 DEF_TRAVERSE_TYPELOC(PipeType, { TRY_TO(TraverseTypeLoc(TL.getValueLoc())); })
1360 
1361 #undef DEF_TRAVERSE_TYPELOC
1362 
1363 // ----------------- Decl traversal -----------------
1364 //
1365 // For a Decl, we automate (in the DEF_TRAVERSE_DECL macro) traversing
1366 // the children that come from the DeclContext associated with it.
1367 // Therefore each Traverse* only needs to worry about children other
1368 // than those.
1369 
1370 template <typename Derived>
1372  const Decl *Child) {
1373  // BlockDecls are traversed through BlockExprs,
1374  // CapturedDecls are traversed through CapturedStmts.
1375  if (isa<BlockDecl>(Child) || isa<CapturedDecl>(Child))
1376  return true;
1377  // Lambda classes are traversed through LambdaExprs.
1378  if (const CXXRecordDecl* Cls = dyn_cast<CXXRecordDecl>(Child))
1379  return Cls->isLambda();
1380  return false;
1381 }
1382 
1383 template <typename Derived>
1385  if (!DC)
1386  return true;
1387 
1388  for (auto *Child : DC->decls()) {
1390  TRY_TO(TraverseDecl(Child));
1391  }
1392 
1393  return true;
1394 }
1395 
1396 // This macro makes available a variable D, the passed-in decl.
1397 #define DEF_TRAVERSE_DECL(DECL, CODE) \
1398  template <typename Derived> \
1399  bool RecursiveASTVisitor<Derived>::Traverse##DECL(DECL *D) { \
1400  bool ShouldVisitChildren = true; \
1401  bool ReturnValue = true; \
1402  if (!getDerived().shouldTraversePostOrder()) \
1403  TRY_TO(WalkUpFrom##DECL(D)); \
1404  { CODE; } \
1405  if (ReturnValue && ShouldVisitChildren) \
1406  TRY_TO(TraverseDeclContextHelper(dyn_cast<DeclContext>(D))); \
1407  if (ReturnValue) { \
1408  /* Visit any attributes attached to this declaration. */ \
1409  for (auto *I : D->attrs()) \
1410  TRY_TO(getDerived().TraverseAttr(I)); \
1411  } \
1412  if (ReturnValue && getDerived().shouldTraversePostOrder()) \
1413  TRY_TO(WalkUpFrom##DECL(D)); \
1414  return ReturnValue; \
1415  }
1416 
1418 
1420  if (TypeSourceInfo *TInfo = D->getSignatureAsWritten())
1421  TRY_TO(TraverseTypeLoc(TInfo->getTypeLoc()));
1422  TRY_TO(TraverseStmt(D->getBody()));
1423  for (const auto &I : D->captures()) {
1424  if (I.hasCopyExpr()) {
1425  TRY_TO(TraverseStmt(I.getCopyExpr()));
1426  }
1427  }
1428  ShouldVisitChildren = false;
1429 })
1430 
1432  TRY_TO(TraverseStmt(D->getBody()));
1433  ShouldVisitChildren = false;
1434 })
1435 
1437 
1439  { TRY_TO(TraverseStmt(D->getAsmString())); })
1440 
1442 
1444  // Friend is either decl or a type.
1445  if (D->getFriendType())
1446  TRY_TO(TraverseTypeLoc(D->getFriendType()->getTypeLoc()));
1447  else
1448  TRY_TO(TraverseDecl(D->getFriendDecl()));
1449 })
1450 
1452  if (D->getFriendType())
1453  TRY_TO(TraverseTypeLoc(D->getFriendType()->getTypeLoc()));
1454  else
1455  TRY_TO(TraverseDecl(D->getFriendDecl()));
1456  for (unsigned I = 0, E = D->getNumTemplateParameters(); I < E; ++I) {
1457  TemplateParameterList *TPL = D->getTemplateParameterList(I);
1458  for (TemplateParameterList::iterator ITPL = TPL->begin(), ETPL = TPL->end();
1459  ITPL != ETPL; ++ITPL) {
1460  TRY_TO(TraverseDecl(*ITPL));
1461  }
1462  }
1463 })
1464 
1466  TRY_TO(TraverseDecl(D->getSpecialization()));
1467 
1468  if (D->hasExplicitTemplateArgs()) {
1469  TRY_TO(TraverseTemplateArgumentLocsHelper(
1470  D->getTemplateArgsAsWritten()->getTemplateArgs(),
1471  D->getTemplateArgsAsWritten()->NumTemplateArgs));
1472  }
1473 })
1474 
1476 
1478 
1479 DEF_TRAVERSE_DECL(ObjCPropertyImplDecl, {// FIXME: implement this
1480  })
1481 
1483  TRY_TO(TraverseStmt(D->getAssertExpr()));
1484  TRY_TO(TraverseStmt(D->getMessage()));
1485 })
1486 
1489  {// Code in an unnamed namespace shows up automatically in
1490  // decls_begin()/decls_end(). Thus we don't need to recurse on
1491  // D->getAnonymousNamespace().
1492  })
1493 
1495 
1497 
1499 
1501  TRY_TO(TraverseNestedNameSpecifierLoc(D->getQualifierLoc()));
1502 
1503  // We shouldn't traverse an aliased namespace, since it will be
1504  // defined (and, therefore, traversed) somewhere else.
1505  ShouldVisitChildren = false;
1506 })
1507 
1508 DEF_TRAVERSE_DECL(LabelDecl, {// There is no code in a LabelDecl.
1509  })
1510 
1512  NamespaceDecl,
1513  {// Code in an unnamed namespace shows up automatically in
1514  // decls_begin()/decls_end(). Thus we don't need to recurse on
1515  // D->getAnonymousNamespace().
1516  })
1517 
1518 DEF_TRAVERSE_DECL(ObjCCompatibleAliasDecl, {// FIXME: implement
1519  })
1520 
1521 DEF_TRAVERSE_DECL(ObjCCategoryDecl, {// FIXME: implement
1522  if (ObjCTypeParamList *typeParamList = D->getTypeParamList()) {
1523  for (auto typeParam : *typeParamList) {
1524  TRY_TO(TraverseObjCTypeParamDecl(typeParam));
1525  }
1526  }
1527 })
1528 
1529 DEF_TRAVERSE_DECL(ObjCCategoryImplDecl, {// FIXME: implement
1530  })
1531 
1532 DEF_TRAVERSE_DECL(ObjCImplementationDecl, {// FIXME: implement
1533  })
1534 
1535 DEF_TRAVERSE_DECL(ObjCInterfaceDecl, {// FIXME: implement
1536  if (ObjCTypeParamList *typeParamList = D->getTypeParamListAsWritten()) {
1537  for (auto typeParam : *typeParamList) {
1538  TRY_TO(TraverseObjCTypeParamDecl(typeParam));
1539  }
1540  }
1541 
1542  if (TypeSourceInfo *superTInfo = D->getSuperClassTInfo()) {
1543  TRY_TO(TraverseTypeLoc(superTInfo->getTypeLoc()));
1544  }
1545 })
1546 
1547 DEF_TRAVERSE_DECL(ObjCProtocolDecl, {// FIXME: implement
1548  })
1549 
1551  if (D->getReturnTypeSourceInfo()) {
1552  TRY_TO(TraverseTypeLoc(D->getReturnTypeSourceInfo()->getTypeLoc()));
1553  }
1554  for (ParmVarDecl *Parameter : D->parameters()) {
1556  }
1557  if (D->isThisDeclarationADefinition()) {
1558  TRY_TO(TraverseStmt(D->getBody()));
1559  }
1560  ShouldVisitChildren = false;
1561 })
1562 
1564  if (D->hasExplicitBound()) {
1565  TRY_TO(TraverseTypeLoc(D->getTypeSourceInfo()->getTypeLoc()));
1566  // We shouldn't traverse D->getTypeForDecl(); it's a result of
1567  // declaring the type alias, not something that was written in the
1568  // source.
1569  }
1570 })
1571 
1573  if (D->getTypeSourceInfo())
1574  TRY_TO(TraverseTypeLoc(D->getTypeSourceInfo()->getTypeLoc()));
1575  else
1576  TRY_TO(TraverseType(D->getType()));
1577  ShouldVisitChildren = false;
1578 })
1579 
1581  TRY_TO(TraverseNestedNameSpecifierLoc(D->getQualifierLoc()));
1582  TRY_TO(TraverseDeclarationNameInfo(D->getNameInfo()));
1583 })
1584 
1586 
1588  TRY_TO(TraverseNestedNameSpecifierLoc(D->getQualifierLoc()));
1589 })
1590 
1592 
1594 
1596  for (auto *I : D->varlists()) {
1597  TRY_TO(TraverseStmt(I));
1598  }
1599  })
1600 
1602  for (auto *C : D->clauselists()) {
1603  TRY_TO(TraverseOMPClause(C));
1604  }
1605 })
1606 
1608  TRY_TO(TraverseStmt(D->getCombiner()));
1609  if (auto *Initializer = D->getInitializer())
1611  TRY_TO(TraverseType(D->getType()));
1612  return true;
1613 })
1614 
1616  for (auto *C : D->clauselists())
1617  TRY_TO(TraverseOMPClause(C));
1618  TRY_TO(TraverseType(D->getType()));
1619  return true;
1620 })
1621 
1622 DEF_TRAVERSE_DECL(OMPCapturedExprDecl, { TRY_TO(TraverseVarHelper(D)); })
1623 
1625  for (auto *I : D->varlists())
1626  TRY_TO(TraverseStmt(I));
1627  for (auto *C : D->clauselists())
1628  TRY_TO(TraverseOMPClause(C));
1629 })
1630 
1631 // A helper method for TemplateDecl's children.
1632 template <typename Derived>
1634  TemplateParameterList *TPL) {
1635  if (TPL) {
1636  for (NamedDecl *D : *TPL) {
1637  TRY_TO(TraverseDecl(D));
1638  }
1639  if (Expr *RequiresClause = TPL->getRequiresClause()) {
1640  TRY_TO(TraverseStmt(RequiresClause));
1641  }
1642  }
1643  return true;
1644 }
1645 
1646 template <typename Derived>
1647 template <typename T>
1649  for (unsigned i = 0; i < D->getNumTemplateParameterLists(); i++) {
1650  TemplateParameterList *TPL = D->getTemplateParameterList(i);
1651  TraverseTemplateParameterListHelper(TPL);
1652  }
1653  return true;
1654 }
1655 
1656 template <typename Derived>
1658  ClassTemplateDecl *D) {
1659  for (auto *SD : D->specializations()) {
1660  for (auto *RD : SD->redecls()) {
1661  // We don't want to visit injected-class-names in this traversal.
1662  if (cast<CXXRecordDecl>(RD)->isInjectedClassName())
1663  continue;
1664 
1665  switch (
1666  cast<ClassTemplateSpecializationDecl>(RD)->getSpecializationKind()) {
1667  // Visit the implicit instantiations with the requested pattern.
1668  case TSK_Undeclared:
1670  TRY_TO(TraverseDecl(RD));
1671  break;
1672 
1673  // We don't need to do anything on an explicit instantiation
1674  // or explicit specialization because there will be an explicit
1675  // node for it elsewhere.
1679  break;
1680  }
1681  }
1682  }
1683 
1684  return true;
1685 }
1686 
1687 template <typename Derived>
1689  VarTemplateDecl *D) {
1690  for (auto *SD : D->specializations()) {
1691  for (auto *RD : SD->redecls()) {
1692  switch (
1693  cast<VarTemplateSpecializationDecl>(RD)->getSpecializationKind()) {
1694  case TSK_Undeclared:
1696  TRY_TO(TraverseDecl(RD));
1697  break;
1698 
1702  break;
1703  }
1704  }
1705  }
1706 
1707  return true;
1708 }
1709 
1710 // A helper method for traversing the instantiations of a
1711 // function while skipping its specializations.
1712 template <typename Derived>
1714  FunctionTemplateDecl *D) {
1715  for (auto *FD : D->specializations()) {
1716  for (auto *RD : FD->redecls()) {
1717  switch (RD->getTemplateSpecializationKind()) {
1718  case TSK_Undeclared:
1720  // We don't know what kind of FunctionDecl this is.
1721  TRY_TO(TraverseDecl(RD));
1722  break;
1723 
1724  // FIXME: For now traverse explicit instantiations here. Change that
1725  // once they are represented as dedicated nodes in the AST.
1728  TRY_TO(TraverseDecl(RD));
1729  break;
1730 
1732  break;
1733  }
1734  }
1735  }
1736 
1737  return true;
1738 }
1739 
1740 // This macro unifies the traversal of class, variable and function
1741 // template declarations.
1742 #define DEF_TRAVERSE_TMPL_DECL(TMPLDECLKIND) \
1743  DEF_TRAVERSE_DECL(TMPLDECLKIND##TemplateDecl, { \
1744  TRY_TO(TraverseTemplateParameterListHelper(D->getTemplateParameters())); \
1745  TRY_TO(TraverseDecl(D->getTemplatedDecl())); \
1746  \
1747  /* By default, we do not traverse the instantiations of \
1748  class templates since they do not appear in the user code. The \
1749  following code optionally traverses them. \
1750  \
1751  We only traverse the class instantiations when we see the canonical \
1752  declaration of the template, to ensure we only visit them once. */ \
1753  if (getDerived().shouldVisitTemplateInstantiations() && \
1754  D == D->getCanonicalDecl()) \
1755  TRY_TO(TraverseTemplateInstantiations(D)); \
1756  \
1757  /* Note that getInstantiatedFromMemberTemplate() is just a link \
1758  from a template instantiation back to the template from which \
1759  it was instantiated, and thus should not be traversed. */ \
1760  })
1761 
1764 DEF_TRAVERSE_TMPL_DECL(Function)
1765 
1767  // D is the "T" in something like
1768  // template <template <typename> class T> class container { };
1770  if (D->hasDefaultArgument() && !D->defaultArgumentWasInherited()) {
1771  TRY_TO(TraverseTemplateArgumentLoc(D->getDefaultArgument()));
1772  }
1773  TRY_TO(TraverseTemplateParameterListHelper(D->getTemplateParameters()));
1774 })
1775 
1777  TRY_TO(TraverseTemplateParameterListHelper(D->getTemplateParameters()));
1778 })
1779 
1781  // D is the "T" in something like "template<typename T> class vector;"
1782  if (D->getTypeForDecl())
1783  TRY_TO(TraverseType(QualType(D->getTypeForDecl(), 0)));
1784  if (D->hasDefaultArgument() && !D->defaultArgumentWasInherited())
1785  TRY_TO(TraverseTypeLoc(D->getDefaultArgumentInfo()->getTypeLoc()));
1786 })
1787 
1789  TRY_TO(TraverseTypeLoc(D->getTypeSourceInfo()->getTypeLoc()));
1790  // We shouldn't traverse D->getTypeForDecl(); it's a result of
1791  // declaring the typedef, not something that was written in the
1792  // source.
1793 })
1794 
1796  TRY_TO(TraverseTypeLoc(D->getTypeSourceInfo()->getTypeLoc()));
1797  // We shouldn't traverse D->getTypeForDecl(); it's a result of
1798  // declaring the type alias, not something that was written in the
1799  // source.
1800 })
1801 
1804  TRY_TO(TraverseTemplateParameterListHelper(D->getTemplateParameters()));
1805 })
1806 
1808  TRY_TO(TraverseTemplateParameterListHelper(D->getTemplateParameters()));
1809  TRY_TO(TraverseStmt(D->getConstraintExpr()));
1810 })
1811 
1813  // A dependent using declaration which was marked with 'typename'.
1814  // template<class T> class A : public B<T> { using typename B<T>::foo; };
1815  TRY_TO(TraverseNestedNameSpecifierLoc(D->getQualifierLoc()));
1816  // We shouldn't traverse D->getTypeForDecl(); it's a result of
1817  // declaring the type, not something that was written in the
1818  // source.
1819 })
1820 
1822  TRY_TO(TraverseDeclTemplateParameterLists(D));
1823 
1824  if (D->getTypeForDecl())
1825  TRY_TO(TraverseType(QualType(D->getTypeForDecl(), 0)));
1826 
1827  TRY_TO(TraverseNestedNameSpecifierLoc(D->getQualifierLoc()));
1828  // The enumerators are already traversed by
1829  // decls_begin()/decls_end().
1830 })
1831 
1832 // Helper methods for RecordDecl and its children.
1833 template <typename Derived>
1835  // We shouldn't traverse D->getTypeForDecl(); it's a result of
1836  // declaring the type, not something that was written in the source.
1837 
1838  TRY_TO(TraverseDeclTemplateParameterLists(D));
1840  return true;
1841 }
1842 
1843 template <typename Derived>
1845  const CXXBaseSpecifier &Base) {
1847  return true;
1848 }
1849 
1850 template <typename Derived>
1852  if (!TraverseRecordHelper(D))
1853  return false;
1854  if (D->isCompleteDefinition()) {
1855  for (const auto &I : D->bases()) {
1857  }
1858  // We don't traverse the friends or the conversions, as they are
1859  // already in decls_begin()/decls_end().
1860  }
1861  return true;
1862 }
1863 
1864 DEF_TRAVERSE_DECL(RecordDecl, { TRY_TO(TraverseRecordHelper(D)); })
1865 
1866 DEF_TRAVERSE_DECL(CXXRecordDecl, { TRY_TO(TraverseCXXRecordHelper(D)); })
1867 
1868 #define DEF_TRAVERSE_TMPL_SPEC_DECL(TMPLDECLKIND) \
1869  DEF_TRAVERSE_DECL(TMPLDECLKIND##TemplateSpecializationDecl, { \
1870  /* For implicit instantiations ("set<int> x;"), we don't want to \
1871  recurse at all, since the instatiated template isn't written in \
1872  the source code anywhere. (Note the instatiated *type* -- \
1873  set<int> -- is written, and will still get a callback of \
1874  TemplateSpecializationType). For explicit instantiations \
1875  ("template set<int>;"), we do need a callback, since this \
1876  is the only callback that's made for this instantiation. \
1877  We use getTypeAsWritten() to distinguish. */ \
1878  if (TypeSourceInfo *TSI = D->getTypeAsWritten()) \
1879  TRY_TO(TraverseTypeLoc(TSI->getTypeLoc())); \
1880  \
1884  /* Returning from here skips traversing the \
1885  declaration context of the *TemplateSpecializationDecl \
1886  (embedded in the DEF_TRAVERSE_DECL() macro) \
1887  which contains the instantiated members of the template. */ \
1888  return true; \
1889  })
1890 
1893 
1894 template <typename Derived>
1896  const TemplateArgumentLoc *TAL, unsigned Count) {
1897  for (unsigned I = 0; I < Count; ++I) {
1899  }
1900  return true;
1901 }
1902 
1903 #define DEF_TRAVERSE_TMPL_PART_SPEC_DECL(TMPLDECLKIND, DECLKIND) \
1904  DEF_TRAVERSE_DECL(TMPLDECLKIND##TemplatePartialSpecializationDecl, { \
1905  /* The partial specialization. */ \
1906  if (TemplateParameterList *TPL = D->getTemplateParameters()) { \
1907  for (TemplateParameterList::iterator I = TPL->begin(), E = TPL->end(); \
1908  I != E; ++I) { \
1909  TRY_TO(TraverseDecl(*I)); \
1910  } \
1911  } \
1912  /* The args that remains unspecialized. */ \
1913  TRY_TO(TraverseTemplateArgumentLocsHelper( \
1914  D->getTemplateArgsAsWritten()->getTemplateArgs(), \
1915  D->getTemplateArgsAsWritten()->NumTemplateArgs)); \
1916  \
1917  /* Don't need the *TemplatePartialSpecializationHelper, even \
1918  though that's our parent class -- we already visit all the \
1919  template args here. */ \
1920  TRY_TO(Traverse##DECLKIND##Helper(D)); \
1921  \
1922  /* Instantiations will have been visited with the primary template. */ \
1923  })
1924 
1925 DEF_TRAVERSE_TMPL_PART_SPEC_DECL(Class, CXXRecord)
1927 
1928 DEF_TRAVERSE_DECL(EnumConstantDecl, { TRY_TO(TraverseStmt(D->getInitExpr())); })
1929 
1931  // Like UnresolvedUsingTypenameDecl, but without the 'typename':
1932  // template <class T> Class A : public Base<T> { using Base<T>::foo; };
1934  TRY_TO(TraverseDeclarationNameInfo(D->getNameInfo()));
1935 })
1936 
1938 
1939 template <typename Derived>
1941  TRY_TO(TraverseDeclTemplateParameterLists(D));
1943  if (D->getTypeSourceInfo())
1945  else
1946  TRY_TO(TraverseType(D->getType()));
1947  return true;
1948 }
1949 
1951  TRY_TO(TraverseVarHelper(D));
1952  for (auto *Binding : D->bindings()) {
1953  TRY_TO(TraverseDecl(Binding));
1954  }
1955 })
1956 
1959  TRY_TO(TraverseStmt(D->getBinding()));
1960 })
1961 
1962 DEF_TRAVERSE_DECL(MSPropertyDecl, { TRY_TO(TraverseDeclaratorHelper(D)); })
1963 
1965  TRY_TO(TraverseDeclaratorHelper(D));
1966  if (D->isBitField())
1967  TRY_TO(TraverseStmt(D->getBitWidth()));
1968  else if (D->hasInClassInitializer())
1969  TRY_TO(TraverseStmt(D->getInClassInitializer()));
1970 })
1971 
1973  TRY_TO(TraverseDeclaratorHelper(D));
1974  if (D->isBitField())
1975  TRY_TO(TraverseStmt(D->getBitWidth()));
1976  // FIXME: implement the rest.
1977 })
1978 
1980  TRY_TO(TraverseDeclaratorHelper(D));
1981  if (D->isBitField())
1982  TRY_TO(TraverseStmt(D->getBitWidth()));
1983  // FIXME: implement the rest.
1984 })
1985 
1986 template <typename Derived>
1988  TRY_TO(TraverseDeclTemplateParameterLists(D));
1991 
1992  // If we're an explicit template specialization, iterate over the
1993  // template args that were explicitly specified. If we were doing
1994  // this in typing order, we'd do it between the return type and
1995  // the function args, but both are handled by the FunctionTypeLoc
1996  // above, so we have to choose one side. I've decided to do before.
1997  if (const FunctionTemplateSpecializationInfo *FTSI =
1999  if (FTSI->getTemplateSpecializationKind() != TSK_Undeclared &&
2000  FTSI->getTemplateSpecializationKind() != TSK_ImplicitInstantiation) {
2001  // A specialization might not have explicit template arguments if it has
2002  // a templated return type and concrete arguments.
2003  if (const ASTTemplateArgumentListInfo *TALI =
2004  FTSI->TemplateArgumentsAsWritten) {
2005  TRY_TO(TraverseTemplateArgumentLocsHelper(TALI->getTemplateArgs(),
2006  TALI->NumTemplateArgs));
2007  }
2008  }
2009  }
2010 
2011  // Visit the function type itself, which can be either
2012  // FunctionNoProtoType or FunctionProtoType, or a typedef. This
2013  // also covers the return type and the function parameters,
2014  // including exception specifications.
2015  if (TypeSourceInfo *TSI = D->getTypeSourceInfo()) {
2016  TRY_TO(TraverseTypeLoc(TSI->getTypeLoc()));
2017  } else if (getDerived().shouldVisitImplicitCode()) {
2018  // Visit parameter variable declarations of the implicit function
2019  // if the traverser is visiting implicit code. Parameter variable
2020  // declarations do not have valid TypeSourceInfo, so to visit them
2021  // we need to traverse the declarations explicitly.
2022  for (ParmVarDecl *Parameter : D->parameters()) {
2024  }
2025  }
2026 
2027  if (CXXConstructorDecl *Ctor = dyn_cast<CXXConstructorDecl>(D)) {
2028  // Constructor initializers.
2029  for (auto *I : Ctor->inits()) {
2030  if (I->isWritten() || getDerived().shouldVisitImplicitCode())
2032  }
2033  }
2034 
2035  bool VisitBody = D->isThisDeclarationADefinition();
2036  // If a method is set to default outside the class definition the compiler
2037  // generates the method body and adds it to the AST.
2038  if (const auto *MD = dyn_cast<CXXMethodDecl>(D))
2039  VisitBody &= !MD->isDefaulted() || getDerived().shouldVisitImplicitCode();
2040 
2041  if (VisitBody) {
2042  TRY_TO(TraverseStmt(D->getBody())); // Function body.
2043  }
2044  return true;
2045 }
2046 
2048  // We skip decls_begin/decls_end, which are already covered by
2049  // TraverseFunctionHelper().
2050  ShouldVisitChildren = false;
2051  ReturnValue = TraverseFunctionHelper(D);
2052 })
2053 
2055  // We skip decls_begin/decls_end, which are already covered by
2056  // TraverseFunctionHelper().
2057  ShouldVisitChildren = false;
2058  ReturnValue = TraverseFunctionHelper(D);
2059 })
2060 
2062  // We skip decls_begin/decls_end, which are already covered by
2063  // TraverseFunctionHelper().
2064  ShouldVisitChildren = false;
2065  ReturnValue = TraverseFunctionHelper(D);
2066 })
2067 
2069  // We skip decls_begin/decls_end, which are already covered by
2070  // TraverseFunctionHelper().
2071  ShouldVisitChildren = false;
2072  ReturnValue = TraverseFunctionHelper(D);
2073 })
2074 
2075 // CXXConversionDecl is the declaration of a type conversion operator.
2076 // It's not a cast expression.
2078  // We skip decls_begin/decls_end, which are already covered by
2079  // TraverseFunctionHelper().
2080  ShouldVisitChildren = false;
2081  ReturnValue = TraverseFunctionHelper(D);
2082 })
2083 
2085  // We skip decls_begin/decls_end, which are already covered by
2086  // TraverseFunctionHelper().
2087  ShouldVisitChildren = false;
2088  ReturnValue = TraverseFunctionHelper(D);
2089 })
2090 
2091 template <typename Derived>
2093  TRY_TO(TraverseDeclaratorHelper(D));
2094  // Default params are taken care of when we traverse the ParmVarDecl.
2095  if (!isa<ParmVarDecl>(D) &&
2096  (!D->isCXXForRangeDecl() || getDerived().shouldVisitImplicitCode()))
2097  TRY_TO(TraverseStmt(D->getInit()));
2098  return true;
2099 }
2100 
2101 DEF_TRAVERSE_DECL(VarDecl, { TRY_TO(TraverseVarHelper(D)); })
2102 
2103 DEF_TRAVERSE_DECL(ImplicitParamDecl, { TRY_TO(TraverseVarHelper(D)); })
2104 
2106  // A non-type template parameter, e.g. "S" in template<int S> class Foo ...
2107  TRY_TO(TraverseDeclaratorHelper(D));
2108  if (D->hasDefaultArgument() && !D->defaultArgumentWasInherited())
2109  TRY_TO(TraverseStmt(D->getDefaultArgument()));
2110 })
2111 
2113  TRY_TO(TraverseVarHelper(D));
2114 
2115  if (D->hasDefaultArg() && D->hasUninstantiatedDefaultArg() &&
2116  !D->hasUnparsedDefaultArg())
2117  TRY_TO(TraverseStmt(D->getUninstantiatedDefaultArg()));
2118 
2119  if (D->hasDefaultArg() && !D->hasUninstantiatedDefaultArg() &&
2120  !D->hasUnparsedDefaultArg())
2121  TRY_TO(TraverseStmt(D->getDefaultArg()));
2122 })
2123 
2124 #undef DEF_TRAVERSE_DECL
2125 
2126 // ----------------- Stmt traversal -----------------
2127 //
2128 // For stmts, we automate (in the DEF_TRAVERSE_STMT macro) iterating
2129 // over the children defined in children() (every stmt defines these,
2130 // though sometimes the range is empty). Each individual Traverse*
2131 // method only needs to worry about children other than those. To see
2132 // what children() does for a given class, see, e.g.,
2133 // http://clang.llvm.org/doxygen/Stmt_8cpp_source.html
2134 
2135 // This macro makes available a variable S, the passed-in stmt.
2136 #define DEF_TRAVERSE_STMT(STMT, CODE) \
2137  template <typename Derived> \
2139  STMT *S, DataRecursionQueue *Queue) { \
2140  bool ShouldVisitChildren = true; \
2141  bool ReturnValue = true; \
2143  TRY_TO(WalkUpFrom##STMT(S)); \
2144  { CODE; } \
2145  if (ShouldVisitChildren) { \
2146  for (Stmt * SubStmt : getDerived().getStmtChildren(S)) { \
2147  TRY_TO_TRAVERSE_OR_ENQUEUE_STMT(SubStmt); \
2148  } \
2149  } \
2150  if (!Queue && ReturnValue && getDerived().shouldTraversePostOrder()) \
2151  TRY_TO(WalkUpFrom##STMT(S)); \
2152  return ReturnValue; \
2153  }
2154 
2156  TRY_TO_TRAVERSE_OR_ENQUEUE_STMT(S->getAsmString());
2157  for (unsigned I = 0, E = S->getNumInputs(); I < E; ++I) {
2158  TRY_TO_TRAVERSE_OR_ENQUEUE_STMT(S->getInputConstraintLiteral(I));
2159  }
2160  for (unsigned I = 0, E = S->getNumOutputs(); I < E; ++I) {
2161  TRY_TO_TRAVERSE_OR_ENQUEUE_STMT(S->getOutputConstraintLiteral(I));
2162  }
2163  for (unsigned I = 0, E = S->getNumClobbers(); I < E; ++I) {
2164  TRY_TO_TRAVERSE_OR_ENQUEUE_STMT(S->getClobberStringLiteral(I));
2165  }
2166  // children() iterates over inputExpr and outputExpr.
2167 })
2168 
2170  MSAsmStmt,
2171  {// FIXME: MS Asm doesn't currently parse Constraints, Clobbers, etc. Once
2172  // added this needs to be implemented.
2173  })
2174 
2176  TRY_TO(TraverseDecl(S->getExceptionDecl()));
2177  // children() iterates over the handler block.
2178 })
2179 
2181  for (auto *I : S->decls()) {
2182  TRY_TO(TraverseDecl(I));
2183  }
2184  // Suppress the default iteration over children() by
2185  // returning. Here's why: A DeclStmt looks like 'type var [=
2186  // initializer]'. The decls above already traverse over the
2187  // initializers, so we don't have to do it again (which
2188  // children() would do).
2189  ShouldVisitChildren = false;
2190 })
2191 
2192 // These non-expr stmts (most of them), do not need any action except
2193 // iterating over the children.
2215 
2218  if (S->getInit())
2219  TRY_TO_TRAVERSE_OR_ENQUEUE_STMT(S->getInit());
2220  TRY_TO_TRAVERSE_OR_ENQUEUE_STMT(S->getLoopVarStmt());
2221  TRY_TO_TRAVERSE_OR_ENQUEUE_STMT(S->getRangeInit());
2222  TRY_TO_TRAVERSE_OR_ENQUEUE_STMT(S->getBody());
2223  // Visit everything else only if shouldVisitImplicitCode().
2224  ShouldVisitChildren = false;
2225  }
2226 })
2227 
2229  TRY_TO(TraverseNestedNameSpecifierLoc(S->getQualifierLoc()));
2230  TRY_TO(TraverseDeclarationNameInfo(S->getNameInfo()));
2231 })
2232 
2236 
2238 
2240  TRY_TO(TraverseNestedNameSpecifierLoc(S->getQualifierLoc()));
2241  TRY_TO(TraverseDeclarationNameInfo(S->getMemberNameInfo()));
2242  if (S->hasExplicitTemplateArgs()) {
2243  TRY_TO(TraverseTemplateArgumentLocsHelper(S->getTemplateArgs(),
2244  S->getNumTemplateArgs()));
2245  }
2246 })
2247 
2249  TRY_TO(TraverseNestedNameSpecifierLoc(S->getQualifierLoc()));
2250  TRY_TO(TraverseDeclarationNameInfo(S->getNameInfo()));
2251  TRY_TO(TraverseTemplateArgumentLocsHelper(S->getTemplateArgs(),
2252  S->getNumTemplateArgs()));
2253 })
2254 
2256  TRY_TO(TraverseNestedNameSpecifierLoc(S->getQualifierLoc()));
2257  TRY_TO(TraverseDeclarationNameInfo(S->getNameInfo()));
2258  if (S->hasExplicitTemplateArgs()) {
2259  TRY_TO(TraverseTemplateArgumentLocsHelper(S->getTemplateArgs(),
2260  S->getNumTemplateArgs()));
2261  }
2262 })
2263 
2265  TRY_TO(TraverseNestedNameSpecifierLoc(S->getQualifierLoc()));
2266  TRY_TO(TraverseDeclarationNameInfo(S->getMemberNameInfo()));
2267  TRY_TO(TraverseTemplateArgumentLocsHelper(S->getTemplateArgs(),
2268  S->getNumTemplateArgs()));
2269 })
2270 
2273  {// We don't traverse the cast type, as it's not written in the
2274  // source code.
2275  })
2276 
2278  TRY_TO(TraverseTypeLoc(S->getTypeInfoAsWritten()->getTypeLoc()));
2279 })
2280 
2282  TRY_TO(TraverseTypeLoc(S->getTypeInfoAsWritten()->getTypeLoc()));
2283 })
2284 
2286  TRY_TO(TraverseTypeLoc(S->getTypeInfoAsWritten()->getTypeLoc()));
2287 })
2288 
2290  TRY_TO(TraverseTypeLoc(S->getTypeInfoAsWritten()->getTypeLoc()));
2291 })
2292 
2294  TRY_TO(TraverseTypeLoc(S->getTypeInfoAsWritten()->getTypeLoc()));
2295 })
2296 
2298  TRY_TO(TraverseTypeLoc(S->getTypeInfoAsWritten()->getTypeLoc()));
2299 })
2300 
2302  TRY_TO(TraverseTypeLoc(S->getTypeInfoAsWritten()->getTypeLoc()));
2303 })
2304 
2305 template <typename Derived>
2307  InitListExpr *S, DataRecursionQueue *Queue) {
2308  if (S) {
2309  // Skip this if we traverse postorder. We will visit it later
2310  // in PostVisitStmt.
2311  if (!getDerived().shouldTraversePostOrder())
2312  TRY_TO(WalkUpFromInitListExpr(S));
2313 
2314  // All we need are the default actions. FIXME: use a helper function.
2315  for (Stmt *SubStmt : S->children()) {
2317  }
2318  }
2319  return true;
2320 }
2321 
2322 // If shouldVisitImplicitCode() returns false, this method traverses only the
2323 // syntactic form of InitListExpr.
2324 // If shouldVisitImplicitCode() return true, this method is called once for
2325 // each pair of syntactic and semantic InitListExpr, and it traverses the
2326 // subtrees defined by the two forms. This may cause some of the children to be
2327 // visited twice, if they appear both in the syntactic and the semantic form.
2328 //
2329 // There is no guarantee about which form \p S takes when this method is called.
2330 template <typename Derived>
2332  InitListExpr *S, DataRecursionQueue *Queue) {
2333  if (S->isSemanticForm() && S->isSyntacticForm()) {
2334  // `S` does not have alternative forms, traverse only once.
2336  return true;
2337  }
2339  S->isSemanticForm() ? S->getSyntacticForm() : S, Queue));
2341  // Only visit the semantic form if the clients are interested in implicit
2342  // compiler-generated.
2344  S->isSemanticForm() ? S : S->getSemanticForm(), Queue));
2345  }
2346  return true;
2347 }
2348 
2349 // GenericSelectionExpr is a special case because the types and expressions
2350 // are interleaved. We also need to watch out for null types (default
2351 // generic associations).
2353  TRY_TO(TraverseStmt(S->getControllingExpr()));
2354  for (const GenericSelectionExpr::Association &Assoc : S->associations()) {
2355  if (TypeSourceInfo *TSI = Assoc.getTypeSourceInfo())
2356  TRY_TO(TraverseTypeLoc(TSI->getTypeLoc()));
2357  TRY_TO_TRAVERSE_OR_ENQUEUE_STMT(Assoc.getAssociationExpr());
2358  }
2359  ShouldVisitChildren = false;
2360 })
2361 
2362 // PseudoObjectExpr is a special case because of the weirdness with
2363 // syntactic expressions and opaque values.
2366  for (PseudoObjectExpr::semantics_iterator i = S->semantics_begin(),
2367  e = S->semantics_end();
2368  i != e; ++i) {
2369  Expr *sub = *i;
2370  if (OpaqueValueExpr *OVE = dyn_cast<OpaqueValueExpr>(sub))
2371  sub = OVE->getSourceExpr();
2373  }
2374  ShouldVisitChildren = false;
2375 })
2376 
2378  // This is called for code like 'return T()' where T is a built-in
2379  // (i.e. non-class) type.
2380  TRY_TO(TraverseTypeLoc(S->getTypeSourceInfo()->getTypeLoc()));
2381 })
2382 
2384  // The child-iterator will pick up the other arguments.
2385  TRY_TO(TraverseTypeLoc(S->getAllocatedTypeSourceInfo()->getTypeLoc()));
2386 })
2387 
2389  // The child-iterator will pick up the expression representing
2390  // the field.
2391  // FIMXE: for code like offsetof(Foo, a.b.c), should we get
2392  // making a MemberExpr callbacks for Foo.a, Foo.a.b, and Foo.a.b.c?
2393  TRY_TO(TraverseTypeLoc(S->getTypeSourceInfo()->getTypeLoc()));
2394 })
2395 
2397  // The child-iterator will pick up the arg if it's an expression,
2398  // but not if it's a type.
2399  if (S->isArgumentType())
2400  TRY_TO(TraverseTypeLoc(S->getArgumentTypeInfo()->getTypeLoc()));
2401 })
2402 
2404  // The child-iterator will pick up the arg if it's an expression,
2405  // but not if it's a type.
2406  if (S->isTypeOperand())
2407  TRY_TO(TraverseTypeLoc(S->getTypeOperandSourceInfo()->getTypeLoc()));
2408 })
2409 
2411  TRY_TO(TraverseNestedNameSpecifierLoc(S->getQualifierLoc()));
2412 })
2413 
2415 
2417  // The child-iterator will pick up the arg if it's an expression,
2418  // but not if it's a type.
2419  if (S->isTypeOperand())
2420  TRY_TO(TraverseTypeLoc(S->getTypeOperandSourceInfo()->getTypeLoc()));
2421 })
2422 
2424  for (unsigned I = 0, N = S->getNumArgs(); I != N; ++I)
2425  TRY_TO(TraverseTypeLoc(S->getArg(I)->getTypeLoc()));
2426 })
2427 
2429  TRY_TO(TraverseTypeLoc(S->getQueriedTypeSourceInfo()->getTypeLoc()));
2430 })
2431 
2433  { TRY_TO_TRAVERSE_OR_ENQUEUE_STMT(S->getQueriedExpression()); })
2434 
2436  // The child-iterator will pick up the expression argument.
2437  TRY_TO(TraverseTypeLoc(S->getWrittenTypeInfo()->getTypeLoc()));
2438 })
2439 
2441  // This is called for code like 'return T()' where T is a class type.
2442  TRY_TO(TraverseTypeLoc(S->getTypeSourceInfo()->getTypeLoc()));
2443 })
2444 
2445 // Walk only the visible parts of lambda expressions.
2447  // Visit the capture list.
2448  for (unsigned I = 0, N = S->capture_size(); I != N; ++I) {
2449  const LambdaCapture *C = S->capture_begin() + I;
2450  if (C->isExplicit() || getDerived().shouldVisitImplicitCode()) {
2451  TRY_TO(TraverseLambdaCapture(S, C, S->capture_init_begin()[I]));
2452  }
2453  }
2454 
2456  // The implicit model is simple: everything else is in the lambda class.
2457  TRY_TO(TraverseDecl(S->getLambdaClass()));
2458  } else {
2459  // We need to poke around to find the bits that might be explicitly written.
2460  TypeLoc TL = S->getCallOperator()->getTypeSourceInfo()->getTypeLoc();
2462 
2463  for (Decl *D : S->getExplicitTemplateParameters()) {
2464  // Visit explicit template parameters.
2465  TRY_TO(TraverseDecl(D));
2466  }
2467  if (S->hasExplicitParameters()) {
2468  // Visit parameters.
2469  for (unsigned I = 0, N = Proto.getNumParams(); I != N; ++I)
2470  TRY_TO(TraverseDecl(Proto.getParam(I)));
2471  }
2472  if (S->hasExplicitResultType())
2474 
2475  auto *T = Proto.getTypePtr();
2476  for (const auto &E : T->exceptions())
2477  TRY_TO(TraverseType(E));
2478 
2479  if (Expr *NE = T->getNoexceptExpr())
2481 
2482  TRY_TO_TRAVERSE_OR_ENQUEUE_STMT(S->getBody());
2483  }
2484  ShouldVisitChildren = false;
2485 })
2486 
2488  // This is called for code like 'T()', where T is a template argument.
2489  TRY_TO(TraverseTypeLoc(S->getTypeSourceInfo()->getTypeLoc()));
2490 })
2491 
2492 // These expressions all might take explicit template arguments.
2493 // We traverse those if so. FIXME: implement these.
2497 
2498 // These exprs (most of them), do not need any action except iterating
2499 // over the children.
2503 
2505  TRY_TO(TraverseDecl(S->getBlockDecl()));
2506  return true; // no child statements to loop through.
2507 })
2508 
2511  TRY_TO(TraverseTypeLoc(S->getTypeSourceInfo()->getTypeLoc()));
2512 })
2515 
2518  TRY_TO(TraverseStmt(S->getExpr()));
2519 })
2520 
2527 
2529  TRY_TO(TraverseNestedNameSpecifierLoc(S->getQualifierLoc()));
2530  if (TypeSourceInfo *ScopeInfo = S->getScopeTypeInfo())
2531  TRY_TO(TraverseTypeLoc(ScopeInfo->getTypeLoc()));
2532  if (TypeSourceInfo *DestroyedTypeInfo = S->getDestroyedTypeInfo())
2533  TRY_TO(TraverseTypeLoc(DestroyedTypeInfo->getTypeLoc()));
2534 })
2535 
2546  // FIXME: The source expression of the OVE should be listed as
2547  // a child of the ArrayInitLoopExpr.
2548  if (OpaqueValueExpr *OVE = S->getCommonExpr())
2549  TRY_TO_TRAVERSE_OR_ENQUEUE_STMT(OVE->getSourceExpr());
2550 })
2553 
2555  if (TypeSourceInfo *TInfo = S->getEncodedTypeSourceInfo())
2556  TRY_TO(TraverseTypeLoc(TInfo->getTypeLoc()));
2557 })
2558 
2561 
2563  if (TypeSourceInfo *TInfo = S->getClassReceiverTypeInfo())
2564  TRY_TO(TraverseTypeLoc(TInfo->getTypeLoc()));
2565 })
2566 
2572 
2574  TRY_TO(TraverseTypeLoc(S->getTypeInfoAsWritten()->getTypeLoc()));
2575 })
2576 
2585 
2587  TRY_TO(TraverseNestedNameSpecifierLoc(S->getQualifierLoc()));
2588  if (S->hasExplicitTemplateArgs()) {
2589  TRY_TO(TraverseTemplateArgumentLocsHelper(S->getTemplateArgs(),
2590  S->getNumTemplateArgs()));
2591  }
2592 })
2593 
2595  TRY_TO(TraverseNestedNameSpecifierLoc(S->getQualifierLoc()));
2596  if (S->hasExplicitTemplateArgs()) {
2597  TRY_TO(TraverseTemplateArgumentLocsHelper(S->getTemplateArgs(),
2598  S->getNumTemplateArgs()));
2599  }
2600 })
2601 
2606 DEF_TRAVERSE_STMT(CapturedStmt, { TRY_TO(TraverseDecl(S->getCapturedDecl())); })
2607 
2612  S->getDecomposedForm();
2613  TRY_TO(TraverseStmt(const_cast<Expr*>(Decomposed.LHS)));
2614  TRY_TO(TraverseStmt(const_cast<Expr*>(Decomposed.RHS)));
2615  ShouldVisitChildren = false;
2616  }
2617 })
2621 
2622 // These operators (all of them) do not need any action except
2623 // iterating over the children.
2638 
2639 // For coroutines expressions, traverse either the operand
2640 // as written or the implied calls, depending on what the
2641 // derived class requests.
2644  TRY_TO_TRAVERSE_OR_ENQUEUE_STMT(S->getBody());
2645  ShouldVisitChildren = false;
2646  }
2647 })
2649  if (!getDerived().shouldVisitImplicitCode()) {
2650  TRY_TO_TRAVERSE_OR_ENQUEUE_STMT(S->getOperand());
2651  ShouldVisitChildren = false;
2652  }
2653 })
2655  if (!getDerived().shouldVisitImplicitCode()) {
2656  TRY_TO_TRAVERSE_OR_ENQUEUE_STMT(S->getOperand());
2657  ShouldVisitChildren = false;
2658  }
2659 })
2661  if (!getDerived().shouldVisitImplicitCode()) {
2662  TRY_TO_TRAVERSE_OR_ENQUEUE_STMT(S->getOperand());
2663  ShouldVisitChildren = false;
2664  }
2665 })
2667  if (!getDerived().shouldVisitImplicitCode()) {
2668  TRY_TO_TRAVERSE_OR_ENQUEUE_STMT(S->getOperand());
2669  ShouldVisitChildren = false;
2670  }
2671 })
2672 
2674  TRY_TO(TraverseTemplateArgumentLocsHelper(
2675  S->getTemplateArgsAsWritten()->getTemplateArgs(),
2676  S->getTemplateArgsAsWritten()->NumTemplateArgs));
2677 })
2678 
2679 // These literals (all of them) do not need any action.
2690 
2691 // Traverse OpenCL: AsType, Convert.
2693 
2694 // OpenMP directives.
2695 template <typename Derived>
2698  for (auto *C : S->clauses()) {
2699  TRY_TO(TraverseOMPClause(C));
2700  }
2701  return true;
2702 }
2703 
2704 template <typename Derived>
2705 bool
2707  return TraverseOMPExecutableDirective(S);
2708 }
2709 
2711  { TRY_TO(TraverseOMPExecutableDirective(S)); })
2712 
2714  { TRY_TO(TraverseOMPExecutableDirective(S)); })
2715 
2717  { TRY_TO(TraverseOMPExecutableDirective(S)); })
2718 
2720  { TRY_TO(TraverseOMPExecutableDirective(S)); })
2721 
2723  { TRY_TO(TraverseOMPExecutableDirective(S)); })
2724 
2726  { TRY_TO(TraverseOMPExecutableDirective(S)); })
2727 
2729  { TRY_TO(TraverseOMPExecutableDirective(S)); })
2730 
2732  { TRY_TO(TraverseOMPExecutableDirective(S)); })
2733 
2735  TRY_TO(TraverseDeclarationNameInfo(S->getDirectiveName()));
2736  TRY_TO(TraverseOMPExecutableDirective(S));
2737 })
2738 
2740  { TRY_TO(TraverseOMPExecutableDirective(S)); })
2741 
2743  { TRY_TO(TraverseOMPExecutableDirective(S)); })
2744 
2746  { TRY_TO(TraverseOMPExecutableDirective(S)); })
2747 
2749  { TRY_TO(TraverseOMPExecutableDirective(S)); })
2750 
2752  { TRY_TO(TraverseOMPExecutableDirective(S)); })
2753 
2755  { TRY_TO(TraverseOMPExecutableDirective(S)); })
2756 
2758  { TRY_TO(TraverseOMPExecutableDirective(S)); })
2759 
2761  { TRY_TO(TraverseOMPExecutableDirective(S)); })
2762 
2764  { TRY_TO(TraverseOMPExecutableDirective(S)); })
2765 
2767  { TRY_TO(TraverseOMPExecutableDirective(S)); })
2768 
2770  { TRY_TO(TraverseOMPExecutableDirective(S)); })
2771 
2773  { TRY_TO(TraverseOMPExecutableDirective(S)); })
2774 
2776  { TRY_TO(TraverseOMPExecutableDirective(S)); })
2777 
2779  { TRY_TO(TraverseOMPExecutableDirective(S)); })
2780 
2782  { TRY_TO(TraverseOMPExecutableDirective(S)); })
2783 
2785  { TRY_TO(TraverseOMPExecutableDirective(S)); })
2786 
2788  { TRY_TO(TraverseOMPExecutableDirective(S)); })
2789 
2791  { TRY_TO(TraverseOMPExecutableDirective(S)); })
2792 
2794  { TRY_TO(TraverseOMPExecutableDirective(S)); })
2795 
2797  { TRY_TO(TraverseOMPExecutableDirective(S)); })
2798 
2800  { TRY_TO(TraverseOMPExecutableDirective(S)); })
2801 
2803  { TRY_TO(TraverseOMPExecutableDirective(S)); })
2804 
2806  { TRY_TO(TraverseOMPExecutableDirective(S)); })
2807 
2809  { TRY_TO(TraverseOMPExecutableDirective(S)); })
2810 
2812  { TRY_TO(TraverseOMPExecutableDirective(S)); })
2813 
2815  { TRY_TO(TraverseOMPExecutableDirective(S)); })
2816 
2818  { TRY_TO(TraverseOMPExecutableDirective(S)); })
2819 
2821  { TRY_TO(TraverseOMPExecutableDirective(S)); })
2822 
2824  { TRY_TO(TraverseOMPExecutableDirective(S)); })
2825 
2827  { TRY_TO(TraverseOMPExecutableDirective(S)); })
2828 
2830  { TRY_TO(TraverseOMPExecutableDirective(S)); })
2831 
2833  { TRY_TO(TraverseOMPExecutableDirective(S)); })
2834 
2836  { TRY_TO(TraverseOMPExecutableDirective(S)); })
2837 
2839  { TRY_TO(TraverseOMPExecutableDirective(S)); })
2840 
2842  { TRY_TO(TraverseOMPExecutableDirective(S)); })
2843 
2845  { TRY_TO(TraverseOMPExecutableDirective(S)); })
2846 
2848  { TRY_TO(TraverseOMPExecutableDirective(S)); })
2849 
2851  { TRY_TO(TraverseOMPExecutableDirective(S)); })
2852 
2854  { TRY_TO(TraverseOMPExecutableDirective(S)); })
2855 
2857  { TRY_TO(TraverseOMPExecutableDirective(S)); })
2858 
2860  { TRY_TO(TraverseOMPExecutableDirective(S)); })
2861 
2862 // OpenMP clauses.
2863 template <typename Derived>
2865  if (!C)
2866  return true;
2867  switch (C->getClauseKind()) {
2868 #define OPENMP_CLAUSE(Name, Class) \
2869  case OMPC_##Name: \
2870  TRY_TO(Visit##Class(static_cast<Class *>(C))); \
2871  break;
2872 #include "clang/Basic/OpenMPKinds.def"
2873  case OMPC_threadprivate:
2874  case OMPC_uniform:
2875  case OMPC_device_type:
2876  case OMPC_match:
2877  case OMPC_unknown:
2878  break;
2879  }
2880  return true;
2881 }
2882 
2883 template <typename Derived>
2887  return true;
2888 }
2889 
2890 template <typename Derived>
2892  OMPClauseWithPostUpdate *Node) {
2893  TRY_TO(VisitOMPClauseWithPreInit(Node));
2895  return true;
2896 }
2897 
2898 template <typename Derived>
2900  OMPAllocatorClause *C) {
2902  return true;
2903 }
2904 
2905 template <typename Derived>
2908  TRY_TO(VisitOMPClauseList(C));
2909  return true;
2910 }
2911 
2912 template <typename Derived>
2914  TRY_TO(VisitOMPClauseWithPreInit(C));
2916  return true;
2917 }
2918 
2919 template <typename Derived>
2921  TRY_TO(VisitOMPClauseWithPreInit(C));
2923  return true;
2924 }
2925 
2926 template <typename Derived>
2927 bool
2929  TRY_TO(VisitOMPClauseWithPreInit(C));
2931  return true;
2932 }
2933 
2934 template <typename Derived>
2937  return true;
2938 }
2939 
2940 template <typename Derived>
2943  return true;
2944 }
2945 
2946 template <typename Derived>
2947 bool
2950  return true;
2951 }
2952 
2953 template <typename Derived>
2955  return true;
2956 }
2957 
2958 template <typename Derived>
2960  return true;
2961 }
2962 
2963 template <typename Derived>
2966  return true;
2967 }
2968 
2969 template <typename Derived>
2972  return true;
2973 }
2974 
2975 template <typename Derived>
2978  return true;
2979 }
2980 
2981 template <typename Derived>
2984  return true;
2985 }
2986 
2987 template <typename Derived>
2990  return true;
2991 }
2992 
2993 template <typename Derived>
2994 bool
2996  TRY_TO(VisitOMPClauseWithPreInit(C));
2998  return true;
2999 }
3000 
3001 template <typename Derived>
3004  return true;
3005 }
3006 
3007 template <typename Derived>
3009  return true;
3010 }
3011 
3012 template <typename Derived>
3014  return true;
3015 }
3016 
3017 template <typename Derived>
3018 bool
3020  return true;
3021 }
3022 
3023 template <typename Derived>
3025  return true;
3026 }
3027 
3028 template <typename Derived>
3030  return true;
3031 }
3032 
3033 template <typename Derived>
3035  return true;
3036 }
3037 
3038 template <typename Derived>
3040  return true;
3041 }
3042 
3043 template <typename Derived>
3045  return true;
3046 }
3047 
3048 template <typename Derived>
3050  return true;
3051 }
3052 
3053 template <typename Derived>
3055  return true;
3056 }
3057 
3058 template <typename Derived>
3060  return true;
3061 }
3062 
3063 template <typename Derived>
3064 template <typename T>
3066  for (auto *E : Node->varlists()) {
3067  TRY_TO(TraverseStmt(E));
3068  }
3069  return true;
3070 }
3071 
3072 template <typename Derived>
3074  TRY_TO(VisitOMPClauseList(C));
3075  for (auto *E : C->private_copies()) {
3076  TRY_TO(TraverseStmt(E));
3077  }
3078  return true;
3079 }
3080 
3081 template <typename Derived>
3083  OMPFirstprivateClause *C) {
3084  TRY_TO(VisitOMPClauseList(C));
3085  TRY_TO(VisitOMPClauseWithPreInit(C));
3086  for (auto *E : C->private_copies()) {
3087  TRY_TO(TraverseStmt(E));
3088  }
3089  for (auto *E : C->inits()) {
3090  TRY_TO(TraverseStmt(E));
3091  }
3092  return true;
3093 }
3094 
3095 template <typename Derived>
3097  OMPLastprivateClause *C) {
3098  TRY_TO(VisitOMPClauseList(C));
3099  TRY_TO(VisitOMPClauseWithPostUpdate(C));
3100  for (auto *E : C->private_copies()) {
3101  TRY_TO(TraverseStmt(E));
3102  }
3103  for (auto *E : C->source_exprs()) {
3104  TRY_TO(TraverseStmt(E));
3105  }
3106  for (auto *E : C->destination_exprs()) {
3107  TRY_TO(TraverseStmt(E));
3108  }
3109  for (auto *E : C->assignment_ops()) {
3110  TRY_TO(TraverseStmt(E));
3111  }
3112  return true;
3113 }
3114 
3115 template <typename Derived>
3117  TRY_TO(VisitOMPClauseList(C));
3118  return true;
3119 }
3120 
3121 template <typename Derived>
3123  TRY_TO(TraverseStmt(C->getStep()));
3124  TRY_TO(TraverseStmt(C->getCalcStep()));
3125  TRY_TO(VisitOMPClauseList(C));
3126  TRY_TO(VisitOMPClauseWithPostUpdate(C));
3127  for (auto *E : C->privates()) {
3128  TRY_TO(TraverseStmt(E));
3129  }
3130  for (auto *E : C->inits()) {
3131  TRY_TO(TraverseStmt(E));
3132  }
3133  for (auto *E : C->updates()) {
3134  TRY_TO(TraverseStmt(E));
3135  }
3136  for (auto *E : C->finals()) {
3137  TRY_TO(TraverseStmt(E));
3138  }
3139  return true;
3140 }
3141 
3142 template <typename Derived>
3145  TRY_TO(VisitOMPClauseList(C));
3146  return true;
3147 }
3148 
3149 template <typename Derived>
3151  TRY_TO(VisitOMPClauseList(C));
3152  for (auto *E : C->source_exprs()) {
3153  TRY_TO(TraverseStmt(E));
3154  }
3155  for (auto *E : C->destination_exprs()) {
3156  TRY_TO(TraverseStmt(E));
3157  }
3158  for (auto *E : C->assignment_ops()) {
3159  TRY_TO(TraverseStmt(E));
3160  }
3161  return true;
3162 }
3163 
3164 template <typename Derived>
3166  OMPCopyprivateClause *C) {
3167  TRY_TO(VisitOMPClauseList(C));
3168  for (auto *E : C->source_exprs()) {
3169  TRY_TO(TraverseStmt(E));
3170  }
3171  for (auto *E : C->destination_exprs()) {
3172  TRY_TO(TraverseStmt(E));
3173  }
3174  for (auto *E : C->assignment_ops()) {
3175  TRY_TO(TraverseStmt(E));
3176  }
3177  return true;
3178 }
3179 
3180 template <typename Derived>
3181 bool
3185  TRY_TO(VisitOMPClauseList(C));
3186  TRY_TO(VisitOMPClauseWithPostUpdate(C));
3187  for (auto *E : C->privates()) {
3188  TRY_TO(TraverseStmt(E));
3189  }
3190  for (auto *E : C->lhs_exprs()) {
3191  TRY_TO(TraverseStmt(E));
3192  }
3193  for (auto *E : C->rhs_exprs()) {
3194  TRY_TO(TraverseStmt(E));
3195  }
3196  for (auto *E : C->reduction_ops()) {
3197  TRY_TO(TraverseStmt(E));
3198  }
3199  return true;
3200 }
3201 
3202 template <typename Derived>
3207  TRY_TO(VisitOMPClauseList(C));
3208  TRY_TO(VisitOMPClauseWithPostUpdate(C));
3209  for (auto *E : C->privates()) {
3210  TRY_TO(TraverseStmt(E));
3211  }
3212  for (auto *E : C->lhs_exprs()) {
3213  TRY_TO(TraverseStmt(E));
3214  }
3215  for (auto *E : C->rhs_exprs()) {
3216  TRY_TO(TraverseStmt(E));
3217  }
3218  for (auto *E : C->reduction_ops()) {
3219  TRY_TO(TraverseStmt(E));
3220  }
3221  return true;
3222 }
3223 
3224 template <typename Derived>
3226  OMPInReductionClause *C) {
3229  TRY_TO(VisitOMPClauseList(C));
3230  TRY_TO(VisitOMPClauseWithPostUpdate(C));
3231  for (auto *E : C->privates()) {
3232  TRY_TO(TraverseStmt(E));
3233  }
3234  for (auto *E : C->lhs_exprs()) {
3235  TRY_TO(TraverseStmt(E));
3236  }
3237  for (auto *E : C->rhs_exprs()) {
3238  TRY_TO(TraverseStmt(E));
3239  }
3240  for (auto *E : C->reduction_ops()) {
3241  TRY_TO(TraverseStmt(E));
3242  }
3243  for (auto *E : C->taskgroup_descriptors())
3244  TRY_TO(TraverseStmt(E));
3245  return true;
3246 }
3247 
3248 template <typename Derived>
3250  TRY_TO(VisitOMPClauseList(C));
3251  return true;
3252 }
3253 
3254 template <typename Derived>
3256  TRY_TO(VisitOMPClauseList(C));
3257  return true;
3258 }
3259 
3260 template <typename Derived>
3262  TRY_TO(VisitOMPClauseWithPreInit(C));
3263  TRY_TO(TraverseStmt(C->getDevice()));
3264  return true;
3265 }
3266 
3267 template <typename Derived>
3269  TRY_TO(VisitOMPClauseList(C));
3270  return true;
3271 }
3272 
3273 template <typename Derived>
3275  OMPNumTeamsClause *C) {
3276  TRY_TO(VisitOMPClauseWithPreInit(C));
3278  return true;
3279 }
3280 
3281 template <typename Derived>
3283  OMPThreadLimitClause *C) {
3284  TRY_TO(VisitOMPClauseWithPreInit(C));
3286  return true;
3287 }
3288 
3289 template <typename Derived>
3291  OMPPriorityClause *C) {
3292  TRY_TO(VisitOMPClauseWithPreInit(C));
3294  return true;
3295 }
3296 
3297 template <typename Derived>
3299  OMPGrainsizeClause *C) {
3300  TRY_TO(VisitOMPClauseWithPreInit(C));
3302  return true;
3303 }
3304 
3305 template <typename Derived>
3307  OMPNumTasksClause *C) {
3308  TRY_TO(VisitOMPClauseWithPreInit(C));
3310  return true;
3311 }
3312 
3313 template <typename Derived>
3315  TRY_TO(TraverseStmt(C->getHint()));
3316  return true;
3317 }
3318 
3319 template <typename Derived>
3321  OMPDistScheduleClause *C) {
3322  TRY_TO(VisitOMPClauseWithPreInit(C));
3324  return true;
3325 }
3326 
3327 template <typename Derived>
3328 bool
3330  return true;
3331 }
3332 
3333 template <typename Derived>
3335  TRY_TO(VisitOMPClauseList(C));
3336  return true;
3337 }
3338 
3339 template <typename Derived>
3341  TRY_TO(VisitOMPClauseList(C));
3342  return true;
3343 }
3344 
3345 template <typename Derived>
3347  OMPUseDevicePtrClause *C) {
3348  TRY_TO(VisitOMPClauseList(C));
3349  return true;
3350 }
3351 
3352 template <typename Derived>
3354  OMPIsDevicePtrClause *C) {
3355  TRY_TO(VisitOMPClauseList(C));
3356  return true;
3357 }
3358 
3359 // FIXME: look at the following tricky-seeming exprs to see if we
3360 // need to recurse on anything. These are ones that have methods
3361 // returning decls or qualtypes or nestednamespecifier -- though I'm
3362 // not sure if they own them -- or just seemed very complicated, or
3363 // had lots of sub-types to explore.
3364 //
3365 // VisitOverloadExpr and its children: recurse on template args? etc?
3366 
3367 // FIXME: go through all the stmts and exprs again, and see which of them
3368 // create new types, and recurse on the types (TypeLocs?) of those.
3369 // Candidates:
3370 //
3371 // http://clang.llvm.org/doxygen/classclang_1_1CXXTypeidExpr.html
3372 // http://clang.llvm.org/doxygen/classclang_1_1UnaryExprOrTypeTraitExpr.html
3373 // http://clang.llvm.org/doxygen/classclang_1_1TypesCompatibleExpr.html
3374 // Every class that has getQualifier.
3375 
3376 #undef DEF_TRAVERSE_STMT
3377 #undef TRAVERSE_STMT
3378 #undef TRAVERSE_STMT_BASE
3379 
3380 #undef TRY_TO
3381 
3382 } // end namespace clang
3383 
3384 #endif // LLVM_CLANG_AST_RECURSIVEASTVISITOR_H
ObjCPropertyRefExpr - A dot-syntax expression to access an ObjC property.
Definition: ExprObjC.h:614
A call to an overloaded operator written using operator syntax.
Definition: ExprCXX.h:78
ObjCIndirectCopyRestoreExpr - Represents the passing of a function argument by indirect copy-restore ...
Definition: ExprObjC.h:1577
This represents &#39;#pragma omp distribute simd&#39; composite directive.
Definition: StmtOpenMP.h:3614
This represents &#39;#pragma omp master&#39; directive.
Definition: StmtOpenMP.h:1592
Represents a type that was referred to using an elaborated type keyword, e.g., struct S...
Definition: Type.h:5205
VarDecl * getCapturedVar() const
Retrieve the declaration of the local variable being captured.
The null pointer literal (C++11 [lex.nullptr])
Definition: ExprCXX.h:683
This represents &#39;#pragma omp task&#39; directive.
Definition: StmtOpenMP.h:1932
This represents a GCC inline-assembly statement extension.
Definition: Stmt.h:2862
Represents a function declaration or definition.
Definition: Decl.h:1784
Represents a &#39;co_await&#39; expression while the type of the promise is dependent.
Definition: ExprCXX.h:4741
helper_expr_const_range reduction_ops() const
This represents &#39;thread_limit&#39; clause in the &#39;#pragma omp ...&#39; directive.
Expr * getInit() const
Get the initializer.
Definition: DeclCXX.h:2335
bool TraverseCXXBaseSpecifier(const CXXBaseSpecifier &Base)
Recursively visit a base specifier.
helper_expr_const_range lhs_exprs() const
This represents clause &#39;copyin&#39; in the &#39;#pragma omp ...&#39; directives.
const TypeClass * getTypePtr() const
Definition: TypeLoc.h:498
PointerType - C99 6.7.5.1 - Pointer Declarators.
Definition: Type.h:2585
Represents the dependent type named by a dependently-scoped typename using declaration, e.g.
Definition: Type.h:4160
A (possibly-)qualified type.
Definition: Type.h:643
base_class_range bases()
Definition: DeclCXX.h:589
#define DEF_TRAVERSE_TMPL_SPEC_DECL(TMPLDECLKIND)
ArrayRef< OMPClause * > clauses()
Definition: StmtOpenMP.h:325
bool shouldWalkTypesOfTypeLocs() const
Return whether this visitor should recurse into the types of TypeLocs.
const TypeClass * getTypePtr() const
Definition: TypeLoc.h:405
A type trait used in the implementation of various C++11 and Library TR1 trait templates.
Definition: ExprCXX.h:2627
This represents &#39;atomic_default_mem_order&#39; clause in the &#39;#pragma omp requires&#39; directive.
DEF_TRAVERSE_TYPE(ComplexType, { TRY_TO(TraverseType(T->getElementType()));}) DEF_TRAVERSE_TYPE(PointerType
NestedNameSpecifierLoc getTemplateQualifierLoc() const
Definition: TemplateBase.h:531
virtual Stmt * getBody() const
getBody - If this Decl represents a declaration for a body of code, such as a function or method defi...
Definition: DeclBase.h:986
helper_expr_const_range rhs_exprs() const
private_copies_range private_copies()
Expr *const * semantics_iterator
Definition: Expr.h:5739
Represents a &#39;co_return&#39; statement in the C++ Coroutines TS.
Definition: StmtCXX.h:456
Stmt - This represents one statement.
Definition: Stmt.h:66
This represents clause &#39;in_reduction&#39; in the &#39;#pragma omp task&#39; directives.
This represents &#39;#pragma omp allocate ...&#39; directive.
Definition: DeclOpenMP.h:422
IfStmt - This represents an if/then/else.
Definition: Stmt.h:1822
#define UNARYOP_LIST()
QualType getPointeeType() const
If this is a pointer, ObjC object pointer, or block pointer, this returns the respective pointee...
Definition: Type.cpp:557
Class that handles pre-initialization statement for some clauses, like &#39;shedule&#39;, &#39;firstprivate&#39; etc...
Definition: OpenMPClause.h:107
An instance of this object exists for each enum constant that is defined.
Definition: Decl.h:2855
Represents the declaration of a typedef-name via the &#39;typedef&#39; type specifier.
Definition: Decl.h:3087
C Language Family Type Representation.
Microsoft&#39;s &#39;__super&#39; specifier, stored as a CXXRecordDecl* of the class it appeared in...
Represents a qualified type name for which the type name is dependent.
Definition: Type.h:5288
This represents &#39;#pragma omp for simd&#39; directive.
Definition: StmtOpenMP.h:1342
spec_range specializations() const
The template argument is an expression, and we&#39;ve not resolved it to one of the other forms yet...
Definition: TemplateBase.h:86
Expr * getAllocator() const
Returns allocator.
Definition: OpenMPClause.h:298
#define TRY_TO_TRAVERSE_OR_ENQUEUE_STMT(S)
helper_expr_const_range rhs_exprs() const
Decl - This represents one declaration (or definition), e.g.
Definition: DeclBase.h:88
This represents &#39;grainsize&#39; clause in the &#39;#pragma omp ...&#39; directive.
bool shouldTraversePostOrder() const
Return whether this visitor should traverse post-order.
This represents &#39;#pragma omp teams distribute parallel for&#39; composite directive.
Definition: StmtOpenMP.h:4025
Represents the index of the current element of an array being initialized by an ArrayInitLoopExpr.
Definition: Expr.h:5054
A reference to a name which we were able to look up during parsing but could not resolve to a specifi...
Definition: ExprCXX.h:3037
NestedNameSpecifier * getPrefix() const
Return the prefix of this nested name specifier.
This represents &#39;if&#39; clause in the &#39;#pragma omp ...&#39; directive.
Definition: OpenMPClause.h:422
Defines the C++ template declaration subclasses.
bool isWritten() const
Determine whether this initializer is explicitly written in the source code.
Definition: DeclCXX.h:2305
StringRef P
Represents a C++11 auto or C++14 decltype(auto) type.
Definition: Type.h:4823
Represents an attribute applied to a statement.
Definition: Stmt.h:1764
ParenExpr - This represents a parethesized expression, e.g.
Definition: Expr.h:1969
helper_expr_const_range assignment_ops() const
bool isCXXForRangeDecl() const
Determine whether this variable is the for-range-declaration in a C++0x for-range statement...
Definition: Decl.h:1370
This represents &#39;priority&#39; clause in the &#39;#pragma omp ...&#39; directive.
The base class of the type hierarchy.
Definition: Type.h:1436
Represents an empty-declaration.
Definition: Decl.h:4357
helper_expr_const_range lhs_exprs() const
This represents &#39;#pragma omp target teams distribute&#39; combined directive.
Definition: StmtOpenMP.h:4162
Represents Objective-C&#39;s @throw statement.
Definition: StmtObjC.h:332
bool isSemanticForm() const
Definition: Expr.h:4527
llvm::iterator_range< child_iterator > child_range
Definition: Stmt.h:1168
Declaration of a variable template.
The template argument is a declaration that was provided for a pointer, reference, or pointer to member non-type template parameter.
Definition: TemplateBase.h:63
Represent a C++ namespace.
Definition: Decl.h:522
Represents a call to a C++ constructor.
Definition: ExprCXX.h:1422
ObjCSubscriptRefExpr - used for array and dictionary subscripting.
Definition: ExprObjC.h:845
An Embarcadero array type trait, as used in the implementation of __array_rank and __array_extent...
Definition: ExprCXX.h:2715
Expr * getCondition() const
Returns condition.
Definition: OpenMPClause.h:564
A container of type source information.
Definition: Decl.h:86
This represents &#39;update&#39; clause in the &#39;#pragma omp atomic&#39; directive.
const Expr * RHS
The original right-hand side.
Definition: ExprCXX.h:302
Expr * getCondition() const
Returns condition.
Definition: OpenMPClause.h:490
This represents &#39;#pragma omp parallel for&#39; directive.
Definition: StmtOpenMP.h:1713
MS property subscript expression.
Definition: ExprCXX.h:937
This represents &#39;#pragma omp target teams distribute parallel for&#39; combined directive.
Definition: StmtOpenMP.h:4230
bool TraverseTemplateName(TemplateName Template)
Recursively visit a template name and dispatch to the appropriate method.
Describes the capture of a variable or of this, or of a C++1y init-capture.
Definition: LambdaCapture.h:25
Represents a C++ constructor within a class.
Definition: DeclCXX.h:2365
Represents a prvalue temporary that is written into memory so that a reference can bind to it...
Definition: ExprCXX.h:4419
Expr * getAlignment()
Returns alignment.
Expr * getNumForLoops() const
Return the number of associated for-loops.
QualType getElementType() const
Definition: Type.h:2881
bool isCompleteDefinition() const
Return true if this decl has its body fully specified.
Definition: Decl.h:3238
Represents a #pragma comment line.
Definition: Decl.h:139
An identifier, stored as an IdentifierInfo*.
This represents &#39;#pragma omp target exit data&#39; directive.
Definition: StmtOpenMP.h:2624
This represents &#39;read&#39; clause in the &#39;#pragma omp atomic&#39; directive.
FriendDecl - Represents the declaration of a friend entity, which can be a function, a type, or a templated function or type.
Definition: DeclFriend.h:53
helper_expr_const_range assignment_ops() const
TRY_TO(TraverseType(T->getPointeeType()))
bool ReturnValue(const T &V, APValue &R)
Convers a value to an APValue.
Definition: Interp.h:41
Represents a variable declaration or definition.
Definition: Decl.h:827
This represents clause &#39;private&#39; in the &#39;#pragma omp ...&#39; directives.
ObjCIsaExpr - Represent X->isa and X.isa when X is an ObjC &#39;id&#39; type.
Definition: ExprObjC.h:1492
This represents &#39;num_threads&#39; clause in the &#39;#pragma omp ...&#39; directive.
Definition: OpenMPClause.h:591
CompoundLiteralExpr - [C99 6.5.2.5].
Definition: Expr.h:3052
Wrapper of type source information for a type with non-trivial direct qualifiers. ...
Definition: TypeLoc.h:273
Derived & getDerived()
Return a reference to the derived class.
Represents an empty template argument, e.g., one that has not been deduced.
Definition: TemplateBase.h:56
This represents &#39;defaultmap&#39; clause in the &#39;#pragma omp ...&#39; directive.
decl_range decls() const
decls_begin/decls_end - Iterate over the declarations stored in this context.
Definition: DeclBase.h:2028
Declaration context for names declared as extern "C" in C++.
Definition: Decl.h:221
Represents a C++17 deduced template specialization type.
Definition: Type.h:4861
QualifiedTemplateName * getAsQualifiedTemplateName() const
Retrieve the underlying qualified template name structure, if any.
ObjCMethodDecl - Represents an instance or class method declaration.
Definition: DeclObjC.h:138
bool dataTraverseStmtPre(Stmt *S)
Invoked before visiting a statement or expression via data recursion.
Represents an explicit template argument list in C++, e.g., the "<int>" in "sort<int>".
Definition: TemplateBase.h:603
A namespace, stored as a NamespaceDecl*.
Implicit construction of a std::initializer_list<T> object from an array temporary within list-initia...
Definition: ExprCXX.h:715
Stores a list of template parameters for a TemplateDecl and its derived classes.
Definition: DeclTemplate.h:67
#define BINOP_LIST()
This represents implicit clause &#39;flush&#39; for the &#39;#pragma omp flush&#39; directive.
Defines the Objective-C statement AST node classes.
const DeclarationNameInfo & getNameInfo() const
Gets the name info for specified reduction identifier.
SpecifierKind getKind() const
Determine what kind of nested name specifier is stored.
A C++ throw-expression (C++ [except.throw]).
Definition: ExprCXX.h:1140
This represents &#39;reverse_offload&#39; clause in the &#39;#pragma omp requires&#39; directive. ...
Represents an expression – generally a full-expression – that introduces cleanups to be run at the ...
Definition: ExprCXX.h:3306
Represents a parameter to a function.
Definition: Decl.h:1600
Represents the result of substituting a type for a template type parameter.
Definition: Type.h:4677
Defines the clang::Expr interface and subclasses for C++ expressions.
SmallVectorImpl< llvm::PointerIntPair< Stmt *, 1, bool > > DataRecursionQueue
A queue used for performing data recursion over statements.
Expr * getGrainsize() const
Return safe iteration space distance.
This represents &#39;nogroup&#39; clause in the &#39;#pragma omp ...&#39; directive.
bool TraverseDecl(Decl *D)
Recursively visit a declaration, by dispatching to Traverse*Decl() based on the argument&#39;s dynamic ty...
Represents the builtin template declaration which is used to implement __make_integer_seq and other b...
This represents &#39;allocator&#39; clause in the &#39;#pragma omp ...&#39; directive.
Definition: OpenMPClause.h:263
const Type * getTypePtr() const
Definition: TypeLoc.h:134
This represents &#39;safelen&#39; clause in the &#39;#pragma omp ...&#39; directive.
Definition: OpenMPClause.h:667
PipeType - OpenCL20.
Definition: Type.h:6078
A C++ static_cast expression (C++ [expr.static.cast]).
Definition: ExprCXX.h:409
Base wrapper for a particular "section" of type source info.
Definition: TypeLoc.h:56
LabelStmt - Represents a label, which has a substatement.
Definition: Stmt.h:1720
Represents a struct/union/class.
Definition: Decl.h:3662
Represents a C99 designated initializer expression.
Definition: Expr.h:4611
Represents a function call to one of __builtin_LINE(), __builtin_COLUMN(), __builtin_FUNCTION(), or __builtin_FILE().
Definition: Expr.h:4267
This represents &#39;#pragma omp parallel&#39; directive.
Definition: StmtOpenMP.h:357
ShuffleVectorExpr - clang-specific builtin-in function __builtin_shufflevector.
Definition: Expr.h:3971
Represents a class type in Objective C.
Definition: Type.h:5614
Expr * getAsExpr() const
Retrieve the template argument as an expression.
Definition: TemplateBase.h:329
Holds long-lived AST nodes (such as types and decls) that can be referred to throughout the semantic ...
Definition: ASTContext.h:160
A C++ nested-name-specifier augmented with source location information.
Represents a dependent template name that cannot be resolved prior to template instantiation.
Definition: TemplateName.h:442
This represents &#39;simd&#39; clause in the &#39;#pragma omp ...&#39; directive.
TypeSourceInfo * getTypeSourceInfo() const
Definition: TemplateBase.h:506
The template argument is an integral value stored in an llvm::APSInt that was provided for an integra...
Definition: TemplateBase.h:71
#define TYPE(CLASS, BASE)
NameKind getNameKind() const
Determine what kind of name this is.
Represents a member of a struct/union/class.
Definition: Decl.h:2643
const Type * getAsType() const
Retrieve the type stored in this nested name specifier.
This represents clause &#39;lastprivate&#39; in the &#39;#pragma omp ...&#39; directives.
TypeSourceInfo * getTypeSourceInfo() const
Returns the declarator information for a base class or delegating initializer.
Definition: DeclCXX.h:2267
This represents clause &#39;allocate&#39; in the &#39;#pragma omp ...&#39; directives.
Definition: OpenMPClause.h:325
Represents a place-holder for an object not to be initialized by anything.
Definition: Expr.h:4909
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:4182
This represents clause &#39;map&#39; in the &#39;#pragma omp ...&#39; directives.
This represents clause &#39;to&#39; in the &#39;#pragma omp ...&#39; directives.
Represents the result of substituting a set of types for a template type parameter pack...
Definition: Type.h:4733
ParmVarDecl * getParam(unsigned i) const
Definition: TypeLoc.h:1443
This represents &#39;#pragma omp target simd&#39; directive.
Definition: StmtOpenMP.h:3750
Represents a C++ member access expression for which lookup produced a set of overloaded functions...
Definition: ExprCXX.h:3771
Defines some OpenMP-specific enums and functions.
ExtVectorElementExpr - This represents access to specific elements of a vector, and may occur on the ...
Definition: Expr.h:5490
Expr * getSafelen() const
Return safe iteration space distance.
Definition: OpenMPClause.h:701
bool TraverseSynOrSemInitListExpr(InitListExpr *S, DataRecursionQueue *Queue=nullptr)
Recursively visit the syntactic or semantic form of an initialization list.
Represents an access specifier followed by colon &#39;:&#39;.
Definition: DeclCXX.h:87
This represents &#39;#pragma omp barrier&#39; directive.
Definition: StmtOpenMP.h:2044
Wrapper of type source information for a type with no direct qualifiers.
Definition: TypeLoc.h:247
Declaration of a function specialization at template class scope.
ObjCArrayLiteral - used for objective-c array containers; as in: @["Hello", NSApp, [NSNumber numberWithInt:42]];.
Definition: ExprObjC.h:188
This is a common base class for loop directives (&#39;omp simd&#39;, &#39;omp for&#39;, &#39;omp for simd&#39; etc...
Definition: StmtOpenMP.h:419
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:4269
This represents &#39;#pragma omp critical&#39; directive.
Definition: StmtOpenMP.h:1639
ArrayRef< ParmVarDecl * > parameters() const
Definition: Decl.h:2325
Represents Objective-C&#39;s @catch statement.
Definition: StmtObjC.h:77
#define TRY_TO(CALL_EXPR)
#define DEF_TRAVERSE_TMPL_DECL(TMPLDECLKIND)
Provides information about a function template specialization, which is a FunctionDecl that has been ...
Definition: DeclTemplate.h:455
Stmt::child_range getStmtChildren(Stmt *S)
This represents clause &#39;copyprivate&#39; in the &#39;#pragma omp ...&#39; directives.
IndirectGotoStmt - This represents an indirect goto.
Definition: Stmt.h:2504
Describes an C or C++ initializer list.
Definition: Expr.h:4375
A C++ typeid expression (C++ [expr.typeid]), which gets the type_info that corresponds to the supplie...
Definition: ExprCXX.h:764
Represents a C++ using-declaration.
Definition: DeclCXX.h:3275
This represents &#39;#pragma omp distribute parallel for&#39; composite directive.
Definition: StmtOpenMP.h:3465
This represents &#39;#pragma omp teams distribute parallel for simd&#39; composite directive.
Definition: StmtOpenMP.h:3954
An rvalue reference type, per C++11 [dcl.ref].
Definition: Type.h:2786
ForStmt - This represents a &#39;for (init;cond;inc)&#39; stmt.
Definition: Stmt.h:2394
NestedNameSpecifierLoc getQualifierLoc() const
Gets the nested name specifier.
Stmt * getBody(const FunctionDecl *&Definition) const
Retrieve the body (definition) of the function.
Definition: Decl.cpp:2849
Forward-declares and imports various common LLVM datatypes that clang wants to use unqualified...
bool TraverseDeclarationNameInfo(DeclarationNameInfo NameInfo)
Recursively visit a name with its location information.
#define DEF_TRAVERSE_DECL(DECL, CODE)
const Stmt * getPreInitStmt() const
Get pre-initialization statement for the clause.
Definition: OpenMPClause.h:129
child_range children()
Definition: Stmt.cpp:223
Sugar type that represents a type that was qualified by a qualifier written as a macro invocation...
Definition: Type.h:4216
Represents a typeof (or typeof) expression (a GCC extension).
Definition: Type.h:4250
A builtin binary operation expression such as "x + y" or "x <= y".
Definition: Expr.h:3409
NestedNameSpecifierLoc getQualifierLoc() const
Retrieve the nested-name-specifier (with source-location information) that qualifies the name of this...
Definition: Decl.h:760
CXXForRangeStmt - This represents C++0x [stmt.ranged]&#39;s ranged for statement, represented as &#39;for (ra...
Definition: StmtCXX.h:134
bool isNull() const
Definition: TypeLoc.h:118
child_range children()
Definition: Expr.h:4560
Class that handles post-update expression for some clauses, like &#39;lastprivate&#39;, &#39;reduction&#39; etc...
Definition: OpenMPClause.h:143
This represents &#39;#pragma omp cancellation point&#39; directive.
Definition: StmtOpenMP.h:2879
FunctionTemplateSpecializationInfo * getTemplateSpecializationInfo() const
If this function is actually a function template specialization, retrieve information about this func...
Definition: Decl.cpp:3588
This represents &#39;default&#39; clause in the &#39;#pragma omp ...&#39; directive.
Definition: OpenMPClause.h:859
ObjCStringLiteral, used for Objective-C string literals i.e.
Definition: ExprObjC.h:50
spec_range specializations() const
CaseStmt - Represent a case statement.
Definition: Stmt.h:1488
TypoExpr - Internal placeholder for expressions where typo correction still needs to be performed and...
Definition: Expr.h:5936
This represents &#39;final&#39; clause in the &#39;#pragma omp ...&#39; directive.
Definition: OpenMPClause.h:522
This represents &#39;mergeable&#39; clause in the &#39;#pragma omp ...&#39; directive.
This represents &#39;#pragma omp teams&#39; directive.
Definition: StmtOpenMP.h:2822
This represents clause &#39;reduction&#39; in the &#39;#pragma omp ...&#39; directives.
This represents &#39;#pragma omp teams distribute simd&#39; combined directive.
Definition: StmtOpenMP.h:3884
Represents an Objective-C protocol declaration.
Definition: DeclObjC.h:2063
AssociationTy< false > Association
Definition: Expr.h:5365
Represents binding an expression to a temporary.
Definition: ExprCXX.h:1373
A C++ lambda expression, which produces a function object (of unspecified type) that can be invoked l...
Definition: ExprCXX.h:1818
helper_expr_const_range source_exprs() const
Represents a C++ member access expression where the actual member referenced could not be resolved be...
Definition: ExprCXX.h:3511
This represents clause &#39;is_device_ptr&#39; in the &#39;#pragma omp ...&#39; directives.
A class that does preorder or postorder depth-first traversal on the entire Clang AST and visits each...
Represents the body of a CapturedStmt, and serves as its DeclContext.
Definition: Decl.h:4140
Represents an ObjC class declaration.
Definition: DeclObjC.h:1171
#define DEF_TRAVERSE_TMPL_PART_SPEC_DECL(TMPLDECLKIND, DECLKIND)
Represents a linkage specification.
Definition: DeclCXX.h:2753
bool isInitCapture(const LambdaCapture *Capture) const
Determine whether one of this lambda&#39;s captures is an init-capture.
Definition: ExprCXX.cpp:1239
A binding in a decomposition declaration.
Definition: DeclCXX.h:3718
helper_expr_const_range source_exprs() const
A default argument (C++ [dcl.fct.default]).
Definition: ExprCXX.h:1202
Represents an extended vector type where either the type or size is dependent.
Definition: Type.h:3166
helper_expr_const_range privates() const
This represents clause &#39;from&#39; in the &#39;#pragma omp ...&#39; directives.
Represents the this expression in C++.
Definition: ExprCXX.h:1097
Represents a K&R-style &#39;int foo()&#39; function, which has no information available about its arguments...
Definition: Type.h:3688
ObjCPropertyImplDecl - Represents implementation declaration of a property in a class or category imp...
Definition: DeclObjC.h:2758
helper_expr_const_range reduction_ops() const
This represents &#39;#pragma omp target parallel for simd&#39; directive.
Definition: StmtOpenMP.h:3682
OpenMP 4.0 [2.4, Array Sections].
Definition: ExprOpenMP.h:44
This represents &#39;dynamic_allocators&#39; clause in the &#39;#pragma omp requires&#39; directive.
ConditionalOperator - The ?: ternary operator.
Definition: Expr.h:3707
#define CAO_LIST()
Represents a C++ pseudo-destructor (C++ [expr.pseudo]).
Definition: ExprCXX.h:2479
Represents the declaration of a typedef-name via a C++11 alias-declaration.
Definition: Decl.h:3107
CompoundStmt - This represents a group of statements like { stmt stmt }.
Definition: Stmt.h:1320
Represents a prototype with parameter type info, e.g.
Definition: Type.h:3725
This represents &#39;threads&#39; clause in the &#39;#pragma omp ...&#39; directive.
helper_expr_const_range destination_exprs() const
This represents &#39;#pragma omp taskgroup&#39; directive.
Definition: StmtOpenMP.h:2132
Expr * getSimdlen() const
Return safe iteration space distance.
Definition: OpenMPClause.h:766
helper_expr_const_range source_exprs() const
TemplateSpecializationKind getTemplateSpecializationKind() const
Determine whether this particular class is a specialization or instantiation of a class template or m...
Definition: DeclCXX.cpp:1695
Represents a ValueDecl that came out of a declarator.
Definition: Decl.h:696
This represents clause &#39;aligned&#39; in the &#39;#pragma omp ...&#39; directives.
OpenMPClauseKind getClauseKind() const
Returns kind of OpenMP clause (private, shared, reduction, etc.).
Definition: OpenMPClause.h:78
UnaryExprOrTypeTraitExpr - expression with either a type or (unevaluated) expression operand...
Definition: Expr.h:2347
helper_expr_const_range private_copies() const
This represents clause &#39;task_reduction&#39; in the &#39;#pragma omp taskgroup&#39; directives.
ConstantExpr - An expression that occurs in a constant context and optionally the result of evaluatin...
Definition: Expr.h:953
Represents a call to the builtin function __builtin_va_arg.
Definition: Expr.h:4216
helper_expr_const_range destination_exprs() const
spec_range specializations() const
This represents &#39;#pragma omp requires...&#39; directive.
Definition: DeclOpenMP.h:345
This represents &#39;#pragma omp distribute&#39; directive.
Definition: StmtOpenMP.h:3338
This represents implicit clause &#39;depend&#39; for the &#39;#pragma omp task&#39; directive.
DEF_TRAVERSE_TYPELOC(ComplexType, { TRY_TO(TraverseType(TL.getTypePtr() ->getElementType()));}) DEF_TRAVERSE_TYPELOC(PointerType
Represents an array type in C++ whose size is a value-dependent expression.
Definition: Type.h:3064
TemplateParameterList * getTemplateParameters() const
Get the list of template parameters.
Definition: DeclTemplate.h:406
An expression "T()" which creates a value-initialized rvalue of type T, which is a non-class type...
Definition: ExprCXX.h:2053
Represents a shadow constructor declaration introduced into a class by a C++11 using-declaration that...
Definition: DeclCXX.h:3169
Represents a block literal declaration, which is like an unnamed FunctionDecl.
Definition: Decl.h:3951
This represents &#39;proc_bind&#39; clause in the &#39;#pragma omp ...&#39; directive.
Definition: OpenMPClause.h:939
This represents &#39;capture&#39; clause in the &#39;#pragma omp atomic&#39; directive.
This represents one expression.
Definition: Expr.h:108
bool TraverseConstructorInitializer(CXXCtorInitializer *Init)
Recursively visit a constructor initializer.
This represents &#39;simdlen&#39; clause in the &#39;#pragma omp ...&#39; directive.
Definition: OpenMPClause.h:732
Declaration of a template type parameter.
Expr * getNumTasks() const
Return safe iteration space distance.
This represents &#39;#pragma omp master taskloop&#39; directive.
Definition: StmtOpenMP.h:3134
UnqualTypeLoc getUnqualifiedLoc() const
Skips past any qualifiers, if this is qualified.
Definition: TypeLoc.h:322
Represents a C++ functional cast expression that builds a temporary object.
Definition: ExprCXX.h:1750
The template argument is a null pointer or null pointer to member that was provided for a non-type te...
Definition: TemplateBase.h:67
A C++ const_cast expression (C++ [expr.const.cast]).
Definition: ExprCXX.h:527
BlockExpr - Adaptor class for mixing a BlockDecl with expressions.
Definition: Expr.h:5551
Represents a C++ destructor within a class.
Definition: DeclCXX.h:2629
bool isThisDeclarationADefinition() const
Returns whether this specific declaration of the function is also a definition that does not contain ...
Definition: Decl.h:2033
bool WalkUpFromQualifiedTypeLoc(QualifiedTypeLoc TL)
bool canIgnoreChildDeclWhileTraversingDeclContext(const Decl *Child)
bool isImplicit() const
isImplicit - Indicates whether the declaration was implicitly generated by the implementation.
Definition: DeclBase.h:558
This represents &#39;#pragma omp target teams distribute parallel for simd&#39; combined directive.
Definition: StmtOpenMP.h:4314
Expr * getAllocator() const
Returns the allocator expression or nullptr, if no allocator is specified.
Definition: OpenMPClause.h:382
ObjCDictionaryLiteral - AST node to represent objective-c dictionary literals; as in:"name" : NSUserN...
Definition: ExprObjC.h:304
Represents Objective-C&#39;s @synchronized statement.
Definition: StmtObjC.h:277
ObjCSelectorExpr used for @selector in Objective-C.
Definition: ExprObjC.h:454
TypeSourceInfo * getNamedTypeInfo() const
getNamedTypeInfo - Returns the source type info associated to the name.
NestedNameSpecifierLoc getPrefix() const
Return the prefix of this nested-name-specifier.
Represents an expression that computes the length of a parameter pack.
Definition: ExprCXX.h:4091
CXXTryStmt - A C++ try block, including all handlers.
Definition: StmtCXX.h:68
AsTypeExpr - Clang builtin function __builtin_astype [OpenCL 6.2.4.2] This AST node provides support ...
Definition: Expr.h:5600
bool VisitQualifiedTypeLoc(QualifiedTypeLoc TL)
NonTypeTemplateParmDecl - Declares a non-type template parameter, e.g., "Size" in.
Represents a C++ template name within the type system.
Definition: TemplateName.h:187
Represents the type decltype(expr) (C++11).
Definition: Type.h:4320
This represents &#39;#pragma omp target teams distribute simd&#39; combined directive.
Definition: StmtOpenMP.h:4387
helper_expr_const_range rhs_exprs() const
Defines the clang::TypeLoc interface and its subclasses.
A namespace alias, stored as a NamespaceAliasDecl*.
This represents &#39;ordered&#39; clause in the &#39;#pragma omp ...&#39; directive.
bool TraverseAST(ASTContext &AST)
Recursively visits an entire AST, starting from the top-level Decls in the AST traversal scope (by de...
This represents &#39;#pragma omp for&#39; directive.
Definition: StmtOpenMP.h:1265
A unary type transform, which is a type constructed from another.
Definition: Type.h:4363
Declaration of an alias template.
Represents a folding of a pack over an operator.
Definition: ExprCXX.h:4535
ReturnStmt - This represents a return, optionally of an expression: return; return 4;...
Definition: Stmt.h:2620
This represents &#39;#pragma omp target teams&#39; directive.
Definition: StmtOpenMP.h:4103
An expression that sends a message to the given Objective-C object or class.
Definition: ExprObjC.h:950
This represents a Microsoft inline-assembly statement extension.
Definition: Stmt.h:3085
UnaryOperator - This represents the unary-expression&#39;s (except sizeof and alignof), the postinc/postdec operators from postfix-expression, and various extensions.
Definition: Expr.h:2021
Represents a GCC generic vector type.
Definition: Type.h:3206
A member reference to an MSPropertyDecl.
Definition: ExprCXX.h:863
An lvalue reference type, per C++11 [dcl.ref].
Definition: Type.h:2768
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:4209
Expr * getDevice()
Return device number.
This represents &#39;#pragma omp cancel&#39; directive.
Definition: StmtOpenMP.h:2937
This represents &#39;collapse&#39; clause in the &#39;#pragma omp ...&#39; directive.
Definition: OpenMPClause.h:797
This represents clause &#39;firstprivate&#39; in the &#39;#pragma omp ...&#39; directives.
Represents a C++ deduction guide declaration.
Definition: DeclCXX.h:1847
Represents a C++ conversion function within a class.
Definition: DeclCXX.h:2690
This template specialization was implicitly instantiated from a template.
Definition: Specifiers.h:181
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:3346
bool isNull() const
Return true if this QualType doesn&#39;t point to a type yet.
Definition: Type.h:708
return TraverseArrayTypeLocHelper(TL)
T getAsAdjusted() const
Convert to the specified TypeLoc type, returning a null TypeLoc if this TypeLoc is not of the desired...
Definition: TypeLoc.h:2317
TypeLoc getReturnLoc() const
Definition: TypeLoc.h:1446
This file defines OpenMP AST classes for clauses.
ImaginaryLiteral - We support imaginary integer and floating point literals, like "1...
Definition: Expr.h:1637
This represents &#39;#pragma omp flush&#39; directive.
Definition: StmtOpenMP.h:2205
This represents &#39;#pragma omp parallel for simd&#39; directive.
Definition: StmtOpenMP.h:1793
DoStmt - This represents a &#39;do/while&#39; stmt.
Definition: Stmt.h:2338
This represents &#39;seq_cst&#39; clause in the &#39;#pragma omp atomic&#39; directive.
helper_expr_const_range assignment_ops() const
This represents &#39;untied&#39; clause in the &#39;#pragma omp ...&#39; directive.
This represents &#39;#pragma omp parallel master taskloop&#39; directive.
Definition: StmtOpenMP.h:3270
This represents &#39;unified_address&#39; clause in the &#39;#pragma omp requires&#39; directive. ...
This represents &#39;#pragma omp target enter data&#39; directive.
Definition: StmtOpenMP.h:2565
Wrapper for source info for arrays.
Definition: TypeLoc.h:1495
Represents a C++ Modules TS module export declaration.
Definition: Decl.h:4310
This represents &#39;#pragma omp master taskloop simd&#39; directive.
Definition: StmtOpenMP.h:3202
bool WalkUpFromUnqualTypeLoc(UnqualTypeLoc TL)
This represents &#39;num_teams&#39; clause in the &#39;#pragma omp ...&#39; directive.
A C++ dynamic_cast expression (C++ [expr.dynamic.cast]).
Definition: ExprCXX.h:445
OpaqueValueExpr - An expression referring to an opaque object of a fixed type and value class...
Definition: Expr.h:1050
ConvertVectorExpr - Clang builtin function __builtin_convertvector This AST node provides support for...
Definition: Expr.h:4039
This captures a statement into a function.
Definition: Stmt.h:3360
Represents a call to an inherited base class constructor from an inheriting constructor.
Definition: ExprCXX.h:1613
PseudoObjectExpr - An expression which accesses a pseudo-object l-value.
Definition: Expr.h:5673
bool shouldVisitTemplateInstantiations() const
Return whether this visitor should recurse into template instantiations.
helper_expr_const_range taskgroup_descriptors() const
This represents &#39;#pragma omp single&#39; directive.
Definition: StmtOpenMP.h:1537
FunctionDecl * getTemplatedDecl() const
Get the underlying function declaration of the template.
const Expr * LHS
The original left-hand side.
Definition: ExprCXX.h:300
Sugar for parentheses used when specifying types.
Definition: Type.h:2555
This represents &#39;hint&#39; clause in the &#39;#pragma omp ...&#39; directive.
A helper class that allows the use of isa/cast/dyncast to detect TagType objects of enums...
Definition: Type.h:4470
This represents &#39;#pragma omp declare reduction ...&#39; directive.
Definition: DeclOpenMP.h:102
Pseudo declaration for capturing expressions.
Definition: DeclOpenMP.h:312
Represents typeof(type), a GCC extension.
Definition: Type.h:4293
Interfaces are the core concept in Objective-C for object oriented design.
Definition: Type.h:5814
bool TraverseTypeLoc(TypeLoc TL)
Recursively visit a type with location, by dispatching to Traverse*TypeLoc() based on the argument ty...
This is a basic class for representing single OpenMP executable directive.
Definition: StmtOpenMP.h:33
private_copies_range private_copies()
Represents a new-expression for memory allocation and constructor calls, e.g: "new CXXNewExpr(foo)"...
Definition: ExprCXX.h:2100
A call to a literal operator (C++11 [over.literal]) written as a user-defined literal (C++11 [lit...
Definition: ExprCXX.h:564
DeclarationName getName() const
getName - Returns the embedded declaration name.
Represents a C++2a __builtin_bit_cast(T, v) expression.
Definition: ExprCXX.h:4818
This represents &#39;schedule&#39; clause in the &#39;#pragma omp ...&#39; directive.
Represents a call to a member function that may be written either with member call syntax (e...
Definition: ExprCXX.h:171
DeclStmt - Adaptor class for mixing declarations with statements and expressions. ...
Definition: Stmt.h:1213
Represents the declaration of a label.
Definition: Decl.h:476
This represents clause &#39;shared&#39; in the &#39;#pragma omp ...&#39; directives.
Represents a vector type where either the type or size is dependent.
Definition: Type.h:3283
Represents a dependent using declaration which was not marked with typename.
Definition: DeclCXX.h:3494
bool TraverseNestedNameSpecifierLoc(NestedNameSpecifierLoc NNS)
Recursively visit a C++ nested-name-specifier with location information.
Represents a static or instance method of a struct/union/class.
Definition: DeclCXX.h:1905
Expr * getPriority()
Return Priority number.
Represents a C++ nested name specifier, such as "\::std::vector<int>::".
This represents &#39;#pragma omp taskwait&#39; directive.
Definition: StmtOpenMP.h:2088
This file defines OpenMP nodes for declarative directives.
ObjCCategoryDecl - Represents a category declaration.
Definition: DeclObjC.h:2279
unsigned pack_size() const
The number of template arguments in the given template argument pack.
Definition: TemplateBase.h:359
This is a basic class for representing single OpenMP clause.
Definition: OpenMPClause.h:50
AtomicExpr - Variadic atomic builtins: __atomic_exchange, __atomic_fetch_*, __atomic_load, __atomic_store, and __atomic_compare_exchange_*, for the similarly-named C++11 instructions, and __c11 variants for <stdatomic.h>, and corresponding __opencl_atomic_* for OpenCL 2.0.
Definition: Expr.h:5807
Expr * getNoexceptExpr() const
Return the expression inside noexcept(expression), or a null pointer if there is none (because the ex...
Definition: Type.h:4002
ObjCProtocolExpr used for protocol expression in Objective-C.
Definition: ExprObjC.h:503
bool TraverseStmt(Stmt *S, DataRecursionQueue *Queue=nullptr)
Recursively visit a statement or expression, by dispatching to Traverse*() based on the argument&#39;s dy...
Represents one property declaration in an Objective-C interface.
Definition: DeclObjC.h:728
ImplicitCastExpr - Allows us to explicitly represent implicit type conversions, which have no direct ...
Definition: Expr.h:3249
This represents &#39;#pragma omp target&#39; directive.
Definition: StmtOpenMP.h:2449
Expr * getNumForLoops() const
Return the number of associated for-loops.
Definition: OpenMPClause.h:832
TypeClass getTypeClass() const
Definition: Type.h:1851
This template specialization was instantiated from a template due to an explicit instantiation defini...
Definition: Specifiers.h:193
This template specialization was formed from a template-id but has not yet been declared, defined, or instantiated.
Definition: Specifiers.h:178
bool isExplicit() const
Determine whether this was an explicit capture (written between the square brackets introducing the l...
An expression trait intrinsic.
Definition: ExprCXX.h:2785
DeclarationNameInfo getNameInfo() const
Definition: Decl.h:1951
Represents a C++11 static_assert declaration.
Definition: DeclCXX.h:3669
This represents &#39;#pragma omp ordered&#39; directive.
Definition: StmtOpenMP.h:2260
StmtExpr - This is the GNU Statement Expression extension: ({int X=4; X;}).
Definition: Expr.h:3926
This represents &#39;#pragma omp target update&#39; directive.
Definition: StmtOpenMP.h:3406
ObjCBoxedExpr - used for generalized expression boxing.
Definition: ExprObjC.h:124
bool TraverseType(QualType T)
Recursively visit a type, by dispatching to Traverse*Type() based on the argument&#39;s getTypeClass() pr...
TypeSourceInfo * getTypeSourceInfo() const
Retrieves the type and source location of the base class.
Definition: DeclCXX.h:251
std::vector< Decl * > getTraversalScope() const
Definition: ASTContext.h:637
helper_expr_const_range lhs_exprs() const
DependentTemplateName * getAsDependentTemplateName() const
Retrieve the underlying dependent template name structure, if any.
Representation of a Microsoft __if_exists or __if_not_exists statement with a dependent name...
Definition: StmtCXX.h:252
bool TraverseLambdaCapture(LambdaExpr *LE, const LambdaCapture *C, Expr *Init)
Recursively visit a lambda capture.
Describes a module import declaration, which makes the contents of the named module visible in the cu...
Definition: Decl.h:4245
Represents a pointer type decayed from an array or function type.
Definition: Type.h:2670
The injected class name of a C++ class template or class template partial specialization.
Definition: Type.h:5054
A qualified reference to a name whose declaration cannot yet be resolved.
Definition: ExprCXX.h:3155
TypeLoc getElementLoc() const
Definition: TypeLoc.h:1528
Represents a pack expansion of types.
Definition: Type.h:5431
CompoundAssignOperator - For compound assignments (e.g.
Definition: Expr.h:3629
Defines various enumerations that describe declaration and type specifiers.
Represents a C11 generic selection.
Definition: Expr.h:5206
NestedNameSpecifierLoc getQualifierLoc() const
Retrieve the nested-name-specifier (with source-location information) that qualifies the name of this...
Definition: Decl.h:3360
bool shouldVisitImplicitCode() const
Return whether this visitor should recurse into implicit code, e.g., implicit constructors and destru...
AddrLabelExpr - The GNU address of label extension, representing &&label.
Definition: Expr.h:3882
An Objective-C "bridged" cast expression, which casts between Objective-C pointers and C pointers...
Definition: ExprObjC.h:1638
ast_type_traits::DynTypedNode Node
Represents a reference to a function parameter pack or init-capture pack that has been substituted bu...
Definition: ExprCXX.h:4337
Represents a template argument.
Definition: TemplateBase.h:50
Represents a type which was implicitly adjusted by the semantic engine for arbitrary reasons...
Definition: Type.h:2633
Represents a template name that was expressed as a qualified name.
Definition: TemplateName.h:386
NullStmt - This is the null statement ";": C99 6.8.3p3.
Definition: Stmt.h:1285
Dataflow Directional Tag Classes.
This represents &#39;device&#39; clause in the &#39;#pragma omp ...&#39; directive.
NestedNameSpecifier * getNestedNameSpecifier() const
Retrieve the nested-name-specifier to which this instance refers.
const TemplateArgument & getArgument() const
Definition: TemplateBase.h:498
[C99 6.4.2.2] - A predefined identifier such as func.
Definition: Expr.h:1878
DeclContext - This is used only as base class of specific decl types that can act as declaration cont...
Definition: DeclBase.h:1271
Represents a delete expression for memory deallocation and destructor calls, e.g. ...
Definition: ExprCXX.h:2359
helper_expr_const_range privates() const
The template argument is a pack expansion of a template name that was provided for a template templat...
Definition: TemplateBase.h:79
bool NE(InterpState &S, CodePtr OpPC)
Definition: Interp.h:226
This represents &#39;#pragma omp section&#39; directive.
Definition: StmtOpenMP.h:1475
This represents &#39;#pragma omp teams distribute&#39; directive.
Definition: StmtOpenMP.h:3816
#define DEF_TRAVERSE_TMPL_INST(TMPLDECLKIND)
Represents a field injected from an anonymous union/struct into the parent scope. ...
Definition: Decl.h:2894
Expr * getSourceExpression() const
Definition: TemplateBase.h:511
const Expr * getInit() const
Definition: Decl.h:1234
A runtime availability query.
Definition: ExprObjC.h:1699
A decomposition declaration.
Definition: DeclCXX.h:3775
This template specialization was instantiated from a template due to an explicit instantiation declar...
Definition: Specifiers.h:189
A C++ reinterpret_cast expression (C++ [expr.reinterpret.cast]).
Definition: ExprCXX.h:487
This represents &#39;#pragma omp simd&#39; directive.
Definition: StmtOpenMP.h:1200
Represents a &#39;co_yield&#39; expression.
Definition: ExprCXX.h:4792
Represents a dependent using declaration which was marked with typename.
Definition: DeclCXX.h:3590
Represents the declaration of an Objective-C type parameter.
Definition: DeclObjC.h:558
ArrayRef< QualType > exceptions() const
Definition: Type.h:4083
Kind getKind() const
Definition: DeclBase.h:432
Represents a C++11 pack expansion that produces a sequence of expressions.
Definition: ExprCXX.h:4015
This represents &#39;unified_shared_memory&#39; clause in the &#39;#pragma omp requires&#39; directive.
This represents clause &#39;linear&#39; in the &#39;#pragma omp ...&#39; directives.
Represents an enum.
Definition: Decl.h:3395
A pointer to member type per C++ 8.3.3 - Pointers to members.
Definition: Type.h:2804
DeclarationNameInfo - A collector data type for bundling together a DeclarationName and the correspnd...
This represents &#39;#pragma omp atomic&#39; directive.
Definition: StmtOpenMP.h:2315
A type that was preceded by the &#39;template&#39; keyword, stored as a Type*.
pack_iterator pack_begin() const
Iterator referencing the first argument of a template argument pack.
Definition: TemplateBase.h:339
Represents a __leave statement.
Definition: Stmt.h:3321
unsigned getNumParams() const
Definition: TypeLoc.h:1437
Represents a pointer to an Objective C object.
Definition: Type.h:5870
helper_expr_const_range privates() const
Represents a C++11 noexcept expression (C++ [expr.unary.noexcept]).
Definition: ExprCXX.h:3958
SwitchStmt - This represents a &#39;switch&#39; stmt.
Definition: Stmt.h:2027
Pointer to a block type.
Definition: Type.h:2687
ObjCImplementationDecl - Represents a class definition - this is where method definitions are specifi...
Definition: DeclObjC.h:2551
Represents the body of a coroutine.
Definition: StmtCXX.h:317
A helper class that allows the use of isa/cast/dyncast to detect TagType objects of structs/unions/cl...
Definition: Type.h:4444
Complex values, per C99 6.2.5p11.
Definition: Type.h:2525
Location wrapper for a TemplateArgument.
Definition: TemplateBase.h:449
ArraySubscriptExpr - [C99 6.5.2.1] Array Subscripting.
Definition: Expr.h:2437
This file defines OpenMP AST classes for executable directives and clauses.
Represents Objective-C&#39;s collection statement.
Definition: StmtObjC.h:23
bool TraverseTemplateArgument(const TemplateArgument &Arg)
Recursively visit a template argument and dispatch to the appropriate method for the argument type...
Represents a C++ base or member initializer.
Definition: DeclCXX.h:2137
This template specialization was declared or defined by an explicit specialization (C++ [temp...
Definition: Specifiers.h:185
ObjCEncodeExpr, used for @encode in Objective-C.
Definition: ExprObjC.h:407
helper_expr_const_range destination_exprs() const
Represents a call to a CUDA kernel function.
Definition: ExprCXX.h:224
Represents a &#39;co_await&#39; expression.
Definition: ExprCXX.h:4705
TypeSourceInfo * getTypeSourceInfo() const
Definition: Decl.h:723
ExtVectorType - Extended vector type.
Definition: Type.h:3325
Expr * getSizeExpr() const
Definition: TypeLoc.h:1520
TypeLocClass getTypeLocClass() const
Definition: TypeLoc.h:113
Represents Objective-C&#39;s @finally statement.
Definition: StmtObjC.h:127
The template argument is a type.
Definition: TemplateBase.h:59
bool TraverseNestedNameSpecifier(NestedNameSpecifier *NNS)
Recursively visit a C++ nested-name-specifier.
The template argument is actually a parameter pack.
Definition: TemplateBase.h:90
const DeclarationNameInfo & getNameInfo() const
Gets the name info for specified reduction identifier.
Represents a base class of a C++ class.
Definition: DeclCXX.h:147
This represents &#39;write&#39; clause in the &#39;#pragma omp atomic&#39; directive.
ObjCIvarRefExpr - A reference to an ObjC instance variable.
Definition: ExprObjC.h:546
UnqualTypeLoc getUnqualifiedLoc() const
Definition: TypeLoc.h:277
Describes an explicit type conversion that uses functional notion but could not be resolved because o...
Definition: ExprCXX.h:3390
GotoStmt - This represents a direct goto.
Definition: Stmt.h:2465
A use of a default initializer in a constructor or in aggregate initialization.
Definition: ExprCXX.h:1279
TypeLoc getTypeLoc() const
Return the TypeLoc wrapper for the type source info.
Definition: TypeLoc.h:240
ArgKind getKind() const
Return the kind of stored template argument.
Definition: TemplateBase.h:234
An attributed type is a type to which a type attribute has been applied.
Definition: Type.h:4499
Defines the C++ Decl subclasses, other than those for templates (found in DeclTemplate.h) and friends (in DeclFriend.h).
QualType getParamType(unsigned i) const
Definition: Type.h:3929
TemplateDecl * getCXXDeductionGuideTemplate() const
If this name is the name of a C++ deduction guide, return the template associated with that name...
const DeclarationNameInfo & getNameInfo() const
Gets the name info for specified reduction identifier.
Represents a type parameter type in Objective C.
Definition: Type.h:5540
Represents a field declaration created by an @defs(...).
Definition: DeclObjC.h:2011
MemberExpr - [C99 6.5.2.3] Structure and Union Members.
Definition: Expr.h:2811
This represents &#39;#pragma omp target parallel&#39; directive.
Definition: StmtOpenMP.h:2682
This represents &#39;nowait&#39; clause in the &#39;#pragma omp ...&#39; directive.
Represents a C++ struct/union/class.
Definition: DeclCXX.h:255
Represents a template specialization type whose template cannot be resolved, e.g. ...
Definition: Type.h:5340
ContinueStmt - This represents a continue.
Definition: Stmt.h:2553
Represents a loop initializing the elements of an array.
Definition: Expr.h:4999
This represents &#39;num_tasks&#39; clause in the &#39;#pragma omp ...&#39; directive.
bool isSyntacticForm() const
Definition: Expr.h:4531
The template argument is a template name that was provided for a template template parameter...
Definition: TemplateBase.h:75
Represents a C array with an unspecified size.
Definition: Type.h:2966
ChooseExpr - GNU builtin-in function __builtin_choose_expr.
Definition: Expr.h:4102
BinaryConditionalOperator - The GNU extension to the conditional operator which allows the middle ope...
Definition: Expr.h:3780
CXXCatchStmt - This represents a C++ catch block.
Definition: StmtCXX.h:28
bool LE(InterpState &S, CodePtr OpPC)
Definition: Interp.h:240
Represents an explicit C++ type conversion that uses "functional" notation (C++ [expr.type.conv]).
Definition: ExprCXX.h:1688
bool dataTraverseStmtPost(Stmt *S)
Invoked after visiting a statement or expression via data recursion.
The parameter type of a method or function.
ObjCIvarDecl - Represents an ObjC instance variable.
Definition: DeclObjC.h:1944
WhileStmt - This represents a &#39;while&#39; stmt.
Definition: Stmt.h:2210
Represents the specialization of a concept - evaluates to a prvalue of type bool. ...
Definition: ExprCXX.h:4849
helper_expr_const_range reduction_ops() const
Declaration of a class template.
Expr * getThreadLimit()
Return ThreadLimit number.
Stores a list of Objective-C type parameters for a parameterized class or a category/extension thereo...
Definition: DeclObjC.h:636
This class is used for builtin types like &#39;int&#39;.
Definition: Type.h:2436
TypeLoc getTypeLoc() const
For a nested-name-specifier that refers to a type, retrieve the type with source-location information...
Represents Objective-C&#39;s @try ... @catch ... @finally statement.
Definition: StmtObjC.h:165
This represents &#39;#pragma omp declare mapper ...&#39; directive.
Definition: DeclOpenMP.h:217
This represents &#39;#pragma omp taskloop simd&#39; directive.
Definition: StmtOpenMP.h:3067
StringLiteral - This represents a string literal expression, e.g.
Definition: Expr.h:1686
CallExpr - Represents a function call (C99 6.5.2.2, C++ [expr.call]).
Definition: Expr.h:2521
bool TraverseTemplateArguments(const TemplateArgument *Args, unsigned NumArgs)
Recursively visit a set of template arguments.
#define DEF_TRAVERSE_STMT(STMT, CODE)
This represents &#39;dist_schedule&#39; clause in the &#39;#pragma omp ...&#39; directive.
This represents &#39;#pragma omp sections&#39; directive.
Definition: StmtOpenMP.h:1407
Expr * getHint() const
Returns number of threads.
NestedNameSpecifierLoc getQualifierLoc() const
Gets the nested name specifier.
ObjCBoolLiteralExpr - Objective-C Boolean Literal.
Definition: ExprObjC.h:85
The top declaration context.
Definition: Decl.h:107
This represents &#39;#pragma omp target data&#39; directive.
Definition: StmtOpenMP.h:2507
QualType getAsType() const
Retrieve the type for a type template argument.
Definition: TemplateBase.h:256
A rewritten comparison expression that was originally written using operator syntax.
Definition: ExprCXX.h:273
A reference to a declared variable, function, enum, etc.
Definition: Expr.h:1146
Represents an extended address space qualifier where the input address space value is dependent...
Definition: Type.h:3124
Represents a type template specialization; the template must be a class template, a type alias templa...
Definition: Type.h:4917
NestedNameSpecifierLoc getQualifierLoc() const
Gets the nested name specifier.
BreakStmt - This represents a break.
Definition: Stmt.h:2583
Expr * getChunkSize()
Get chunk size.
Expr * getNumThreads() const
Returns number of threads.
Definition: OpenMPClause.h:635
An instance of this class represents the declaration of a property member.
Definition: DeclCXX.h:3846
QualType getType() const
Definition: Decl.h:655
bool TraverseAttr(Attr *At)
Recursively visit an attribute, by dispatching to Traverse*Attr() based on the argument&#39;s dynamic typ...
This represents &#39;#pragma omp taskyield&#39; directive.
Definition: StmtOpenMP.h:2000
This represents a decl that may have a name.
Definition: Decl.h:248
This represents &#39;#pragma omp distribute parallel for simd&#39; composite directive.
Definition: StmtOpenMP.h:3545
A boolean literal, per ([C++ lex.bool] Boolean literals).
Definition: ExprCXX.h:645
OffsetOfExpr - [C99 7.17] - This represents an expression of the form offsetof(record-type, member-designator).
Definition: Expr.h:2242
Represents a C array with a specified size that is not an integer-constant-expression.
Definition: Type.h:3010
This represents &#39;#pragma omp parallel sections&#39; directive.
Definition: StmtOpenMP.h:1861
Represents a C++ namespace alias.
Definition: DeclCXX.h:2949
A Microsoft C++ __uuidof expression, which gets the _GUID that corresponds to the supplied type or ex...
Definition: ExprCXX.h:1000
bool VisitUnqualTypeLoc(UnqualTypeLoc TL)
Declaration of a friend template.
Represents C++ using-directive.
Definition: DeclCXX.h:2845
Represents a #pragma detect_mismatch line.
Definition: Decl.h:173
const Expr * getPostUpdateExpr() const
Get post-update expression for the clause.
Definition: OpenMPClause.h:159
The global specifier &#39;::&#39;. There is no stored value.
TemplateName getAsTemplateOrTemplatePattern() const
Retrieve the template argument as a template name; if the argument is a pack expansion, return the pattern as a template name.
Definition: TemplateBase.h:287
Represents Objective-C&#39;s @autoreleasepool Statement.
Definition: StmtObjC.h:368
This represents &#39;#pragma omp threadprivate ...&#39; directive.
Definition: DeclOpenMP.h:39
ObjCCategoryImplDecl - An object of this class encapsulates a category @implementation declaration...
Definition: DeclObjC.h:2498
Represents the canonical version of C arrays with a specified constant size.
Definition: Type.h:2906
InitListExpr * getSyntacticForm() const
Definition: Expr.h:4534
Declaration of a template function.
Definition: DeclTemplate.h:961
Represents an implicitly-generated value initialization of an object of a given type.
Definition: Expr.h:5089
bool TraverseTemplateArgumentLoc(const TemplateArgumentLoc &ArgLoc)
Recursively visit a template argument location and dispatch to the appropriate method for the argumen...
This represents &#39;#pragma omp target parallel for&#39; directive.
Definition: StmtOpenMP.h:2742
Attr - This represents one attribute.
Definition: Attr.h:45
This represents clause &#39;use_device_ptr&#39; in the &#39;#pragma omp ...&#39; directives.
Represents a shadow declaration introduced into a scope by a (resolved) using declaration.
Definition: DeclCXX.h:3068
Represents a pack of using declarations that a single using-declarator pack-expanded into...
Definition: DeclCXX.h:3425
InitListExpr * getSemanticForm() const
Definition: Expr.h:4528
Defines the LambdaCapture class.
ObjCCompatibleAliasDecl - Represents alias of a class.
Definition: DeclObjC.h:2728
#define STMT(CLASS, PARENT)
This represents &#39;#pragma omp taskloop&#39; directive.
Definition: StmtOpenMP.h:3002