clang 19.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
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:182
void dumpTemplateDeclSpecialization(const SpecializationDecl *D, bool DumpExplicitInst, bool DumpRefOnly)
Definition: ASTDumper.cpp:114
void dumpLookups(const DeclContext *DC, bool DumpDecls)
Definition: ASTDumper.cpp:54
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:148
void dumpInvalidDeclContext(const DeclContext *DC)
Definition: ASTDumper.cpp:27
void VisitVarTemplateDecl(const VarTemplateDecl *D)
Definition: ASTDumper.cpp:171
void VisitClassTemplateDecl(const ClassTemplateDecl *D)
Definition: ASTDumper.cpp:167
void VisitFunctionTemplateDecl(const FunctionTemplateDecl *D)
Definition: ASTDumper.cpp:160
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:1437
Declaration of a template function.
Definition: DeclTemplate.h:958
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.