const PrintingPolicy &Policy, unsigned Indentation = 0,
StringRef NewlineSymbol = "\n",
const ASTContext *Context = nullptr) const;
+ void printPrettyControlled(raw_ostream &OS, PrinterHelper *Helper,
+ const PrintingPolicy &Policy,
+ unsigned Indentation = 0,
+ StringRef NewlineSymbol = "\n",
+ const ASTContext *Context = nullptr) const;
/// Pretty-prints in JSON format.
void printJson(raw_ostream &Out, PrinterHelper *Helper,
Out << ";\n";
}
Indentation -= Policy.Indentation;
- } else
- Out << ' ';
+ }
if (D->getBody())
- D->getBody()->printPretty(Out, nullptr, SubPolicy, Indentation, "\n",
+ D->getBody()->printPrettyControlled(Out, nullptr, SubPolicy, Indentation, "\n",
&Context);
} else {
if (!Policy.TerseOutput && isa<CXXConstructorDecl>(*D))
P.Visit(const_cast<Stmt *>(this));
}
+void Stmt::printPrettyControlled(raw_ostream &Out, PrinterHelper *Helper,
+ const PrintingPolicy &Policy,
+ unsigned Indentation, StringRef NL,
+ const ASTContext *Context) const {
+ StmtPrinter P(Out, Helper, Policy, Indentation, NL, Context);
+ P.PrintControlledStmt(const_cast<Stmt *>(this));
+}
+
void Stmt::printJson(raw_ostream &Out, PrinterHelper *Helper,
const PrintingPolicy &Policy, bool AddQuotes) const {
std::string Buf;
// type/unsigned argument (see
// TemplateParameterList::shouldIncludeTypeForArgument)
// CHECK1: {{^ }}template<> struct foo<0, 0L> {
+// CHECK1: {{^ }}void test(){{ }}{
+// CHECK1: {{^ }}foo<0, 0 + 0L>::fn();
void test() {
foo<0, 0 + 0L>::fn();
}