void setDeserialize(bool D) { Deserialize = D; }
void dumpDecl(const Decl *D);
- void dumpStmt(const Stmt *S);
+ void dumpStmt(const Stmt *S, const char *label = nullptr);
+ void dumpStmtImpl(const Stmt *S);
// Utilities
void dumpType(QualType T) { NodeDumper.dumpType(T); }
// Stmt dumping methods.
//===----------------------------------------------------------------------===//
-void ASTDumper::dumpStmt(const Stmt *S) {
+void ASTDumper::dumpStmt(const Stmt *S, const char *label) {
+ if (label) {
+ dumpChild([=] {
+ OS << label;
+ dumpStmtImpl(S);
+ });
+ } else {
+ dumpStmtImpl(S);
+ }
+}
+
+void ASTDumper::dumpStmtImpl(const Stmt *S) {
dumpChild([=] {
if (!S) {
ColorScope Color(OS, ShowColors, NullColor);
NodeDumper.dumpBareDeclRef(Field);
}
if (auto *Filler = ILE->getArrayFiller()) {
- dumpChild([=] {
- OS << "array filler";
- dumpStmt(Filler);
- });
+ dumpStmt(Filler, "array filler");
}
}