[NFC] Adopt TypeBase-isms for GenericSignature

Structurally prevent a number of common anti-patterns involving generic
signatures by separating the interface into GenericSignature and the
implementation into GenericSignatureBase.  In particular, this allows
the comparison operators to be deleted which forces callers to
canonicalize the signature or ask to compare pointers explicitly.
This commit is contained in:
Robert Widmann
2019-09-29 23:06:49 -07:00
parent d1c87f3c93
commit 5a8d0744c3
104 changed files with 780 additions and 631 deletions

View File

@@ -318,7 +318,7 @@ private:
MutableArrayRef<Serialized<Type>> Types;
/// Generic signatures referenced by this module.
MutableArrayRef<Serialized<GenericSignature *>> GenericSignatures;
MutableArrayRef<Serialized<GenericSignature>> GenericSignatures;
/// Substitution maps referenced by this module.
MutableArrayRef<Serialized<SubstitutionMap>> SubstitutionMaps;
@@ -864,10 +864,10 @@ public:
ModuleDecl *getModule(ArrayRef<Identifier> name, bool allowLoading = false);
/// Returns the generic signature for the given ID.
GenericSignature *getGenericSignature(serialization::GenericSignatureID ID);
GenericSignature getGenericSignature(serialization::GenericSignatureID ID);
/// Returns the generic signature for the given ID or the first error.
llvm::Expected<GenericSignature *>
llvm::Expected<GenericSignature>
getGenericSignatureChecked(serialization::GenericSignatureID ID);
/// Returns the substitution map for the given ID, deserializing it if