clang  12.0.0git
TextNodeDumper.h
Go to the documentation of this file.
1 //===--- TextNodeDumper.h - Printing of AST nodes -------------------------===//
2 //
3 // Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.
4 // See https://llvm.org/LICENSE.txt for license information.
5 // SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception
6 //
7 //===----------------------------------------------------------------------===//
8 //
9 // This file implements AST dumping of components of individual AST nodes.
10 //
11 //===----------------------------------------------------------------------===//
12 
13 #ifndef LLVM_CLANG_AST_TEXTNODEDUMPER_H
14 #define LLVM_CLANG_AST_TEXTNODEDUMPER_H
15 
16 #include "clang/AST/ASTContext.h"
18 #include "clang/AST/AttrVisitor.h"
21 #include "clang/AST/DeclVisitor.h"
22 #include "clang/AST/ExprCXX.h"
23 #include "clang/AST/StmtVisitor.h"
25 #include "clang/AST/Type.h"
26 #include "clang/AST/TypeVisitor.h"
27 
28 namespace clang {
29 
30 class APValue;
31 
33  raw_ostream &OS;
34  const bool ShowColors;
35 
36  /// Pending[i] is an action to dump an entity at level i.
38 
39  /// Indicates whether we're at the top level.
40  bool TopLevel = true;
41 
42  /// Indicates if we're handling the first child after entering a new depth.
43  bool FirstChild = true;
44 
45  /// Prefix for currently-being-dumped entity.
46  std::string Prefix;
47 
48 public:
49  /// Add a child of the current node. Calls DoAddChild without arguments
50  template <typename Fn> void AddChild(Fn DoAddChild) {
51  return AddChild("", DoAddChild);
52  }
53 
54  /// Add a child of the current node with an optional label.
55  /// Calls DoAddChild without arguments.
56  template <typename Fn> void AddChild(StringRef Label, Fn DoAddChild) {
57  // If we're at the top level, there's nothing interesting to do; just
58  // run the dumper.
59  if (TopLevel) {
60  TopLevel = false;
61  DoAddChild();
62  while (!Pending.empty()) {
63  Pending.back()(true);
64  Pending.pop_back();
65  }
66  Prefix.clear();
67  OS << "\n";
68  TopLevel = true;
69  return;
70  }
71 
72  // We need to capture an owning-string in the lambda because the lambda
73  // is invoked in a deferred manner.
74  std::string LabelStr(Label);
75  auto DumpWithIndent = [this, DoAddChild, LabelStr](bool IsLastChild) {
76  // Print out the appropriate tree structure and work out the prefix for
77  // children of this node. For instance:
78  //
79  // A Prefix = ""
80  // |-B Prefix = "| "
81  // | `-C Prefix = "| "
82  // `-D Prefix = " "
83  // |-E Prefix = " | "
84  // `-F Prefix = " "
85  // G Prefix = ""
86  //
87  // Note that the first level gets no prefix.
88  {
89  OS << '\n';
90  ColorScope Color(OS, ShowColors, IndentColor);
91  OS << Prefix << (IsLastChild ? '`' : '|') << '-';
92  if (!LabelStr.empty())
93  OS << LabelStr << ": ";
94 
95  this->Prefix.push_back(IsLastChild ? ' ' : '|');
96  this->Prefix.push_back(' ');
97  }
98 
99  FirstChild = true;
100  unsigned Depth = Pending.size();
101 
102  DoAddChild();
103 
104  // If any children are left, they're the last at their nesting level.
105  // Dump those ones out now.
106  while (Depth < Pending.size()) {
107  Pending.back()(true);
108  this->Pending.pop_back();
109  }
110 
111  // Restore the old prefix.
112  this->Prefix.resize(Prefix.size() - 2);
113  };
114 
115  if (FirstChild) {
116  Pending.push_back(std::move(DumpWithIndent));
117  } else {
118  Pending.back()(false);
119  Pending.back() = std::move(DumpWithIndent);
120  }
121  FirstChild = false;
122  }
123 
124  TextTreeStructure(raw_ostream &OS, bool ShowColors)
125  : OS(OS), ShowColors(ShowColors) {}
126 };
127 
129  : public TextTreeStructure,
130  public comments::ConstCommentVisitor<TextNodeDumper, void,
131  const comments::FullComment *>,
132  public ConstAttrVisitor<TextNodeDumper>,
133  public ConstTemplateArgumentVisitor<TextNodeDumper>,
134  public ConstStmtVisitor<TextNodeDumper>,
135  public TypeVisitor<TextNodeDumper>,
136  public ConstDeclVisitor<TextNodeDumper> {
137  raw_ostream &OS;
138  const bool ShowColors;
139 
140  /// Keep track of the last location we print out so that we can
141  /// print out deltas from then on out.
142  const char *LastLocFilename = "";
143  unsigned LastLocLine = ~0U;
144 
145  /// \p Context, \p SM, and \p Traits can be null. This is because we want
146  /// to be able to call \p dump() in a debugger without having to pass the
147  /// \p ASTContext to \p dump. Not all parts of the AST dump output will be
148  /// available without the \p ASTContext.
149  const ASTContext *Context = nullptr;
150  const SourceManager *SM = nullptr;
151 
152  /// The policy to use for printing; can be defaulted.
153  PrintingPolicy PrintPolicy = LangOptions();
154 
155  const comments::CommandTraits *Traits = nullptr;
156 
157  const char *getCommandName(unsigned CommandID);
158 
159  void dumpAPValueChildren(const APValue &Value, QualType Ty,
160  const APValue &(*IdxToChildFun)(const APValue &,
161  unsigned),
162  unsigned NumChildren, StringRef LabelSingular,
163  StringRef LabelPlurial);
164 
165 public:
166  TextNodeDumper(raw_ostream &OS, const ASTContext &Context, bool ShowColors);
167  TextNodeDumper(raw_ostream &OS, bool ShowColors);
168 
169  void Visit(const comments::Comment *C, const comments::FullComment *FC);
170 
171  void Visit(const Attr *A);
172 
173  void Visit(const TemplateArgument &TA, SourceRange R,
174  const Decl *From = nullptr, StringRef Label = {});
175 
176  void Visit(const Stmt *Node);
177 
178  void Visit(const Type *T);
179 
180  void Visit(QualType T);
181 
182  void Visit(const Decl *D);
183 
184  void Visit(const CXXCtorInitializer *Init);
185 
186  void Visit(const OMPClause *C);
187 
188  void Visit(const BlockDecl::Capture &C);
189 
190  void Visit(const GenericSelectionExpr::ConstAssociation &A);
191 
192  void Visit(const APValue &Value, QualType Ty);
193 
194  void dumpPointer(const void *Ptr);
195  void dumpLocation(SourceLocation Loc);
196  void dumpSourceRange(SourceRange R);
197  void dumpBareType(QualType T, bool Desugar = true);
198  void dumpType(QualType T);
199  void dumpBareDeclRef(const Decl *D);
200  void dumpName(const NamedDecl *ND);
201  void dumpAccessSpecifier(AccessSpecifier AS);
202  void dumpCleanupObject(const ExprWithCleanups::CleanupObject &C);
203 
204  void dumpDeclRef(const Decl *D, StringRef Label = {});
205 
206  void visitTextComment(const comments::TextComment *C,
207  const comments::FullComment *);
208  void visitInlineCommandComment(const comments::InlineCommandComment *C,
209  const comments::FullComment *);
210  void visitHTMLStartTagComment(const comments::HTMLStartTagComment *C,
211  const comments::FullComment *);
212  void visitHTMLEndTagComment(const comments::HTMLEndTagComment *C,
213  const comments::FullComment *);
214  void visitBlockCommandComment(const comments::BlockCommandComment *C,
215  const comments::FullComment *);
216  void visitParamCommandComment(const comments::ParamCommandComment *C,
217  const comments::FullComment *FC);
218  void visitTParamCommandComment(const comments::TParamCommandComment *C,
219  const comments::FullComment *FC);
220  void visitVerbatimBlockComment(const comments::VerbatimBlockComment *C,
221  const comments::FullComment *);
222  void
223  visitVerbatimBlockLineComment(const comments::VerbatimBlockLineComment *C,
224  const comments::FullComment *);
225  void visitVerbatimLineComment(const comments::VerbatimLineComment *C,
226  const comments::FullComment *);
227 
228 // Implements Visit methods for Attrs.
229 #include "clang/AST/AttrTextNodeDump.inc"
230 
231  void VisitNullTemplateArgument(const TemplateArgument &TA);
232  void VisitTypeTemplateArgument(const TemplateArgument &TA);
233  void VisitDeclarationTemplateArgument(const TemplateArgument &TA);
234  void VisitNullPtrTemplateArgument(const TemplateArgument &TA);
235  void VisitIntegralTemplateArgument(const TemplateArgument &TA);
236  void VisitTemplateTemplateArgument(const TemplateArgument &TA);
237  void VisitTemplateExpansionTemplateArgument(const TemplateArgument &TA);
238  void VisitExpressionTemplateArgument(const TemplateArgument &TA);
239  void VisitPackTemplateArgument(const TemplateArgument &TA);
240 
241  void VisitIfStmt(const IfStmt *Node);
242  void VisitSwitchStmt(const SwitchStmt *Node);
243  void VisitWhileStmt(const WhileStmt *Node);
244  void VisitLabelStmt(const LabelStmt *Node);
245  void VisitGotoStmt(const GotoStmt *Node);
246  void VisitCaseStmt(const CaseStmt *Node);
247  void VisitConstantExpr(const ConstantExpr *Node);
248  void VisitCallExpr(const CallExpr *Node);
249  void VisitCXXOperatorCallExpr(const CXXOperatorCallExpr *Node);
250  void VisitCastExpr(const CastExpr *Node);
251  void VisitImplicitCastExpr(const ImplicitCastExpr *Node);
252  void VisitDeclRefExpr(const DeclRefExpr *Node);
253  void VisitPredefinedExpr(const PredefinedExpr *Node);
254  void VisitCharacterLiteral(const CharacterLiteral *Node);
255  void VisitIntegerLiteral(const IntegerLiteral *Node);
256  void VisitFixedPointLiteral(const FixedPointLiteral *Node);
257  void VisitFloatingLiteral(const FloatingLiteral *Node);
258  void VisitStringLiteral(const StringLiteral *Str);
259  void VisitInitListExpr(const InitListExpr *ILE);
260  void VisitGenericSelectionExpr(const GenericSelectionExpr *E);
261  void VisitUnaryOperator(const UnaryOperator *Node);
262  void VisitUnaryExprOrTypeTraitExpr(const UnaryExprOrTypeTraitExpr *Node);
263  void VisitMemberExpr(const MemberExpr *Node);
264  void VisitExtVectorElementExpr(const ExtVectorElementExpr *Node);
265  void VisitBinaryOperator(const BinaryOperator *Node);
266  void VisitCompoundAssignOperator(const CompoundAssignOperator *Node);
267  void VisitAddrLabelExpr(const AddrLabelExpr *Node);
268  void VisitCXXNamedCastExpr(const CXXNamedCastExpr *Node);
269  void VisitCXXBoolLiteralExpr(const CXXBoolLiteralExpr *Node);
270  void VisitCXXThisExpr(const CXXThisExpr *Node);
271  void VisitCXXFunctionalCastExpr(const CXXFunctionalCastExpr *Node);
272  void VisitCXXUnresolvedConstructExpr(const CXXUnresolvedConstructExpr *Node);
273  void VisitCXXConstructExpr(const CXXConstructExpr *Node);
274  void VisitCXXBindTemporaryExpr(const CXXBindTemporaryExpr *Node);
275  void VisitCXXNewExpr(const CXXNewExpr *Node);
276  void VisitCXXDeleteExpr(const CXXDeleteExpr *Node);
277  void VisitTypeTraitExpr(const TypeTraitExpr *Node);
278  void VisitArrayTypeTraitExpr(const ArrayTypeTraitExpr *Node);
279  void VisitExpressionTraitExpr(const ExpressionTraitExpr *Node);
280  void VisitMaterializeTemporaryExpr(const MaterializeTemporaryExpr *Node);
281  void VisitExprWithCleanups(const ExprWithCleanups *Node);
282  void VisitUnresolvedLookupExpr(const UnresolvedLookupExpr *Node);
283  void VisitSizeOfPackExpr(const SizeOfPackExpr *Node);
284  void
285  VisitCXXDependentScopeMemberExpr(const CXXDependentScopeMemberExpr *Node);
286  void VisitObjCAtCatchStmt(const ObjCAtCatchStmt *Node);
287  void VisitObjCEncodeExpr(const ObjCEncodeExpr *Node);
288  void VisitObjCMessageExpr(const ObjCMessageExpr *Node);
289  void VisitObjCBoxedExpr(const ObjCBoxedExpr *Node);
290  void VisitObjCSelectorExpr(const ObjCSelectorExpr *Node);
291  void VisitObjCProtocolExpr(const ObjCProtocolExpr *Node);
292  void VisitObjCPropertyRefExpr(const ObjCPropertyRefExpr *Node);
293  void VisitObjCSubscriptRefExpr(const ObjCSubscriptRefExpr *Node);
294  void VisitObjCIvarRefExpr(const ObjCIvarRefExpr *Node);
295  void VisitObjCBoolLiteralExpr(const ObjCBoolLiteralExpr *Node);
296  void VisitOMPIteratorExpr(const OMPIteratorExpr *Node);
297 
298  void VisitRValueReferenceType(const ReferenceType *T);
299  void VisitArrayType(const ArrayType *T);
300  void VisitConstantArrayType(const ConstantArrayType *T);
301  void VisitVariableArrayType(const VariableArrayType *T);
302  void VisitDependentSizedArrayType(const DependentSizedArrayType *T);
303  void VisitDependentSizedExtVectorType(const DependentSizedExtVectorType *T);
304  void VisitVectorType(const VectorType *T);
305  void VisitFunctionType(const FunctionType *T);
306  void VisitFunctionProtoType(const FunctionProtoType *T);
307  void VisitUnresolvedUsingType(const UnresolvedUsingType *T);
308  void VisitTypedefType(const TypedefType *T);
309  void VisitUnaryTransformType(const UnaryTransformType *T);
310  void VisitTagType(const TagType *T);
311  void VisitTemplateTypeParmType(const TemplateTypeParmType *T);
312  void VisitAutoType(const AutoType *T);
313  void VisitTemplateSpecializationType(const TemplateSpecializationType *T);
314  void VisitInjectedClassNameType(const InjectedClassNameType *T);
315  void VisitObjCInterfaceType(const ObjCInterfaceType *T);
316  void VisitPackExpansionType(const PackExpansionType *T);
317 
318  void VisitLabelDecl(const LabelDecl *D);
319  void VisitTypedefDecl(const TypedefDecl *D);
320  void VisitEnumDecl(const EnumDecl *D);
321  void VisitRecordDecl(const RecordDecl *D);
322  void VisitEnumConstantDecl(const EnumConstantDecl *D);
323  void VisitIndirectFieldDecl(const IndirectFieldDecl *D);
324  void VisitFunctionDecl(const FunctionDecl *D);
325  void VisitFieldDecl(const FieldDecl *D);
326  void VisitVarDecl(const VarDecl *D);
327  void VisitBindingDecl(const BindingDecl *D);
328  void VisitCapturedDecl(const CapturedDecl *D);
329  void VisitImportDecl(const ImportDecl *D);
330  void VisitPragmaCommentDecl(const PragmaCommentDecl *D);
331  void VisitPragmaDetectMismatchDecl(const PragmaDetectMismatchDecl *D);
332  void VisitOMPExecutableDirective(const OMPExecutableDirective *D);
333  void VisitOMPDeclareReductionDecl(const OMPDeclareReductionDecl *D);
334  void VisitOMPRequiresDecl(const OMPRequiresDecl *D);
335  void VisitOMPCapturedExprDecl(const OMPCapturedExprDecl *D);
336  void VisitNamespaceDecl(const NamespaceDecl *D);
337  void VisitUsingDirectiveDecl(const UsingDirectiveDecl *D);
338  void VisitNamespaceAliasDecl(const NamespaceAliasDecl *D);
339  void VisitTypeAliasDecl(const TypeAliasDecl *D);
340  void VisitTypeAliasTemplateDecl(const TypeAliasTemplateDecl *D);
341  void VisitCXXRecordDecl(const CXXRecordDecl *D);
342  void VisitFunctionTemplateDecl(const FunctionTemplateDecl *D);
343  void VisitClassTemplateDecl(const ClassTemplateDecl *D);
344  void VisitBuiltinTemplateDecl(const BuiltinTemplateDecl *D);
345  void VisitVarTemplateDecl(const VarTemplateDecl *D);
346  void VisitTemplateTypeParmDecl(const TemplateTypeParmDecl *D);
347  void VisitNonTypeTemplateParmDecl(const NonTypeTemplateParmDecl *D);
348  void VisitTemplateTemplateParmDecl(const TemplateTemplateParmDecl *D);
349  void VisitUsingDecl(const UsingDecl *D);
350  void VisitUnresolvedUsingTypenameDecl(const UnresolvedUsingTypenameDecl *D);
351  void VisitUnresolvedUsingValueDecl(const UnresolvedUsingValueDecl *D);
352  void VisitUsingShadowDecl(const UsingShadowDecl *D);
353  void VisitConstructorUsingShadowDecl(const ConstructorUsingShadowDecl *D);
354  void VisitLinkageSpecDecl(const LinkageSpecDecl *D);
355  void VisitAccessSpecDecl(const AccessSpecDecl *D);
356  void VisitFriendDecl(const FriendDecl *D);
357  void VisitObjCIvarDecl(const ObjCIvarDecl *D);
358  void VisitObjCMethodDecl(const ObjCMethodDecl *D);
359  void VisitObjCTypeParamDecl(const ObjCTypeParamDecl *D);
360  void VisitObjCCategoryDecl(const ObjCCategoryDecl *D);
361  void VisitObjCCategoryImplDecl(const ObjCCategoryImplDecl *D);
362  void VisitObjCProtocolDecl(const ObjCProtocolDecl *D);
363  void VisitObjCInterfaceDecl(const ObjCInterfaceDecl *D);
364  void VisitObjCImplementationDecl(const ObjCImplementationDecl *D);
365  void VisitObjCCompatibleAliasDecl(const ObjCCompatibleAliasDecl *D);
366  void VisitObjCPropertyDecl(const ObjCPropertyDecl *D);
367  void VisitObjCPropertyImplDecl(const ObjCPropertyImplDecl *D);
368  void VisitBlockDecl(const BlockDecl *D);
369  void VisitConceptDecl(const ConceptDecl *D);
370  void
371  VisitLifetimeExtendedTemporaryDecl(const LifetimeExtendedTemporaryDecl *D);
372 };
373 
374 } // namespace clang
375 
376 #endif // LLVM_CLANG_AST_TEXTNODEDUMPER_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:82
Defines the clang::ASTContext interface.
Represents a function declaration or definition.
Definition: Decl.h:1783
A class which contains all the information about a particular captured value.
Definition: Decl.h:4070
Represents the dependent type named by a dependently-scoped typename using declaration, e.g.
Definition: Type.h:4342
A (possibly-)qualified type.
Definition: Type.h:655
ConstStmtVisitor - This class implements a simple visitor for Stmt subclasses.
Definition: StmtVisitor.h:193
A type trait used in the implementation of various C++11 and Library TR1 trait templates.
Definition: ExprCXX.h:2619
Stmt - This represents one statement.
Definition: Stmt.h:68
FunctionType - C99 6.7.5.3 - Function Declarators.
Definition: Type.h:3547
IfStmt - This represents an if/then/else.
Definition: Stmt.h:1866
An instance of this object exists for each enum constant that is defined.
Definition: Decl.h:2961
Represents the declaration of a typedef-name via the &#39;typedef&#39; type specifier.
Definition: Decl.h:3193
C Language Family Type Representation.
Decl - This represents one declaration (or definition), e.g.
Definition: DeclBase.h:89
A reference to a name which we were able to look up during parsing but could not resolve to a specifi...
Definition: ExprCXX.h:3027
Represents a C++11 auto or C++14 decltype(auto) type, possibly constrained by a type-constraint.
Definition: Type.h:4981
The base class of the type hierarchy.
Definition: Type.h:1472
Declaration of a variable template.
Represents an array type, per C99 6.7.5.2 - Array Declarators.
Definition: Type.h:2888
Represent a C++ namespace.
Definition: Decl.h:497
Represents a call to a C++ constructor.
Definition: ExprCXX.h:1426
ObjCSubscriptRefExpr - used for array and dictionary subscripting.
Definition: ExprObjC.h:841
An Embarcadero array type trait, as used in the implementation of __array_rank and __array_extent...
Definition: ExprCXX.h:2707
AccessSpecifier
A C++ access specifier (public, private, protected), plus the special value "none" which means differ...
Definition: Specifiers.h:115
Represents a prvalue temporary that is written into memory so that a reference can bind to it...
Definition: ExprCXX.h:4406
Represents a #pragma comment line.
Definition: Decl.h:114
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
Represents a variable declaration or definition.
Definition: Decl.h:820
ObjCMethodDecl - Represents an instance or class method declaration.
Definition: DeclObjC.h:139
Describes how types, statements, expressions, and declarations should be printed. ...
Definition: PrettyPrinter.h:49
Represents an expression – generally a full-expression – that introduces cleanups to be run at the ...
Definition: ExprCXX.h:3296
Defines the clang::Expr interface and subclasses for C++ expressions.
Represents the builtin template declaration which is used to implement __make_integer_seq and other b...
LabelStmt - Represents a label, which has a substatement.
Definition: Stmt.h:1764
Represents a struct/union/class.
Definition: Decl.h:3770
Holds long-lived AST nodes (such as types and decls) that can be referred to throughout the semantic ...
Definition: ASTContext.h:174
Represents a member of a struct/union/class.
Definition: Decl.h:2746
A simple visitor class that helps create attribute visitors.
Definition: AttrVisitor.h:69
An operation on a type.
Definition: TypeVisitor.h:64
ExtVectorElementExpr - This represents access to specific elements of a vector, and may occur on the ...
Definition: Expr.h:5736
Represents an access specifier followed by colon &#39;:&#39;.
Definition: DeclCXX.h:86
Keeps track of the various options that can be enabled, which controls the dialect of C or C++ that i...
Definition: LangOptions.h:54
Represents Objective-C&#39;s @catch statement.
Definition: StmtObjC.h:77
A command with word-like arguments that is considered inline content.
Definition: Comment.h:297
Describes an C or C++ initializer list.
Definition: Expr.h:4627
Represents a C++ using-declaration.
Definition: DeclCXX.h:3398
AssociationTy< true > ConstAssociation
Definition: Expr.h:5612
A line of text contained in a verbatim block.
Definition: Comment.h:863
A verbatim line command.
Definition: Comment.h:943
A simple visitor class that helps create template argument visitors.
OpenMP 5.0 [2.1.6 Iterators] Iterators are identifiers that expand to multiple values in the clause o...
Definition: ExprOpenMP.h:272
A builtin binary operation expression such as "x + y" or "x <= y".
Definition: Expr.h:3644
Any part of the comment.
Definition: Comment.h:52
CaseStmt - Represent a case statement.
Definition: Stmt.h:1532
CastExpr - Base class for type casts, including both implicit casts (ImplicitCastExpr) and explicit c...
Definition: Expr.h:3373
Represents an Objective-C protocol declaration.
Definition: DeclObjC.h:2055
Represents binding an expression to a temporary.
Definition: ExprCXX.h:1378
Represents a C++ member access expression where the actual member referenced could not be resolved be...
Definition: ExprCXX.h:3503
Represents the body of a CapturedStmt, and serves as its DeclContext.
Definition: Decl.h:4253
Represents an ObjC class declaration.
Definition: DeclObjC.h:1163
Represents a linkage specification.
Definition: DeclCXX.h:2807
A binding in a decomposition declaration.
Definition: DeclCXX.h:3841
Represents an extended vector type where either the type or size is dependent.
Definition: Type.h:3194
Represents the this expression in C++.
Definition: ExprCXX.h:1108
ObjCPropertyImplDecl - Represents implementation declaration of a property in a class or category imp...
Definition: DeclObjC.h:2748
A verbatim block command (e.
Definition: Comment.h:891
Represents the declaration of a typedef-name via a C++11 alias-declaration.
Definition: Decl.h:3213
Represents a prototype with parameter type info, e.g.
Definition: Type.h:3886
UnaryExprOrTypeTraitExpr - expression with either a type or (unevaluated) expression operand...
Definition: Expr.h:2517
ConstantExpr - An expression that occurs in a constant context and optionally the result of evaluatin...
Definition: Expr.h:999
This represents &#39;#pragma omp requires...&#39; directive.
Definition: DeclOpenMP.h:345
Represents an array type in C++ whose size is a value-dependent expression.
Definition: Type.h:3092
Represents a shadow constructor declaration introduced into a class by a C++11 using-declaration that...
Definition: DeclCXX.h:3292
Represents a block literal declaration, which is like an unnamed FunctionDecl.
Definition: Decl.h:4064
llvm::PointerUnion< BlockDecl *, CompoundLiteralExpr * > CleanupObject
The type of objects that are kept in the cleanup.
Definition: ExprCXX.h:3306
std::string Label
Declaration of a template type parameter.
DynTypedNode Node
TextTreeStructure(raw_ostream &OS, bool ShowColors)
A command that has zero or more word-like arguments (number of word-like arguments depends on command...
Definition: Comment.h:596
ObjCSelectorExpr used for @selector in Objective-C.
Definition: ExprObjC.h:454
Represents an expression that computes the length of a parameter pack.
Definition: ExprCXX.h:4080
NonTypeTemplateParmDecl - Declares a non-type template parameter, e.g., "Size" in.
int Depth
Definition: ASTDiff.cpp:191
A unary type transform, which is a type constructed from another.
Definition: Type.h:4535
Declaration of an alias template.
An expression that sends a message to the given Objective-C object or class.
Definition: ExprObjC.h:940
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:2131
#define SM(sm)
Definition: Cuda.cpp:62
Represents a GCC generic vector type.
Definition: Type.h:3234
An opening HTML tag with attributes.
Definition: Comment.h:413
TemplateTemplateParmDecl - Declares a template template parameter, e.g., "T" in.
static QualType Desugar(ASTContext &Context, QualType QT, bool &ShouldAKA)
This class provides information about commands that can be used in comments.
Encodes a location in the source.
This represents &#39;#pragma omp declare reduction ...&#39; directive.
Definition: DeclOpenMP.h:102
Pseudo declaration for capturing expressions.
Definition: DeclOpenMP.h:312
Interfaces are the core concept in Objective-C for object oriented design.
Definition: Type.h:5993
This is a basic class for representing single OpenMP executable directive.
Definition: StmtOpenMP.h:33
Represents a new-expression for memory allocation and constructor calls, e.g: "new CXXNewExpr(foo)"...
Definition: ExprCXX.h:2093
Represents the declaration of a label.
Definition: Decl.h:451
Represents a dependent using declaration which was not marked with typename.
Definition: DeclCXX.h:3617
void AddChild(StringRef Label, Fn DoAddChild)
Add a child of the current node with an optional label.
ObjCCategoryDecl - Represents a category declaration.
Definition: DeclObjC.h:2271
This is a basic class for representing single OpenMP clause.
Definition: OpenMPClause.h:52
ObjCProtocolExpr used for protocol expression in Objective-C.
Definition: ExprObjC.h:504
Represents one property declaration in an Objective-C interface.
Definition: DeclObjC.h:742
ImplicitCastExpr - Allows us to explicitly represent implicit type conversions, which have no direct ...
Definition: Expr.h:3484
An expression trait intrinsic.
Definition: ExprCXX.h:2777
A closing HTML tag.
Definition: Comment.h:507
ObjCBoxedExpr - used for generalized expression boxing.
Definition: ExprObjC.h:128
Describes a module import declaration, which makes the contents of the named module visible in the cu...
Definition: Decl.h:4358
Doxygen \tparam command, describes a template parameter.
Definition: Comment.h:799
The injected class name of a C++ class template or class template partial specialization.
Definition: Type.h:5241
Represents a pack expansion of types.
Definition: Type.h:5610
CompoundAssignOperator - For compound assignments (e.g.
Definition: Expr.h:3891
Represents a C11 generic selection.
Definition: Expr.h:5454
AddrLabelExpr - The GNU address of label extension, representing &&label.
Definition: Expr.h:4141
Represents a template argument.
Definition: TemplateBase.h:51
Dataflow Directional Tag Classes.
[C99 6.4.2.2] - A predefined identifier such as func.
Definition: Expr.h:1924
Represents a delete expression for memory deallocation and destructor calls, e.g. ...
Definition: ExprCXX.h:2352
static const TerminalColor IndentColor
Represents a field injected from an anonymous union/struct into the parent scope. ...
Definition: Decl.h:3000
Represents a dependent using declaration which was marked with typename.
Definition: DeclCXX.h:3713
Represents the declaration of an Objective-C type parameter.
Definition: DeclObjC.h:572
Represents an enum.
Definition: Decl.h:3501
SwitchStmt - This represents a &#39;switch&#39; stmt.
Definition: Stmt.h:2075
ObjCImplementationDecl - Represents a class definition - this is where method definitions are specifi...
Definition: DeclObjC.h:2543
Represents a C++ base or member initializer.
Definition: DeclCXX.h:2185
ObjCEncodeExpr, used for @encode in Objective-C.
Definition: ExprObjC.h:409
Base for LValueReferenceType and RValueReferenceType.
Definition: Type.h:2756
APValue - This class implements a discriminated union of [uninitialized] [APSInt] [APFloat]...
Definition: APValue.h:115
ObjCIvarRefExpr - A reference to an ObjC instance variable.
Definition: ExprObjC.h:548
Describes an explicit type conversion that uses functional notion but could not be resolved because o...
Definition: ExprCXX.h:3382
GotoStmt - This represents a direct goto.
Definition: Stmt.h:2522
MemberExpr - [C99 6.5.2.3] Structure and Union Members.
Definition: Expr.h:3062
Represents a C++ struct/union/class.
Definition: DeclCXX.h:254
Represents an explicit C++ type conversion that uses "functional" notation (C++ [expr.type.conv]).
Definition: ExprCXX.h:1692
ObjCIvarDecl - Represents an ObjC instance variable.
Definition: DeclObjC.h:1936
WhileStmt - This represents a &#39;while&#39; stmt.
Definition: Stmt.h:2258
Declaration of a class template.
StringLiteral - This represents a string literal expression, e.g.
Definition: Expr.h:1732
Implicit declaration of a temporary that was materialized by a MaterializeTemporaryExpr and lifetime-...
Definition: DeclCXX.h:3104
CallExpr - Represents a function call (C99 6.5.2.2, C++ [expr.call]).
Definition: Expr.h:2768
Abstract class common to all of the C++ "named"/"keyword" casts.
Definition: ExprCXX.h:363
ObjCBoolLiteralExpr - Objective-C Boolean Literal.
Definition: ExprObjC.h:88
A reference to a declared variable, function, enum, etc.
Definition: Expr.h:1190
Represents a type template specialization; the template must be a class template, a type alias templa...
Definition: Type.h:5104
Doxygen \param command.
Definition: Comment.h:711
A trivial tuple used to represent a source range.
This represents a decl that may have a name.
Definition: Decl.h:223
A boolean literal, per ([C++ lex.bool] Boolean literals).
Definition: ExprCXX.h:691
Represents a C array with a specified size that is not an integer-constant-expression.
Definition: Type.h:3038
Represents a C++ namespace alias.
Definition: DeclCXX.h:2996
Represents C++ using-directive.
Definition: DeclCXX.h:2892
Represents a #pragma detect_mismatch line.
Definition: Decl.h:148
A simple visitor class that helps create declaration visitors.
Definition: DeclVisitor.h:73
ObjCCategoryImplDecl - An object of this class encapsulates a category @implementation declaration...
Definition: DeclObjC.h:2490
Represents the canonical version of C arrays with a specified constant size.
Definition: Type.h:2934
This class handles loading and caching of source files into memory.
Declaration of a template function.
Definition: DeclTemplate.h:977
void AddChild(Fn DoAddChild)
Add a child of the current node. Calls DoAddChild without arguments.
Attr - This represents one attribute.
Definition: Attr.h:46
Represents a shadow declaration introduced into a scope by a (resolved) using declaration.
Definition: DeclCXX.h:3191
A full comment attached to a declaration, contains block content.
Definition: Comment.h:1091
ObjCCompatibleAliasDecl - Represents alias of a class.
Definition: DeclObjC.h:2718