diff options
author | Richard Smith <richard-llvm@metafoo.co.uk> | 2012-04-14 00:33:13 +0000 |
---|---|---|
committer | Richard Smith <richard-llvm@metafoo.co.uk> | 2012-04-14 00:33:13 +0000 |
commit | c202b2809ac814bcae8553cd772ec4901fdb8441 (patch) | |
tree | 62ba003fd9543a7e7e961b6b08b09ed314c5a040 /clang/lib/AST/StmtPrinter.cpp | |
parent | 0fcd749a5186b1d3b1c75cfe028df3cfaba6989f (diff) | |
download | bcm5719-llvm-c202b2809ac814bcae8553cd772ec4901fdb8441.tar.gz bcm5719-llvm-c202b2809ac814bcae8553cd772ec4901fdb8441.zip |
Add an AttributedStmt type to represent a statement with C++11 attributes
attached. Since we do not support any attributes which appertain to a statement
(yet), testing of this is necessarily quite minimal.
Patch by Alexander Kornienko!
llvm-svn: 154723
Diffstat (limited to 'clang/lib/AST/StmtPrinter.cpp')
-rw-r--r-- | clang/lib/AST/StmtPrinter.cpp | 17 |
1 files changed, 17 insertions, 0 deletions
diff --git a/clang/lib/AST/StmtPrinter.cpp b/clang/lib/AST/StmtPrinter.cpp index 3a44183e203..0d1066b7e32 100644 --- a/clang/lib/AST/StmtPrinter.cpp +++ b/clang/lib/AST/StmtPrinter.cpp @@ -169,6 +169,23 @@ void StmtPrinter::VisitLabelStmt(LabelStmt *Node) { PrintStmt(Node->getSubStmt(), 0); } +void StmtPrinter::VisitAttributedStmt(AttributedStmt *Node) { + OS << "[["; + bool first = true; + for (AttrVec::const_iterator it = Node->getAttrs().begin(), + end = Node->getAttrs().end(); + it != end; ++it) { + if (!first) { + OS << ", "; + first = false; + } + // TODO: check this + (*it)->printPretty(OS, Context); + } + OS << "]] "; + PrintStmt(Node->getSubStmt(), 0); +} + void StmtPrinter::PrintRawIfStmt(IfStmt *If) { OS << "if ("; PrintExpr(If->getCond()); |