File tree Expand file tree Collapse file tree 3 files changed +29
-4
lines changed
Expand file tree Collapse file tree 3 files changed +29
-4
lines changed Original file line number Diff line number Diff line change @@ -127,10 +127,6 @@ class ASTVisitor {
127127 llvm_unreachable (" Not reachable, all cases handled" );
128128 }
129129
130- TypeReprRetTy visitTypeRepr (TypeRepr *T, Args... AA) {
131- return TypeReprRetTy ();
132- }
133-
134130#define TYPEREPR (CLASS, PARENT ) \
135131 TypeReprRetTy visit##CLASS##TypeRepr(CLASS##TypeRepr *T, Args... AA) {\
136132 return static_cast <ImplClass*>(this )->visit ##PARENT (T, \
Original file line number Diff line number Diff line change @@ -3003,6 +3003,31 @@ class PrintTypeRepr : public TypeReprVisitor<PrintTypeRepr> {
30033003 OS << " type=" ; Ty.dump (OS);
30043004 PrintWithColorRAII (OS, ParenthesisColor) << ' )' ;
30053005 }
3006+
3007+ void visitSILBoxTypeRepr (SILBoxTypeRepr *T) {
3008+ printCommon (" sil_box" );
3009+ Indent += 2 ;
3010+
3011+ ArrayRef<SILBoxTypeReprField> Fields = T->getFields ();
3012+ for (unsigned i = 0 , end = Fields.size (); i != end; ++i) {
3013+ OS << ' \n ' ;
3014+ printCommon (" sil_box_field" );
3015+ if (Fields[i].isMutable ()) {
3016+ OS << " mutable" ;
3017+ }
3018+ OS << ' \n ' ;
3019+ printRec (Fields[i].getFieldType ());
3020+ PrintWithColorRAII (OS, ParenthesisColor) << ' )' ;
3021+ }
3022+
3023+ for (auto genArg : T->getGenericArguments ()) {
3024+ OS << ' \n ' ;
3025+ printRec (genArg);
3026+ }
3027+
3028+ PrintWithColorRAII (OS, ParenthesisColor) << ' )' ;
3029+ Indent -= 2 ;
3030+ }
30063031};
30073032
30083033} // end anonymous namespace
Original file line number Diff line number Diff line change @@ -3674,6 +3674,10 @@ class UnsupportedProtocolVisitor
36743674 return !checkStatements;
36753675 }
36763676
3677+ void visitTypeRepr (TypeRepr *T) {
3678+ // Do nothing for all TypeReprs except the ones listed below.
3679+ }
3680+
36773681 void visitIdentTypeRepr (IdentTypeRepr *T) {
36783682 if (T->isInvalid ())
36793683 return ;
You can’t perform that action at this time.
0 commit comments