StmtPrinter: factor out arg printing code to PrintCallArgs

llvm-svn: 125114
This commit is contained in:
Peter Collingbourne 2011-02-08 21:17:54 +00:00
parent f2b16dc847
commit 4b279a033b
1 changed files with 8 additions and 3 deletions

View File

@ -65,6 +65,7 @@ namespace {
void PrintRawDeclStmt(DeclStmt *S);
void PrintRawIfStmt(IfStmt *If);
void PrintRawCXXCatchStmt(CXXCatchStmt *Catch);
void PrintCallArgs(CallExpr *E);
void PrintExpr(Expr *E) {
if (E)
@ -725,9 +726,7 @@ void StmtPrinter::VisitArraySubscriptExpr(ArraySubscriptExpr *Node) {
OS << "]";
}
void StmtPrinter::VisitCallExpr(CallExpr *Call) {
PrintExpr(Call->getCallee());
OS << "(";
void StmtPrinter::PrintCallArgs(CallExpr *Call) {
for (unsigned i = 0, e = Call->getNumArgs(); i != e; ++i) {
if (isa<CXXDefaultArgExpr>(Call->getArg(i))) {
// Don't print any defaulted arguments
@ -737,6 +736,12 @@ void StmtPrinter::VisitCallExpr(CallExpr *Call) {
if (i) OS << ", ";
PrintExpr(Call->getArg(i));
}
}
void StmtPrinter::VisitCallExpr(CallExpr *Call) {
PrintExpr(Call->getCallee());
OS << "(";
PrintCallArgs(Call);
OS << ")";
}
void StmtPrinter::VisitMemberExpr(MemberExpr *Node) {