21#include "llvm/Support/raw_ostream.h"
55 OS <<
"StoredDeclsMap ";
69 for (
auto I = Range.begin(), E = Range.end(); I != E; ++I) {
74 OS <<
"DeclarationName ";
77 OS <<
'\'' << Name <<
'\'';
85 if (!(*RI)->isUnconditionallyVisible())
91 std::function<void(
Decl *)> DumpWithPrev = [&](
Decl *D) {
103 if (HasUndeserializedLookups) {
106 OS <<
"<undeserialized lookups>";
112template <
typename SpecializationDecl>
114 bool DumpExplicitInst,
116 bool DumpedAny =
false;
117 for (
const auto *RedeclWithBadType : D->redecls()) {
121 auto *Redecl = cast<SpecializationDecl>(RedeclWithBadType);
122 switch (Redecl->getTemplateSpecializationKind()) {
125 if (!DumpExplicitInst)
146template <
typename TemplateDecl>
153 for (
const auto *Child : D->specializations())
180 llvm::errs() << msg <<
": ";
199 QualType(
this, 0).dump(OS, Context);
208LLVM_DUMP_METHOD
void Decl::dump(raw_ostream &OS,
bool Deserialize,
220 P.setDeserialize(Deserialize);
244 const auto *D = cast<Decl>(
this);
252 P.dumpInvalidDeclContext(
this);
262 bool Deserialize)
const {
266 const ASTContext &Ctx = cast<TranslationUnitDecl>(DC)->getASTContext();
268 P.setDeserialize(Deserialize);
269 P.dumpLookups(
this, DumpDecls);
297 const auto *FC = dyn_cast<FullComment>(
this);
301 Dumper.
Visit(FC, FC);
306 const auto *FC = dyn_cast<FullComment>(
this);
310 Dumper.
Visit(FC, FC);
314 const auto *FC = dyn_cast<FullComment>(
this);
318 Dumper.
Visit(FC, FC);
Defines the clang::ASTContext interface.
Defines enum values for all the target-independent builtin functions.
Defines the clang::Module class, which describes a module in the source code.
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
QualType getPointerType(QualType T) const
Return the uniqued reference to the type for a pointer to the specified type.
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)
bool getDeserialize() const
void Visit(const Decl *D)
TraversalKind GetTraversalKind() const
void dumpTemplateParameters(const TemplateParameterList *TPL)
Declaration of a class template.
The results of name lookup within a DeclContext.
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.
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.
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 dumpPointer(const void *Ptr)
void dumpDeclRef(const Decl *D, StringRef Label={})
void dumpBareDeclRef(const Decl *D)
void AddChild(Fn DoAddChild)
Add a child of the current node. Calls DoAddChild without arguments.
Declaration of a variable template.
static const TerminalColor NullColor
ASTDumpOutputFormat
Used to specify the format for printing AST dump information.
static const TerminalColor DeclNameColor
static const TerminalColor UndeserializedColor
static const TerminalColor DeclKindNameColor
@ TK_AsIs
Will traverse all child nodes.
if(T->getSizeExpr()) TRY_TO(TraverseStmt(T -> getSizeExpr()))
@ 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,...