forked from OSchip/llvm-project
ast-print: Avoid extra whitespace before function opening brace
This commit is contained in:
parent
604446aa6b
commit
b2589e326b
|
@ -1216,6 +1216,11 @@ public:
|
|||
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,
|
||||
|
|
|
@ -782,11 +782,10 @@ void DeclPrinter::VisitFunctionDecl(FunctionDecl *D) {
|
|||
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))
|
||||
|
|
|
@ -2595,6 +2595,14 @@ void Stmt::printPretty(raw_ostream &Out, PrinterHelper *Helper,
|
|||
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;
|
||||
|
|
|
@ -79,6 +79,8 @@ struct foo {
|
|||
// 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();
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue