[ASTPrinter] Tweak #if print

* Removed extra newlines.
* Print '/* condition */' for condition part.
This commit is contained in:
Rintaro Ishizaki
2017-05-16 12:20:28 +09:00
parent de7f2f713a
commit 2ad22a80f1
3 changed files with 25 additions and 9 deletions

View File

@@ -2365,18 +2365,15 @@ void PrintAST::visitIfConfigDecl(IfConfigDecl *ICD) {
for (auto &Clause : ICD->getClauses()) {
if (&Clause == &*ICD->getClauses().begin())
Printer << tok::pound_if << " "; // FIXME: print condition
Printer << tok::pound_if << " /* condition */"; // FIXME: print condition
else if (Clause.Cond)
Printer << tok::pound_elseif << ""; // FIXME: print condition
Printer << tok::pound_elseif << " /* condition */"; // FIXME: print condition
else
Printer << tok::pound_else;
printASTNodes(Clause.Elements);
Printer.printNewline();
if (printASTNodes(Clause.Elements)) {
Printer.printNewline();
indent();
}
indent();
}
Printer.printNewline();
Printer << tok::pound_endif;
}