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
172
172
173
173
void Visit (const BlockDecl::Capture &C);
174
174
175
+ void Visit (const GenericSelectionExpr::ConstAssociation &A);
176
+
175
177
void dumpPointer (const void *Ptr );
176
178
void dumpLocation (SourceLocation Loc);
177
179
void dumpSourceRange (SourceRange R);
Original file line number Diff line number Diff line change @@ -297,6 +297,7 @@ namespace {
297
297
void VisitInitListExpr (const InitListExpr *ILE);
298
298
void VisitBlockExpr (const BlockExpr *Node);
299
299
void VisitOpaqueValueExpr (const OpaqueValueExpr *Node);
300
+ void Visit (const GenericSelectionExpr::ConstAssociation &A);
300
301
void VisitGenericSelectionExpr (const GenericSelectionExpr *E);
301
302
302
303
// C++
@@ -1456,28 +1457,23 @@ void ASTDumper::VisitOpaqueValueExpr(const OpaqueValueExpr *Node) {
1456
1457
dumpStmt (Source);
1457
1458
}
1458
1459
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
+
1459
1469
void ASTDumper::VisitGenericSelectionExpr (const GenericSelectionExpr *E) {
1460
1470
if (E->isResultDependent ())
1461
1471
OS << " result_dependent" ;
1462
1472
dumpStmt (E->getControllingExpr ());
1463
1473
dumpTypeAsChild (E->getControllingExpr ()->getType ()); // FIXME: remove
1464
1474
1465
1475
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);
1481
1477
}
1482
1478
}
1483
1479
Original file line number Diff line number Diff line change @@ -312,6 +312,19 @@ void TextNodeDumper::Visit(const OMPClause *C) {
312
312
OS << " <implicit>" ;
313
313
}
314
314
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
+
315
328
void TextNodeDumper::dumpPointer (const void *Ptr ) {
316
329
ColorScope Color (OS, ShowColors, AddressColor);
317
330
OS << ' ' << Ptr ;
You can’t perform that action at this time.
0 commit comments