clang 20.0.0git
ASTDumper.h
Go to the documentation of this file.
1//===--- ASTDumper.h - Dumping implementation for ASTs --------------------===//
2//
3// Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.
4// See https://llvm.org/LICENSE.txt for license information.
5// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception
6//
7//===----------------------------------------------------------------------===//
8
9#ifndef LLVM_CLANG_AST_ASTDUMPER_H
10#define LLVM_CLANG_AST_ASTDUMPER_H
11
15
16namespace clang {
17
18class ASTDumper : public ASTNodeTraverser<ASTDumper, TextNodeDumper> {
19
20 TextNodeDumper NodeDumper;
21
22 raw_ostream &OS;
23
24 const bool ShowColors;
25
26public:
27 ASTDumper(raw_ostream &OS, const ASTContext &Context, bool ShowColors)
28 : NodeDumper(OS, Context, ShowColors), OS(OS), ShowColors(ShowColors) {}
29
30 ASTDumper(raw_ostream &OS, bool ShowColors)
31 : NodeDumper(OS, ShowColors), OS(OS), ShowColors(ShowColors) {}
32
33 TextNodeDumper &doGetNodeDelegate() { return NodeDumper; }
34
35 void dumpInvalidDeclContext(const DeclContext *DC);
36 void dumpLookups(const DeclContext *DC, bool DumpDecls);
37
38 template <typename SpecializationDecl>
39 void dumpTemplateDeclSpecialization(const SpecializationDecl *D,
40 bool DumpExplicitInst, bool DumpRefOnly);
41 template <typename TemplateDecl>
42 void dumpTemplateDecl(const TemplateDecl *D, bool DumpExplicitInst);
43
47};
48
49} // namespace clang
50
51#endif
const Decl * D
bool ShowColors
Definition: Logger.cpp:29
Defines the SourceManager interface.
Holds long-lived AST nodes (such as types and decls) that can be referred to throughout the semantic ...
Definition: ASTContext.h:187
void dumpTemplateDeclSpecialization(const SpecializationDecl *D, bool DumpExplicitInst, bool DumpRefOnly)
Definition: ASTDumper.cpp:113
void dumpLookups(const DeclContext *DC, bool DumpDecls)
Definition: ASTDumper.cpp:53
ASTDumper(raw_ostream &OS, bool ShowColors)
Definition: ASTDumper.h:30
ASTDumper(raw_ostream &OS, const ASTContext &Context, bool ShowColors)
Definition: ASTDumper.h:27
TextNodeDumper & doGetNodeDelegate()
Definition: ASTDumper.h:33
void dumpTemplateDecl(const TemplateDecl *D, bool DumpExplicitInst)
Definition: ASTDumper.cpp:147
void dumpInvalidDeclContext(const DeclContext *DC)
Definition: ASTDumper.cpp:26
void VisitVarTemplateDecl(const VarTemplateDecl *D)
Definition: ASTDumper.cpp:170
void VisitClassTemplateDecl(const ClassTemplateDecl *D)
Definition: ASTDumper.cpp:166
void VisitFunctionTemplateDecl(const FunctionTemplateDecl *D)
Definition: ASTDumper.cpp:159
ASTNodeTraverser traverses the Clang AST for dumping purposes.
Declaration of a class template.
DeclContext - This is used only as base class of specific decl types that can act as declaration cont...
Definition: DeclBase.h:1436
Declaration of a template function.
Definition: DeclTemplate.h:957
The base class of all kinds of template declarations (e.g., class, function, etc.).
Definition: DeclTemplate.h:394
Declaration of a variable template.
The JSON file list parser is used to communicate input to InstallAPI.