A couple of tweaks to make -ast-print produce code that's closer to
valid C code.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@71971 91177308-0d34-0410-b5e6-96231b3b80d8
diff --git a/lib/AST/StmtPrinter.cpp b/lib/AST/StmtPrinter.cpp
index cf1a255..380634d 100644
--- a/lib/AST/StmtPrinter.cpp
+++ b/lib/AST/StmtPrinter.cpp
@@ -289,9 +289,9 @@
Indent();
}
- OS << "while ";
+ OS << "while (";
PrintExpr(Node->getCond());
- OS << ";\n";
+ OS << ");\n";
}
void StmtPrinter::VisitForStmt(ForStmt *Node) {