From: Chris Lattner Date: Thu, 23 Aug 2007 21:46:40 +0000 (+0000) Subject: Pretty print as: X-Git-Url: https://granicus.if.org/sourcecode?a=commitdiff_plain;h=296bf19bf8a2ddcaecd0b3a3dc234b612e6482cf;p=clang Pretty print as: "case sizeof x:" instead of: "case sizeofx:" git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@41339 91177308-0d34-0410-b5e6-96231b3b80d8 --- diff --git a/AST/StmtPrinter.cpp b/AST/StmtPrinter.cpp index 2c77f131d8..ec37f9e81c 100644 --- a/AST/StmtPrinter.cpp +++ b/AST/StmtPrinter.cpp @@ -404,8 +404,21 @@ void StmtPrinter::VisitParenExpr(ParenExpr *Node) { OS << ")"; } void StmtPrinter::VisitUnaryOperator(UnaryOperator *Node) { - if (!Node->isPostfix()) + if (!Node->isPostfix()) { OS << UnaryOperator::getOpcodeStr(Node->getOpcode()); + + // Print a space if this is an "identifier operator" like sizeof or __real. + switch (Node->getOpcode()) { + default: break; + case UnaryOperator::SizeOf: + case UnaryOperator::AlignOf: + case UnaryOperator::Real: + case UnaryOperator::Imag: + case UnaryOperator::Extension: + OS << ' '; + break; + } + } PrintExpr(Node->getSubExpr()); if (Node->isPostfix())