diff options
author | Ed Schouten <ed@FreeBSD.org> | 2009-06-22 08:08:35 +0000 |
---|---|---|
committer | Ed Schouten <ed@FreeBSD.org> | 2009-06-22 08:08:35 +0000 |
commit | b897c8660c4ff7037dde81b9645737bc1c992abe (patch) | |
tree | b6403365e77095a79062d3379c9e6aea0df5f088 /lib/AST/StmtPrinter.cpp | |
parent | 7ef7bab7e3d06f660b059b903c231f100bb13cc5 (diff) |
Diffstat (limited to 'lib/AST/StmtPrinter.cpp')
-rw-r--r-- | lib/AST/StmtPrinter.cpp | 8 |
1 files changed, 7 insertions, 1 deletions
diff --git a/lib/AST/StmtPrinter.cpp b/lib/AST/StmtPrinter.cpp index 710da6386133..b300940824de 100644 --- a/lib/AST/StmtPrinter.cpp +++ b/lib/AST/StmtPrinter.cpp @@ -643,7 +643,8 @@ void StmtPrinter::VisitUnaryOperator(UnaryOperator *Node) { if (!Node->isPostfix()) { OS << UnaryOperator::getOpcodeStr(Node->getOpcode()); - // Print a space if this is an "identifier operator" like __real. + // Print a space if this is an "identifier operator" like __real, or if + // it might be concatenated incorrectly like '+'. switch (Node->getOpcode()) { default: break; case UnaryOperator::Real: @@ -651,6 +652,11 @@ void StmtPrinter::VisitUnaryOperator(UnaryOperator *Node) { case UnaryOperator::Extension: OS << ' '; break; + case UnaryOperator::Plus: + case UnaryOperator::Minus: + if (isa<UnaryOperator>(Node->getSubExpr())) + OS << ' '; + break; } } PrintExpr(Node->getSubExpr()); |