From 3e5e3967c6eafa38a79653be5a8e27dee257425c Mon Sep 17 00:00:00 2001 From: Peter Collingbourne Date: Tue, 8 Feb 2011 21:17:54 +0000 Subject: [PATCH] StmtPrinter: factor out arg printing code to PrintCallArgs git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@125114 91177308-0d34-0410-b5e6-96231b3b80d8 --- lib/AST/StmtPrinter.cpp | 11 ++++++++--- 1 file changed, 8 insertions(+), 3 deletions(-) diff --git a/lib/AST/StmtPrinter.cpp b/lib/AST/StmtPrinter.cpp index 201115c7e..2ed2c9275 100644 --- a/lib/AST/StmtPrinter.cpp +++ b/lib/AST/StmtPrinter.cpp @@ -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(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) { -- 2.11.4.GIT