clang  14.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 
16 namespace clang {
17 
18 class ASTDumper : public ASTNodeTraverser<ASTDumper, TextNodeDumper> {
19 
20  TextNodeDumper NodeDumper;
21 
22  raw_ostream &OS;
23 
24  const bool ShowColors;
25 
26 public:
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 dumpLookups(const DeclContext *DC, bool DumpDecls);
36 
37  template <typename SpecializationDecl>
38  void dumpTemplateDeclSpecialization(const SpecializationDecl *D,
39  bool DumpExplicitInst, bool DumpRefOnly);
40  template <typename TemplateDecl>
41  void dumpTemplateDecl(const TemplateDecl *D, bool DumpExplicitInst);
42 
46 };
47 
48 } // namespace clang
49 
50 #endif
clang::ASTDumper::VisitClassTemplateDecl
void VisitClassTemplateDecl(const ClassTemplateDecl *D)
Definition: ASTDumper.cpp:146
clang::DeclContext
DeclContext - This is used only as base class of specific decl types that can act as declaration cont...
Definition: DeclBase.h:1347
SourceManager.h
TextNodeDumper.h
clang::ASTDumper::doGetNodeDelegate
TextNodeDumper & doGetNodeDelegate()
Definition: ASTDumper.h:33
clang::FunctionTemplateDecl
Declaration of a template function.
Definition: DeclTemplate.h:978
ASTNodeTraverser.h
clang::ASTContext
Holds long-lived AST nodes (such as types and decls) that can be referred to throughout the semantic ...
Definition: ASTContext.h:212
clang::ASTNodeTraverser
ASTNodeTraverser traverses the Clang AST for dumping purposes.
Definition: ASTNodeTraverser.h:61
clang::ASTDumper::dumpTemplateDecl
void dumpTemplateDecl(const TemplateDecl *D, bool DumpExplicitInst)
Definition: ASTDumper.cpp:127
clang::ASTDumper::ASTDumper
ASTDumper(raw_ostream &OS, const ASTContext &Context, bool ShowColors)
Definition: ASTDumper.h:27
clang::ASTDumper::VisitVarTemplateDecl
void VisitVarTemplateDecl(const VarTemplateDecl *D)
Definition: ASTDumper.cpp:150
clang::ASTDumper::ASTDumper
ASTDumper(raw_ostream &OS, bool ShowColors)
Definition: ASTDumper.h:30
clang::ASTDumper::VisitFunctionTemplateDecl
void VisitFunctionTemplateDecl(const FunctionTemplateDecl *D)
Definition: ASTDumper.cpp:139
clang::ClassTemplateDecl
Declaration of a class template.
Definition: DeclTemplate.h:2247
clang::TemplateDecl
The base class of all kinds of template declarations (e.g., class, function, etc.).
Definition: DeclTemplate.h:399
clang::ASTDumper::dumpTemplateDeclSpecialization
void dumpTemplateDeclSpecialization(const SpecializationDecl *D, bool DumpExplicitInst, bool DumpRefOnly)
Definition: ASTDumper.cpp:85
clang::ASTDumper::dumpLookups
void dumpLookups(const DeclContext *DC, bool DumpDecls)
Definition: ASTDumper.cpp:25
clang
Definition: CalledOnceCheck.h:17
clang::TextNodeDumper
Definition: TextNodeDumper.h:127
clang::ASTDumper
Definition: ASTDumper.h:18
clang::VarTemplateDecl
Declaration of a variable template.
Definition: DeclTemplate.h:3079