From: Sebastian Redl Date: Sat, 7 Feb 2009 20:05:48 +0000 (+0000) Subject: Fix pretty-printing of if conditions. Patch by Ben Lickly. X-Git-Url: https://granicus.if.org/sourcecode?a=commitdiff_plain;h=bfee9b2d909b80ef56b49980665016b9eecacf12;p=clang Fix pretty-printing of if conditions. Patch by Ben Lickly. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@64027 91177308-0d34-0410-b5e6-96231b3b80d8 --- diff --git a/lib/AST/StmtPrinter.cpp b/lib/AST/StmtPrinter.cpp index 1f07db7692..49292afe67 100644 --- a/lib/AST/StmtPrinter.cpp +++ b/lib/AST/StmtPrinter.cpp @@ -202,8 +202,9 @@ void StmtPrinter::VisitLabelStmt(LabelStmt *Node) { } void StmtPrinter::PrintRawIfStmt(IfStmt *If) { - OS << "if "; + OS << "if ("; PrintExpr(If->getCond()); + OS << ')'; if (CompoundStmt *CS = dyn_cast(If->getThen())) { OS << ' ';