summaryrefslogtreecommitdiffstats
path: root/clang/lib/AST/StmtPrinter.cpp
diff options
context:
space:
mode:
authorAaron Ballman <aaron@aaronballman.com>2014-05-13 16:12:14 +0000
committerAaron Ballman <aaron@aaronballman.com>2014-05-13 16:12:14 +0000
commit8063c3b80c710a42ff9f32546ebefa89b10e55b4 (patch)
tree34d57e7841baeb6339cb03f21f8e6f7ba8173f80 /clang/lib/AST/StmtPrinter.cpp
parent12a8bf09d0751b9ed05595809879de783ceba58d (diff)
downloadbcm5719-llvm-8063c3b80c710a42ff9f32546ebefa89b10e55b4.tar.gz
bcm5719-llvm-8063c3b80c710a42ff9f32546ebefa89b10e55b4.zip
Fix the AST printer for attributed statements so that it does not print duplicate attribute introducers. Eg) [[clang::fallthrough]] instead of [[[[clang::fallthrough]]]]
llvm-svn: 208706
Diffstat (limited to 'clang/lib/AST/StmtPrinter.cpp')
-rw-r--r--clang/lib/AST/StmtPrinter.cpp15
1 files changed, 2 insertions, 13 deletions
diff --git a/clang/lib/AST/StmtPrinter.cpp b/clang/lib/AST/StmtPrinter.cpp
index f3ecff9ad3c..e5f24dc5d5e 100644
--- a/clang/lib/AST/StmtPrinter.cpp
+++ b/clang/lib/AST/StmtPrinter.cpp
@@ -168,19 +168,8 @@ void StmtPrinter::VisitLabelStmt(LabelStmt *Node) {
}
void StmtPrinter::VisitAttributedStmt(AttributedStmt *Node) {
- OS << "[[";
- bool first = true;
- for (ArrayRef<const Attr*>::iterator it = Node->getAttrs().begin(),
- end = Node->getAttrs().end();
- it != end; ++it) {
- if (!first) {
- OS << ", ";
- first = false;
- }
- // TODO: check this
- (*it)->printPretty(OS, Policy);
- }
- OS << "]] ";
+ for (const auto *Attr : Node->getAttrs())
+ Attr->printPretty(OS, Policy);
PrintStmt(Node->getSubStmt(), 0);
}
OpenPOWER on IntegriCloud