21#include "llvm/Support/raw_ostream.h"
32 NodeDumper.AddChild([=] {
48 NodeDumper.dumpPointer(DC);
59 NodeDumper.AddChild([=] {
60 OS <<
"StoredDeclsMap ";
74 for (
auto I = Range.begin(), E = Range.end(); I != E; ++I) {
78 NodeDumper.AddChild([=] {
79 OS <<
"DeclarationName ";
82 OS <<
'\'' << Name <<
'\'';
87 NodeDumper.AddChild([=] {
88 NodeDumper.dumpBareDeclRef(*RI);
90 if (!(*RI)->isUnconditionallyVisible())
108 if (HasUndeserializedLookups) {
109 NodeDumper.AddChild([=] {
111 OS <<
"<undeserialized lookups>";
117template <
typename SpecializationDecl>
119 bool DumpExplicitInst,
121 bool DumpedAny =
false;
122 for (
const auto *RedeclWithBadType : D->redecls()) {
126 auto *Redecl = dyn_cast<SpecializationDecl>(RedeclWithBadType);
129 switch (Redecl->getTemplateSpecializationKind()) {
132 if (!DumpExplicitInst)
138 NodeDumper.dumpDeclRef(Redecl);
150 NodeDumper.dumpDeclRef(D);
153template <
typename TemplateDecl>
160 for (
const auto *Child : D->specializations())
187 llvm::errs() << msg <<
": ";
206 QualType(
this, 0).dump(OS, Context);
228LLVM_DUMP_METHOD
void Decl::dump(raw_ostream &OS,
bool Deserialize,
282 bool Deserialize)
const {
288 P.setDeserialize(Deserialize);
289 P.dumpLookups(
this, DumpDecls);
317 const auto *FC = dyn_cast<FullComment>(
this);
321 Dumper.
Visit(FC, FC);
326 const auto *FC = dyn_cast<FullComment>(
this);
330 Dumper.
Visit(FC, FC);
334 const auto *FC = dyn_cast<FullComment>(
this);
338 Dumper.
Visit(FC, FC);
353 Dumper.
Visit(*
this, Context.getPointerType(Context.CharTy));
This file provides AST data structures related to concepts.
Defines the clang::ASTContext interface.
static bool showColorsForStream(const ASTContext &Ctx, raw_ostream &OS)
Defines the Diagnostic-related interfaces.
Defines the SourceManager interface.
Holds long-lived AST nodes (such as types and decls) that can be referred to throughout the semantic ...
SourceManager & getSourceManager()
comments::CommandTraits & getCommentCommandTraits() const
const clang::PrintingPolicy & getPrintingPolicy() const
DiagnosticsEngine & getDiagnostics() const
void dumpTemplateDeclSpecialization(const SpecializationDecl *D, bool DumpExplicitInst, bool DumpRefOnly)
void dumpLookups(const DeclContext *DC, bool DumpDecls)
void dumpTemplateDecl(const TemplateDecl *D, bool DumpExplicitInst)
void dumpInvalidDeclContext(const DeclContext *DC)
void VisitVarTemplateDecl(const VarTemplateDecl *D)
void VisitClassTemplateDecl(const ClassTemplateDecl *D)
void VisitFunctionTemplateDecl(const FunctionTemplateDecl *D)
void Visit(const Decl *D, bool VisitLocs=false)
bool getDeserialize() const
void setDeserialize(bool D)
TraversalKind GetTraversalKind() const
void dumpTemplateParameters(const TemplateParameterList *TPL)
Declaration of a class template.
TemplateDecl * getNamedConcept() const
The results of name lookup within a DeclContext.
DeclListNode::iterator iterator
DeclContext - This is used only as base class of specific decl types that can act as declaration cont...
DeclContext * getParent()
getParent - Returns the containing DeclContext.
lookups_range noload_lookups(bool PreserveInternalState) const
bool hasExternalVisibleStorage() const
Whether this DeclContext has external storage containing additional declarations that are visible in ...
bool isTranslationUnit() const
lookups_range lookups() const
bool hasValidDeclKind() const
DeclContext * getPrimaryContext()
getPrimaryContext - There may be many different declarations of the same entity (including forward de...
Decl::Kind getDeclKind() const
Decl - This represents one declaration (or definition), e.g.
Decl * getPreviousDecl()
Retrieve the previous declaration that declares the same entity as this declaration,...
ASTContext & getASTContext() const LLVM_READONLY
bool isCanonicalDecl() const
Whether this particular Decl is a canonical one.
The name of a declaration.
bool showColors(bool StreamHasColors) const
Resolve the color mode against a stream's capability.
DiagnosticOptions & getDiagnosticOptions() const
Retrieve the diagnostic options.
Declaration of a template function.
A (possibly-)qualified type.
This class handles loading and caching of source files into memory.
void dump() const
Dumps the specified AST fragment and all subtrees to llvm::errs().
void dumpColor() const
dumpColor - same as dump(), but forces color highlighting.
void dump() const
Debugging aid that dumps the template argument to standard error.
The base class of all kinds of template declarations (e.g., class, function, etc.).
NamedDecl * getTemplatedDecl() const
Get the underlying, templated declaration.
TemplateParameterList * getTemplateParameters() const
Get the list of template parameters.
void dump() const
Debugging aid that dumps the template name to standard error.
Declaration of a variable template.
The JSON file list parser is used to communicate input to InstallAPI.
ASTDumpOutputFormat
Used to specify the format for printing AST dump information.
@ TK_AsIs
Will traverse all child nodes.
@ TSK_ExplicitInstantiationDefinition
This template specialization was instantiated from a template due to an explicit instantiation defini...
@ TSK_ExplicitInstantiationDeclaration
This template specialization was instantiated from a template due to an explicit instantiation declar...
@ TSK_ExplicitSpecialization
This template specialization was declared or defined by an explicit specialization (C++ [temp....
@ TSK_ImplicitInstantiation
This template specialization was implicitly instantiated from a template.
@ TSK_Undeclared
This template specialization was formed from a template-id but has not yet been declared,...
U cast(CodeGen::Address addr)
int const char * function
static constexpr TerminalColor DeclKindName
static constexpr TerminalColor Null
static constexpr TerminalColor DeclName
static constexpr TerminalColor Undeserialized