const bool ShowColors;
- /// Dump a child of the current node.
- template<typename Fn> void dumpChild(Fn DoDumpChild) {
- NodeDumper.AddChild(DoDumpChild);
- }
- template <typename Fn> void dumpChild(StringRef Label, Fn DoDumpChild) {
- NodeDumper.AddChild(Label, DoDumpChild);
- }
-
public:
ASTDumper(raw_ostream &OS, const CommandTraits *Traits,
const SourceManager *SM)
if (!SQT.Quals.hasQualifiers())
return dumpTypeAsChild(SQT.Ty);
- dumpChild([=] {
+ NodeDumper.AddChild([=] {
NodeDumper.Visit(T);
dumpTypeAsChild(T.split().Ty);
});
}
void ASTDumper::dumpTypeAsChild(const Type *T) {
- dumpChild([=] {
+ NodeDumper.AddChild([=] {
NodeDumper.Visit(T);
if (!T)
return;
}
void ASTDumper::dumpLookups(const DeclContext *DC, bool DumpDecls) {
- dumpChild([=] {
+ NodeDumper.AddChild([=] {
OS << "StoredDeclsMap ";
NodeDumper.dumpBareDeclRef(cast<Decl>(DC));
DeclarationName Name = I.getLookupName();
DeclContextLookupResult R = *I;
- dumpChild([=] {
+ NodeDumper.AddChild([=] {
OS << "DeclarationName ";
{
ColorScope Color(OS, ShowColors, DeclNameColor);
for (DeclContextLookupResult::iterator RI = R.begin(), RE = R.end();
RI != RE; ++RI) {
- dumpChild([=] {
+ NodeDumper.AddChild([=] {
NodeDumper.dumpBareDeclRef(*RI);
if ((*RI)->isHidden())
}
if (HasUndeserializedLookups) {
- dumpChild([=] {
+ NodeDumper.AddChild([=] {
ColorScope Color(OS, ShowColors, UndeserializedColor);
OS << "<undeserialized lookups>";
});
}
void ASTDumper::dumpAttr(const Attr *A) {
- dumpChild([=] {
+ NodeDumper.AddChild([=] {
NodeDumper.Visit(A);
ConstAttrVisitor<ASTDumper>::Visit(A);
});
//===----------------------------------------------------------------------===//
void ASTDumper::dumpCXXCtorInitializer(const CXXCtorInitializer *Init) {
- dumpChild([=] {
+ NodeDumper.AddChild([=] {
NodeDumper.Visit(Init);
dumpStmt(Init->getInit());
});
void ASTDumper::dumpTemplateArgument(const TemplateArgument &A, SourceRange R,
const Decl *From, const char *Label) {
- dumpChild([=] {
+ NodeDumper.AddChild([=] {
NodeDumper.Visit(A, R, From, Label);
ConstTemplateArgumentVisitor<ASTDumper>::Visit(A);
});
//===----------------------------------------------------------------------===//
void ASTDumper::dumpDecl(const Decl *D) {
- dumpChild([=] {
+ NodeDumper.AddChild([=] {
NodeDumper.Visit(D);
if (!D)
return;
}
void ASTDumper::Visit(const BlockDecl::Capture &C) {
- dumpChild([=] {
+ NodeDumper.AddChild([=] {
NodeDumper.Visit(C);
if (C.hasCopyExpr())
dumpStmt(C.getCopyExpr());
//===----------------------------------------------------------------------===//
void ASTDumper::dumpStmt(const Stmt *S, StringRef Label) {
- dumpChild(Label, [=] {
+ NodeDumper.AddChild(Label, [=] {
NodeDumper.Visit(S);
if (!S) {
//===----------------------------------------------------------------------===//
void ASTDumper::Visit(const OMPClause *C) {
- dumpChild([=] {
+ NodeDumper.AddChild([=] {
NodeDumper.Visit(C);
for (const auto *S : C->children())
dumpStmt(S);
}
void ASTDumper::Visit(const GenericSelectionExpr::ConstAssociation &A) {
- dumpChild([=] {
+ NodeDumper.AddChild([=] {
NodeDumper.Visit(A);
if (const TypeSourceInfo *TSI = A.getTypeSourceInfo())
dumpTypeAsChild(TSI->getType());
//===----------------------------------------------------------------------===//
void ASTDumper::dumpComment(const Comment *C, const FullComment *FC) {
- dumpChild([=] {
+ NodeDumper.AddChild([=] {
NodeDumper.Visit(C, FC);
if (!C) {
return;