diff options
author | Argyrios Kyrtzidis <akyrtzi@gmail.com> | 2010-08-15 01:15:33 +0000 |
---|---|---|
committer | Argyrios Kyrtzidis <akyrtzi@gmail.com> | 2010-08-15 01:15:33 +0000 |
commit | 3080553b108bd8fae165dd62ce3c1b70ac440fdb (patch) | |
tree | 6086e929bcf22d9e78b7978d9f5e34a68d2ac711 /clang/lib/AST/StmtPrinter.cpp | |
parent | 0a33cb62a6474fe0713be93afbe380989ca65a68 (diff) | |
download | bcm5719-llvm-3080553b108bd8fae165dd62ce3c1b70ac440fdb.tar.gz bcm5719-llvm-3080553b108bd8fae165dd62ce3c1b70ac440fdb.zip |
Some refactoring on StmtPrinter to avoid unused function warnings.
llvm-svn: 111088
Diffstat (limited to 'clang/lib/AST/StmtPrinter.cpp')
-rw-r--r-- | clang/lib/AST/StmtPrinter.cpp | 24 |
1 files changed, 9 insertions, 15 deletions
diff --git a/clang/lib/AST/StmtPrinter.cpp b/clang/lib/AST/StmtPrinter.cpp index be7fdb56567..7f497a3d60f 100644 --- a/clang/lib/AST/StmtPrinter.cpp +++ b/clang/lib/AST/StmtPrinter.cpp @@ -82,8 +82,16 @@ namespace { return; else StmtVisitor<StmtPrinter>::Visit(S); } + + void VisitStmt(Stmt *Node) ATTRIBUTE_UNUSED { + Indent() << "<<unknown stmt type>>\n"; + } + void VisitExpr(Expr *Node) ATTRIBUTE_UNUSED { + OS << "<<unknown expr type>>"; + } + void VisitCXXNamedCastExpr(CXXNamedCastExpr *Node); - void VisitStmt(Stmt *Node); +#define ABSTRACT_STMT(CLASS) #define STMT(CLASS, PARENT) \ void Visit##CLASS(CLASS *Node); #include "clang/AST/StmtNodes.inc" @@ -94,10 +102,6 @@ namespace { // Stmt printing methods. //===----------------------------------------------------------------------===// -void StmtPrinter::VisitStmt(Stmt *Node) { - Indent() << "<<unknown stmt type>>\n"; -} - /// PrintRawCompoundStmt - Print a compound stmt without indenting the {, and /// with no newline after the }. void StmtPrinter::PrintRawCompoundStmt(CompoundStmt *Node) { @@ -462,10 +466,6 @@ void StmtPrinter::VisitCXXTryStmt(CXXTryStmt *Node) { // Expr printing methods. //===----------------------------------------------------------------------===// -void StmtPrinter::VisitExpr(Expr *Node) { - OS << "<<unknown expr type>>"; -} - void StmtPrinter::VisitDeclRefExpr(DeclRefExpr *Node) { if (NestedNameSpecifier *Qualifier = Node->getQualifier()) Qualifier->print(OS, Policy); @@ -767,12 +767,6 @@ void StmtPrinter::VisitExtVectorElementExpr(ExtVectorElementExpr *Node) { OS << "."; OS << Node->getAccessor().getName(); } -void StmtPrinter::VisitCastExpr(CastExpr *) { - assert(0 && "CastExpr is an abstract class"); -} -void StmtPrinter::VisitExplicitCastExpr(ExplicitCastExpr *) { - assert(0 && "ExplicitCastExpr is an abstract class"); -} void StmtPrinter::VisitCStyleCastExpr(CStyleCastExpr *Node) { OS << "(" << Node->getType().getAsString(Policy) << ")"; PrintExpr(Node->getSubExpr()); |