Pretty print as:

"case sizeof x:"
instead of:
  "case sizeofx:"

llvm-svn: 41339
This commit is contained in:
Chris Lattner 2007-08-23 21:46:40 +00:00
parent 9568880c3e
commit e5b60445e7
1 changed files with 14 additions and 1 deletions

View File

@ -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())