[cfe-commits] r125114 - /cfe/trunk/lib/AST/StmtPrinter.cpp
Peter Collingbourne
peter at pcc.me.uk
Tue Feb 8 13:17:54 PST 2011
Author: pcc
Date: Tue Feb 8 15:17:54 2011
New Revision: 125114
URL: http://llvm.org/viewvc/llvm-project?rev=125114&view=rev
Log:
StmtPrinter: factor out arg printing code to PrintCallArgs
Modified:
cfe/trunk/lib/AST/StmtPrinter.cpp
Modified: cfe/trunk/lib/AST/StmtPrinter.cpp
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/lib/AST/StmtPrinter.cpp?rev=125114&r1=125113&r2=125114&view=diff
==============================================================================
--- cfe/trunk/lib/AST/StmtPrinter.cpp (original)
+++ cfe/trunk/lib/AST/StmtPrinter.cpp Tue Feb 8 15:17:54 2011
@@ -65,6 +65,7 @@
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 @@
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 @@
if (i) OS << ", ";
PrintExpr(Call->getArg(i));
}
+}
+
+void StmtPrinter::VisitCallExpr(CallExpr *Call) {
+ PrintExpr(Call->getCallee());
+ OS << "(";
+ PrintCallArgs(Call);
OS << ")";
}
void StmtPrinter::VisitMemberExpr(MemberExpr *Node) {
More information about the cfe-commits
mailing list