@@ -563,6 +563,42 @@ class ProtocolCompositionTypeRef final : public TypeRef {
563563 }
564564};
565565
566+ class ParameterizedProtocolTypeRef final : public TypeRef {
567+ const ProtocolCompositionTypeRef *Base;
568+ std::vector<const TypeRef *> Args;
569+
570+ static TypeRefID Profile (const ProtocolCompositionTypeRef *Protocol,
571+ std::vector<const TypeRef *> Args) {
572+ TypeRefID ID;
573+ ID.addPointer (Protocol);
574+ for (auto Arg : Args) {
575+ ID.addPointer (Arg);
576+ }
577+ return ID;
578+ }
579+
580+ public:
581+ ParameterizedProtocolTypeRef (const ProtocolCompositionTypeRef *Protocol,
582+ std::vector<const TypeRef *> Args)
583+ : TypeRef(TypeRefKind::ParameterizedProtocol), Base(Protocol),
584+ Args (Args) {}
585+
586+ template <typename Allocator>
587+ static const ParameterizedProtocolTypeRef *
588+ create (Allocator &A, const ProtocolCompositionTypeRef *Protocol,
589+ std::vector<const TypeRef *> Args) {
590+ FIND_OR_CREATE_TYPEREF (A, ParameterizedProtocolTypeRef, Protocol, Args);
591+ }
592+
593+ const ProtocolCompositionTypeRef *getBase () const { return Base; }
594+
595+ const std::vector<const TypeRef *> &getArgs () const { return Args; }
596+
597+ static bool classof (const TypeRef *TR) {
598+ return TR->getKind () == TypeRefKind::ParameterizedProtocol;
599+ }
600+ };
601+
566602class MetatypeTypeRef final : public TypeRef {
567603 const TypeRef *InstanceType;
568604 bool WasAbstract;
0 commit comments