summaryrefslogtreecommitdiffstats
path: root/clang/lib/AST/ASTDumper.cpp
diff options
context:
space:
mode:
authorBruno Ricci <riccibrun@gmail.com>2019-01-28 14:18:11 +0000
committerBruno Ricci <riccibrun@gmail.com>2019-01-28 14:18:11 +0000
commit9feaecf22c235e5b97bd56d657a90fe1736eba56 (patch)
tree850efde25b4db59058d898c345a273d2341a4bd0 /clang/lib/AST/ASTDumper.cpp
parent7b6f874717bedf29413e9c0564433a95453fac61 (diff)
downloadbcm5719-llvm-9feaecf22c235e5b97bd56d657a90fe1736eba56.tar.gz
bcm5719-llvm-9feaecf22c235e5b97bd56d657a90fe1736eba56.zip
[AST] Introduce GenericSelectionExpr::Association
Introduce a new class GenericSelectionExpr::Association which bundle together an association expression and its TypeSourceInfo. An iterator GenericSelectionExpr::AssociationIterator is additionally added to make it possible to iterate over ranges of Associations. This iterator is a kind of proxy iterator which abstract over how exactly the expressions and the TypeSourceInfos are stored. Differential Revision: https://reviews.llvm.org/D57106 Reviewed By: aaron.ballman Reviewers: aaron.ballman, steveire, dblaikie, mclow.lists llvm-svn: 352369
Diffstat (limited to 'clang/lib/AST/ASTDumper.cpp')
-rw-r--r--clang/lib/AST/ASTDumper.cpp10
1 files changed, 5 insertions, 5 deletions
diff --git a/clang/lib/AST/ASTDumper.cpp b/clang/lib/AST/ASTDumper.cpp
index b91dab5aa38..5c99dab356f 100644
--- a/clang/lib/AST/ASTDumper.cpp
+++ b/clang/lib/AST/ASTDumper.cpp
@@ -1462,21 +1462,21 @@ void ASTDumper::VisitGenericSelectionExpr(const GenericSelectionExpr *E) {
dumpStmt(E->getControllingExpr());
dumpTypeAsChild(E->getControllingExpr()->getType()); // FIXME: remove
- for (unsigned I = 0, N = E->getNumAssocs(); I != N; ++I) {
+ for (const auto &Assoc : E->associations()) {
dumpChild([=] {
- if (const TypeSourceInfo *TSI = E->getAssocTypeSourceInfo(I)) {
+ if (const TypeSourceInfo *TSI = Assoc.getTypeSourceInfo()) {
OS << "case ";
NodeDumper.dumpType(TSI->getType());
} else {
OS << "default";
}
- if (!E->isResultDependent() && E->getResultIndex() == I)
+ if (Assoc.isSelected())
OS << " selected";
- if (const TypeSourceInfo *TSI = E->getAssocTypeSourceInfo(I))
+ if (const TypeSourceInfo *TSI = Assoc.getTypeSourceInfo())
dumpTypeAsChild(TSI->getType());
- dumpStmt(E->getAssocExpr(I));
+ dumpStmt(Assoc.getAssociationExpr());
});
}
}
OpenPOWER on IntegriCloud