diff options
Diffstat (limited to 'lib/AST/StmtPrinter.cpp')
-rw-r--r-- | lib/AST/StmtPrinter.cpp | 17 |
1 files changed, 15 insertions, 2 deletions
diff --git a/lib/AST/StmtPrinter.cpp b/lib/AST/StmtPrinter.cpp index e6a2bad7a5..fc9fdf975d 100644 --- a/lib/AST/StmtPrinter.cpp +++ b/lib/AST/StmtPrinter.cpp @@ -816,7 +816,7 @@ void StmtPrinter::VisitConditionalOperator(ConditionalOperator *Node) { PrintExpr(Node->getLHS()); OS << " : "; } - else { // Handle GCC extention where LHS can be NULL. + else { // Handle GCC extension where LHS can be NULL. OS << " ?: "; } @@ -903,7 +903,15 @@ void StmtPrinter::VisitDesignatedInitExpr(DesignatedInitExpr *Node) { } void StmtPrinter::VisitImplicitValueInitExpr(ImplicitValueInitExpr *Node) { - OS << "/*implicit*/" << Node->getType().getAsString() << "()"; + if (Policy.CPlusPlus) + OS << "/*implicit*/" << Node->getType().getAsString(Policy) << "()"; + else { + OS << "/*implicit*/(" << Node->getType().getAsString(Policy) << ")"; + if (Node->getType()->isRecordType()) + OS << "{}"; + else + OS << 0; + } } void StmtPrinter::VisitVAArgExpr(VAArgExpr *Node) { @@ -1257,6 +1265,11 @@ void Stmt::printPretty(llvm::raw_ostream &OS, PrinterHelper* Helper, return; } + if (Policy.Dump) { + dump(); + return; + } + StmtPrinter P(OS, Helper, Policy, Indentation); P.Visit(const_cast<Stmt*>(this)); } |