File tree Expand file tree Collapse file tree 3 files changed +26
-15
lines changed Expand file tree Collapse file tree 3 files changed +26
-15
lines changed Original file line number Diff line number Diff line change @@ -172,6 +172,8 @@ class TextNodeDumper
172172
173173 void Visit (const BlockDecl::Capture &C);
174174
175+ void Visit (const GenericSelectionExpr::ConstAssociation &A);
176+
175177 void dumpPointer (const void *Ptr);
176178 void dumpLocation (SourceLocation Loc);
177179 void dumpSourceRange (SourceRange R);
Original file line number Diff line number Diff line change @@ -297,6 +297,7 @@ namespace {
297297 void VisitInitListExpr (const InitListExpr *ILE);
298298 void VisitBlockExpr (const BlockExpr *Node);
299299 void VisitOpaqueValueExpr (const OpaqueValueExpr *Node);
300+ void Visit (const GenericSelectionExpr::ConstAssociation &A);
300301 void VisitGenericSelectionExpr (const GenericSelectionExpr *E);
301302
302303 // C++
@@ -1456,28 +1457,23 @@ void ASTDumper::VisitOpaqueValueExpr(const OpaqueValueExpr *Node) {
14561457 dumpStmt (Source);
14571458}
14581459
1460+ void ASTDumper::Visit (const GenericSelectionExpr::ConstAssociation &A) {
1461+ dumpChild ([=] {
1462+ NodeDumper.Visit (A);
1463+ if (const TypeSourceInfo *TSI = A.getTypeSourceInfo ())
1464+ dumpTypeAsChild (TSI->getType ());
1465+ dumpStmt (A.getAssociationExpr ());
1466+ });
1467+ }
1468+
14591469void ASTDumper::VisitGenericSelectionExpr (const GenericSelectionExpr *E) {
14601470 if (E->isResultDependent ())
14611471 OS << " result_dependent" ;
14621472 dumpStmt (E->getControllingExpr ());
14631473 dumpTypeAsChild (E->getControllingExpr ()->getType ()); // FIXME: remove
14641474
14651475 for (const auto &Assoc : E->associations ()) {
1466- dumpChild ([=] {
1467- if (const TypeSourceInfo *TSI = Assoc.getTypeSourceInfo ()) {
1468- OS << " case " ;
1469- NodeDumper.dumpType (TSI->getType ());
1470- } else {
1471- OS << " default" ;
1472- }
1473-
1474- if (Assoc.isSelected ())
1475- OS << " selected" ;
1476-
1477- if (const TypeSourceInfo *TSI = Assoc.getTypeSourceInfo ())
1478- dumpTypeAsChild (TSI->getType ());
1479- dumpStmt (Assoc.getAssociationExpr ());
1480- });
1476+ Visit (Assoc);
14811477 }
14821478}
14831479
Original file line number Diff line number Diff line change @@ -312,6 +312,19 @@ void TextNodeDumper::Visit(const OMPClause *C) {
312312 OS << " <implicit>" ;
313313}
314314
315+ void TextNodeDumper::Visit (const GenericSelectionExpr::ConstAssociation &A) {
316+ const TypeSourceInfo *TSI = A.getTypeSourceInfo ();
317+ if (TSI) {
318+ OS << " case " ;
319+ dumpType (TSI->getType ());
320+ } else {
321+ OS << " default" ;
322+ }
323+
324+ if (A.isSelected ())
325+ OS << " selected" ;
326+ }
327+
315328void TextNodeDumper::dumpPointer (const void *Ptr) {
316329 ColorScope Color (OS, ShowColors, AddressColor);
317330 OS << ' ' << Ptr;
You can’t perform that action at this time.
0 commit comments