]> granicus.if.org Git - clang/commitdiff
Fix pretty-printing of if conditions. Patch by Ben Lickly.
authorSebastian Redl <sebastian.redl@getdesigned.at>
Sat, 7 Feb 2009 20:05:48 +0000 (20:05 +0000)
committerSebastian Redl <sebastian.redl@getdesigned.at>
Sat, 7 Feb 2009 20:05:48 +0000 (20:05 +0000)
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@64027 91177308-0d34-0410-b5e6-96231b3b80d8

lib/AST/StmtPrinter.cpp

index 1f07db76925d2901753de832a7a2b48999430bb0..49292afe67e3479ae1d43dd5705f5873ab3a87ad 100644 (file)
@@ -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<CompoundStmt>(If->getThen())) {
     OS << ' ';