@@ -1662,6 +1662,7 @@ class PrintExpr : public ExprVisitor<PrintExpr> {
1662
1662
Indent += 2 ;
1663
1663
OS.indent (Indent);
1664
1664
PrintWithColorRAII (OS, ParenthesisColor) << ' (' ;
1665
+ PrintWithColorRAII (OS, ExprColor) << label;
1665
1666
OS << ' \n ' ;
1666
1667
printRec (E);
1667
1668
PrintWithColorRAII (OS, ParenthesisColor) << ' )' ;
@@ -1720,6 +1721,15 @@ class PrintExpr : public ExprVisitor<PrintExpr> {
1720
1721
1721
1722
return OS;
1722
1723
}
1724
+
1725
+ void printSemanticExpr (Expr * semanticExpr) {
1726
+ if (semanticExpr == nullptr ) {
1727
+ return ;
1728
+ }
1729
+
1730
+ OS << ' \n ' ;
1731
+ printRecLabeled (semanticExpr, " semantic_expr" );
1732
+ }
1723
1733
1724
1734
void visitErrorExpr (ErrorExpr *E) {
1725
1735
printCommon (E, " error_expr" );
@@ -1780,6 +1790,7 @@ class PrintExpr : public ExprVisitor<PrintExpr> {
1780
1790
OS << ' \n ' ;
1781
1791
printRec (Segment);
1782
1792
}
1793
+ printSemanticExpr (E->getSemanticExpr ());
1783
1794
PrintWithColorRAII (OS, ParenthesisColor) << ' )' ;
1784
1795
}
1785
1796
void visitMagicIdentifierLiteralExpr (MagicIdentifierLiteralExpr *E) {
@@ -1803,6 +1814,7 @@ class PrintExpr : public ExprVisitor<PrintExpr> {
1803
1814
printArgumentLabels (E->getArgumentLabels ());
1804
1815
OS << " \n " ;
1805
1816
printRec (E->getArg ());
1817
+ printSemanticExpr (E->getSemanticExpr ());
1806
1818
PrintWithColorRAII (OS, ParenthesisColor) << ' )' ;
1807
1819
}
1808
1820
@@ -1955,20 +1967,16 @@ class PrintExpr : public ExprVisitor<PrintExpr> {
1955
1967
OS << ' \n ' ;
1956
1968
printRec (elt);
1957
1969
}
1970
+ printSemanticExpr (E->getSemanticExpr ());
1958
1971
PrintWithColorRAII (OS, ParenthesisColor) << ' )' ;
1959
1972
}
1960
1973
void visitDictionaryExpr (DictionaryExpr *E) {
1961
1974
printCommon (E, " dictionary_expr" );
1962
- if (auto semaE = E->getSemanticExpr ()) {
1963
- OS << ' \n ' ;
1964
- printRec (semaE);
1965
- PrintWithColorRAII (OS, ParenthesisColor) << ' )' ;
1966
- return ;
1967
- }
1968
1975
for (auto elt : E->getElements ()) {
1969
1976
OS << ' \n ' ;
1970
1977
printRec (elt);
1971
1978
}
1979
+ printSemanticExpr (E->getSemanticExpr ());
1972
1980
PrintWithColorRAII (OS, ParenthesisColor) << ' )' ;
1973
1981
}
1974
1982
void visitSubscriptExpr (SubscriptExpr *E) {
@@ -2468,6 +2476,7 @@ class PrintExpr : public ExprVisitor<PrintExpr> {
2468
2476
OS << ' \n ' ;
2469
2477
printRec (ExpTyR);
2470
2478
}
2479
+ printSemanticExpr (E->getSemanticExpr ());
2471
2480
PrintWithColorRAII (OS, ParenthesisColor) << ' )' ;
2472
2481
}
2473
2482
void visitObjCSelectorExpr (ObjCSelectorExpr *E) {
0 commit comments