@@ -975,7 +975,7 @@ bool DeclAttribute::printImpl(ASTPrinter &Printer, const PrintOptions &Options,
975
975
Printer.printAttrName (" @_implements" );
976
976
Printer << " (" ;
977
977
auto *attr = cast<ImplementsAttr>(this );
978
- attr->getProtocolType ().getType (). print (Printer, Options);
978
+ attr->getProtocolType ().print (Printer, Options);
979
979
Printer << " , " << attr->getMemberName () << " )" ;
980
980
break ;
981
981
}
@@ -1814,7 +1814,7 @@ TransposeAttr *TransposeAttr::create(ASTContext &context, bool implicit,
1814
1814
}
1815
1815
1816
1816
ImplementsAttr::ImplementsAttr (SourceLoc atLoc, SourceRange range,
1817
- TypeLoc ProtocolType,
1817
+ TypeExpr * ProtocolType,
1818
1818
DeclName MemberName,
1819
1819
DeclNameLoc MemberNameLoc)
1820
1820
: DeclAttribute(DAK_Implements, atLoc, range, /* Implicit=*/ false ),
@@ -1826,20 +1826,25 @@ ImplementsAttr::ImplementsAttr(SourceLoc atLoc, SourceRange range,
1826
1826
1827
1827
ImplementsAttr *ImplementsAttr::create (ASTContext &Ctx, SourceLoc atLoc,
1828
1828
SourceRange range,
1829
- TypeLoc ProtocolType,
1829
+ TypeExpr * ProtocolType,
1830
1830
DeclName MemberName,
1831
1831
DeclNameLoc MemberNameLoc) {
1832
1832
void *mem = Ctx.Allocate (sizeof (ImplementsAttr), alignof (ImplementsAttr));
1833
1833
return new (mem) ImplementsAttr (atLoc, range, ProtocolType,
1834
1834
MemberName, MemberNameLoc);
1835
1835
}
1836
1836
1837
- TypeLoc ImplementsAttr::getProtocolType () const {
1838
- return ProtocolType;
1837
+ void ImplementsAttr::setProtocolType (Type ty) {
1838
+ assert (ty);
1839
+ ProtocolType->setType (MetatypeType::get (ty));
1839
1840
}
1840
1841
1841
- TypeLoc &ImplementsAttr::getProtocolType () {
1842
- return ProtocolType;
1842
+ Type ImplementsAttr::getProtocolType () const {
1843
+ return ProtocolType->getInstanceType ();
1844
+ }
1845
+
1846
+ TypeRepr *ImplementsAttr::getProtocolTypeRepr () const {
1847
+ return ProtocolType->getTypeRepr ();
1843
1848
}
1844
1849
1845
1850
CustomAttr::CustomAttr (SourceLoc atLoc, SourceRange range, TypeLoc type,
0 commit comments